diff --git a/jest.config.js b/jest.config.js index 5349edf9fad0..0aff2e854e7a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,4 @@ module.exports = { - // this will become default in jest 27: - testRunner: 'jest-circus/runner', testMatch: ['**/*.test.js'], verbose: true, rootDir: 'test', diff --git a/package.json b/package.json index 09c3db1ce14c..591aa3760456 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "async-sema": "3.0.1", "babel-core": "7.0.0-bridge.0", "babel-eslint": "10.0.3", - "babel-jest": "24.9.0", + "babel-jest": "27.0.0-next.5", "browserslist": "^4.14.7", "browserstack-local": "1.4.0", "cheerio": "0.22.0", @@ -87,8 +87,7 @@ "image-size": "0.9.3", "is-animated": "2.0.0", "isomorphic-unfetch": "3.0.0", - "jest-circus": "26.0.1", - "jest-cli": "24.9.0", + "jest-cli": "27.0.0-next.5", "ky": "0.19.1", "ky-universal": "0.6.0", "lerna": "4.0.0", diff --git a/packages/next/build/index.ts b/packages/next/build/index.ts index 484178a8b9f9..56a30c9df9b4 100644 --- a/packages/next/build/index.ts +++ b/packages/next/build/index.ts @@ -2,7 +2,7 @@ import { loadEnvConfig } from '@next/env' import chalk from 'chalk' import crypto from 'crypto' import { promises, writeFileSync } from 'fs' -import Worker from 'jest-worker' +import { Worker } from 'jest-worker' import devalue from 'next/dist/compiled/devalue' import escapeStringRegexp from 'next/dist/compiled/escape-string-regexp' import findUp from 'next/dist/compiled/find-up' diff --git a/packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js b/packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js index 720d068d11ab..bfe6e2c52101 100644 --- a/packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js +++ b/packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js @@ -7,7 +7,7 @@ import { sources, } from 'next/dist/compiled/webpack/webpack' import pLimit from 'p-limit' -import jestWorker from 'jest-worker' +import { Worker } from 'jest-worker' import crypto from 'crypto' import cacache from 'next/dist/compiled/cacache' import { spans } from '../../profiling-plugin' @@ -192,13 +192,10 @@ class TerserPlugin { return initializedWorker } - initializedWorker = new jestWorker( - path.join(__dirname, './minify.js'), - { - numWorkers: numberOfWorkers, - enableWorkerThreads: true, - } - ) + initializedWorker = new Worker(path.join(__dirname, './minify.js'), { + numWorkers: numberOfWorkers, + enableWorkerThreads: true, + }) initializedWorker.getStdout().pipe(process.stdout) initializedWorker.getStderr().pipe(process.stderr) diff --git a/packages/next/compiled/conf/index.js b/packages/next/compiled/conf/index.js index 5d2f2acd8eae..4644219baaa8 100644 --- a/packages/next/compiled/conf/index.js +++ b/packages/next/compiled/conf/index.js @@ -1 +1 @@ -module.exports=(()=>{var f={601:f=>{"use strict";f.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},8938:f=>{"use strict";f.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},1414:(f,e,n)=>{"use strict";var s=n(1645),l=n(2630),v=n(7246),r=n(7837),b=n(3600),g=n(9290),w=n(1665),j=n(6989),d=n(6057);f.exports=Ajv;Ajv.prototype.validate=validate;Ajv.prototype.compile=compile;Ajv.prototype.addSchema=addSchema;Ajv.prototype.addMetaSchema=addMetaSchema;Ajv.prototype.validateSchema=validateSchema;Ajv.prototype.getSchema=getSchema;Ajv.prototype.removeSchema=removeSchema;Ajv.prototype.addFormat=addFormat;Ajv.prototype.errorsText=errorsText;Ajv.prototype._addSchema=_addSchema;Ajv.prototype._compile=_compile;Ajv.prototype.compileAsync=n(75);var E=n(8093);Ajv.prototype.addKeyword=E.add;Ajv.prototype.getKeyword=E.get;Ajv.prototype.removeKeyword=E.remove;Ajv.prototype.validateKeyword=E.validate;var R=n(2718);Ajv.ValidationError=R.Validation;Ajv.MissingRefError=R.MissingRef;Ajv.$dataMetaSchema=j;var A="http://json-schema.org/draft-07/schema";var F=["removeAdditional","useDefaults","coerceTypes","strictDefaults"];var p=["/properties"];function Ajv(f){if(!(this instanceof Ajv))return new Ajv(f);f=this._opts=d.copy(f)||{};setLogger(this);this._schemas={};this._refs={};this._fragments={};this._formats=g(f.format);this._cache=f.cache||new v;this._loadingSchemas={};this._compilations=[];this.RULES=w();this._getId=chooseGetId(f);f.loopRequired=f.loopRequired||Infinity;if(f.errorDataPath=="property")f._errorDataPathProperty=true;if(f.serialize===undefined)f.serialize=b;this._metaOpts=getMetaSchemaOptions(this);if(f.formats)addInitialFormats(this);if(f.keywords)addInitialKeywords(this);addDefaultMetaSchema(this);if(typeof f.meta=="object")this.addMetaSchema(f.meta);if(f.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});addInitialSchemas(this)}function validate(f,e){var n;if(typeof f=="string"){n=this.getSchema(f);if(!n)throw new Error('no schema with key or ref "'+f+'"')}else{var s=this._addSchema(f);n=s.validate||this._compile(s)}var l=n(e);if(n.$async!==true)this.errors=n.errors;return l}function compile(f,e){var n=this._addSchema(f,undefined,e);return n.validate||this._compile(n)}function addSchema(f,e,n,s){if(Array.isArray(f)){for(var v=0;v{"use strict";var e=f.exports=function Cache(){this._cache={}};e.prototype.put=function Cache_put(f,e){this._cache[f]=e};e.prototype.get=function Cache_get(f){return this._cache[f]};e.prototype.del=function Cache_del(f){delete this._cache[f]};e.prototype.clear=function Cache_clear(){this._cache={}}},75:(f,e,n)=>{"use strict";var s=n(2718).MissingRef;f.exports=compileAsync;function compileAsync(f,e,n){var l=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof e=="function"){n=e;e=undefined}var v=loadMetaSchemaOf(f).then(function(){var n=l._addSchema(f,undefined,e);return n.validate||_compileAsync(n)});if(n){v.then(function(f){n(null,f)},n)}return v;function loadMetaSchemaOf(f){var e=f.$schema;return e&&!l.getSchema(e)?compileAsync.call(l,{$ref:e},true):Promise.resolve()}function _compileAsync(f){try{return l._compile(f)}catch(f){if(f instanceof s)return loadMissingSchema(f);throw f}function loadMissingSchema(n){var s=n.missingSchema;if(added(s))throw new Error("Schema "+s+" is loaded but "+n.missingRef+" cannot be resolved");var v=l._loadingSchemas[s];if(!v){v=l._loadingSchemas[s]=l._opts.loadSchema(s);v.then(removePromise,removePromise)}return v.then(function(f){if(!added(s)){return loadMetaSchemaOf(f).then(function(){if(!added(s))l.addSchema(f,s,undefined,e)})}}).then(function(){return _compileAsync(f)});function removePromise(){delete l._loadingSchemas[s]}function added(f){return l._refs[f]||l._schemas[f]}}}}},2718:(f,e,n)=>{"use strict";var s=n(2630);f.exports={Validation:errorSubclass(ValidationError),MissingRef:errorSubclass(MissingRefError)};function ValidationError(f){this.message="validation failed";this.errors=f;this.ajv=this.validation=true}MissingRefError.message=function(f,e){return"can't resolve reference "+e+" from id "+f};function MissingRefError(f,e,n){this.message=n||MissingRefError.message(f,e);this.missingRef=s.url(f,e);this.missingSchema=s.normalizeId(s.fullPath(this.missingRef))}function errorSubclass(f){f.prototype=Object.create(Error.prototype);f.prototype.constructor=f;return f}},9290:(f,e,n)=>{"use strict";var s=n(6057);var l=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;var v=[0,31,28,31,30,31,30,31,31,30,31,30,31];var r=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;var b=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;var g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var w=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var j=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;var d=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;var E=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;var R=/^(?:\/(?:[^~/]|~0|~1)*)*$/;var A=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;var F=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;f.exports=formats;function formats(f){f=f=="full"?"full":"fast";return s.copy(formats[f])}formats.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":j,url:d,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:b,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:E,"json-pointer":R,"json-pointer-uri-fragment":A,"relative-json-pointer":F};formats.full={date:date,time:time,"date-time":date_time,uri:uri,"uri-reference":w,"uri-template":j,url:d,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:b,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:E,"json-pointer":R,"json-pointer-uri-fragment":A,"relative-json-pointer":F};function isLeapYear(f){return f%4===0&&(f%100!==0||f%400===0)}function date(f){var e=f.match(l);if(!e)return false;var n=+e[1];var s=+e[2];var r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(s==2&&isLeapYear(n)?29:v[s])}function time(f,e){var n=f.match(r);if(!n)return false;var s=n[1];var l=n[2];var v=n[3];var b=n[5];return(s<=23&&l<=59&&v<=59||s==23&&l==59&&v==60)&&(!e||b)}var p=/t|\s/i;function date_time(f){var e=f.split(p);return e.length==2&&date(e[0])&&time(e[1],true)}var I=/\/|:/;function uri(f){return I.test(f)&&g.test(f)}var x=/[^\\]\\Z/;function regex(f){if(x.test(f))return false;try{new RegExp(f);return true}catch(f){return false}}},1645:(f,e,n)=>{"use strict";var s=n(2630),l=n(6057),v=n(2718),r=n(3600);var b=n(6131);var g=l.ucs2length;var w=n(3933);var j=v.Validation;f.exports=compile;function compile(f,e,n,d){var E=this,R=this._opts,A=[undefined],F={},p=[],I={},x=[],z={},U=[];e=e||{schema:f,refVal:A,refs:F};var N=checkCompiling.call(this,f,e,d);var Q=this._compilations[N.index];if(N.compiling)return Q.callValidate=callValidate;var q=this._formats;var O=this.RULES;try{var C=localCompile(f,e,n,d);Q.validate=C;var L=Q.callValidate;if(L){L.schema=C.schema;L.errors=null;L.refs=C.refs;L.refVal=C.refVal;L.root=C.root;L.$async=C.$async;if(R.sourceCode)L.source=C.source}return C}finally{endCompiling.call(this,f,e,d)}function callValidate(){var f=Q.validate;var e=f.apply(this,arguments);callValidate.errors=f.errors;return e}function localCompile(f,n,r,d){var I=!n||n&&n.schema==f;if(n.schema!=e.schema)return compile.call(E,f,n,r,d);var z=f.$async===true;var N=b({isTop:true,schema:f,isRoot:I,baseId:d,root:n,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:v.MissingRef,RULES:O,validate:b,util:l,resolve:s,resolveRef:resolveRef,usePattern:usePattern,useDefault:useDefault,useCustomRule:useCustomRule,opts:R,formats:q,logger:E.logger,self:E});N=vars(A,refValCode)+vars(p,patternCode)+vars(x,defaultCode)+vars(U,customRuleCode)+N;if(R.processCode)N=R.processCode(N,f);var Q;try{var C=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",N);Q=C(E,O,q,e,A,x,U,w,g,j);A[0]=Q}catch(f){E.logger.error("Error compiling schema, function code:",N);throw f}Q.schema=f;Q.errors=null;Q.refs=F;Q.refVal=A;Q.root=I?Q:n;if(z)Q.$async=true;if(R.sourceCode===true){Q.source={code:N,patterns:p,defaults:x}}return Q}function resolveRef(f,l,v){l=s.url(f,l);var r=F[l];var b,g;if(r!==undefined){b=A[r];g="refVal["+r+"]";return resolvedRef(b,g)}if(!v&&e.refs){var w=e.refs[l];if(w!==undefined){b=e.refVal[w];g=addLocalRef(l,b);return resolvedRef(b,g)}}g=addLocalRef(l);var j=s.call(E,localCompile,e,l);if(j===undefined){var d=n&&n[l];if(d){j=s.inlineRef(d,R.inlineRefs)?d:compile.call(E,d,e,n,f)}}if(j===undefined){removeLocalRef(l)}else{replaceLocalRef(l,j);return resolvedRef(j,g)}}function addLocalRef(f,e){var n=A.length;A[n]=e;F[f]=n;return"refVal"+n}function removeLocalRef(f){delete F[f]}function replaceLocalRef(f,e){var n=F[f];A[n]=e}function resolvedRef(f,e){return typeof f=="object"||typeof f=="boolean"?{code:e,schema:f,inline:true}:{code:e,$async:f&&!!f.$async}}function usePattern(f){var e=I[f];if(e===undefined){e=I[f]=p.length;p[e]=f}return"pattern"+e}function useDefault(f){switch(typeof f){case"boolean":case"number":return""+f;case"string":return l.toQuotedString(f);case"object":if(f===null)return"null";var e=r(f);var n=z[e];if(n===undefined){n=z[e]=x.length;x[n]=f}return"default"+n}}function useCustomRule(f,e,n,s){if(E._opts.validateSchema!==false){var l=f.definition.dependencies;if(l&&!l.every(function(f){return Object.prototype.hasOwnProperty.call(n,f)}))throw new Error("parent schema must have all required keywords: "+l.join(","));var v=f.definition.validateSchema;if(v){var r=v(e);if(!r){var b="keyword schema is invalid: "+E.errorsText(v.errors);if(E._opts.validateSchema=="log")E.logger.error(b);else throw new Error(b)}}}var g=f.definition.compile,w=f.definition.inline,j=f.definition.macro;var d;if(g){d=g.call(E,e,n,s)}else if(j){d=j.call(E,e,n,s);if(R.validateSchema!==false)E.validateSchema(d,true)}else if(w){d=w.call(E,s,f.keyword,e,n)}else{d=f.definition.validate;if(!d)return}if(d===undefined)throw new Error('custom keyword "'+f.keyword+'"failed to compile');var A=U.length;U[A]=d;return{code:"customRule"+A,validate:d}}}function checkCompiling(f,e,n){var s=compIndex.call(this,f,e,n);if(s>=0)return{index:s,compiling:true};s=this._compilations.length;this._compilations[s]={schema:f,root:e,baseId:n};return{index:s,compiling:false}}function endCompiling(f,e,n){var s=compIndex.call(this,f,e,n);if(s>=0)this._compilations.splice(s,1)}function compIndex(f,e,n){for(var s=0;s{"use strict";var s=n(4007),l=n(3933),v=n(6057),r=n(7837),b=n(2437);f.exports=resolve;resolve.normalizeId=normalizeId;resolve.fullPath=getFullPath;resolve.url=resolveUrl;resolve.ids=resolveIds;resolve.inlineRef=inlineRef;resolve.schema=resolveSchema;function resolve(f,e,n){var s=this._refs[n];if(typeof s=="string"){if(this._refs[s])s=this._refs[s];else return resolve.call(this,f,e,s)}s=s||this._schemas[n];if(s instanceof r){return inlineRef(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s)}var l=resolveSchema.call(this,e,n);var v,b,g;if(l){v=l.schema;e=l.root;g=l.baseId}if(v instanceof r){b=v.validate||f.call(this,v.schema,e,undefined,g)}else if(v!==undefined){b=inlineRef(v,this._opts.inlineRefs)?v:f.call(this,v,e,undefined,g)}return b}function resolveSchema(f,e){var n=s.parse(e),l=_getFullPath(n),v=getFullPath(this._getId(f.schema));if(Object.keys(f.schema).length===0||l!==v){var b=normalizeId(l);var g=this._refs[b];if(typeof g=="string"){return resolveRecursive.call(this,f,g,n)}else if(g instanceof r){if(!g.validate)this._compile(g);f=g}else{g=this._schemas[b];if(g instanceof r){if(!g.validate)this._compile(g);if(b==normalizeId(e))return{schema:g,root:f,baseId:v};f=g}else{return}}if(!f.schema)return;v=getFullPath(this._getId(f.schema))}return getJsonPointer.call(this,n,v,f.schema,f)}function resolveRecursive(f,e,n){var s=resolveSchema.call(this,f,e);if(s){var l=s.schema;var v=s.baseId;f=s.root;var r=this._getId(l);if(r)v=resolveUrl(v,r);return getJsonPointer.call(this,n,v,l,f)}}var g=v.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(f,e,n,s){f.fragment=f.fragment||"";if(f.fragment.slice(0,1)!="/")return;var l=f.fragment.split("/");for(var r=1;r{"use strict";var s=n(4124),l=n(6057).toHash;f.exports=function rules(){var f=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}];var e=["type","$comment"];var n=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"];var v=["number","integer","string","array","object","boolean","null"];f.all=l(e);f.types=l(v);f.forEach(function(n){n.rules=n.rules.map(function(n){var l;if(typeof n=="object"){var v=Object.keys(n)[0];l=n[v];n=v;l.forEach(function(n){e.push(n);f.all[n]=true})}e.push(n);var r=f.all[n]={keyword:n,code:s[n],implements:l};return r});f.all.$comment={keyword:"$comment",code:s.$comment};if(n.type)f.types[n.type]=n});f.keywords=l(e.concat(n));f.custom={};return f}},7837:(f,e,n)=>{"use strict";var s=n(6057);f.exports=SchemaObject;function SchemaObject(f){s.copy(f,this)}},9652:f=>{"use strict";f.exports=function ucs2length(f){var e=0,n=f.length,s=0,l;while(s=55296&&l<=56319&&s{"use strict";f.exports={copy:copy,checkDataType:checkDataType,checkDataTypes:checkDataTypes,coerceToTypes:coerceToTypes,toHash:toHash,getProperty:getProperty,escapeQuotes:escapeQuotes,equal:n(3933),ucs2length:n(9652),varOccurences:varOccurences,varReplace:varReplace,schemaHasRules:schemaHasRules,schemaHasRulesExcept:schemaHasRulesExcept,schemaUnknownRules:schemaUnknownRules,toQuotedString:toQuotedString,getPathExpr:getPathExpr,getPath:getPath,getData:getData,unescapeFragment:unescapeFragment,unescapeJsonPointer:unescapeJsonPointer,escapeFragment:escapeFragment,escapeJsonPointer:escapeJsonPointer};function copy(f,e){e=e||{};for(var n in f)e[n]=f[n];return e}function checkDataType(f,e,n,s){var l=s?" !== ":" === ",v=s?" || ":" && ",r=s?"!":"",b=s?"":"!";switch(f){case"null":return e+l+"null";case"array":return r+"Array.isArray("+e+")";case"object":return"("+r+e+v+"typeof "+e+l+'"object"'+v+b+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+l+'"number"'+v+b+"("+e+" % 1)"+v+e+l+e+(n?v+r+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+l+'"'+f+'"'+(n?v+r+"isFinite("+e+")":"")+")";default:return"typeof "+e+l+'"'+f+'"'}}function checkDataTypes(f,e,n){switch(f.length){case 1:return checkDataType(f[0],e,n,true);default:var s="";var l=toHash(f);if(l.array&&l.object){s=l.null?"(":"(!"+e+" || ";s+="typeof "+e+' !== "object")';delete l.null;delete l.array;delete l.object}if(l.number)delete l.integer;for(var v in l)s+=(s?" && ":"")+checkDataType(v,e,n,true);return s}}var s=toHash(["string","number","integer","boolean","null"]);function coerceToTypes(f,e){if(Array.isArray(e)){var n=[];for(var l=0;l=e)throw new Error("Cannot access property/index "+s+" levels up, current level is "+e);return n[e-s]}if(s>e)throw new Error("Cannot access data "+s+" levels up, current level is "+e);v="data"+(e-s||"");if(!l)return v}var w=v;var j=l.split("/");for(var d=0;d{"use strict";var e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];f.exports=function(f,n){for(var s=0;s{"use strict";var s=n(8938);f.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:s.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:s.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},3711:f=>{"use strict";f.exports=function generate__limit(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}var A=e=="maximum",F=A?"exclusiveMaximum":"exclusiveMinimum",p=f.schema[F],I=f.opts.$data&&p&&p.$data,x=A?"<":">",z=A?">":"<",j=undefined;if(!(E||typeof r=="number"||r===undefined)){throw new Error(e+" must be number")}if(!(I||p===undefined||typeof p=="number"||typeof p=="boolean")){throw new Error(F+" must be number or boolean")}if(I){var U=f.util.getData(p.$data,v,f.dataPathArr),N="exclusive"+l,Q="exclType"+l,q="exclIsNumber"+l,O="op"+l,C="' + "+O+" + '";s+=" var schemaExcl"+l+" = "+U+"; ";U="schemaExcl"+l;s+=" var "+N+"; var "+Q+" = typeof "+U+"; if ("+Q+" != 'boolean' && "+Q+" != 'undefined' && "+Q+" != 'number') { ";var j=F;var L=L||[];L.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: '"+F+" should be boolean' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var J=s;s=L.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+J+"]); "}else{s+=" validate.errors = ["+J+"]; return false; "}}else{s+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } else if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" "+Q+" == 'number' ? ( ("+N+" = "+R+" === undefined || "+U+" "+x+"= "+R+") ? "+d+" "+z+"= "+U+" : "+d+" "+z+" "+R+" ) : ( ("+N+" = "+U+" === true) ? "+d+" "+z+"= "+R+" : "+d+" "+z+" "+R+" ) || "+d+" !== "+d+") { var op"+l+" = "+N+" ? '"+x+"' : '"+x+"='; ";if(r===undefined){j=F;g=f.errSchemaPath+"/"+F;R=U;E=I}}else{var q=typeof p=="number",C=x;if(q&&E){var O="'"+C+"'";s+=" if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" ( "+R+" === undefined || "+p+" "+x+"= "+R+" ? "+d+" "+z+"= "+p+" : "+d+" "+z+" "+R+" ) || "+d+" !== "+d+") { "}else{if(q&&r===undefined){N=true;j=F;g=f.errSchemaPath+"/"+F;R=p;z+="="}else{if(q)R=Math[A?"min":"max"](p,r);if(p===(q?R:true)){N=true;j=F;g=f.errSchemaPath+"/"+F;z+="="}else{N=false;C+="="}}var O="'"+C+"'";s+=" if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" "+d+" "+z+" "+R+" || "+d+" !== "+d+") { "}}j=j||e;var L=L||[];L.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_limit")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { comparison: "+O+", limit: "+R+", exclusive: "+N+" } ";if(f.opts.messages!==false){s+=" , message: 'should be "+C+" ";if(E){s+="' + "+R}else{s+=""+R+"'"}}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var J=s;s=L.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+J+"]); "}else{s+=" validate.errors = ["+J+"]; return false; "}}else{s+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } ";if(w){s+=" else { "}return s}},5675:f=>{"use strict";f.exports=function generate__limitItems(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if(!(E||typeof r=="number")){throw new Error(e+" must be number")}var A=e=="maxItems"?">":"<";s+="if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" "+d+".length "+A+" "+R+") { ";var j=e;var F=F||[];F.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_limitItems")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { limit: "+R+" } ";if(f.opts.messages!==false){s+=" , message: 'should NOT have ";if(e=="maxItems"){s+="more"}else{s+="fewer"}s+=" than ";if(E){s+="' + "+R+" + '"}else{s+=""+r}s+=" items' "}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var p=s;s=F.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+p+"]); "}else{s+=" validate.errors = ["+p+"]; return false; "}}else{s+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},6051:f=>{"use strict";f.exports=function generate__limitLength(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if(!(E||typeof r=="number")){throw new Error(e+" must be number")}var A=e=="maxLength"?">":"<";s+="if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}if(f.opts.unicode===false){s+=" "+d+".length "}else{s+=" ucs2length("+d+") "}s+=" "+A+" "+R+") { ";var j=e;var F=F||[];F.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_limitLength")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { limit: "+R+" } ";if(f.opts.messages!==false){s+=" , message: 'should NOT be ";if(e=="maxLength"){s+="longer"}else{s+="shorter"}s+=" than ";if(E){s+="' + "+R+" + '"}else{s+=""+r}s+=" characters' "}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var p=s;s=F.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+p+"]); "}else{s+=" validate.errors = ["+p+"]; return false; "}}else{s+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},7043:f=>{"use strict";f.exports=function generate__limitProperties(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if(!(E||typeof r=="number")){throw new Error(e+" must be number")}var A=e=="maxProperties"?">":"<";s+="if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" Object.keys("+d+").length "+A+" "+R+") { ";var j=e;var F=F||[];F.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_limitProperties")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { limit: "+R+" } ";if(f.opts.messages!==false){s+=" , message: 'should NOT have ";if(e=="maxProperties"){s+="more"}else{s+="fewer"}s+=" than ";if(E){s+="' + "+R+" + '"}else{s+=""+r}s+=" properties' "}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var p=s;s=F.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+p+"]); "}else{s+=" validate.errors = ["+p+"]; return false; "}}else{s+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},3639:f=>{"use strict";f.exports=function generate_allOf(f,e,n){var s=" ";var l=f.schema[e];var v=f.schemaPath+f.util.getProperty(e);var r=f.errSchemaPath+"/"+e;var b=!f.opts.allErrors;var g=f.util.copy(f);var w="";g.level++;var j="valid"+g.level;var d=g.baseId,E=true;var R=l;if(R){var A,F=-1,p=R.length-1;while(F0||A===false:f.util.schemaHasRules(A,f.RULES.all)){E=false;g.schema=A;g.schemaPath=v+"["+F+"]";g.errSchemaPath=r+"/"+F;s+=" "+f.validate(g)+" ";g.baseId=d;if(b){s+=" if ("+j+") { ";w+="}"}}}}if(b){if(E){s+=" if (true) { "}else{s+=" "+w.slice(0,-1)+" "}}return s}},1256:f=>{"use strict";f.exports=function generate_anyOf(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);var A="";R.level++;var F="valid"+R.level;var p=r.every(function(e){return f.opts.strictKeywords?typeof e=="object"&&Object.keys(e).length>0||e===false:f.util.schemaHasRules(e,f.RULES.all)});if(p){var I=R.baseId;s+=" var "+E+" = errors; var "+d+" = false; ";var x=f.compositeRule;f.compositeRule=R.compositeRule=true;var z=r;if(z){var U,N=-1,Q=z.length-1;while(N{"use strict";f.exports=function generate_comment(f,e,n){var s=" ";var l=f.schema[e];var v=f.errSchemaPath+"/"+e;var r=!f.opts.allErrors;var b=f.util.toQuotedString(l);if(f.opts.$comment===true){s+=" console.log("+b+");"}else if(typeof f.opts.$comment=="function"){s+=" self._opts.$comment("+b+", "+f.util.toQuotedString(v)+", validate.root.schema);"}return s}},184:f=>{"use strict";f.exports=function generate_const(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if(!E){s+=" var schema"+l+" = validate.schema"+b+";"}s+="var "+d+" = equal("+j+", schema"+l+"); if (!"+d+") { ";var A=A||[];A.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"const"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { allowedValue: schema"+l+" } ";if(f.opts.messages!==false){s+=" , message: 'should be equal to constant' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var F=s;s=A.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+F+"]); "}else{s+=" validate.errors = ["+F+"]; return false; "}}else{s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" }";if(w){s+=" else { "}return s}},7419:f=>{"use strict";f.exports=function generate_contains(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);var A="";R.level++;var F="valid"+R.level;var p="i"+l,I=R.dataLevel=f.dataLevel+1,x="data"+I,z=f.baseId,U=f.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:f.util.schemaHasRules(r,f.RULES.all);s+="var "+E+" = errors;var "+d+";";if(U){var N=f.compositeRule;f.compositeRule=R.compositeRule=true;R.schema=r;R.schemaPath=b;R.errSchemaPath=g;s+=" var "+F+" = false; for (var "+p+" = 0; "+p+" < "+j+".length; "+p+"++) { ";R.errorPath=f.util.getPathExpr(f.errorPath,p,f.opts.jsonPointers,true);var Q=j+"["+p+"]";R.dataPathArr[I]=p;var q=f.validate(R);R.baseId=z;if(f.util.varOccurences(q,x)<2){s+=" "+f.util.varReplace(q,x,Q)+" "}else{s+=" var "+x+" = "+Q+"; "+q+" "}s+=" if ("+F+") break; } ";f.compositeRule=R.compositeRule=N;s+=" "+A+" if (!"+F+") {"}else{s+=" if ("+j+".length == 0) {"}var O=O||[];O.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"contains"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: 'should contain a valid item' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var C=s;s=O.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+C+"]); "}else{s+=" validate.errors = ["+C+"]; return false; "}}else{s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } else { ";if(U){s+=" errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; } "}if(f.opts.allErrors){s+=" } "}return s}},7921:f=>{"use strict";f.exports=function generate_custom(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E="valid"+l;var R="errs__"+l;var A=f.opts.$data&&r&&r.$data,F;if(A){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";F="schema"+l}else{F=r}var p=this,I="definition"+l,x=p.definition,z="";var U,N,Q,q,O;if(A&&x.$data){O="keywordValidate"+l;var C=x.validateSchema;s+=" var "+I+" = RULES.custom['"+e+"'].definition; var "+O+" = "+I+".validate;"}else{q=f.useCustomRule(p,r,f.schema,f);if(!q)return;F="validate.schema"+b;O=q.code;U=x.compile;N=x.inline;Q=x.macro}var L=O+".errors",J="i"+l,T="ruleErr"+l,G=x.async;if(G&&!f.async)throw new Error("async keyword in sync schema");if(!(N||Q)){s+=""+L+" = null;"}s+="var "+R+" = errors;var "+E+";";if(A&&x.$data){z+="}";s+=" if ("+F+" === undefined) { "+E+" = true; } else { ";if(C){z+="}";s+=" "+E+" = "+I+".validateSchema("+F+"); if ("+E+") { "}}if(N){if(x.statements){s+=" "+q.validate+" "}else{s+=" "+E+" = "+q.validate+"; "}}else if(Q){var H=f.util.copy(f);var z="";H.level++;var X="valid"+H.level;H.schema=q.validate;H.schemaPath="";var M=f.compositeRule;f.compositeRule=H.compositeRule=true;var Y=f.validate(H).replace(/validate\.schema/g,O);f.compositeRule=H.compositeRule=M;s+=" "+Y}else{var W=W||[];W.push(s);s="";s+=" "+O+".call( ";if(f.opts.passContext){s+="this"}else{s+="self"}if(U||x.schema===false){s+=" , "+d+" "}else{s+=" , "+F+" , "+d+" , validate.schema"+f.schemaPath+" "}s+=" , (dataPath || '')";if(f.errorPath!='""'){s+=" + "+f.errorPath}var B=v?"data"+(v-1||""):"parentData",c=v?f.dataPathArr[v]:"parentDataProperty";s+=" , "+B+" , "+c+" , rootData ) ";var Z=s;s=W.pop();if(x.errors===false){s+=" "+E+" = ";if(G){s+="await "}s+=""+Z+"; "}else{if(G){L="customErrors"+l;s+=" var "+L+" = null; try { "+E+" = await "+Z+"; } catch (e) { "+E+" = false; if (e instanceof ValidationError) "+L+" = e.errors; else throw e; } "}else{s+=" "+L+" = null; "+E+" = "+Z+"; "}}}if(x.modifying){s+=" if ("+B+") "+d+" = "+B+"["+c+"];"}s+=""+z;if(x.valid){if(w){s+=" if (true) { "}}else{s+=" if ( ";if(x.valid===undefined){s+=" !";if(Q){s+=""+X}else{s+=""+E}}else{s+=" "+!x.valid+" "}s+=") { ";j=p.keyword;var W=W||[];W.push(s);s="";var W=W||[];W.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"custom")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { keyword: '"+p.keyword+"' } ";if(f.opts.messages!==false){s+=" , message: 'should pass \""+p.keyword+"\" keyword validation' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var D=s;s=W.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+D+"]); "}else{s+=" validate.errors = ["+D+"]; return false; "}}else{s+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}var K=s;s=W.pop();if(N){if(x.errors){if(x.errors!="full"){s+=" for (var "+J+"="+R+"; "+J+"{"use strict";f.exports=function generate_dependencies(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="errs__"+l;var E=f.util.copy(f);var R="";E.level++;var A="valid"+E.level;var F={},p={},I=f.opts.ownProperties;for(N in r){if(N=="__proto__")continue;var x=r[N];var z=Array.isArray(x)?p:F;z[N]=x}s+="var "+d+" = errors;";var U=f.errorPath;s+="var missing"+l+";";for(var N in p){z=p[N];if(z.length){s+=" if ( "+j+f.util.getProperty(N)+" !== undefined ";if(I){s+=" && Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(N)+"') "}if(w){s+=" && ( ";var Q=z;if(Q){var q,O=-1,C=Q.length-1;while(O0||x===false:f.util.schemaHasRules(x,f.RULES.all)){s+=" "+A+" = true; if ( "+j+f.util.getProperty(N)+" !== undefined ";if(I){s+=" && Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(N)+"') "}s+=") { ";E.schema=x;E.schemaPath=b+f.util.getProperty(N);E.errSchemaPath=g+"/"+f.util.escapeFragment(N);s+=" "+f.validate(E)+" ";E.baseId=B;s+=" } ";if(w){s+=" if ("+A+") { ";R+="}"}}}if(w){s+=" "+R+" if ("+d+" == errors) {"}return s}},9795:f=>{"use strict";f.exports=function generate_enum(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}var A="i"+l,F="schema"+l;if(!E){s+=" var "+F+" = validate.schema"+b+";"}s+="var "+d+";";if(E){s+=" if (schema"+l+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+l+")) "+d+" = false; else {"}s+=""+d+" = false;for (var "+A+"=0; "+A+"<"+F+".length; "+A+"++) if (equal("+j+", "+F+"["+A+"])) { "+d+" = true; break; }";if(E){s+=" } "}s+=" if (!"+d+") { ";var p=p||[];p.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"enum"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { allowedValues: schema"+l+" } ";if(f.opts.messages!==false){s+=" , message: 'should be equal to one of the allowed values' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var I=s;s=p.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+I+"]); "}else{s+=" validate.errors = ["+I+"]; return false; "}}else{s+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" }";if(w){s+=" else { "}return s}},5801:f=>{"use strict";f.exports=function generate_format(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");if(f.opts.format===false){if(w){s+=" if (true) { "}return s}var d=f.opts.$data&&r&&r.$data,E;if(d){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";E="schema"+l}else{E=r}var R=f.opts.unknownFormats,A=Array.isArray(R);if(d){var F="format"+l,p="isObject"+l,I="formatType"+l;s+=" var "+F+" = formats["+E+"]; var "+p+" = typeof "+F+" == 'object' && !("+F+" instanceof RegExp) && "+F+".validate; var "+I+" = "+p+" && "+F+".type || 'string'; if ("+p+") { ";if(f.async){s+=" var async"+l+" = "+F+".async; "}s+=" "+F+" = "+F+".validate; } if ( ";if(d){s+=" ("+E+" !== undefined && typeof "+E+" != 'string') || "}s+=" (";if(R!="ignore"){s+=" ("+E+" && !"+F+" ";if(A){s+=" && self._opts.unknownFormats.indexOf("+E+") == -1 "}s+=") || "}s+=" ("+F+" && "+I+" == '"+n+"' && !(typeof "+F+" == 'function' ? ";if(f.async){s+=" (async"+l+" ? await "+F+"("+j+") : "+F+"("+j+")) "}else{s+=" "+F+"("+j+") "}s+=" : "+F+".test("+j+"))))) {"}else{var F=f.formats[r];if(!F){if(R=="ignore"){f.logger.warn('unknown format "'+r+'" ignored in schema at path "'+f.errSchemaPath+'"');if(w){s+=" if (true) { "}return s}else if(A&&R.indexOf(r)>=0){if(w){s+=" if (true) { "}return s}else{throw new Error('unknown format "'+r+'" is used in schema at path "'+f.errSchemaPath+'"')}}var p=typeof F=="object"&&!(F instanceof RegExp)&&F.validate;var I=p&&F.type||"string";if(p){var x=F.async===true;F=F.validate}if(I!=n){if(w){s+=" if (true) { "}return s}if(x){if(!f.async)throw new Error("async format in sync schema");var z="formats"+f.util.getProperty(r)+".validate";s+=" if (!(await "+z+"("+j+"))) { "}else{s+=" if (! ";var z="formats"+f.util.getProperty(r);if(p)z+=".validate";if(typeof F=="function"){s+=" "+z+"("+j+") "}else{s+=" "+z+".test("+j+") "}s+=") { "}}var U=U||[];U.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"format"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { format: ";if(d){s+=""+E}else{s+=""+f.util.toQuotedString(r)}s+=" } ";if(f.opts.messages!==false){s+=" , message: 'should match format \"";if(d){s+="' + "+E+" + '"}else{s+=""+f.util.escapeQuotes(r)}s+="\"' "}if(f.opts.verbose){s+=" , schema: ";if(d){s+="validate.schema"+b}else{s+=""+f.util.toQuotedString(r)}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var N=s;s=U.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+N+"]); "}else{s+=" validate.errors = ["+N+"]; return false; "}}else{s+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } ";if(w){s+=" else { "}return s}},4962:f=>{"use strict";f.exports=function generate_if(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);R.level++;var A="valid"+R.level;var F=f.schema["then"],p=f.schema["else"],I=F!==undefined&&(f.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===false:f.util.schemaHasRules(F,f.RULES.all)),x=p!==undefined&&(f.opts.strictKeywords?typeof p=="object"&&Object.keys(p).length>0||p===false:f.util.schemaHasRules(p,f.RULES.all)),z=R.baseId;if(I||x){var U;R.createErrors=false;R.schema=r;R.schemaPath=b;R.errSchemaPath=g;s+=" var "+E+" = errors; var "+d+" = true; ";var N=f.compositeRule;f.compositeRule=R.compositeRule=true;s+=" "+f.validate(R)+" ";R.baseId=z;R.createErrors=true;s+=" errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; } ";f.compositeRule=R.compositeRule=N;if(I){s+=" if ("+A+") { ";R.schema=f.schema["then"];R.schemaPath=f.schemaPath+".then";R.errSchemaPath=f.errSchemaPath+"/then";s+=" "+f.validate(R)+" ";R.baseId=z;s+=" "+d+" = "+A+"; ";if(I&&x){U="ifClause"+l;s+=" var "+U+" = 'then'; "}else{U="'then'"}s+=" } ";if(x){s+=" else { "}}else{s+=" if (!"+A+") { "}if(x){R.schema=f.schema["else"];R.schemaPath=f.schemaPath+".else";R.errSchemaPath=f.errSchemaPath+"/else";s+=" "+f.validate(R)+" ";R.baseId=z;s+=" "+d+" = "+A+"; ";if(I&&x){U="ifClause"+l;s+=" var "+U+" = 'else'; "}else{U="'else'"}s+=" } "}s+=" if (!"+d+") { var err = ";if(f.createErrors!==false){s+=" { keyword: '"+"if"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { failingKeyword: "+U+" } ";if(f.opts.messages!==false){s+=" , message: 'should match \"' + "+U+" + '\" schema' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(vErrors); "}else{s+=" validate.errors = vErrors; return false; "}}s+=" } ";if(w){s+=" else { "}}else{if(w){s+=" if (true) { "}}return s}},4124:(f,e,n)=>{"use strict";f.exports={$ref:n(5746),allOf:n(3639),anyOf:n(1256),$comment:n(2660),const:n(184),contains:n(7419),dependencies:n(7299),enum:n(9795),format:n(5801),if:n(4962),items:n(9623),maximum:n(3711),minimum:n(3711),maxItems:n(5675),minItems:n(5675),maxLength:n(6051),minLength:n(6051),maxProperties:n(7043),minProperties:n(7043),multipleOf:n(9251),not:n(7739),oneOf:n(6857),pattern:n(8099),properties:n(9438),propertyNames:n(3466),required:n(8430),uniqueItems:n(2207),validate:n(6131)}},9623:f=>{"use strict";f.exports=function generate_items(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);var A="";R.level++;var F="valid"+R.level;var p="i"+l,I=R.dataLevel=f.dataLevel+1,x="data"+I,z=f.baseId;s+="var "+E+" = errors;var "+d+";";if(Array.isArray(r)){var U=f.schema.additionalItems;if(U===false){s+=" "+d+" = "+j+".length <= "+r.length+"; ";var N=g;g=f.errSchemaPath+"/additionalItems";s+=" if (!"+d+") { ";var Q=Q||[];Q.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"additionalItems"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { limit: "+r.length+" } ";if(f.opts.messages!==false){s+=" , message: 'should NOT have more than "+r.length+" items' "}if(f.opts.verbose){s+=" , schema: false , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var q=s;s=Q.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+q+"]); "}else{s+=" validate.errors = ["+q+"]; return false; "}}else{s+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } ";g=N;if(w){A+="}";s+=" else { "}}var O=r;if(O){var C,L=-1,J=O.length-1;while(L0||C===false:f.util.schemaHasRules(C,f.RULES.all)){s+=" "+F+" = true; if ("+j+".length > "+L+") { ";var T=j+"["+L+"]";R.schema=C;R.schemaPath=b+"["+L+"]";R.errSchemaPath=g+"/"+L;R.errorPath=f.util.getPathExpr(f.errorPath,L,f.opts.jsonPointers,true);R.dataPathArr[I]=L;var G=f.validate(R);R.baseId=z;if(f.util.varOccurences(G,x)<2){s+=" "+f.util.varReplace(G,x,T)+" "}else{s+=" var "+x+" = "+T+"; "+G+" "}s+=" } ";if(w){s+=" if ("+F+") { ";A+="}"}}}}if(typeof U=="object"&&(f.opts.strictKeywords?typeof U=="object"&&Object.keys(U).length>0||U===false:f.util.schemaHasRules(U,f.RULES.all))){R.schema=U;R.schemaPath=f.schemaPath+".additionalItems";R.errSchemaPath=f.errSchemaPath+"/additionalItems";s+=" "+F+" = true; if ("+j+".length > "+r.length+") { for (var "+p+" = "+r.length+"; "+p+" < "+j+".length; "+p+"++) { ";R.errorPath=f.util.getPathExpr(f.errorPath,p,f.opts.jsonPointers,true);var T=j+"["+p+"]";R.dataPathArr[I]=p;var G=f.validate(R);R.baseId=z;if(f.util.varOccurences(G,x)<2){s+=" "+f.util.varReplace(G,x,T)+" "}else{s+=" var "+x+" = "+T+"; "+G+" "}if(w){s+=" if (!"+F+") break; "}s+=" } } ";if(w){s+=" if ("+F+") { ";A+="}"}}}else if(f.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:f.util.schemaHasRules(r,f.RULES.all)){R.schema=r;R.schemaPath=b;R.errSchemaPath=g;s+=" for (var "+p+" = "+0+"; "+p+" < "+j+".length; "+p+"++) { ";R.errorPath=f.util.getPathExpr(f.errorPath,p,f.opts.jsonPointers,true);var T=j+"["+p+"]";R.dataPathArr[I]=p;var G=f.validate(R);R.baseId=z;if(f.util.varOccurences(G,x)<2){s+=" "+f.util.varReplace(G,x,T)+" "}else{s+=" var "+x+" = "+T+"; "+G+" "}if(w){s+=" if (!"+F+") break; "}s+=" }"}if(w){s+=" "+A+" if ("+E+" == errors) {"}return s}},9251:f=>{"use strict";f.exports=function generate_multipleOf(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d=f.opts.$data&&r&&r.$data,E;if(d){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";E="schema"+l}else{E=r}if(!(d||typeof r=="number")){throw new Error(e+" must be number")}s+="var division"+l+";if (";if(d){s+=" "+E+" !== undefined && ( typeof "+E+" != 'number' || "}s+=" (division"+l+" = "+j+" / "+E+", ";if(f.opts.multipleOfPrecision){s+=" Math.abs(Math.round(division"+l+") - division"+l+") > 1e-"+f.opts.multipleOfPrecision+" "}else{s+=" division"+l+" !== parseInt(division"+l+") "}s+=" ) ";if(d){s+=" ) "}s+=" ) { ";var R=R||[];R.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"multipleOf"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { multipleOf: "+E+" } ";if(f.opts.messages!==false){s+=" , message: 'should be multiple of ";if(d){s+="' + "+E}else{s+=""+E+"'"}}if(f.opts.verbose){s+=" , schema: ";if(d){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var A=s;s=R.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+A+"]); "}else{s+=" validate.errors = ["+A+"]; return false; "}}else{s+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},7739:f=>{"use strict";f.exports=function generate_not(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="errs__"+l;var E=f.util.copy(f);E.level++;var R="valid"+E.level;if(f.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:f.util.schemaHasRules(r,f.RULES.all)){E.schema=r;E.schemaPath=b;E.errSchemaPath=g;s+=" var "+d+" = errors; ";var A=f.compositeRule;f.compositeRule=E.compositeRule=true;E.createErrors=false;var F;if(E.opts.allErrors){F=E.opts.allErrors;E.opts.allErrors=false}s+=" "+f.validate(E)+" ";E.createErrors=true;if(F)E.opts.allErrors=F;f.compositeRule=E.compositeRule=A;s+=" if ("+R+") { ";var p=p||[];p.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"not"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: 'should NOT be valid' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var I=s;s=p.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+I+"]); "}else{s+=" validate.errors = ["+I+"]; return false; "}}else{s+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ";if(f.opts.allErrors){s+=" } "}}else{s+=" var err = ";if(f.createErrors!==false){s+=" { keyword: '"+"not"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: 'should NOT be valid' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(w){s+=" if (false) { "}}return s}},6857:f=>{"use strict";f.exports=function generate_oneOf(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);var A="";R.level++;var F="valid"+R.level;var p=R.baseId,I="prevValid"+l,x="passingSchemas"+l;s+="var "+E+" = errors , "+I+" = false , "+d+" = false , "+x+" = null; ";var z=f.compositeRule;f.compositeRule=R.compositeRule=true;var U=r;if(U){var N,Q=-1,q=U.length-1;while(Q0||N===false:f.util.schemaHasRules(N,f.RULES.all)){R.schema=N;R.schemaPath=b+"["+Q+"]";R.errSchemaPath=g+"/"+Q;s+=" "+f.validate(R)+" ";R.baseId=p}else{s+=" var "+F+" = true; "}if(Q){s+=" if ("+F+" && "+I+") { "+d+" = false; "+x+" = ["+x+", "+Q+"]; } else { ";A+="}"}s+=" if ("+F+") { "+d+" = "+I+" = true; "+x+" = "+Q+"; }"}}f.compositeRule=R.compositeRule=z;s+=""+A+"if (!"+d+") { var err = ";if(f.createErrors!==false){s+=" { keyword: '"+"oneOf"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { passingSchemas: "+x+" } ";if(f.opts.messages!==false){s+=" , message: 'should match exactly one schema in oneOf' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(vErrors); "}else{s+=" validate.errors = vErrors; return false; "}}s+="} else { errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; }";if(f.opts.allErrors){s+=" } "}return s}},8099:f=>{"use strict";f.exports=function generate_pattern(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d=f.opts.$data&&r&&r.$data,E;if(d){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";E="schema"+l}else{E=r}var R=d?"(new RegExp("+E+"))":f.usePattern(r);s+="if ( ";if(d){s+=" ("+E+" !== undefined && typeof "+E+" != 'string') || "}s+=" !"+R+".test("+j+") ) { ";var A=A||[];A.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"pattern"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { pattern: ";if(d){s+=""+E}else{s+=""+f.util.toQuotedString(r)}s+=" } ";if(f.opts.messages!==false){s+=" , message: 'should match pattern \"";if(d){s+="' + "+E+" + '"}else{s+=""+f.util.escapeQuotes(r)}s+="\"' "}if(f.opts.verbose){s+=" , schema: ";if(d){s+="validate.schema"+b}else{s+=""+f.util.toQuotedString(r)}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var F=s;s=A.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+F+"]); "}else{s+=" validate.errors = ["+F+"]; return false; "}}else{s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},9438:f=>{"use strict";f.exports=function generate_properties(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="errs__"+l;var E=f.util.copy(f);var R="";E.level++;var A="valid"+E.level;var F="key"+l,p="idx"+l,I=E.dataLevel=f.dataLevel+1,x="data"+I,z="dataProperties"+l;var U=Object.keys(r||{}).filter(notProto),N=f.schema.patternProperties||{},Q=Object.keys(N).filter(notProto),q=f.schema.additionalProperties,O=U.length||Q.length,C=q===false,L=typeof q=="object"&&Object.keys(q).length,J=f.opts.removeAdditional,T=C||L||J,G=f.opts.ownProperties,H=f.baseId;var X=f.schema.required;if(X&&!(f.opts.$data&&X.$data)&&X.length8){s+=" || validate.schema"+b+".hasOwnProperty("+F+") "}else{var Y=U;if(Y){var W,B=-1,c=Y.length-1;while(B0||t===false:f.util.schemaHasRules(t,f.RULES.all)){var ff=f.util.getProperty(W),P=j+ff,ef=_&&t.default!==undefined;E.schema=t;E.schemaPath=b+ff;E.errSchemaPath=g+"/"+f.util.escapeFragment(W);E.errorPath=f.util.getPath(f.errorPath,W,f.opts.jsonPointers);E.dataPathArr[I]=f.util.toQuotedString(W);var i=f.validate(E);E.baseId=H;if(f.util.varOccurences(i,x)<2){i=f.util.varReplace(i,x,P);var nf=P}else{var nf=x;s+=" var "+x+" = "+P+"; "}if(ef){s+=" "+i+" "}else{if(M&&M[W]){s+=" if ( "+nf+" === undefined ";if(G){s+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(W)+"') "}s+=") { "+A+" = false; ";var y=f.errorPath,h=g,sf=f.util.escapeQuotes(W);if(f.opts._errorDataPathProperty){f.errorPath=f.util.getPath(y,W,f.opts.jsonPointers)}g=f.errSchemaPath+"/required";var a=a||[];a.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { missingProperty: '"+sf+"' } ";if(f.opts.messages!==false){s+=" , message: '";if(f.opts._errorDataPathProperty){s+="is a required property"}else{s+="should have required property \\'"+sf+"\\'"}s+="' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var S=s;s=a.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+S+"]); "}else{s+=" validate.errors = ["+S+"]; return false; "}}else{s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}g=h;f.errorPath=y;s+=" } else { "}else{if(w){s+=" if ( "+nf+" === undefined ";if(G){s+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(W)+"') "}s+=") { "+A+" = true; } else { "}else{s+=" if ("+nf+" !== undefined ";if(G){s+=" && Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(W)+"') "}s+=" ) { "}}s+=" "+i+" } "}}if(w){s+=" if ("+A+") { ";R+="}"}}}}if(Q.length){var lf=Q;if(lf){var D,vf=-1,rf=lf.length-1;while(vf0||t===false:f.util.schemaHasRules(t,f.RULES.all)){E.schema=t;E.schemaPath=f.schemaPath+".patternProperties"+f.util.getProperty(D);E.errSchemaPath=f.errSchemaPath+"/patternProperties/"+f.util.escapeFragment(D);if(G){s+=" "+z+" = "+z+" || Object.keys("+j+"); for (var "+p+"=0; "+p+"<"+z+".length; "+p+"++) { var "+F+" = "+z+"["+p+"]; "}else{s+=" for (var "+F+" in "+j+") { "}s+=" if ("+f.usePattern(D)+".test("+F+")) { ";E.errorPath=f.util.getPathExpr(f.errorPath,F,f.opts.jsonPointers);var P=j+"["+F+"]";E.dataPathArr[I]=F;var i=f.validate(E);E.baseId=H;if(f.util.varOccurences(i,x)<2){s+=" "+f.util.varReplace(i,x,P)+" "}else{s+=" var "+x+" = "+P+"; "+i+" "}if(w){s+=" if (!"+A+") break; "}s+=" } ";if(w){s+=" else "+A+" = true; "}s+=" } ";if(w){s+=" if ("+A+") { ";R+="}"}}}}}if(w){s+=" "+R+" if ("+d+" == errors) {"}return s}},3466:f=>{"use strict";f.exports=function generate_propertyNames(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="errs__"+l;var E=f.util.copy(f);var R="";E.level++;var A="valid"+E.level;s+="var "+d+" = errors;";if(f.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:f.util.schemaHasRules(r,f.RULES.all)){E.schema=r;E.schemaPath=b;E.errSchemaPath=g;var F="key"+l,p="idx"+l,I="i"+l,x="' + "+F+" + '",z=E.dataLevel=f.dataLevel+1,U="data"+z,N="dataProperties"+l,Q=f.opts.ownProperties,q=f.baseId;if(Q){s+=" var "+N+" = undefined; "}if(Q){s+=" "+N+" = "+N+" || Object.keys("+j+"); for (var "+p+"=0; "+p+"<"+N+".length; "+p+"++) { var "+F+" = "+N+"["+p+"]; "}else{s+=" for (var "+F+" in "+j+") { "}s+=" var startErrs"+l+" = errors; ";var O=F;var C=f.compositeRule;f.compositeRule=E.compositeRule=true;var L=f.validate(E);E.baseId=q;if(f.util.varOccurences(L,U)<2){s+=" "+f.util.varReplace(L,U,O)+" "}else{s+=" var "+U+" = "+O+"; "+L+" "}f.compositeRule=E.compositeRule=C;s+=" if (!"+A+") { for (var "+I+"=startErrs"+l+"; "+I+"{"use strict";f.exports=function generate_ref(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.errSchemaPath+"/"+e;var g=!f.opts.allErrors;var w="data"+(v||"");var j="valid"+l;var d,E;if(r=="#"||r=="#/"){if(f.isRoot){d=f.async;E="validate"}else{d=f.root.schema.$async===true;E="root.refVal[0]"}}else{var R=f.resolveRef(f.baseId,r,f.isRoot);if(R===undefined){var A=f.MissingRefError.message(f.baseId,r);if(f.opts.missingRefs=="fail"){f.logger.error(A);var F=F||[];F.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"$ref"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(b)+" , params: { ref: '"+f.util.escapeQuotes(r)+"' } ";if(f.opts.messages!==false){s+=" , message: 'can\\'t resolve reference "+f.util.escapeQuotes(r)+"' "}if(f.opts.verbose){s+=" , schema: "+f.util.toQuotedString(r)+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+w+" "}s+=" } "}else{s+=" {} "}var p=s;s=F.pop();if(!f.compositeRule&&g){if(f.async){s+=" throw new ValidationError(["+p+"]); "}else{s+=" validate.errors = ["+p+"]; return false; "}}else{s+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}if(g){s+=" if (false) { "}}else if(f.opts.missingRefs=="ignore"){f.logger.warn(A);if(g){s+=" if (true) { "}}else{throw new f.MissingRefError(f.baseId,r,A)}}else if(R.inline){var I=f.util.copy(f);I.level++;var x="valid"+I.level;I.schema=R.schema;I.schemaPath="";I.errSchemaPath=r;var z=f.validate(I).replace(/validate\.schema/g,R.code);s+=" "+z+" ";if(g){s+=" if ("+x+") { "}}else{d=R.$async===true||f.async&&R.$async!==false;E=R.code}}if(E){var F=F||[];F.push(s);s="";if(f.opts.passContext){s+=" "+E+".call(this, "}else{s+=" "+E+"( "}s+=" "+w+", (dataPath || '')";if(f.errorPath!='""'){s+=" + "+f.errorPath}var U=v?"data"+(v-1||""):"parentData",N=v?f.dataPathArr[v]:"parentDataProperty";s+=" , "+U+" , "+N+", rootData) ";var Q=s;s=F.pop();if(d){if(!f.async)throw new Error("async schema referenced by sync schema");if(g){s+=" var "+j+"; "}s+=" try { await "+Q+"; ";if(g){s+=" "+j+" = true; "}s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ";if(g){s+=" "+j+" = false; "}s+=" } ";if(g){s+=" if ("+j+") { "}}else{s+=" if (!"+Q+") { if (vErrors === null) vErrors = "+E+".errors; else vErrors = vErrors.concat("+E+".errors); errors = vErrors.length; } ";if(g){s+=" else { "}}}return s}},8430:f=>{"use strict";f.exports=function generate_required(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}var A="schema"+l;if(!E){if(r.length0||U===false:f.util.schemaHasRules(U,f.RULES.all)))){F[F.length]=I}}}}else{var F=r}}if(E||F.length){var N=f.errorPath,Q=E||F.length>=f.opts.loopRequired,q=f.opts.ownProperties;if(w){s+=" var missing"+l+"; ";if(Q){if(!E){s+=" var "+A+" = validate.schema"+b+"; "}var O="i"+l,C="schema"+l+"["+O+"]",L="' + "+C+" + '";if(f.opts._errorDataPathProperty){f.errorPath=f.util.getPathExpr(N,C,f.opts.jsonPointers)}s+=" var "+d+" = true; ";if(E){s+=" if (schema"+l+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+l+")) "+d+" = false; else {"}s+=" for (var "+O+" = 0; "+O+" < "+A+".length; "+O+"++) { "+d+" = "+j+"["+A+"["+O+"]] !== undefined ";if(q){s+=" && Object.prototype.hasOwnProperty.call("+j+", "+A+"["+O+"]) "}s+="; if (!"+d+") break; } ";if(E){s+=" } "}s+=" if (!"+d+") { ";var J=J||[];J.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { missingProperty: '"+L+"' } ";if(f.opts.messages!==false){s+=" , message: '";if(f.opts._errorDataPathProperty){s+="is a required property"}else{s+="should have required property \\'"+L+"\\'"}s+="' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var T=s;s=J.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+T+"]); "}else{s+=" validate.errors = ["+T+"]; return false; "}}else{s+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } else { "}else{s+=" if ( ";var G=F;if(G){var H,O=-1,X=G.length-1;while(O{"use strict";f.exports=function generate_uniqueItems(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if((r||E)&&f.opts.uniqueItems!==false){if(E){s+=" var "+d+"; if ("+R+" === false || "+R+" === undefined) "+d+" = true; else if (typeof "+R+" != 'boolean') "+d+" = false; else { "}s+=" var i = "+j+".length , "+d+" = true , j; if (i > 1) { ";var A=f.schema.items&&f.schema.items.type,F=Array.isArray(A);if(!A||A=="object"||A=="array"||F&&(A.indexOf("object")>=0||A.indexOf("array")>=0)){s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+j+"[i], "+j+"[j])) { "+d+" = false; break outer; } } } "}else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+j+"[i]; ";var p="checkDataType"+(F?"s":"");s+=" if ("+f.util[p](A,"item",f.opts.strictNumbers,true)+") continue; ";if(F){s+=" if (typeof item == 'string') item = '\"' + item; "}s+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ";if(E){s+=" } "}s+=" if (!"+d+") { ";var I=I||[];I.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"uniqueItems"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { i: i, j: j } ";if(f.opts.messages!==false){s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var x=s;s=I.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+x+"]); "}else{s+=" validate.errors = ["+x+"]; return false; "}}else{s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } ";if(w){s+=" else { "}}else{if(w){s+=" if (true) { "}}return s}},6131:f=>{"use strict";f.exports=function generate_validate(f,e,n){var s="";var l=f.schema.$async===true,v=f.util.schemaHasRulesExcept(f.schema,f.RULES.all,"$ref"),r=f.self._getId(f.schema);if(f.opts.strictKeywords){var b=f.util.schemaUnknownRules(f.schema,f.RULES.keywords);if(b){var g="unknown keyword: "+b;if(f.opts.strictKeywords==="log")f.logger.warn(g);else throw new Error(g)}}if(f.isTop){s+=" var validate = ";if(l){f.async=true;s+="async "}s+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ";if(r&&(f.opts.sourceCode||f.opts.processCode)){s+=" "+("/*# sourceURL="+r+" */")+" "}}if(typeof f.schema=="boolean"||!(v||f.schema.$ref)){var e="false schema";var w=f.level;var j=f.dataLevel;var d=f.schema[e];var E=f.schemaPath+f.util.getProperty(e);var R=f.errSchemaPath+"/"+e;var A=!f.opts.allErrors;var F;var p="data"+(j||"");var I="valid"+w;if(f.schema===false){if(f.isTop){A=true}else{s+=" var "+I+" = false; "}var x=x||[];x.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(F||"false schema")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(R)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: 'boolean schema is false' "}if(f.opts.verbose){s+=" , schema: false , parentSchema: validate.schema"+f.schemaPath+" , data: "+p+" "}s+=" } "}else{s+=" {} "}var z=s;s=x.pop();if(!f.compositeRule&&A){if(f.async){s+=" throw new ValidationError(["+z+"]); "}else{s+=" validate.errors = ["+z+"]; return false; "}}else{s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}}else{if(f.isTop){if(l){s+=" return data; "}else{s+=" validate.errors = null; return true; "}}else{s+=" var "+I+" = true; "}}if(f.isTop){s+=" }; return validate; "}return s}if(f.isTop){var U=f.isTop,w=f.level=0,j=f.dataLevel=0,p="data";f.rootId=f.resolve.fullPath(f.self._getId(f.root.schema));f.baseId=f.baseId||f.rootId;delete f.isTop;f.dataPathArr=[""];if(f.schema.default!==undefined&&f.opts.useDefaults&&f.opts.strictDefaults){var N="default is ignored in the schema root";if(f.opts.strictDefaults==="log")f.logger.warn(N);else throw new Error(N)}s+=" var vErrors = null; ";s+=" var errors = 0; ";s+=" if (rootData === undefined) rootData = data; "}else{var w=f.level,j=f.dataLevel,p="data"+(j||"");if(r)f.baseId=f.resolve.url(f.baseId,r);if(l&&!f.async)throw new Error("async schema in sync schema");s+=" var errs_"+w+" = errors;"}var I="valid"+w,A=!f.opts.allErrors,Q="",q="";var F;var O=f.schema.type,C=Array.isArray(O);if(O&&f.opts.nullable&&f.schema.nullable===true){if(C){if(O.indexOf("null")==-1)O=O.concat("null")}else if(O!="null"){O=[O,"null"];C=true}}if(C&&O.length==1){O=O[0];C=false}if(f.schema.$ref&&v){if(f.opts.extendRefs=="fail"){throw new Error('$ref: validation keywords used in schema at path "'+f.errSchemaPath+'" (see option extendRefs)')}else if(f.opts.extendRefs!==true){v=false;f.logger.warn('$ref: keywords ignored in schema at path "'+f.errSchemaPath+'"')}}if(f.schema.$comment&&f.opts.$comment){s+=" "+f.RULES.all.$comment.code(f,"$comment")}if(O){if(f.opts.coerceTypes){var L=f.util.coerceToTypes(f.opts.coerceTypes,O)}var J=f.RULES.types[O];if(L||C||J===true||J&&!$shouldUseGroup(J)){var E=f.schemaPath+".type",R=f.errSchemaPath+"/type";var E=f.schemaPath+".type",R=f.errSchemaPath+"/type",T=C?"checkDataTypes":"checkDataType";s+=" if ("+f.util[T](O,p,f.opts.strictNumbers,true)+") { ";if(L){var G="dataType"+w,H="coerced"+w;s+=" var "+G+" = typeof "+p+"; var "+H+" = undefined; ";if(f.opts.coerceTypes=="array"){s+=" if ("+G+" == 'object' && Array.isArray("+p+") && "+p+".length == 1) { "+p+" = "+p+"[0]; "+G+" = typeof "+p+"; if ("+f.util.checkDataType(f.schema.type,p,f.opts.strictNumbers)+") "+H+" = "+p+"; } "}s+=" if ("+H+" !== undefined) ; ";var X=L;if(X){var M,Y=-1,W=X.length-1;while(Y{"use strict";var s=/^[a-z_$][a-z0-9_$-]*$/i;var l=n(7921);var v=n(5533);f.exports={add:addKeyword,get:getKeyword,remove:removeKeyword,validate:validateKeyword};function addKeyword(f,e){var n=this.RULES;if(n.keywords[f])throw new Error("Keyword "+f+" is already defined");if(!s.test(f))throw new Error("Keyword "+f+" is not a valid identifier");if(e){this.validateKeyword(e,true);var v=e.type;if(Array.isArray(v)){for(var r=0;r{"use strict";f=n.nmd(f);const s=n(5747);const l=n(5622);const v=n(6417);const r=n(2357);const b=n(8614);const g=n(5514);const w=n(3900);const j=n(6536);const d=n(7727);const E=n(8393);const R=n(1414);const A=()=>Object.create(null);const F="aes-256-cbc";delete require.cache[__filename];const p=l.dirname(f.parent&&f.parent.filename||".");const I=(f,e)=>{const n=["undefined","symbol","function"];const s=typeof e;if(n.includes(s)){throw new TypeError(`Setting a value of type \`${s}\` for key \`${f}\` is not allowed as it's not supported by JSON`)}};class Conf{constructor(f){f={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:true,serialize:f=>JSON.stringify(f,null,"\t"),deserialize:JSON.parse,accessPropertiesByDotNotation:true,...f};if(!f.cwd){if(!f.projectName){const e=j.sync(p);f.projectName=e&&JSON.parse(s.readFileSync(e,"utf8")).name}if(!f.projectName){throw new Error("Project name could not be inferred. Please specify the `projectName` option.")}f.cwd=d(f.projectName,{suffix:f.projectSuffix}).config}this._options=f;if(f.schema){if(typeof f.schema!=="object"){throw new TypeError("The `schema` option must be an object.")}const e=new R({allErrors:true,format:"full",useDefaults:true,errorDataPath:"property"});const n={type:"object",properties:f.schema};this._validator=e.compile(n)}this.events=new b;this.encryptionKey=f.encryptionKey;this.serialize=f.serialize;this.deserialize=f.deserialize;const e=f.fileExtension?`.${f.fileExtension}`:"";this.path=l.resolve(f.cwd,`${f.configName}${e}`);const n=this.store;const v=Object.assign(A(),f.defaults,n);this._validate(v);try{r.deepEqual(n,v)}catch(f){this.store=v}}_validate(f){if(!this._validator){return}const e=this._validator(f);if(!e){const f=this._validator.errors.reduce((f,{dataPath:e,message:n})=>f+` \`${e.slice(1)}\` ${n};`,"");throw new Error("Config schema violation:"+f.slice(0,-1))}}get(f,e){if(this._options.accessPropertiesByDotNotation){return g.get(this.store,f,e)}return f in this.store?this.store[f]:e}set(f,e){if(typeof f!=="string"&&typeof f!=="object"){throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof f}`)}if(typeof f!=="object"&&e===undefined){throw new TypeError("Use `delete()` to clear values")}const{store:n}=this;const s=(f,e)=>{I(f,e);if(this._options.accessPropertiesByDotNotation){g.set(n,f,e)}else{n[f]=e}};if(typeof f==="object"){const e=f;for(const[f,n]of Object.entries(e)){s(f,n)}}else{s(f,e)}this.store=n}has(f){if(this._options.accessPropertiesByDotNotation){return g.has(this.store,f)}return f in this.store}delete(f){const{store:e}=this;if(this._options.accessPropertiesByDotNotation){g.delete(e,f)}else{delete e[f]}this.store=e}clear(){this.store=A()}onDidChange(f,e){if(typeof f!=="string"){throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof f}`)}if(typeof e!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`)}const n=()=>this.get(f);return this.handleChange(n,e)}onDidAnyChange(f){if(typeof f!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof f}`)}const e=()=>this.store;return this.handleChange(e,f)}handleChange(f,e){let n=f();const s=()=>{const s=n;const l=f();try{r.deepEqual(l,s)}catch(f){n=l;e.call(this,l,s)}};this.events.on("change",s);return()=>this.events.removeListener("change",s)}get size(){return Object.keys(this.store).length}get store(){try{let f=s.readFileSync(this.path,this.encryptionKey?null:"utf8");if(this.encryptionKey){try{if(f.slice(16,17).toString()===":"){const e=f.slice(0,16);const n=v.pbkdf2Sync(this.encryptionKey,e.toString(),1e4,32,"sha512");const s=v.createDecipheriv(F,n,e);f=Buffer.concat([s.update(f.slice(17)),s.final()])}else{const e=v.createDecipher(F,this.encryptionKey);f=Buffer.concat([e.update(f),e.final()])}}catch(f){}}f=this.deserialize(f);this._validate(f);return Object.assign(A(),f)}catch(f){if(f.code==="ENOENT"){w.sync(l.dirname(this.path));return A()}if(this._options.clearInvalidConfig&&f.name==="SyntaxError"){return A()}throw f}}set store(f){w.sync(l.dirname(this.path));this._validate(f);let e=this.serialize(f);if(this.encryptionKey){const f=v.randomBytes(16);const n=v.pbkdf2Sync(this.encryptionKey,f.toString(),1e4,32,"sha512");const s=v.createCipheriv(F,n,f);e=Buffer.concat([f,Buffer.from(":"),s.update(Buffer.from(e)),s.final()])}E.sync(this.path,e);this.events.emit("change")}*[Symbol.iterator](){for(const[f,e]of Object.entries(this.store)){yield[f,e]}}}f.exports=Conf},5514:(f,e,n)=>{"use strict";const s=n(1771);const l=["__proto__","prototype","constructor"];const v=f=>!f.some(f=>l.includes(f));function getPathSegments(f){const e=f.split(".");const n=[];for(let f=0;f{"use strict";f.exports=(f=>{const e=typeof f;return f!==null&&(e==="object"||e==="function")})},3900:(f,e,n)=>{"use strict";const s=n(5747);const l=n(5622);const{promisify:v}=n(1669);const r=n(2519);const b=r.satisfies(process.version,">=10.12.0");const g=f=>{if(process.platform==="win32"){const e=/[<>:"|?*]/.test(f.replace(l.parse(f).root,""));if(e){const e=new Error(`Path contains invalid characters: ${f}`);e.code="EINVAL";throw e}}};const w=f=>{const e={mode:511&~process.umask(),fs:s};return{...e,...f}};const j=f=>{const e=new Error(`operation not permitted, mkdir '${f}'`);e.code="EPERM";e.errno=-4048;e.path=f;e.syscall="mkdir";return e};const d=async(f,e)=>{g(f);e=w(e);const n=v(e.fs.mkdir);const r=v(e.fs.stat);if(b&&e.fs.mkdir===s.mkdir){const s=l.resolve(f);await n(s,{mode:e.mode,recursive:true});return s}const d=async f=>{try{await n(f,e.mode);return f}catch(e){if(e.code==="EPERM"){throw e}if(e.code==="ENOENT"){if(l.dirname(f)===f){throw j(f)}if(e.message.includes("null bytes")){throw e}await d(l.dirname(f));return d(f)}try{const n=await r(f);if(!n.isDirectory()){throw new Error("The path is not a directory")}}catch(f){throw e}return f}};return d(l.resolve(f))};f.exports=d;f.exports.sync=((f,e)=>{g(f);e=w(e);if(b&&e.fs.mkdirSync===s.mkdirSync){const n=l.resolve(f);s.mkdirSync(n,{mode:e.mode,recursive:true});return n}const n=f=>{try{e.fs.mkdirSync(f,e.mode)}catch(s){if(s.code==="EPERM"){throw s}if(s.code==="ENOENT"){if(l.dirname(f)===f){throw j(f)}if(s.message.includes("null bytes")){throw s}n(l.dirname(f));return n(f)}try{if(!e.fs.statSync(f).isDirectory()){throw new Error("The path is not a directory")}}catch(f){throw s}}return f};return n(l.resolve(f))})},8393:(f,e,n)=>{"use strict";f.exports=writeFile;f.exports.sync=writeFileSync;f.exports._getTmpname=getTmpname;f.exports._cleanupOnExit=cleanupOnExit;const s=n(5747);const l=n(8681);const v=n(2317);const r=n(5622);const b=n(3010);const g=n(4005);const{promisify:w}=n(1669);const j={};const d=function getId(){try{const f=n(5013);return f.threadId}catch(f){return 0}}();let E=0;function getTmpname(f){return f+"."+l(__filename).hash(String(process.pid)).hash(String(d)).hash(String(++E)).result()}function cleanupOnExit(f){return()=>{try{s.unlinkSync(typeof f==="function"?f():f)}catch(f){}}}function serializeActiveFile(f){return new Promise(e=>{if(!j[f])j[f]=[];j[f].push(e);if(j[f].length===1)e()})}async function writeFileAsync(f,e,n={}){if(typeof n==="string"){n={encoding:n}}let l;let d;const E=v(cleanupOnExit(()=>d));const R=r.resolve(f);try{await serializeActiveFile(R);const v=await w(s.realpath)(f).catch(()=>f);d=getTmpname(v);if(!n.mode||!n.chown){const f=await w(s.stat)(v).catch(()=>{});if(f){if(n.mode==null){n.mode=f.mode}if(n.chown==null&&process.getuid){n.chown={uid:f.uid,gid:f.gid}}}}l=await w(s.open)(d,"w",n.mode);if(n.tmpfileCreated){await n.tmpfileCreated(d)}if(b(e)){e=g(e)}if(Buffer.isBuffer(e)){await w(s.write)(l,e,0,e.length,0)}else if(e!=null){await w(s.write)(l,String(e),0,String(n.encoding||"utf8"))}if(n.fsync!==false){await w(s.fsync)(l)}await w(s.close)(l);l=null;if(n.chown){await w(s.chown)(d,n.chown.uid,n.chown.gid)}if(n.mode){await w(s.chmod)(d,n.mode)}await w(s.rename)(d,v)}finally{if(l){await w(s.close)(l).catch(()=>{})}E();await w(s.unlink)(d).catch(()=>{});j[R].shift();if(j[R].length>0){j[R][0]()}else delete j[R]}}function writeFile(f,e,n,s){if(n instanceof Function){s=n;n={}}const l=writeFileAsync(f,e,n);if(s){l.then(s,s)}return l}function writeFileSync(f,e,n){if(typeof n==="string")n={encoding:n};else if(!n)n={};try{f=s.realpathSync(f)}catch(f){}const l=getTmpname(f);if(!n.mode||!n.chown){try{const e=s.statSync(f);n=Object.assign({},n);if(!n.mode){n.mode=e.mode}if(!n.chown&&process.getuid){n.chown={uid:e.uid,gid:e.gid}}}catch(f){}}let r;const w=cleanupOnExit(l);const j=v(w);let d=true;try{r=s.openSync(l,"w",n.mode);if(n.tmpfileCreated){n.tmpfileCreated(l)}if(b(e)){e=g(e)}if(Buffer.isBuffer(e)){s.writeSync(r,e,0,e.length,0)}else if(e!=null){s.writeSync(r,String(e),0,String(n.encoding||"utf8"))}if(n.fsync!==false){s.fsyncSync(r)}s.closeSync(r);r=null;if(n.chown)s.chownSync(l,n.chown.uid,n.chown.gid);if(n.mode)s.chmodSync(l,n.mode);s.renameSync(l,f);d=false}finally{if(r){try{s.closeSync(r)}catch(f){}}j();if(d){w()}}}},7727:(f,e,n)=>{"use strict";const s=n(5622);const l=n(2087);const v=l.homedir();const r=l.tmpdir();const{env:b}=process;const g=f=>{const e=s.join(v,"Library");return{data:s.join(e,"Application Support",f),config:s.join(e,"Preferences",f),cache:s.join(e,"Caches",f),log:s.join(e,"Logs",f),temp:s.join(r,f)}};const w=f=>{const e=b.APPDATA||s.join(v,"AppData","Roaming");const n=b.LOCALAPPDATA||s.join(v,"AppData","Local");return{data:s.join(n,f,"Data"),config:s.join(e,f,"Config"),cache:s.join(n,f,"Cache"),log:s.join(n,f,"Log"),temp:s.join(r,f)}};const j=f=>{const e=s.basename(v);return{data:s.join(b.XDG_DATA_HOME||s.join(v,".local","share"),f),config:s.join(b.XDG_CONFIG_HOME||s.join(v,".config"),f),cache:s.join(b.XDG_CACHE_HOME||s.join(v,".cache"),f),log:s.join(b.XDG_STATE_HOME||s.join(v,".local","state"),f),temp:s.join(r,e,f)}};const d=(f,e)=>{if(typeof f!=="string"){throw new TypeError(`Expected string, got ${typeof f}`)}e=Object.assign({suffix:"nodejs"},e);if(e.suffix){f+=`-${e.suffix}`}if(process.platform==="darwin"){return g(f)}if(process.platform==="win32"){return w(f)}return j(f)};f.exports=d;f.exports.default=d},3933:f=>{"use strict";f.exports=function equal(f,e){if(f===e)return true;if(f&&e&&typeof f=="object"&&typeof e=="object"){if(f.constructor!==e.constructor)return false;var n,s,l;if(Array.isArray(f)){n=f.length;if(n!=e.length)return false;for(s=n;s--!==0;)if(!equal(f[s],e[s]))return false;return true}if(f.constructor===RegExp)return f.source===e.source&&f.flags===e.flags;if(f.valueOf!==Object.prototype.valueOf)return f.valueOf()===e.valueOf();if(f.toString!==Object.prototype.toString)return f.toString()===e.toString();l=Object.keys(f);n=l.length;if(n!==Object.keys(e).length)return false;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,l[s]))return false;for(s=n;s--!==0;){var v=l[s];if(!equal(f[v],e[v]))return false}return true}return f!==f&&e!==e}},3600:f=>{"use strict";f.exports=function(f,e){if(!e)e={};if(typeof e==="function")e={cmp:e};var n=typeof e.cycles==="boolean"?e.cycles:false;var s=e.cmp&&function(f){return function(e){return function(n,s){var l={key:n,value:e[n]};var v={key:s,value:e[s]};return f(l,v)}}}(e.cmp);var l=[];return function stringify(f){if(f&&f.toJSON&&typeof f.toJSON==="function"){f=f.toJSON()}if(f===undefined)return;if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!=="object")return JSON.stringify(f);var e,v;if(Array.isArray(f)){v="[";for(e=0;e{(function(){var e;function MurmurHash3(f,n){var s=this instanceof MurmurHash3?this:e;s.reset(n);if(typeof f==="string"&&f.length>0){s.hash(f)}if(s!==this){return s}}MurmurHash3.prototype.hash=function(f){var e,n,s,l,v;v=f.length;this.len+=v;n=this.k1;s=0;switch(this.rem){case 0:n^=v>s?f.charCodeAt(s++)&65535:0;case 1:n^=v>s?(f.charCodeAt(s++)&65535)<<8:0;case 2:n^=v>s?(f.charCodeAt(s++)&65535)<<16:0;case 3:n^=v>s?(f.charCodeAt(s)&255)<<24:0;n^=v>s?(f.charCodeAt(s++)&65280)>>8:0}this.rem=v+this.rem&3;v-=this.rem;if(v>0){e=this.h1;while(1){n=n*11601+(n&65535)*3432906752&4294967295;n=n<<15|n>>>17;n=n*13715+(n&65535)*461832192&4294967295;e^=n;e=e<<13|e>>>19;e=e*5+3864292196&4294967295;if(s>=v){break}n=f.charCodeAt(s++)&65535^(f.charCodeAt(s++)&65535)<<8^(f.charCodeAt(s++)&65535)<<16;l=f.charCodeAt(s++);n^=(l&255)<<24^(l&65280)>>8}n=0;switch(this.rem){case 3:n^=(f.charCodeAt(s+2)&65535)<<16;case 2:n^=(f.charCodeAt(s+1)&65535)<<8;case 1:n^=f.charCodeAt(s)&65535}this.h1=e}this.k1=n;return this};MurmurHash3.prototype.result=function(){var f,e;f=this.k1;e=this.h1;if(f>0){f=f*11601+(f&65535)*3432906752&4294967295;f=f<<15|f>>>17;f=f*13715+(f&65535)*461832192&4294967295;e^=f}e^=this.len;e^=e>>>16;e=e*51819+(e&65535)*2246770688&4294967295;e^=e>>>13;e=e*44597+(e&65535)*3266445312&4294967295;e^=e>>>16;return e>>>0};MurmurHash3.prototype.reset=function(f){this.h1=typeof f==="number"?f:0;this.rem=this.k1=this.len=0;return this};e=new MurmurHash3;if(true){f.exports=MurmurHash3}else{}})()},3010:f=>{f.exports=isTypedArray;isTypedArray.strict=isStrictTypedArray;isTypedArray.loose=isLooseTypedArray;var e=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function isTypedArray(f){return isStrictTypedArray(f)||isLooseTypedArray(f)}function isStrictTypedArray(f){return f instanceof Int8Array||f instanceof Int16Array||f instanceof Int32Array||f instanceof Uint8Array||f instanceof Uint8ClampedArray||f instanceof Uint16Array||f instanceof Uint32Array||f instanceof Float32Array||f instanceof Float64Array}function isLooseTypedArray(f){return n[e.call(f)]}},2437:f=>{"use strict";var e=f.exports=function(f,e,n){if(typeof e=="function"){n=e;e={}}n=e.cb||n;var s=typeof n=="function"?n:n.pre||function(){};var l=n.post||function(){};_traverse(e,s,l,f,"",f)};e.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true};e.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};e.propsKeywords={definitions:true,properties:true,patternProperties:true,dependencies:true};e.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function _traverse(f,n,s,l,v,r,b,g,w,j){if(l&&typeof l=="object"&&!Array.isArray(l)){n(l,v,r,b,g,w,j);for(var d in l){var E=l[d];if(Array.isArray(E)){if(d in e.arrayKeywords){for(var R=0;R{"use strict";const s=n(4442);f.exports=(async({cwd:f}={})=>s("package.json",{cwd:f}));f.exports.sync=(({cwd:f}={})=>s.sync("package.json",{cwd:f}))},2317:(f,e,n)=>{var s=n(2357);var l=n(2935);var v=n(8614);if(typeof v!=="function"){v=v.EventEmitter}var r;if(process.__signal_exit_emitter__){r=process.__signal_exit_emitter__}else{r=process.__signal_exit_emitter__=new v;r.count=0;r.emitted={}}if(!r.infinite){r.setMaxListeners(Infinity);r.infinite=true}f.exports=function(f,e){s.equal(typeof f,"function","a callback must be provided for exit handler");if(g===false){load()}var n="exit";if(e&&e.alwaysLast){n="afterexit"}var l=function(){r.removeListener(n,f);if(r.listeners("exit").length===0&&r.listeners("afterexit").length===0){unload()}};r.on(n,f);return l};f.exports.unload=unload;function unload(){if(!g){return}g=false;l.forEach(function(f){try{process.removeListener(f,b[f])}catch(f){}});process.emit=j;process.reallyExit=w;r.count-=1}function emit(f,e,n){if(r.emitted[f]){return}r.emitted[f]=true;r.emit(f,e,n)}var b={};l.forEach(function(f){b[f]=function listener(){var e=process.listeners(f);if(e.length===r.count){unload();emit("exit",null,f);emit("afterexit",null,f);process.kill(process.pid,f)}}});f.exports.signals=function(){return l};f.exports.load=load;var g=false;function load(){if(g){return}g=true;r.count+=1;l=l.filter(function(f){try{process.on(f,b[f]);return true}catch(f){return false}});process.emit=processEmit;process.reallyExit=processReallyExit}var w=process.reallyExit;function processReallyExit(f){process.exitCode=f||0;emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);w.call(process,process.exitCode)}var j=process.emit;function processEmit(f,e){if(f==="exit"){if(e!==undefined){process.exitCode=e}var n=j.apply(this,arguments);emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);return n}else{return j.apply(this,arguments)}}},2935:f=>{f.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){f.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){f.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},4005:(f,e,n)=>{var s=n(3010).strict;f.exports=function typedarrayToBuffer(f){if(s(f)){var e=Buffer.from(f.buffer);if(f.byteLength!==f.buffer.byteLength){e=e.slice(f.byteOffset,f.byteOffset+f.byteLength)}return e}else{return Buffer.from(f)}}},4007:function(f,e){(function(f,n){true?n(e):0})(this,function(f){"use strict";function merge(){for(var f=arguments.length,e=Array(f),n=0;n1){e[0]=e[0].slice(0,-1);var s=e.length-1;for(var l=1;l= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var x=r-b;var z=Math.floor;var U=String.fromCharCode;function error$1(f){throw new RangeError(I[f])}function map(f,e){var n=[];var s=f.length;while(s--){n[s]=e(f[s])}return n}function mapDomain(f,e){var n=f.split("@");var s="";if(n.length>1){s=n[0]+"@";f=n[1]}f=f.replace(p,".");var l=f.split(".");var v=map(l,e).join(".");return s+v}function ucs2decode(f){var e=[];var n=0;var s=f.length;while(n=55296&&l<=56319&&n>1;f+=z(f/e);for(;f>x*g>>1;s+=r){f=z(f/x)}return z(s+(x+1)*f/(f+w))};var C=function decode(f){var e=[];var n=f.length;var s=0;var l=E;var w=d;var j=f.lastIndexOf(R);if(j<0){j=0}for(var A=0;A=128){error$1("not-basic")}e.push(f.charCodeAt(A))}for(var F=j>0?j+1:0;F=n){error$1("invalid-input")}var U=Q(f.charCodeAt(F++));if(U>=r||U>z((v-s)/I)){error$1("overflow")}s+=U*I;var N=x<=w?b:x>=w+g?g:x-w;if(Uz(v/q)){error$1("overflow")}I*=q}var C=e.length+1;w=O(s-p,C,p==0);if(z(s/C)>v-l){error$1("overflow")}l+=z(s/C);s%=C;e.splice(s++,0,l)}return String.fromCodePoint.apply(String,e)};var L=function encode(f){var e=[];f=ucs2decode(f);var n=f.length;var s=E;var l=0;var w=d;var j=true;var A=false;var F=undefined;try{for(var p=f[Symbol.iterator](),I;!(j=(I=p.next()).done);j=true){var x=I.value;if(x<128){e.push(U(x))}}}catch(f){A=true;F=f}finally{try{if(!j&&p.return){p.return()}}finally{if(A){throw F}}}var N=e.length;var Q=N;if(N){e.push(R)}while(Q=s&&Xz((v-l)/M)){error$1("overflow")}l+=(C-s)*M;s=C;var Y=true;var W=false;var B=undefined;try{for(var c=f[Symbol.iterator](),Z;!(Y=(Z=c.next()).done);Y=true){var D=Z.value;if(Dv){error$1("overflow")}if(D==s){var K=l;for(var V=r;;V+=r){var y=V<=w?b:V>=w+g?g:V-w;if(K>6|192).toString(16).toUpperCase()+"%"+(e&63|128).toString(16).toUpperCase();else n="%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(e&63|128).toString(16).toUpperCase();return n}function pctDecChars(f){var e="";var n=0;var s=f.length;while(n=194&&l<224){if(s-n>=6){var v=parseInt(f.substr(n+4,2),16);e+=String.fromCharCode((l&31)<<6|v&63)}else{e+=f.substr(n,6)}n+=6}else if(l>=224){if(s-n>=9){var r=parseInt(f.substr(n+4,2),16);var b=parseInt(f.substr(n+7,2),16);e+=String.fromCharCode((l&15)<<12|(r&63)<<6|b&63)}else{e+=f.substr(n,9)}n+=9}else{e+=f.substr(n,3);n+=3}}return e}function _normalizeComponentEncoding(f,e){function decodeUnreserved(f){var n=pctDecChars(f);return!n.match(e.UNRESERVED)?f:n}if(f.scheme)f.scheme=String(f.scheme).replace(e.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(e.NOT_SCHEME,"");if(f.userinfo!==undefined)f.userinfo=String(f.userinfo).replace(e.PCT_ENCODED,decodeUnreserved).replace(e.NOT_USERINFO,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);if(f.host!==undefined)f.host=String(f.host).replace(e.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(e.NOT_HOST,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);if(f.path!==undefined)f.path=String(f.path).replace(e.PCT_ENCODED,decodeUnreserved).replace(f.scheme?e.NOT_PATH:e.NOT_PATH_NOSCHEME,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);if(f.query!==undefined)f.query=String(f.query).replace(e.PCT_ENCODED,decodeUnreserved).replace(e.NOT_QUERY,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);if(f.fragment!==undefined)f.fragment=String(f.fragment).replace(e.PCT_ENCODED,decodeUnreserved).replace(e.NOT_FRAGMENT,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);return f}function _stripLeadingZeros(f){return f.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(f,e){var n=f.match(e.IPV4ADDRESS)||[];var l=s(n,2),v=l[1];if(v){return v.split(".").map(_stripLeadingZeros).join(".")}else{return f}}function _normalizeIPv6(f,e){var n=f.match(e.IPV6ADDRESS)||[];var l=s(n,3),v=l[1],r=l[2];if(v){var b=v.toLowerCase().split("::").reverse(),g=s(b,2),w=g[0],j=g[1];var d=j?j.split(":").map(_stripLeadingZeros):[];var E=w.split(":").map(_stripLeadingZeros);var R=e.IPV4ADDRESS.test(E[E.length-1]);var A=R?7:8;var F=E.length-A;var p=Array(A);for(var I=0;I1){var N=p.slice(0,z.index);var Q=p.slice(z.index+z.length);U=N.join(":")+"::"+Q.join(":")}else{U=p.join(":")}if(r){U+="%"+r}return U}else{return f}}var X=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var M="".match(/(){0}/)[1]===undefined;function parse(f){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var l={};var v=s.iri!==false?n:e;if(s.reference==="suffix")f=(s.scheme?s.scheme+":":"")+"//"+f;var r=f.match(X);if(r){if(M){l.scheme=r[1];l.userinfo=r[3];l.host=r[4];l.port=parseInt(r[5],10);l.path=r[6]||"";l.query=r[7];l.fragment=r[8];if(isNaN(l.port)){l.port=r[5]}}else{l.scheme=r[1]||undefined;l.userinfo=f.indexOf("@")!==-1?r[3]:undefined;l.host=f.indexOf("//")!==-1?r[4]:undefined;l.port=parseInt(r[5],10);l.path=r[6]||"";l.query=f.indexOf("?")!==-1?r[7]:undefined;l.fragment=f.indexOf("#")!==-1?r[8]:undefined;if(isNaN(l.port)){l.port=f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?r[4]:undefined}}if(l.host){l.host=_normalizeIPv6(_normalizeIPv4(l.host,v),v)}if(l.scheme===undefined&&l.userinfo===undefined&&l.host===undefined&&l.port===undefined&&!l.path&&l.query===undefined){l.reference="same-document"}else if(l.scheme===undefined){l.reference="relative"}else if(l.fragment===undefined){l.reference="absolute"}else{l.reference="uri"}if(s.reference&&s.reference!=="suffix"&&s.reference!==l.reference){l.error=l.error||"URI is not a "+s.reference+" reference."}var b=H[(s.scheme||l.scheme||"").toLowerCase()];if(!s.unicodeSupport&&(!b||!b.unicodeSupport)){if(l.host&&(s.domainHost||b&&b.domainHost)){try{l.host=G.toASCII(l.host.replace(v.PCT_ENCODED,pctDecChars).toLowerCase())}catch(f){l.error=l.error||"Host's domain name can not be converted to ASCII via punycode: "+f}}_normalizeComponentEncoding(l,e)}else{_normalizeComponentEncoding(l,v)}if(b&&b.parse){b.parse(l,s)}}else{l.error=l.error||"URI can not be parsed."}return l}function _recomposeAuthority(f,s){var l=s.iri!==false?n:e;var v=[];if(f.userinfo!==undefined){v.push(f.userinfo);v.push("@")}if(f.host!==undefined){v.push(_normalizeIPv6(_normalizeIPv4(String(f.host),l),l).replace(l.IPV6ADDRESS,function(f,e,n){return"["+e+(n?"%25"+n:"")+"]"}))}if(typeof f.port==="number"){v.push(":");v.push(f.port.toString(10))}return v.length?v.join(""):undefined}var Y=/^\.\.?\//;var W=/^\/\.(\/|$)/;var B=/^\/\.\.(\/|$)/;var c=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(f){var e=[];while(f.length){if(f.match(Y)){f=f.replace(Y,"")}else if(f.match(W)){f=f.replace(W,"/")}else if(f.match(B)){f=f.replace(B,"/");e.pop()}else if(f==="."||f===".."){f=""}else{var n=f.match(c);if(n){var s=n[0];f=f.slice(s.length);e.push(s)}else{throw new Error("Unexpected dot segment condition")}}}return e.join("")}function serialize(f){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var l=s.iri?n:e;var v=[];var r=H[(s.scheme||f.scheme||"").toLowerCase()];if(r&&r.serialize)r.serialize(f,s);if(f.host){if(l.IPV6ADDRESS.test(f.host)){}else if(s.domainHost||r&&r.domainHost){try{f.host=!s.iri?G.toASCII(f.host.replace(l.PCT_ENCODED,pctDecChars).toLowerCase()):G.toUnicode(f.host)}catch(e){f.error=f.error||"Host's domain name can not be converted to "+(!s.iri?"ASCII":"Unicode")+" via punycode: "+e}}}_normalizeComponentEncoding(f,l);if(s.reference!=="suffix"&&f.scheme){v.push(f.scheme);v.push(":")}var b=_recomposeAuthority(f,s);if(b!==undefined){if(s.reference!=="suffix"){v.push("//")}v.push(b);if(f.path&&f.path.charAt(0)!=="/"){v.push("/")}}if(f.path!==undefined){var g=f.path;if(!s.absolutePath&&(!r||!r.absolutePath)){g=removeDotSegments(g)}if(b===undefined){g=g.replace(/^\/\//,"/%2F")}v.push(g)}if(f.query!==undefined){v.push("?");v.push(f.query)}if(f.fragment!==undefined){v.push("#");v.push(f.fragment)}return v.join("")}function resolveComponents(f,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var s=arguments[3];var l={};if(!s){f=parse(serialize(f,n),n);e=parse(serialize(e,n),n)}n=n||{};if(!n.tolerant&&e.scheme){l.scheme=e.scheme;l.userinfo=e.userinfo;l.host=e.host;l.port=e.port;l.path=removeDotSegments(e.path||"");l.query=e.query}else{if(e.userinfo!==undefined||e.host!==undefined||e.port!==undefined){l.userinfo=e.userinfo;l.host=e.host;l.port=e.port;l.path=removeDotSegments(e.path||"");l.query=e.query}else{if(!e.path){l.path=f.path;if(e.query!==undefined){l.query=e.query}else{l.query=f.query}}else{if(e.path.charAt(0)==="/"){l.path=removeDotSegments(e.path)}else{if((f.userinfo!==undefined||f.host!==undefined||f.port!==undefined)&&!f.path){l.path="/"+e.path}else if(!f.path){l.path=e.path}else{l.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+e.path}l.path=removeDotSegments(l.path)}l.query=e.query}l.userinfo=f.userinfo;l.host=f.host;l.port=f.port}l.scheme=f.scheme}l.fragment=e.fragment;return l}function resolve(f,e,n){var s=assign({scheme:"null"},n);return serialize(resolveComponents(parse(f,s),parse(e,s),s,true),s)}function normalize(f,e){if(typeof f==="string"){f=serialize(parse(f,e),e)}else if(typeOf(f)==="object"){f=parse(serialize(f,e),e)}return f}function equal(f,e,n){if(typeof f==="string"){f=serialize(parse(f,n),n)}else if(typeOf(f)==="object"){f=serialize(f,n)}if(typeof e==="string"){e=serialize(parse(e,n),n)}else if(typeOf(e)==="object"){e=serialize(e,n)}return f===e}function escapeComponent(f,s){return f&&f.toString().replace(!s||!s.iri?e.ESCAPE:n.ESCAPE,pctEncChar)}function unescapeComponent(f,s){return f&&f.toString().replace(!s||!s.iri?e.PCT_ENCODED:n.PCT_ENCODED,pctDecChars)}var Z={scheme:"http",domainHost:true,parse:function parse(f,e){if(!f.host){f.error=f.error||"HTTP URIs must have a host."}return f},serialize:function serialize(f,e){if(f.port===(String(f.scheme).toLowerCase()!=="https"?80:443)||f.port===""){f.port=undefined}if(!f.path){f.path="/"}return f}};var D={scheme:"https",domainHost:Z.domainHost,parse:Z.parse,serialize:Z.serialize};var K={};var V=true;var y="[A-Za-z0-9\\-\\.\\_\\~"+(V?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var k="[0-9A-Fa-f]";var h=subexp(subexp("%[EFef]"+k+"%"+k+k+"%"+k+k)+"|"+subexp("%[89A-Fa-f]"+k+"%"+k+k)+"|"+subexp("%"+k+k));var a="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var S="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var m=merge(S,'[\\"\\\\]');var P="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var i=new RegExp(y,"g");var _=new RegExp(h,"g");var u=new RegExp(merge("[^]",a,"[\\.]",'[\\"]',m),"g");var o=new RegExp(merge("[^]",y,P),"g");var $=o;function decodeUnreserved(f){var e=pctDecChars(f);return!e.match(i)?f:e}var t={scheme:"mailto",parse:function parse$$1(f,e){var n=f;var s=n.to=n.path?n.path.split(","):[];n.path=undefined;if(n.query){var l=false;var v={};var r=n.query.split("&");for(var b=0,g=r.length;b{"use strict";f.exports=require("assert")},6417:f=>{"use strict";f.exports=require("crypto")},8614:f=>{"use strict";f.exports=require("events")},5747:f=>{"use strict";f.exports=require("fs")},4442:f=>{"use strict";f.exports=require("next/dist/compiled/find-up")},2519:f=>{"use strict";f.exports=require("next/dist/compiled/semver")},2087:f=>{"use strict";f.exports=require("os")},5622:f=>{"use strict";f.exports=require("path")},1669:f=>{"use strict";f.exports=require("util")},5013:f=>{"use strict";f.exports=require("worker_threads")}};var e={};function __nccwpck_require__(n){if(e[n]){return e[n].exports}var s=e[n]={id:n,loaded:false,exports:{}};var l=true;try{f[n].call(s.exports,s,s.exports,__nccwpck_require__);l=false}finally{if(l)delete e[n]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.nmd=(f=>{f.paths=[];if(!f.children)f.children=[];return f})})();__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(3331)})(); \ No newline at end of file +module.exports=(()=>{var f={601:f=>{"use strict";f.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},8938:f=>{"use strict";f.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},1414:(f,e,n)=>{"use strict";var s=n(1645),l=n(2630),v=n(7246),r=n(7837),b=n(3600),g=n(9290),w=n(1665),j=n(6989),d=n(6057);f.exports=Ajv;Ajv.prototype.validate=validate;Ajv.prototype.compile=compile;Ajv.prototype.addSchema=addSchema;Ajv.prototype.addMetaSchema=addMetaSchema;Ajv.prototype.validateSchema=validateSchema;Ajv.prototype.getSchema=getSchema;Ajv.prototype.removeSchema=removeSchema;Ajv.prototype.addFormat=addFormat;Ajv.prototype.errorsText=errorsText;Ajv.prototype._addSchema=_addSchema;Ajv.prototype._compile=_compile;Ajv.prototype.compileAsync=n(75);var E=n(8093);Ajv.prototype.addKeyword=E.add;Ajv.prototype.getKeyword=E.get;Ajv.prototype.removeKeyword=E.remove;Ajv.prototype.validateKeyword=E.validate;var R=n(2718);Ajv.ValidationError=R.Validation;Ajv.MissingRefError=R.MissingRef;Ajv.$dataMetaSchema=j;var A="http://json-schema.org/draft-07/schema";var F=["removeAdditional","useDefaults","coerceTypes","strictDefaults"];var p=["/properties"];function Ajv(f){if(!(this instanceof Ajv))return new Ajv(f);f=this._opts=d.copy(f)||{};setLogger(this);this._schemas={};this._refs={};this._fragments={};this._formats=g(f.format);this._cache=f.cache||new v;this._loadingSchemas={};this._compilations=[];this.RULES=w();this._getId=chooseGetId(f);f.loopRequired=f.loopRequired||Infinity;if(f.errorDataPath=="property")f._errorDataPathProperty=true;if(f.serialize===undefined)f.serialize=b;this._metaOpts=getMetaSchemaOptions(this);if(f.formats)addInitialFormats(this);if(f.keywords)addInitialKeywords(this);addDefaultMetaSchema(this);if(typeof f.meta=="object")this.addMetaSchema(f.meta);if(f.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});addInitialSchemas(this)}function validate(f,e){var n;if(typeof f=="string"){n=this.getSchema(f);if(!n)throw new Error('no schema with key or ref "'+f+'"')}else{var s=this._addSchema(f);n=s.validate||this._compile(s)}var l=n(e);if(n.$async!==true)this.errors=n.errors;return l}function compile(f,e){var n=this._addSchema(f,undefined,e);return n.validate||this._compile(n)}function addSchema(f,e,n,s){if(Array.isArray(f)){for(var v=0;v{"use strict";var e=f.exports=function Cache(){this._cache={}};e.prototype.put=function Cache_put(f,e){this._cache[f]=e};e.prototype.get=function Cache_get(f){return this._cache[f]};e.prototype.del=function Cache_del(f){delete this._cache[f]};e.prototype.clear=function Cache_clear(){this._cache={}}},75:(f,e,n)=>{"use strict";var s=n(2718).MissingRef;f.exports=compileAsync;function compileAsync(f,e,n){var l=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof e=="function"){n=e;e=undefined}var v=loadMetaSchemaOf(f).then(function(){var n=l._addSchema(f,undefined,e);return n.validate||_compileAsync(n)});if(n){v.then(function(f){n(null,f)},n)}return v;function loadMetaSchemaOf(f){var e=f.$schema;return e&&!l.getSchema(e)?compileAsync.call(l,{$ref:e},true):Promise.resolve()}function _compileAsync(f){try{return l._compile(f)}catch(f){if(f instanceof s)return loadMissingSchema(f);throw f}function loadMissingSchema(n){var s=n.missingSchema;if(added(s))throw new Error("Schema "+s+" is loaded but "+n.missingRef+" cannot be resolved");var v=l._loadingSchemas[s];if(!v){v=l._loadingSchemas[s]=l._opts.loadSchema(s);v.then(removePromise,removePromise)}return v.then(function(f){if(!added(s)){return loadMetaSchemaOf(f).then(function(){if(!added(s))l.addSchema(f,s,undefined,e)})}}).then(function(){return _compileAsync(f)});function removePromise(){delete l._loadingSchemas[s]}function added(f){return l._refs[f]||l._schemas[f]}}}}},2718:(f,e,n)=>{"use strict";var s=n(2630);f.exports={Validation:errorSubclass(ValidationError),MissingRef:errorSubclass(MissingRefError)};function ValidationError(f){this.message="validation failed";this.errors=f;this.ajv=this.validation=true}MissingRefError.message=function(f,e){return"can't resolve reference "+e+" from id "+f};function MissingRefError(f,e,n){this.message=n||MissingRefError.message(f,e);this.missingRef=s.url(f,e);this.missingSchema=s.normalizeId(s.fullPath(this.missingRef))}function errorSubclass(f){f.prototype=Object.create(Error.prototype);f.prototype.constructor=f;return f}},9290:(f,e,n)=>{"use strict";var s=n(6057);var l=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;var v=[0,31,28,31,30,31,30,31,31,30,31,30,31];var r=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;var b=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;var g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var w=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var j=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;var d=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;var E=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;var R=/^(?:\/(?:[^~/]|~0|~1)*)*$/;var A=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;var F=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;f.exports=formats;function formats(f){f=f=="full"?"full":"fast";return s.copy(formats[f])}formats.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":j,url:d,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:b,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:E,"json-pointer":R,"json-pointer-uri-fragment":A,"relative-json-pointer":F};formats.full={date:date,time:time,"date-time":date_time,uri:uri,"uri-reference":w,"uri-template":j,url:d,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:b,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:E,"json-pointer":R,"json-pointer-uri-fragment":A,"relative-json-pointer":F};function isLeapYear(f){return f%4===0&&(f%100!==0||f%400===0)}function date(f){var e=f.match(l);if(!e)return false;var n=+e[1];var s=+e[2];var r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(s==2&&isLeapYear(n)?29:v[s])}function time(f,e){var n=f.match(r);if(!n)return false;var s=n[1];var l=n[2];var v=n[3];var b=n[5];return(s<=23&&l<=59&&v<=59||s==23&&l==59&&v==60)&&(!e||b)}var p=/t|\s/i;function date_time(f){var e=f.split(p);return e.length==2&&date(e[0])&&time(e[1],true)}var I=/\/|:/;function uri(f){return I.test(f)&&g.test(f)}var x=/[^\\]\\Z/;function regex(f){if(x.test(f))return false;try{new RegExp(f);return true}catch(f){return false}}},1645:(f,e,n)=>{"use strict";var s=n(2630),l=n(6057),v=n(2718),r=n(3600);var b=n(6131);var g=l.ucs2length;var w=n(3933);var j=v.Validation;f.exports=compile;function compile(f,e,n,d){var E=this,R=this._opts,A=[undefined],F={},p=[],I={},x=[],z={},U=[];e=e||{schema:f,refVal:A,refs:F};var N=checkCompiling.call(this,f,e,d);var Q=this._compilations[N.index];if(N.compiling)return Q.callValidate=callValidate;var q=this._formats;var O=this.RULES;try{var C=localCompile(f,e,n,d);Q.validate=C;var L=Q.callValidate;if(L){L.schema=C.schema;L.errors=null;L.refs=C.refs;L.refVal=C.refVal;L.root=C.root;L.$async=C.$async;if(R.sourceCode)L.source=C.source}return C}finally{endCompiling.call(this,f,e,d)}function callValidate(){var f=Q.validate;var e=f.apply(this,arguments);callValidate.errors=f.errors;return e}function localCompile(f,n,r,d){var I=!n||n&&n.schema==f;if(n.schema!=e.schema)return compile.call(E,f,n,r,d);var z=f.$async===true;var N=b({isTop:true,schema:f,isRoot:I,baseId:d,root:n,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:v.MissingRef,RULES:O,validate:b,util:l,resolve:s,resolveRef:resolveRef,usePattern:usePattern,useDefault:useDefault,useCustomRule:useCustomRule,opts:R,formats:q,logger:E.logger,self:E});N=vars(A,refValCode)+vars(p,patternCode)+vars(x,defaultCode)+vars(U,customRuleCode)+N;if(R.processCode)N=R.processCode(N,f);var Q;try{var C=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",N);Q=C(E,O,q,e,A,x,U,w,g,j);A[0]=Q}catch(f){E.logger.error("Error compiling schema, function code:",N);throw f}Q.schema=f;Q.errors=null;Q.refs=F;Q.refVal=A;Q.root=I?Q:n;if(z)Q.$async=true;if(R.sourceCode===true){Q.source={code:N,patterns:p,defaults:x}}return Q}function resolveRef(f,l,v){l=s.url(f,l);var r=F[l];var b,g;if(r!==undefined){b=A[r];g="refVal["+r+"]";return resolvedRef(b,g)}if(!v&&e.refs){var w=e.refs[l];if(w!==undefined){b=e.refVal[w];g=addLocalRef(l,b);return resolvedRef(b,g)}}g=addLocalRef(l);var j=s.call(E,localCompile,e,l);if(j===undefined){var d=n&&n[l];if(d){j=s.inlineRef(d,R.inlineRefs)?d:compile.call(E,d,e,n,f)}}if(j===undefined){removeLocalRef(l)}else{replaceLocalRef(l,j);return resolvedRef(j,g)}}function addLocalRef(f,e){var n=A.length;A[n]=e;F[f]=n;return"refVal"+n}function removeLocalRef(f){delete F[f]}function replaceLocalRef(f,e){var n=F[f];A[n]=e}function resolvedRef(f,e){return typeof f=="object"||typeof f=="boolean"?{code:e,schema:f,inline:true}:{code:e,$async:f&&!!f.$async}}function usePattern(f){var e=I[f];if(e===undefined){e=I[f]=p.length;p[e]=f}return"pattern"+e}function useDefault(f){switch(typeof f){case"boolean":case"number":return""+f;case"string":return l.toQuotedString(f);case"object":if(f===null)return"null";var e=r(f);var n=z[e];if(n===undefined){n=z[e]=x.length;x[n]=f}return"default"+n}}function useCustomRule(f,e,n,s){if(E._opts.validateSchema!==false){var l=f.definition.dependencies;if(l&&!l.every(function(f){return Object.prototype.hasOwnProperty.call(n,f)}))throw new Error("parent schema must have all required keywords: "+l.join(","));var v=f.definition.validateSchema;if(v){var r=v(e);if(!r){var b="keyword schema is invalid: "+E.errorsText(v.errors);if(E._opts.validateSchema=="log")E.logger.error(b);else throw new Error(b)}}}var g=f.definition.compile,w=f.definition.inline,j=f.definition.macro;var d;if(g){d=g.call(E,e,n,s)}else if(j){d=j.call(E,e,n,s);if(R.validateSchema!==false)E.validateSchema(d,true)}else if(w){d=w.call(E,s,f.keyword,e,n)}else{d=f.definition.validate;if(!d)return}if(d===undefined)throw new Error('custom keyword "'+f.keyword+'"failed to compile');var A=U.length;U[A]=d;return{code:"customRule"+A,validate:d}}}function checkCompiling(f,e,n){var s=compIndex.call(this,f,e,n);if(s>=0)return{index:s,compiling:true};s=this._compilations.length;this._compilations[s]={schema:f,root:e,baseId:n};return{index:s,compiling:false}}function endCompiling(f,e,n){var s=compIndex.call(this,f,e,n);if(s>=0)this._compilations.splice(s,1)}function compIndex(f,e,n){for(var s=0;s{"use strict";var s=n(4007),l=n(3933),v=n(6057),r=n(7837),b=n(2437);f.exports=resolve;resolve.normalizeId=normalizeId;resolve.fullPath=getFullPath;resolve.url=resolveUrl;resolve.ids=resolveIds;resolve.inlineRef=inlineRef;resolve.schema=resolveSchema;function resolve(f,e,n){var s=this._refs[n];if(typeof s=="string"){if(this._refs[s])s=this._refs[s];else return resolve.call(this,f,e,s)}s=s||this._schemas[n];if(s instanceof r){return inlineRef(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s)}var l=resolveSchema.call(this,e,n);var v,b,g;if(l){v=l.schema;e=l.root;g=l.baseId}if(v instanceof r){b=v.validate||f.call(this,v.schema,e,undefined,g)}else if(v!==undefined){b=inlineRef(v,this._opts.inlineRefs)?v:f.call(this,v,e,undefined,g)}return b}function resolveSchema(f,e){var n=s.parse(e),l=_getFullPath(n),v=getFullPath(this._getId(f.schema));if(Object.keys(f.schema).length===0||l!==v){var b=normalizeId(l);var g=this._refs[b];if(typeof g=="string"){return resolveRecursive.call(this,f,g,n)}else if(g instanceof r){if(!g.validate)this._compile(g);f=g}else{g=this._schemas[b];if(g instanceof r){if(!g.validate)this._compile(g);if(b==normalizeId(e))return{schema:g,root:f,baseId:v};f=g}else{return}}if(!f.schema)return;v=getFullPath(this._getId(f.schema))}return getJsonPointer.call(this,n,v,f.schema,f)}function resolveRecursive(f,e,n){var s=resolveSchema.call(this,f,e);if(s){var l=s.schema;var v=s.baseId;f=s.root;var r=this._getId(l);if(r)v=resolveUrl(v,r);return getJsonPointer.call(this,n,v,l,f)}}var g=v.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(f,e,n,s){f.fragment=f.fragment||"";if(f.fragment.slice(0,1)!="/")return;var l=f.fragment.split("/");for(var r=1;r{"use strict";var s=n(4124),l=n(6057).toHash;f.exports=function rules(){var f=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}];var e=["type","$comment"];var n=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"];var v=["number","integer","string","array","object","boolean","null"];f.all=l(e);f.types=l(v);f.forEach(function(n){n.rules=n.rules.map(function(n){var l;if(typeof n=="object"){var v=Object.keys(n)[0];l=n[v];n=v;l.forEach(function(n){e.push(n);f.all[n]=true})}e.push(n);var r=f.all[n]={keyword:n,code:s[n],implements:l};return r});f.all.$comment={keyword:"$comment",code:s.$comment};if(n.type)f.types[n.type]=n});f.keywords=l(e.concat(n));f.custom={};return f}},7837:(f,e,n)=>{"use strict";var s=n(6057);f.exports=SchemaObject;function SchemaObject(f){s.copy(f,this)}},9652:f=>{"use strict";f.exports=function ucs2length(f){var e=0,n=f.length,s=0,l;while(s=55296&&l<=56319&&s{"use strict";f.exports={copy:copy,checkDataType:checkDataType,checkDataTypes:checkDataTypes,coerceToTypes:coerceToTypes,toHash:toHash,getProperty:getProperty,escapeQuotes:escapeQuotes,equal:n(3933),ucs2length:n(9652),varOccurences:varOccurences,varReplace:varReplace,schemaHasRules:schemaHasRules,schemaHasRulesExcept:schemaHasRulesExcept,schemaUnknownRules:schemaUnknownRules,toQuotedString:toQuotedString,getPathExpr:getPathExpr,getPath:getPath,getData:getData,unescapeFragment:unescapeFragment,unescapeJsonPointer:unescapeJsonPointer,escapeFragment:escapeFragment,escapeJsonPointer:escapeJsonPointer};function copy(f,e){e=e||{};for(var n in f)e[n]=f[n];return e}function checkDataType(f,e,n,s){var l=s?" !== ":" === ",v=s?" || ":" && ",r=s?"!":"",b=s?"":"!";switch(f){case"null":return e+l+"null";case"array":return r+"Array.isArray("+e+")";case"object":return"("+r+e+v+"typeof "+e+l+'"object"'+v+b+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+l+'"number"'+v+b+"("+e+" % 1)"+v+e+l+e+(n?v+r+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+l+'"'+f+'"'+(n?v+r+"isFinite("+e+")":"")+")";default:return"typeof "+e+l+'"'+f+'"'}}function checkDataTypes(f,e,n){switch(f.length){case 1:return checkDataType(f[0],e,n,true);default:var s="";var l=toHash(f);if(l.array&&l.object){s=l.null?"(":"(!"+e+" || ";s+="typeof "+e+' !== "object")';delete l.null;delete l.array;delete l.object}if(l.number)delete l.integer;for(var v in l)s+=(s?" && ":"")+checkDataType(v,e,n,true);return s}}var s=toHash(["string","number","integer","boolean","null"]);function coerceToTypes(f,e){if(Array.isArray(e)){var n=[];for(var l=0;l=e)throw new Error("Cannot access property/index "+s+" levels up, current level is "+e);return n[e-s]}if(s>e)throw new Error("Cannot access data "+s+" levels up, current level is "+e);v="data"+(e-s||"");if(!l)return v}var w=v;var j=l.split("/");for(var d=0;d{"use strict";var e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];f.exports=function(f,n){for(var s=0;s{"use strict";var s=n(8938);f.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:s.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:s.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},3711:f=>{"use strict";f.exports=function generate__limit(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}var A=e=="maximum",F=A?"exclusiveMaximum":"exclusiveMinimum",p=f.schema[F],I=f.opts.$data&&p&&p.$data,x=A?"<":">",z=A?">":"<",j=undefined;if(!(E||typeof r=="number"||r===undefined)){throw new Error(e+" must be number")}if(!(I||p===undefined||typeof p=="number"||typeof p=="boolean")){throw new Error(F+" must be number or boolean")}if(I){var U=f.util.getData(p.$data,v,f.dataPathArr),N="exclusive"+l,Q="exclType"+l,q="exclIsNumber"+l,O="op"+l,C="' + "+O+" + '";s+=" var schemaExcl"+l+" = "+U+"; ";U="schemaExcl"+l;s+=" var "+N+"; var "+Q+" = typeof "+U+"; if ("+Q+" != 'boolean' && "+Q+" != 'undefined' && "+Q+" != 'number') { ";var j=F;var L=L||[];L.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: '"+F+" should be boolean' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var J=s;s=L.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+J+"]); "}else{s+=" validate.errors = ["+J+"]; return false; "}}else{s+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } else if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" "+Q+" == 'number' ? ( ("+N+" = "+R+" === undefined || "+U+" "+x+"= "+R+") ? "+d+" "+z+"= "+U+" : "+d+" "+z+" "+R+" ) : ( ("+N+" = "+U+" === true) ? "+d+" "+z+"= "+R+" : "+d+" "+z+" "+R+" ) || "+d+" !== "+d+") { var op"+l+" = "+N+" ? '"+x+"' : '"+x+"='; ";if(r===undefined){j=F;g=f.errSchemaPath+"/"+F;R=U;E=I}}else{var q=typeof p=="number",C=x;if(q&&E){var O="'"+C+"'";s+=" if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" ( "+R+" === undefined || "+p+" "+x+"= "+R+" ? "+d+" "+z+"= "+p+" : "+d+" "+z+" "+R+" ) || "+d+" !== "+d+") { "}else{if(q&&r===undefined){N=true;j=F;g=f.errSchemaPath+"/"+F;R=p;z+="="}else{if(q)R=Math[A?"min":"max"](p,r);if(p===(q?R:true)){N=true;j=F;g=f.errSchemaPath+"/"+F;z+="="}else{N=false;C+="="}}var O="'"+C+"'";s+=" if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" "+d+" "+z+" "+R+" || "+d+" !== "+d+") { "}}j=j||e;var L=L||[];L.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_limit")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { comparison: "+O+", limit: "+R+", exclusive: "+N+" } ";if(f.opts.messages!==false){s+=" , message: 'should be "+C+" ";if(E){s+="' + "+R}else{s+=""+R+"'"}}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var J=s;s=L.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+J+"]); "}else{s+=" validate.errors = ["+J+"]; return false; "}}else{s+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } ";if(w){s+=" else { "}return s}},5675:f=>{"use strict";f.exports=function generate__limitItems(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if(!(E||typeof r=="number")){throw new Error(e+" must be number")}var A=e=="maxItems"?">":"<";s+="if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" "+d+".length "+A+" "+R+") { ";var j=e;var F=F||[];F.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_limitItems")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { limit: "+R+" } ";if(f.opts.messages!==false){s+=" , message: 'should NOT have ";if(e=="maxItems"){s+="more"}else{s+="fewer"}s+=" than ";if(E){s+="' + "+R+" + '"}else{s+=""+r}s+=" items' "}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var p=s;s=F.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+p+"]); "}else{s+=" validate.errors = ["+p+"]; return false; "}}else{s+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},6051:f=>{"use strict";f.exports=function generate__limitLength(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if(!(E||typeof r=="number")){throw new Error(e+" must be number")}var A=e=="maxLength"?">":"<";s+="if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}if(f.opts.unicode===false){s+=" "+d+".length "}else{s+=" ucs2length("+d+") "}s+=" "+A+" "+R+") { ";var j=e;var F=F||[];F.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_limitLength")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { limit: "+R+" } ";if(f.opts.messages!==false){s+=" , message: 'should NOT be ";if(e=="maxLength"){s+="longer"}else{s+="shorter"}s+=" than ";if(E){s+="' + "+R+" + '"}else{s+=""+r}s+=" characters' "}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var p=s;s=F.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+p+"]); "}else{s+=" validate.errors = ["+p+"]; return false; "}}else{s+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},7043:f=>{"use strict";f.exports=function generate__limitProperties(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if(!(E||typeof r=="number")){throw new Error(e+" must be number")}var A=e=="maxProperties"?">":"<";s+="if ( ";if(E){s+=" ("+R+" !== undefined && typeof "+R+" != 'number') || "}s+=" Object.keys("+d+").length "+A+" "+R+") { ";var j=e;var F=F||[];F.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"_limitProperties")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { limit: "+R+" } ";if(f.opts.messages!==false){s+=" , message: 'should NOT have ";if(e=="maxProperties"){s+="more"}else{s+="fewer"}s+=" than ";if(E){s+="' + "+R+" + '"}else{s+=""+r}s+=" properties' "}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var p=s;s=F.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+p+"]); "}else{s+=" validate.errors = ["+p+"]; return false; "}}else{s+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},3639:f=>{"use strict";f.exports=function generate_allOf(f,e,n){var s=" ";var l=f.schema[e];var v=f.schemaPath+f.util.getProperty(e);var r=f.errSchemaPath+"/"+e;var b=!f.opts.allErrors;var g=f.util.copy(f);var w="";g.level++;var j="valid"+g.level;var d=g.baseId,E=true;var R=l;if(R){var A,F=-1,p=R.length-1;while(F0||A===false:f.util.schemaHasRules(A,f.RULES.all)){E=false;g.schema=A;g.schemaPath=v+"["+F+"]";g.errSchemaPath=r+"/"+F;s+=" "+f.validate(g)+" ";g.baseId=d;if(b){s+=" if ("+j+") { ";w+="}"}}}}if(b){if(E){s+=" if (true) { "}else{s+=" "+w.slice(0,-1)+" "}}return s}},1256:f=>{"use strict";f.exports=function generate_anyOf(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);var A="";R.level++;var F="valid"+R.level;var p=r.every(function(e){return f.opts.strictKeywords?typeof e=="object"&&Object.keys(e).length>0||e===false:f.util.schemaHasRules(e,f.RULES.all)});if(p){var I=R.baseId;s+=" var "+E+" = errors; var "+d+" = false; ";var x=f.compositeRule;f.compositeRule=R.compositeRule=true;var z=r;if(z){var U,N=-1,Q=z.length-1;while(N{"use strict";f.exports=function generate_comment(f,e,n){var s=" ";var l=f.schema[e];var v=f.errSchemaPath+"/"+e;var r=!f.opts.allErrors;var b=f.util.toQuotedString(l);if(f.opts.$comment===true){s+=" console.log("+b+");"}else if(typeof f.opts.$comment=="function"){s+=" self._opts.$comment("+b+", "+f.util.toQuotedString(v)+", validate.root.schema);"}return s}},184:f=>{"use strict";f.exports=function generate_const(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if(!E){s+=" var schema"+l+" = validate.schema"+b+";"}s+="var "+d+" = equal("+j+", schema"+l+"); if (!"+d+") { ";var A=A||[];A.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"const"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { allowedValue: schema"+l+" } ";if(f.opts.messages!==false){s+=" , message: 'should be equal to constant' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var F=s;s=A.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+F+"]); "}else{s+=" validate.errors = ["+F+"]; return false; "}}else{s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" }";if(w){s+=" else { "}return s}},7419:f=>{"use strict";f.exports=function generate_contains(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);var A="";R.level++;var F="valid"+R.level;var p="i"+l,I=R.dataLevel=f.dataLevel+1,x="data"+I,z=f.baseId,U=f.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:f.util.schemaHasRules(r,f.RULES.all);s+="var "+E+" = errors;var "+d+";";if(U){var N=f.compositeRule;f.compositeRule=R.compositeRule=true;R.schema=r;R.schemaPath=b;R.errSchemaPath=g;s+=" var "+F+" = false; for (var "+p+" = 0; "+p+" < "+j+".length; "+p+"++) { ";R.errorPath=f.util.getPathExpr(f.errorPath,p,f.opts.jsonPointers,true);var Q=j+"["+p+"]";R.dataPathArr[I]=p;var q=f.validate(R);R.baseId=z;if(f.util.varOccurences(q,x)<2){s+=" "+f.util.varReplace(q,x,Q)+" "}else{s+=" var "+x+" = "+Q+"; "+q+" "}s+=" if ("+F+") break; } ";f.compositeRule=R.compositeRule=N;s+=" "+A+" if (!"+F+") {"}else{s+=" if ("+j+".length == 0) {"}var O=O||[];O.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"contains"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: 'should contain a valid item' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var C=s;s=O.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+C+"]); "}else{s+=" validate.errors = ["+C+"]; return false; "}}else{s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } else { ";if(U){s+=" errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; } "}if(f.opts.allErrors){s+=" } "}return s}},7921:f=>{"use strict";f.exports=function generate_custom(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j;var d="data"+(v||"");var E="valid"+l;var R="errs__"+l;var A=f.opts.$data&&r&&r.$data,F;if(A){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";F="schema"+l}else{F=r}var p=this,I="definition"+l,x=p.definition,z="";var U,N,Q,q,O;if(A&&x.$data){O="keywordValidate"+l;var C=x.validateSchema;s+=" var "+I+" = RULES.custom['"+e+"'].definition; var "+O+" = "+I+".validate;"}else{q=f.useCustomRule(p,r,f.schema,f);if(!q)return;F="validate.schema"+b;O=q.code;U=x.compile;N=x.inline;Q=x.macro}var L=O+".errors",J="i"+l,T="ruleErr"+l,G=x.async;if(G&&!f.async)throw new Error("async keyword in sync schema");if(!(N||Q)){s+=""+L+" = null;"}s+="var "+R+" = errors;var "+E+";";if(A&&x.$data){z+="}";s+=" if ("+F+" === undefined) { "+E+" = true; } else { ";if(C){z+="}";s+=" "+E+" = "+I+".validateSchema("+F+"); if ("+E+") { "}}if(N){if(x.statements){s+=" "+q.validate+" "}else{s+=" "+E+" = "+q.validate+"; "}}else if(Q){var H=f.util.copy(f);var z="";H.level++;var X="valid"+H.level;H.schema=q.validate;H.schemaPath="";var M=f.compositeRule;f.compositeRule=H.compositeRule=true;var Y=f.validate(H).replace(/validate\.schema/g,O);f.compositeRule=H.compositeRule=M;s+=" "+Y}else{var W=W||[];W.push(s);s="";s+=" "+O+".call( ";if(f.opts.passContext){s+="this"}else{s+="self"}if(U||x.schema===false){s+=" , "+d+" "}else{s+=" , "+F+" , "+d+" , validate.schema"+f.schemaPath+" "}s+=" , (dataPath || '')";if(f.errorPath!='""'){s+=" + "+f.errorPath}var B=v?"data"+(v-1||""):"parentData",c=v?f.dataPathArr[v]:"parentDataProperty";s+=" , "+B+" , "+c+" , rootData ) ";var Z=s;s=W.pop();if(x.errors===false){s+=" "+E+" = ";if(G){s+="await "}s+=""+Z+"; "}else{if(G){L="customErrors"+l;s+=" var "+L+" = null; try { "+E+" = await "+Z+"; } catch (e) { "+E+" = false; if (e instanceof ValidationError) "+L+" = e.errors; else throw e; } "}else{s+=" "+L+" = null; "+E+" = "+Z+"; "}}}if(x.modifying){s+=" if ("+B+") "+d+" = "+B+"["+c+"];"}s+=""+z;if(x.valid){if(w){s+=" if (true) { "}}else{s+=" if ( ";if(x.valid===undefined){s+=" !";if(Q){s+=""+X}else{s+=""+E}}else{s+=" "+!x.valid+" "}s+=") { ";j=p.keyword;var W=W||[];W.push(s);s="";var W=W||[];W.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(j||"custom")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { keyword: '"+p.keyword+"' } ";if(f.opts.messages!==false){s+=" , message: 'should pass \""+p.keyword+"\" keyword validation' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+d+" "}s+=" } "}else{s+=" {} "}var D=s;s=W.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+D+"]); "}else{s+=" validate.errors = ["+D+"]; return false; "}}else{s+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}var K=s;s=W.pop();if(N){if(x.errors){if(x.errors!="full"){s+=" for (var "+J+"="+R+"; "+J+"{"use strict";f.exports=function generate_dependencies(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="errs__"+l;var E=f.util.copy(f);var R="";E.level++;var A="valid"+E.level;var F={},p={},I=f.opts.ownProperties;for(N in r){if(N=="__proto__")continue;var x=r[N];var z=Array.isArray(x)?p:F;z[N]=x}s+="var "+d+" = errors;";var U=f.errorPath;s+="var missing"+l+";";for(var N in p){z=p[N];if(z.length){s+=" if ( "+j+f.util.getProperty(N)+" !== undefined ";if(I){s+=" && Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(N)+"') "}if(w){s+=" && ( ";var Q=z;if(Q){var q,O=-1,C=Q.length-1;while(O0||x===false:f.util.schemaHasRules(x,f.RULES.all)){s+=" "+A+" = true; if ( "+j+f.util.getProperty(N)+" !== undefined ";if(I){s+=" && Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(N)+"') "}s+=") { ";E.schema=x;E.schemaPath=b+f.util.getProperty(N);E.errSchemaPath=g+"/"+f.util.escapeFragment(N);s+=" "+f.validate(E)+" ";E.baseId=B;s+=" } ";if(w){s+=" if ("+A+") { ";R+="}"}}}if(w){s+=" "+R+" if ("+d+" == errors) {"}return s}},9795:f=>{"use strict";f.exports=function generate_enum(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}var A="i"+l,F="schema"+l;if(!E){s+=" var "+F+" = validate.schema"+b+";"}s+="var "+d+";";if(E){s+=" if (schema"+l+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+l+")) "+d+" = false; else {"}s+=""+d+" = false;for (var "+A+"=0; "+A+"<"+F+".length; "+A+"++) if (equal("+j+", "+F+"["+A+"])) { "+d+" = true; break; }";if(E){s+=" } "}s+=" if (!"+d+") { ";var p=p||[];p.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"enum"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { allowedValues: schema"+l+" } ";if(f.opts.messages!==false){s+=" , message: 'should be equal to one of the allowed values' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var I=s;s=p.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+I+"]); "}else{s+=" validate.errors = ["+I+"]; return false; "}}else{s+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" }";if(w){s+=" else { "}return s}},5801:f=>{"use strict";f.exports=function generate_format(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");if(f.opts.format===false){if(w){s+=" if (true) { "}return s}var d=f.opts.$data&&r&&r.$data,E;if(d){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";E="schema"+l}else{E=r}var R=f.opts.unknownFormats,A=Array.isArray(R);if(d){var F="format"+l,p="isObject"+l,I="formatType"+l;s+=" var "+F+" = formats["+E+"]; var "+p+" = typeof "+F+" == 'object' && !("+F+" instanceof RegExp) && "+F+".validate; var "+I+" = "+p+" && "+F+".type || 'string'; if ("+p+") { ";if(f.async){s+=" var async"+l+" = "+F+".async; "}s+=" "+F+" = "+F+".validate; } if ( ";if(d){s+=" ("+E+" !== undefined && typeof "+E+" != 'string') || "}s+=" (";if(R!="ignore"){s+=" ("+E+" && !"+F+" ";if(A){s+=" && self._opts.unknownFormats.indexOf("+E+") == -1 "}s+=") || "}s+=" ("+F+" && "+I+" == '"+n+"' && !(typeof "+F+" == 'function' ? ";if(f.async){s+=" (async"+l+" ? await "+F+"("+j+") : "+F+"("+j+")) "}else{s+=" "+F+"("+j+") "}s+=" : "+F+".test("+j+"))))) {"}else{var F=f.formats[r];if(!F){if(R=="ignore"){f.logger.warn('unknown format "'+r+'" ignored in schema at path "'+f.errSchemaPath+'"');if(w){s+=" if (true) { "}return s}else if(A&&R.indexOf(r)>=0){if(w){s+=" if (true) { "}return s}else{throw new Error('unknown format "'+r+'" is used in schema at path "'+f.errSchemaPath+'"')}}var p=typeof F=="object"&&!(F instanceof RegExp)&&F.validate;var I=p&&F.type||"string";if(p){var x=F.async===true;F=F.validate}if(I!=n){if(w){s+=" if (true) { "}return s}if(x){if(!f.async)throw new Error("async format in sync schema");var z="formats"+f.util.getProperty(r)+".validate";s+=" if (!(await "+z+"("+j+"))) { "}else{s+=" if (! ";var z="formats"+f.util.getProperty(r);if(p)z+=".validate";if(typeof F=="function"){s+=" "+z+"("+j+") "}else{s+=" "+z+".test("+j+") "}s+=") { "}}var U=U||[];U.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"format"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { format: ";if(d){s+=""+E}else{s+=""+f.util.toQuotedString(r)}s+=" } ";if(f.opts.messages!==false){s+=" , message: 'should match format \"";if(d){s+="' + "+E+" + '"}else{s+=""+f.util.escapeQuotes(r)}s+="\"' "}if(f.opts.verbose){s+=" , schema: ";if(d){s+="validate.schema"+b}else{s+=""+f.util.toQuotedString(r)}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var N=s;s=U.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+N+"]); "}else{s+=" validate.errors = ["+N+"]; return false; "}}else{s+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } ";if(w){s+=" else { "}return s}},4962:f=>{"use strict";f.exports=function generate_if(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);R.level++;var A="valid"+R.level;var F=f.schema["then"],p=f.schema["else"],I=F!==undefined&&(f.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===false:f.util.schemaHasRules(F,f.RULES.all)),x=p!==undefined&&(f.opts.strictKeywords?typeof p=="object"&&Object.keys(p).length>0||p===false:f.util.schemaHasRules(p,f.RULES.all)),z=R.baseId;if(I||x){var U;R.createErrors=false;R.schema=r;R.schemaPath=b;R.errSchemaPath=g;s+=" var "+E+" = errors; var "+d+" = true; ";var N=f.compositeRule;f.compositeRule=R.compositeRule=true;s+=" "+f.validate(R)+" ";R.baseId=z;R.createErrors=true;s+=" errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; } ";f.compositeRule=R.compositeRule=N;if(I){s+=" if ("+A+") { ";R.schema=f.schema["then"];R.schemaPath=f.schemaPath+".then";R.errSchemaPath=f.errSchemaPath+"/then";s+=" "+f.validate(R)+" ";R.baseId=z;s+=" "+d+" = "+A+"; ";if(I&&x){U="ifClause"+l;s+=" var "+U+" = 'then'; "}else{U="'then'"}s+=" } ";if(x){s+=" else { "}}else{s+=" if (!"+A+") { "}if(x){R.schema=f.schema["else"];R.schemaPath=f.schemaPath+".else";R.errSchemaPath=f.errSchemaPath+"/else";s+=" "+f.validate(R)+" ";R.baseId=z;s+=" "+d+" = "+A+"; ";if(I&&x){U="ifClause"+l;s+=" var "+U+" = 'else'; "}else{U="'else'"}s+=" } "}s+=" if (!"+d+") { var err = ";if(f.createErrors!==false){s+=" { keyword: '"+"if"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { failingKeyword: "+U+" } ";if(f.opts.messages!==false){s+=" , message: 'should match \"' + "+U+" + '\" schema' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(vErrors); "}else{s+=" validate.errors = vErrors; return false; "}}s+=" } ";if(w){s+=" else { "}}else{if(w){s+=" if (true) { "}}return s}},4124:(f,e,n)=>{"use strict";f.exports={$ref:n(5746),allOf:n(3639),anyOf:n(1256),$comment:n(2660),const:n(184),contains:n(7419),dependencies:n(7299),enum:n(9795),format:n(5801),if:n(4962),items:n(9623),maximum:n(3711),minimum:n(3711),maxItems:n(5675),minItems:n(5675),maxLength:n(6051),minLength:n(6051),maxProperties:n(7043),minProperties:n(7043),multipleOf:n(9251),not:n(7739),oneOf:n(6857),pattern:n(8099),properties:n(9438),propertyNames:n(3466),required:n(8430),uniqueItems:n(2207),validate:n(6131)}},9623:f=>{"use strict";f.exports=function generate_items(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);var A="";R.level++;var F="valid"+R.level;var p="i"+l,I=R.dataLevel=f.dataLevel+1,x="data"+I,z=f.baseId;s+="var "+E+" = errors;var "+d+";";if(Array.isArray(r)){var U=f.schema.additionalItems;if(U===false){s+=" "+d+" = "+j+".length <= "+r.length+"; ";var N=g;g=f.errSchemaPath+"/additionalItems";s+=" if (!"+d+") { ";var Q=Q||[];Q.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"additionalItems"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { limit: "+r.length+" } ";if(f.opts.messages!==false){s+=" , message: 'should NOT have more than "+r.length+" items' "}if(f.opts.verbose){s+=" , schema: false , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var q=s;s=Q.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+q+"]); "}else{s+=" validate.errors = ["+q+"]; return false; "}}else{s+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } ";g=N;if(w){A+="}";s+=" else { "}}var O=r;if(O){var C,L=-1,J=O.length-1;while(L0||C===false:f.util.schemaHasRules(C,f.RULES.all)){s+=" "+F+" = true; if ("+j+".length > "+L+") { ";var T=j+"["+L+"]";R.schema=C;R.schemaPath=b+"["+L+"]";R.errSchemaPath=g+"/"+L;R.errorPath=f.util.getPathExpr(f.errorPath,L,f.opts.jsonPointers,true);R.dataPathArr[I]=L;var G=f.validate(R);R.baseId=z;if(f.util.varOccurences(G,x)<2){s+=" "+f.util.varReplace(G,x,T)+" "}else{s+=" var "+x+" = "+T+"; "+G+" "}s+=" } ";if(w){s+=" if ("+F+") { ";A+="}"}}}}if(typeof U=="object"&&(f.opts.strictKeywords?typeof U=="object"&&Object.keys(U).length>0||U===false:f.util.schemaHasRules(U,f.RULES.all))){R.schema=U;R.schemaPath=f.schemaPath+".additionalItems";R.errSchemaPath=f.errSchemaPath+"/additionalItems";s+=" "+F+" = true; if ("+j+".length > "+r.length+") { for (var "+p+" = "+r.length+"; "+p+" < "+j+".length; "+p+"++) { ";R.errorPath=f.util.getPathExpr(f.errorPath,p,f.opts.jsonPointers,true);var T=j+"["+p+"]";R.dataPathArr[I]=p;var G=f.validate(R);R.baseId=z;if(f.util.varOccurences(G,x)<2){s+=" "+f.util.varReplace(G,x,T)+" "}else{s+=" var "+x+" = "+T+"; "+G+" "}if(w){s+=" if (!"+F+") break; "}s+=" } } ";if(w){s+=" if ("+F+") { ";A+="}"}}}else if(f.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:f.util.schemaHasRules(r,f.RULES.all)){R.schema=r;R.schemaPath=b;R.errSchemaPath=g;s+=" for (var "+p+" = "+0+"; "+p+" < "+j+".length; "+p+"++) { ";R.errorPath=f.util.getPathExpr(f.errorPath,p,f.opts.jsonPointers,true);var T=j+"["+p+"]";R.dataPathArr[I]=p;var G=f.validate(R);R.baseId=z;if(f.util.varOccurences(G,x)<2){s+=" "+f.util.varReplace(G,x,T)+" "}else{s+=" var "+x+" = "+T+"; "+G+" "}if(w){s+=" if (!"+F+") break; "}s+=" }"}if(w){s+=" "+A+" if ("+E+" == errors) {"}return s}},9251:f=>{"use strict";f.exports=function generate_multipleOf(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d=f.opts.$data&&r&&r.$data,E;if(d){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";E="schema"+l}else{E=r}if(!(d||typeof r=="number")){throw new Error(e+" must be number")}s+="var division"+l+";if (";if(d){s+=" "+E+" !== undefined && ( typeof "+E+" != 'number' || "}s+=" (division"+l+" = "+j+" / "+E+", ";if(f.opts.multipleOfPrecision){s+=" Math.abs(Math.round(division"+l+") - division"+l+") > 1e-"+f.opts.multipleOfPrecision+" "}else{s+=" division"+l+" !== parseInt(division"+l+") "}s+=" ) ";if(d){s+=" ) "}s+=" ) { ";var R=R||[];R.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"multipleOf"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { multipleOf: "+E+" } ";if(f.opts.messages!==false){s+=" , message: 'should be multiple of ";if(d){s+="' + "+E}else{s+=""+E+"'"}}if(f.opts.verbose){s+=" , schema: ";if(d){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var A=s;s=R.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+A+"]); "}else{s+=" validate.errors = ["+A+"]; return false; "}}else{s+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},7739:f=>{"use strict";f.exports=function generate_not(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="errs__"+l;var E=f.util.copy(f);E.level++;var R="valid"+E.level;if(f.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:f.util.schemaHasRules(r,f.RULES.all)){E.schema=r;E.schemaPath=b;E.errSchemaPath=g;s+=" var "+d+" = errors; ";var A=f.compositeRule;f.compositeRule=E.compositeRule=true;E.createErrors=false;var F;if(E.opts.allErrors){F=E.opts.allErrors;E.opts.allErrors=false}s+=" "+f.validate(E)+" ";E.createErrors=true;if(F)E.opts.allErrors=F;f.compositeRule=E.compositeRule=A;s+=" if ("+R+") { ";var p=p||[];p.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"not"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: 'should NOT be valid' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var I=s;s=p.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+I+"]); "}else{s+=" validate.errors = ["+I+"]; return false; "}}else{s+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ";if(f.opts.allErrors){s+=" } "}}else{s+=" var err = ";if(f.createErrors!==false){s+=" { keyword: '"+"not"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: 'should NOT be valid' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(w){s+=" if (false) { "}}return s}},6857:f=>{"use strict";f.exports=function generate_oneOf(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E="errs__"+l;var R=f.util.copy(f);var A="";R.level++;var F="valid"+R.level;var p=R.baseId,I="prevValid"+l,x="passingSchemas"+l;s+="var "+E+" = errors , "+I+" = false , "+d+" = false , "+x+" = null; ";var z=f.compositeRule;f.compositeRule=R.compositeRule=true;var U=r;if(U){var N,Q=-1,q=U.length-1;while(Q0||N===false:f.util.schemaHasRules(N,f.RULES.all)){R.schema=N;R.schemaPath=b+"["+Q+"]";R.errSchemaPath=g+"/"+Q;s+=" "+f.validate(R)+" ";R.baseId=p}else{s+=" var "+F+" = true; "}if(Q){s+=" if ("+F+" && "+I+") { "+d+" = false; "+x+" = ["+x+", "+Q+"]; } else { ";A+="}"}s+=" if ("+F+") { "+d+" = "+I+" = true; "+x+" = "+Q+"; }"}}f.compositeRule=R.compositeRule=z;s+=""+A+"if (!"+d+") { var err = ";if(f.createErrors!==false){s+=" { keyword: '"+"oneOf"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { passingSchemas: "+x+" } ";if(f.opts.messages!==false){s+=" , message: 'should match exactly one schema in oneOf' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(vErrors); "}else{s+=" validate.errors = vErrors; return false; "}}s+="} else { errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; }";if(f.opts.allErrors){s+=" } "}return s}},8099:f=>{"use strict";f.exports=function generate_pattern(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d=f.opts.$data&&r&&r.$data,E;if(d){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";E="schema"+l}else{E=r}var R=d?"(new RegExp("+E+"))":f.usePattern(r);s+="if ( ";if(d){s+=" ("+E+" !== undefined && typeof "+E+" != 'string') || "}s+=" !"+R+".test("+j+") ) { ";var A=A||[];A.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"pattern"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { pattern: ";if(d){s+=""+E}else{s+=""+f.util.toQuotedString(r)}s+=" } ";if(f.opts.messages!==false){s+=" , message: 'should match pattern \"";if(d){s+="' + "+E+" + '"}else{s+=""+f.util.escapeQuotes(r)}s+="\"' "}if(f.opts.verbose){s+=" , schema: ";if(d){s+="validate.schema"+b}else{s+=""+f.util.toQuotedString(r)}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var F=s;s=A.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+F+"]); "}else{s+=" validate.errors = ["+F+"]; return false; "}}else{s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+="} ";if(w){s+=" else { "}return s}},9438:f=>{"use strict";f.exports=function generate_properties(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="errs__"+l;var E=f.util.copy(f);var R="";E.level++;var A="valid"+E.level;var F="key"+l,p="idx"+l,I=E.dataLevel=f.dataLevel+1,x="data"+I,z="dataProperties"+l;var U=Object.keys(r||{}).filter(notProto),N=f.schema.patternProperties||{},Q=Object.keys(N).filter(notProto),q=f.schema.additionalProperties,O=U.length||Q.length,C=q===false,L=typeof q=="object"&&Object.keys(q).length,J=f.opts.removeAdditional,T=C||L||J,G=f.opts.ownProperties,H=f.baseId;var X=f.schema.required;if(X&&!(f.opts.$data&&X.$data)&&X.length8){s+=" || validate.schema"+b+".hasOwnProperty("+F+") "}else{var Y=U;if(Y){var W,B=-1,c=Y.length-1;while(B0||t===false:f.util.schemaHasRules(t,f.RULES.all)){var ff=f.util.getProperty(W),P=j+ff,ef=_&&t.default!==undefined;E.schema=t;E.schemaPath=b+ff;E.errSchemaPath=g+"/"+f.util.escapeFragment(W);E.errorPath=f.util.getPath(f.errorPath,W,f.opts.jsonPointers);E.dataPathArr[I]=f.util.toQuotedString(W);var i=f.validate(E);E.baseId=H;if(f.util.varOccurences(i,x)<2){i=f.util.varReplace(i,x,P);var nf=P}else{var nf=x;s+=" var "+x+" = "+P+"; "}if(ef){s+=" "+i+" "}else{if(M&&M[W]){s+=" if ( "+nf+" === undefined ";if(G){s+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(W)+"') "}s+=") { "+A+" = false; ";var y=f.errorPath,h=g,sf=f.util.escapeQuotes(W);if(f.opts._errorDataPathProperty){f.errorPath=f.util.getPath(y,W,f.opts.jsonPointers)}g=f.errSchemaPath+"/required";var a=a||[];a.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { missingProperty: '"+sf+"' } ";if(f.opts.messages!==false){s+=" , message: '";if(f.opts._errorDataPathProperty){s+="is a required property"}else{s+="should have required property \\'"+sf+"\\'"}s+="' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var S=s;s=a.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+S+"]); "}else{s+=" validate.errors = ["+S+"]; return false; "}}else{s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}g=h;f.errorPath=y;s+=" } else { "}else{if(w){s+=" if ( "+nf+" === undefined ";if(G){s+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(W)+"') "}s+=") { "+A+" = true; } else { "}else{s+=" if ("+nf+" !== undefined ";if(G){s+=" && Object.prototype.hasOwnProperty.call("+j+", '"+f.util.escapeQuotes(W)+"') "}s+=" ) { "}}s+=" "+i+" } "}}if(w){s+=" if ("+A+") { ";R+="}"}}}}if(Q.length){var lf=Q;if(lf){var D,vf=-1,rf=lf.length-1;while(vf0||t===false:f.util.schemaHasRules(t,f.RULES.all)){E.schema=t;E.schemaPath=f.schemaPath+".patternProperties"+f.util.getProperty(D);E.errSchemaPath=f.errSchemaPath+"/patternProperties/"+f.util.escapeFragment(D);if(G){s+=" "+z+" = "+z+" || Object.keys("+j+"); for (var "+p+"=0; "+p+"<"+z+".length; "+p+"++) { var "+F+" = "+z+"["+p+"]; "}else{s+=" for (var "+F+" in "+j+") { "}s+=" if ("+f.usePattern(D)+".test("+F+")) { ";E.errorPath=f.util.getPathExpr(f.errorPath,F,f.opts.jsonPointers);var P=j+"["+F+"]";E.dataPathArr[I]=F;var i=f.validate(E);E.baseId=H;if(f.util.varOccurences(i,x)<2){s+=" "+f.util.varReplace(i,x,P)+" "}else{s+=" var "+x+" = "+P+"; "+i+" "}if(w){s+=" if (!"+A+") break; "}s+=" } ";if(w){s+=" else "+A+" = true; "}s+=" } ";if(w){s+=" if ("+A+") { ";R+="}"}}}}}if(w){s+=" "+R+" if ("+d+" == errors) {"}return s}},3466:f=>{"use strict";f.exports=function generate_propertyNames(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="errs__"+l;var E=f.util.copy(f);var R="";E.level++;var A="valid"+E.level;s+="var "+d+" = errors;";if(f.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:f.util.schemaHasRules(r,f.RULES.all)){E.schema=r;E.schemaPath=b;E.errSchemaPath=g;var F="key"+l,p="idx"+l,I="i"+l,x="' + "+F+" + '",z=E.dataLevel=f.dataLevel+1,U="data"+z,N="dataProperties"+l,Q=f.opts.ownProperties,q=f.baseId;if(Q){s+=" var "+N+" = undefined; "}if(Q){s+=" "+N+" = "+N+" || Object.keys("+j+"); for (var "+p+"=0; "+p+"<"+N+".length; "+p+"++) { var "+F+" = "+N+"["+p+"]; "}else{s+=" for (var "+F+" in "+j+") { "}s+=" var startErrs"+l+" = errors; ";var O=F;var C=f.compositeRule;f.compositeRule=E.compositeRule=true;var L=f.validate(E);E.baseId=q;if(f.util.varOccurences(L,U)<2){s+=" "+f.util.varReplace(L,U,O)+" "}else{s+=" var "+U+" = "+O+"; "+L+" "}f.compositeRule=E.compositeRule=C;s+=" if (!"+A+") { for (var "+I+"=startErrs"+l+"; "+I+"{"use strict";f.exports=function generate_ref(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.errSchemaPath+"/"+e;var g=!f.opts.allErrors;var w="data"+(v||"");var j="valid"+l;var d,E;if(r=="#"||r=="#/"){if(f.isRoot){d=f.async;E="validate"}else{d=f.root.schema.$async===true;E="root.refVal[0]"}}else{var R=f.resolveRef(f.baseId,r,f.isRoot);if(R===undefined){var A=f.MissingRefError.message(f.baseId,r);if(f.opts.missingRefs=="fail"){f.logger.error(A);var F=F||[];F.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"$ref"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(b)+" , params: { ref: '"+f.util.escapeQuotes(r)+"' } ";if(f.opts.messages!==false){s+=" , message: 'can\\'t resolve reference "+f.util.escapeQuotes(r)+"' "}if(f.opts.verbose){s+=" , schema: "+f.util.toQuotedString(r)+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+w+" "}s+=" } "}else{s+=" {} "}var p=s;s=F.pop();if(!f.compositeRule&&g){if(f.async){s+=" throw new ValidationError(["+p+"]); "}else{s+=" validate.errors = ["+p+"]; return false; "}}else{s+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}if(g){s+=" if (false) { "}}else if(f.opts.missingRefs=="ignore"){f.logger.warn(A);if(g){s+=" if (true) { "}}else{throw new f.MissingRefError(f.baseId,r,A)}}else if(R.inline){var I=f.util.copy(f);I.level++;var x="valid"+I.level;I.schema=R.schema;I.schemaPath="";I.errSchemaPath=r;var z=f.validate(I).replace(/validate\.schema/g,R.code);s+=" "+z+" ";if(g){s+=" if ("+x+") { "}}else{d=R.$async===true||f.async&&R.$async!==false;E=R.code}}if(E){var F=F||[];F.push(s);s="";if(f.opts.passContext){s+=" "+E+".call(this, "}else{s+=" "+E+"( "}s+=" "+w+", (dataPath || '')";if(f.errorPath!='""'){s+=" + "+f.errorPath}var U=v?"data"+(v-1||""):"parentData",N=v?f.dataPathArr[v]:"parentDataProperty";s+=" , "+U+" , "+N+", rootData) ";var Q=s;s=F.pop();if(d){if(!f.async)throw new Error("async schema referenced by sync schema");if(g){s+=" var "+j+"; "}s+=" try { await "+Q+"; ";if(g){s+=" "+j+" = true; "}s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ";if(g){s+=" "+j+" = false; "}s+=" } ";if(g){s+=" if ("+j+") { "}}else{s+=" if (!"+Q+") { if (vErrors === null) vErrors = "+E+".errors; else vErrors = vErrors.concat("+E+".errors); errors = vErrors.length; } ";if(g){s+=" else { "}}}return s}},8430:f=>{"use strict";f.exports=function generate_required(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}var A="schema"+l;if(!E){if(r.length0||U===false:f.util.schemaHasRules(U,f.RULES.all)))){F[F.length]=I}}}}else{var F=r}}if(E||F.length){var N=f.errorPath,Q=E||F.length>=f.opts.loopRequired,q=f.opts.ownProperties;if(w){s+=" var missing"+l+"; ";if(Q){if(!E){s+=" var "+A+" = validate.schema"+b+"; "}var O="i"+l,C="schema"+l+"["+O+"]",L="' + "+C+" + '";if(f.opts._errorDataPathProperty){f.errorPath=f.util.getPathExpr(N,C,f.opts.jsonPointers)}s+=" var "+d+" = true; ";if(E){s+=" if (schema"+l+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+l+")) "+d+" = false; else {"}s+=" for (var "+O+" = 0; "+O+" < "+A+".length; "+O+"++) { "+d+" = "+j+"["+A+"["+O+"]] !== undefined ";if(q){s+=" && Object.prototype.hasOwnProperty.call("+j+", "+A+"["+O+"]) "}s+="; if (!"+d+") break; } ";if(E){s+=" } "}s+=" if (!"+d+") { ";var J=J||[];J.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { missingProperty: '"+L+"' } ";if(f.opts.messages!==false){s+=" , message: '";if(f.opts._errorDataPathProperty){s+="is a required property"}else{s+="should have required property \\'"+L+"\\'"}s+="' "}if(f.opts.verbose){s+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var T=s;s=J.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+T+"]); "}else{s+=" validate.errors = ["+T+"]; return false; "}}else{s+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } else { "}else{s+=" if ( ";var G=F;if(G){var H,O=-1,X=G.length-1;while(O{"use strict";f.exports=function generate_uniqueItems(f,e,n){var s=" ";var l=f.level;var v=f.dataLevel;var r=f.schema[e];var b=f.schemaPath+f.util.getProperty(e);var g=f.errSchemaPath+"/"+e;var w=!f.opts.allErrors;var j="data"+(v||"");var d="valid"+l;var E=f.opts.$data&&r&&r.$data,R;if(E){s+=" var schema"+l+" = "+f.util.getData(r.$data,v,f.dataPathArr)+"; ";R="schema"+l}else{R=r}if((r||E)&&f.opts.uniqueItems!==false){if(E){s+=" var "+d+"; if ("+R+" === false || "+R+" === undefined) "+d+" = true; else if (typeof "+R+" != 'boolean') "+d+" = false; else { "}s+=" var i = "+j+".length , "+d+" = true , j; if (i > 1) { ";var A=f.schema.items&&f.schema.items.type,F=Array.isArray(A);if(!A||A=="object"||A=="array"||F&&(A.indexOf("object")>=0||A.indexOf("array")>=0)){s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+j+"[i], "+j+"[j])) { "+d+" = false; break outer; } } } "}else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+j+"[i]; ";var p="checkDataType"+(F?"s":"");s+=" if ("+f.util[p](A,"item",f.opts.strictNumbers,true)+") continue; ";if(F){s+=" if (typeof item == 'string') item = '\"' + item; "}s+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ";if(E){s+=" } "}s+=" if (!"+d+") { ";var I=I||[];I.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+"uniqueItems"+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(g)+" , params: { i: i, j: j } ";if(f.opts.messages!==false){s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "}if(f.opts.verbose){s+=" , schema: ";if(E){s+="validate.schema"+b}else{s+=""+r}s+=" , parentSchema: validate.schema"+f.schemaPath+" , data: "+j+" "}s+=" } "}else{s+=" {} "}var x=s;s=I.pop();if(!f.compositeRule&&w){if(f.async){s+=" throw new ValidationError(["+x+"]); "}else{s+=" validate.errors = ["+x+"]; return false; "}}else{s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } ";if(w){s+=" else { "}}else{if(w){s+=" if (true) { "}}return s}},6131:f=>{"use strict";f.exports=function generate_validate(f,e,n){var s="";var l=f.schema.$async===true,v=f.util.schemaHasRulesExcept(f.schema,f.RULES.all,"$ref"),r=f.self._getId(f.schema);if(f.opts.strictKeywords){var b=f.util.schemaUnknownRules(f.schema,f.RULES.keywords);if(b){var g="unknown keyword: "+b;if(f.opts.strictKeywords==="log")f.logger.warn(g);else throw new Error(g)}}if(f.isTop){s+=" var validate = ";if(l){f.async=true;s+="async "}s+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ";if(r&&(f.opts.sourceCode||f.opts.processCode)){s+=" "+("/*# sourceURL="+r+" */")+" "}}if(typeof f.schema=="boolean"||!(v||f.schema.$ref)){var e="false schema";var w=f.level;var j=f.dataLevel;var d=f.schema[e];var E=f.schemaPath+f.util.getProperty(e);var R=f.errSchemaPath+"/"+e;var A=!f.opts.allErrors;var F;var p="data"+(j||"");var I="valid"+w;if(f.schema===false){if(f.isTop){A=true}else{s+=" var "+I+" = false; "}var x=x||[];x.push(s);s="";if(f.createErrors!==false){s+=" { keyword: '"+(F||"false schema")+"' , dataPath: (dataPath || '') + "+f.errorPath+" , schemaPath: "+f.util.toQuotedString(R)+" , params: {} ";if(f.opts.messages!==false){s+=" , message: 'boolean schema is false' "}if(f.opts.verbose){s+=" , schema: false , parentSchema: validate.schema"+f.schemaPath+" , data: "+p+" "}s+=" } "}else{s+=" {} "}var z=s;s=x.pop();if(!f.compositeRule&&A){if(f.async){s+=" throw new ValidationError(["+z+"]); "}else{s+=" validate.errors = ["+z+"]; return false; "}}else{s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}}else{if(f.isTop){if(l){s+=" return data; "}else{s+=" validate.errors = null; return true; "}}else{s+=" var "+I+" = true; "}}if(f.isTop){s+=" }; return validate; "}return s}if(f.isTop){var U=f.isTop,w=f.level=0,j=f.dataLevel=0,p="data";f.rootId=f.resolve.fullPath(f.self._getId(f.root.schema));f.baseId=f.baseId||f.rootId;delete f.isTop;f.dataPathArr=[""];if(f.schema.default!==undefined&&f.opts.useDefaults&&f.opts.strictDefaults){var N="default is ignored in the schema root";if(f.opts.strictDefaults==="log")f.logger.warn(N);else throw new Error(N)}s+=" var vErrors = null; ";s+=" var errors = 0; ";s+=" if (rootData === undefined) rootData = data; "}else{var w=f.level,j=f.dataLevel,p="data"+(j||"");if(r)f.baseId=f.resolve.url(f.baseId,r);if(l&&!f.async)throw new Error("async schema in sync schema");s+=" var errs_"+w+" = errors;"}var I="valid"+w,A=!f.opts.allErrors,Q="",q="";var F;var O=f.schema.type,C=Array.isArray(O);if(O&&f.opts.nullable&&f.schema.nullable===true){if(C){if(O.indexOf("null")==-1)O=O.concat("null")}else if(O!="null"){O=[O,"null"];C=true}}if(C&&O.length==1){O=O[0];C=false}if(f.schema.$ref&&v){if(f.opts.extendRefs=="fail"){throw new Error('$ref: validation keywords used in schema at path "'+f.errSchemaPath+'" (see option extendRefs)')}else if(f.opts.extendRefs!==true){v=false;f.logger.warn('$ref: keywords ignored in schema at path "'+f.errSchemaPath+'"')}}if(f.schema.$comment&&f.opts.$comment){s+=" "+f.RULES.all.$comment.code(f,"$comment")}if(O){if(f.opts.coerceTypes){var L=f.util.coerceToTypes(f.opts.coerceTypes,O)}var J=f.RULES.types[O];if(L||C||J===true||J&&!$shouldUseGroup(J)){var E=f.schemaPath+".type",R=f.errSchemaPath+"/type";var E=f.schemaPath+".type",R=f.errSchemaPath+"/type",T=C?"checkDataTypes":"checkDataType";s+=" if ("+f.util[T](O,p,f.opts.strictNumbers,true)+") { ";if(L){var G="dataType"+w,H="coerced"+w;s+=" var "+G+" = typeof "+p+"; var "+H+" = undefined; ";if(f.opts.coerceTypes=="array"){s+=" if ("+G+" == 'object' && Array.isArray("+p+") && "+p+".length == 1) { "+p+" = "+p+"[0]; "+G+" = typeof "+p+"; if ("+f.util.checkDataType(f.schema.type,p,f.opts.strictNumbers)+") "+H+" = "+p+"; } "}s+=" if ("+H+" !== undefined) ; ";var X=L;if(X){var M,Y=-1,W=X.length-1;while(Y{"use strict";var s=/^[a-z_$][a-z0-9_$-]*$/i;var l=n(7921);var v=n(5533);f.exports={add:addKeyword,get:getKeyword,remove:removeKeyword,validate:validateKeyword};function addKeyword(f,e){var n=this.RULES;if(n.keywords[f])throw new Error("Keyword "+f+" is already defined");if(!s.test(f))throw new Error("Keyword "+f+" is not a valid identifier");if(e){this.validateKeyword(e,true);var v=e.type;if(Array.isArray(v)){for(var r=0;r{"use strict";f=n.nmd(f);const s=n(5747);const l=n(5622);const v=n(6417);const r=n(2357);const b=n(8614);const g=n(5514);const w=n(293);const j=n(6536);const d=n(7727);const E=n(8393);const R=n(1414);const A=()=>Object.create(null);const F="aes-256-cbc";delete require.cache[__filename];const p=l.dirname(f.parent&&f.parent.filename||".");const I=(f,e)=>{const n=["undefined","symbol","function"];const s=typeof e;if(n.includes(s)){throw new TypeError(`Setting a value of type \`${s}\` for key \`${f}\` is not allowed as it's not supported by JSON`)}};class Conf{constructor(f){f={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:true,serialize:f=>JSON.stringify(f,null,"\t"),deserialize:JSON.parse,accessPropertiesByDotNotation:true,...f};if(!f.cwd){if(!f.projectName){const e=j.sync(p);f.projectName=e&&JSON.parse(s.readFileSync(e,"utf8")).name}if(!f.projectName){throw new Error("Project name could not be inferred. Please specify the `projectName` option.")}f.cwd=d(f.projectName,{suffix:f.projectSuffix}).config}this._options=f;if(f.schema){if(typeof f.schema!=="object"){throw new TypeError("The `schema` option must be an object.")}const e=new R({allErrors:true,format:"full",useDefaults:true,errorDataPath:"property"});const n={type:"object",properties:f.schema};this._validator=e.compile(n)}this.events=new b;this.encryptionKey=f.encryptionKey;this.serialize=f.serialize;this.deserialize=f.deserialize;const e=f.fileExtension?`.${f.fileExtension}`:"";this.path=l.resolve(f.cwd,`${f.configName}${e}`);const n=this.store;const v=Object.assign(A(),f.defaults,n);this._validate(v);try{r.deepEqual(n,v)}catch(f){this.store=v}}_validate(f){if(!this._validator){return}const e=this._validator(f);if(!e){const f=this._validator.errors.reduce((f,{dataPath:e,message:n})=>f+` \`${e.slice(1)}\` ${n};`,"");throw new Error("Config schema violation:"+f.slice(0,-1))}}get(f,e){if(this._options.accessPropertiesByDotNotation){return g.get(this.store,f,e)}return f in this.store?this.store[f]:e}set(f,e){if(typeof f!=="string"&&typeof f!=="object"){throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof f}`)}if(typeof f!=="object"&&e===undefined){throw new TypeError("Use `delete()` to clear values")}const{store:n}=this;const s=(f,e)=>{I(f,e);if(this._options.accessPropertiesByDotNotation){g.set(n,f,e)}else{n[f]=e}};if(typeof f==="object"){const e=f;for(const[f,n]of Object.entries(e)){s(f,n)}}else{s(f,e)}this.store=n}has(f){if(this._options.accessPropertiesByDotNotation){return g.has(this.store,f)}return f in this.store}delete(f){const{store:e}=this;if(this._options.accessPropertiesByDotNotation){g.delete(e,f)}else{delete e[f]}this.store=e}clear(){this.store=A()}onDidChange(f,e){if(typeof f!=="string"){throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof f}`)}if(typeof e!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`)}const n=()=>this.get(f);return this.handleChange(n,e)}onDidAnyChange(f){if(typeof f!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof f}`)}const e=()=>this.store;return this.handleChange(e,f)}handleChange(f,e){let n=f();const s=()=>{const s=n;const l=f();try{r.deepEqual(l,s)}catch(f){n=l;e.call(this,l,s)}};this.events.on("change",s);return()=>this.events.removeListener("change",s)}get size(){return Object.keys(this.store).length}get store(){try{let f=s.readFileSync(this.path,this.encryptionKey?null:"utf8");if(this.encryptionKey){try{if(f.slice(16,17).toString()===":"){const e=f.slice(0,16);const n=v.pbkdf2Sync(this.encryptionKey,e.toString(),1e4,32,"sha512");const s=v.createDecipheriv(F,n,e);f=Buffer.concat([s.update(f.slice(17)),s.final()])}else{const e=v.createDecipher(F,this.encryptionKey);f=Buffer.concat([e.update(f),e.final()])}}catch(f){}}f=this.deserialize(f);this._validate(f);return Object.assign(A(),f)}catch(f){if(f.code==="ENOENT"){w.sync(l.dirname(this.path));return A()}if(this._options.clearInvalidConfig&&f.name==="SyntaxError"){return A()}throw f}}set store(f){w.sync(l.dirname(this.path));this._validate(f);let e=this.serialize(f);if(this.encryptionKey){const f=v.randomBytes(16);const n=v.pbkdf2Sync(this.encryptionKey,f.toString(),1e4,32,"sha512");const s=v.createCipheriv(F,n,f);e=Buffer.concat([f,Buffer.from(":"),s.update(Buffer.from(e)),s.final()])}E.sync(this.path,e);this.events.emit("change")}*[Symbol.iterator](){for(const[f,e]of Object.entries(this.store)){yield[f,e]}}}f.exports=Conf},5514:(f,e,n)=>{"use strict";const s=n(1771);const l=["__proto__","prototype","constructor"];const v=f=>!f.some(f=>l.includes(f));function getPathSegments(f){const e=f.split(".");const n=[];for(let f=0;f{"use strict";f.exports=(f=>{const e=typeof f;return f!==null&&(e==="object"||e==="function")})},8393:(f,e,n)=>{"use strict";f.exports=writeFile;f.exports.sync=writeFileSync;f.exports._getTmpname=getTmpname;f.exports._cleanupOnExit=cleanupOnExit;const s=n(5747);const l=n(8681);const v=n(2317);const r=n(5622);const b=n(3010);const g=n(4005);const{promisify:w}=n(1669);const j={};const d=function getId(){try{const f=n(5013);return f.threadId}catch(f){return 0}}();let E=0;function getTmpname(f){return f+"."+l(__filename).hash(String(process.pid)).hash(String(d)).hash(String(++E)).result()}function cleanupOnExit(f){return()=>{try{s.unlinkSync(typeof f==="function"?f():f)}catch(f){}}}function serializeActiveFile(f){return new Promise(e=>{if(!j[f])j[f]=[];j[f].push(e);if(j[f].length===1)e()})}async function writeFileAsync(f,e,n={}){if(typeof n==="string"){n={encoding:n}}let l;let d;const E=v(cleanupOnExit(()=>d));const R=r.resolve(f);try{await serializeActiveFile(R);const v=await w(s.realpath)(f).catch(()=>f);d=getTmpname(v);if(!n.mode||!n.chown){const f=await w(s.stat)(v).catch(()=>{});if(f){if(n.mode==null){n.mode=f.mode}if(n.chown==null&&process.getuid){n.chown={uid:f.uid,gid:f.gid}}}}l=await w(s.open)(d,"w",n.mode);if(n.tmpfileCreated){await n.tmpfileCreated(d)}if(b(e)){e=g(e)}if(Buffer.isBuffer(e)){await w(s.write)(l,e,0,e.length,0)}else if(e!=null){await w(s.write)(l,String(e),0,String(n.encoding||"utf8"))}if(n.fsync!==false){await w(s.fsync)(l)}await w(s.close)(l);l=null;if(n.chown){await w(s.chown)(d,n.chown.uid,n.chown.gid)}if(n.mode){await w(s.chmod)(d,n.mode)}await w(s.rename)(d,v)}finally{if(l){await w(s.close)(l).catch(()=>{})}E();await w(s.unlink)(d).catch(()=>{});j[R].shift();if(j[R].length>0){j[R][0]()}else delete j[R]}}function writeFile(f,e,n,s){if(n instanceof Function){s=n;n={}}const l=writeFileAsync(f,e,n);if(s){l.then(s,s)}return l}function writeFileSync(f,e,n){if(typeof n==="string")n={encoding:n};else if(!n)n={};try{f=s.realpathSync(f)}catch(f){}const l=getTmpname(f);if(!n.mode||!n.chown){try{const e=s.statSync(f);n=Object.assign({},n);if(!n.mode){n.mode=e.mode}if(!n.chown&&process.getuid){n.chown={uid:e.uid,gid:e.gid}}}catch(f){}}let r;const w=cleanupOnExit(l);const j=v(w);let d=true;try{r=s.openSync(l,"w",n.mode);if(n.tmpfileCreated){n.tmpfileCreated(l)}if(b(e)){e=g(e)}if(Buffer.isBuffer(e)){s.writeSync(r,e,0,e.length,0)}else if(e!=null){s.writeSync(r,String(e),0,String(n.encoding||"utf8"))}if(n.fsync!==false){s.fsyncSync(r)}s.closeSync(r);r=null;if(n.chown)s.chownSync(l,n.chown.uid,n.chown.gid);if(n.mode)s.chmodSync(l,n.mode);s.renameSync(l,f);d=false}finally{if(r){try{s.closeSync(r)}catch(f){}}j();if(d){w()}}}},7727:(f,e,n)=>{"use strict";const s=n(5622);const l=n(2087);const v=l.homedir();const r=l.tmpdir();const{env:b}=process;const g=f=>{const e=s.join(v,"Library");return{data:s.join(e,"Application Support",f),config:s.join(e,"Preferences",f),cache:s.join(e,"Caches",f),log:s.join(e,"Logs",f),temp:s.join(r,f)}};const w=f=>{const e=b.APPDATA||s.join(v,"AppData","Roaming");const n=b.LOCALAPPDATA||s.join(v,"AppData","Local");return{data:s.join(n,f,"Data"),config:s.join(e,f,"Config"),cache:s.join(n,f,"Cache"),log:s.join(n,f,"Log"),temp:s.join(r,f)}};const j=f=>{const e=s.basename(v);return{data:s.join(b.XDG_DATA_HOME||s.join(v,".local","share"),f),config:s.join(b.XDG_CONFIG_HOME||s.join(v,".config"),f),cache:s.join(b.XDG_CACHE_HOME||s.join(v,".cache"),f),log:s.join(b.XDG_STATE_HOME||s.join(v,".local","state"),f),temp:s.join(r,e,f)}};const d=(f,e)=>{if(typeof f!=="string"){throw new TypeError(`Expected string, got ${typeof f}`)}e=Object.assign({suffix:"nodejs"},e);if(e.suffix){f+=`-${e.suffix}`}if(process.platform==="darwin"){return g(f)}if(process.platform==="win32"){return w(f)}return j(f)};f.exports=d;f.exports.default=d},3933:f=>{"use strict";f.exports=function equal(f,e){if(f===e)return true;if(f&&e&&typeof f=="object"&&typeof e=="object"){if(f.constructor!==e.constructor)return false;var n,s,l;if(Array.isArray(f)){n=f.length;if(n!=e.length)return false;for(s=n;s--!==0;)if(!equal(f[s],e[s]))return false;return true}if(f.constructor===RegExp)return f.source===e.source&&f.flags===e.flags;if(f.valueOf!==Object.prototype.valueOf)return f.valueOf()===e.valueOf();if(f.toString!==Object.prototype.toString)return f.toString()===e.toString();l=Object.keys(f);n=l.length;if(n!==Object.keys(e).length)return false;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,l[s]))return false;for(s=n;s--!==0;){var v=l[s];if(!equal(f[v],e[v]))return false}return true}return f!==f&&e!==e}},3600:f=>{"use strict";f.exports=function(f,e){if(!e)e={};if(typeof e==="function")e={cmp:e};var n=typeof e.cycles==="boolean"?e.cycles:false;var s=e.cmp&&function(f){return function(e){return function(n,s){var l={key:n,value:e[n]};var v={key:s,value:e[s]};return f(l,v)}}}(e.cmp);var l=[];return function stringify(f){if(f&&f.toJSON&&typeof f.toJSON==="function"){f=f.toJSON()}if(f===undefined)return;if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!=="object")return JSON.stringify(f);var e,v;if(Array.isArray(f)){v="[";for(e=0;e{(function(){var e;function MurmurHash3(f,n){var s=this instanceof MurmurHash3?this:e;s.reset(n);if(typeof f==="string"&&f.length>0){s.hash(f)}if(s!==this){return s}}MurmurHash3.prototype.hash=function(f){var e,n,s,l,v;v=f.length;this.len+=v;n=this.k1;s=0;switch(this.rem){case 0:n^=v>s?f.charCodeAt(s++)&65535:0;case 1:n^=v>s?(f.charCodeAt(s++)&65535)<<8:0;case 2:n^=v>s?(f.charCodeAt(s++)&65535)<<16:0;case 3:n^=v>s?(f.charCodeAt(s)&255)<<24:0;n^=v>s?(f.charCodeAt(s++)&65280)>>8:0}this.rem=v+this.rem&3;v-=this.rem;if(v>0){e=this.h1;while(1){n=n*11601+(n&65535)*3432906752&4294967295;n=n<<15|n>>>17;n=n*13715+(n&65535)*461832192&4294967295;e^=n;e=e<<13|e>>>19;e=e*5+3864292196&4294967295;if(s>=v){break}n=f.charCodeAt(s++)&65535^(f.charCodeAt(s++)&65535)<<8^(f.charCodeAt(s++)&65535)<<16;l=f.charCodeAt(s++);n^=(l&255)<<24^(l&65280)>>8}n=0;switch(this.rem){case 3:n^=(f.charCodeAt(s+2)&65535)<<16;case 2:n^=(f.charCodeAt(s+1)&65535)<<8;case 1:n^=f.charCodeAt(s)&65535}this.h1=e}this.k1=n;return this};MurmurHash3.prototype.result=function(){var f,e;f=this.k1;e=this.h1;if(f>0){f=f*11601+(f&65535)*3432906752&4294967295;f=f<<15|f>>>17;f=f*13715+(f&65535)*461832192&4294967295;e^=f}e^=this.len;e^=e>>>16;e=e*51819+(e&65535)*2246770688&4294967295;e^=e>>>13;e=e*44597+(e&65535)*3266445312&4294967295;e^=e>>>16;return e>>>0};MurmurHash3.prototype.reset=function(f){this.h1=typeof f==="number"?f:0;this.rem=this.k1=this.len=0;return this};e=new MurmurHash3;if(true){f.exports=MurmurHash3}else{}})()},3010:f=>{f.exports=isTypedArray;isTypedArray.strict=isStrictTypedArray;isTypedArray.loose=isLooseTypedArray;var e=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function isTypedArray(f){return isStrictTypedArray(f)||isLooseTypedArray(f)}function isStrictTypedArray(f){return f instanceof Int8Array||f instanceof Int16Array||f instanceof Int32Array||f instanceof Uint8Array||f instanceof Uint8ClampedArray||f instanceof Uint16Array||f instanceof Uint32Array||f instanceof Float32Array||f instanceof Float64Array}function isLooseTypedArray(f){return n[e.call(f)]}},2437:f=>{"use strict";var e=f.exports=function(f,e,n){if(typeof e=="function"){n=e;e={}}n=e.cb||n;var s=typeof n=="function"?n:n.pre||function(){};var l=n.post||function(){};_traverse(e,s,l,f,"",f)};e.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true};e.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};e.propsKeywords={definitions:true,properties:true,patternProperties:true,dependencies:true};e.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function _traverse(f,n,s,l,v,r,b,g,w,j){if(l&&typeof l=="object"&&!Array.isArray(l)){n(l,v,r,b,g,w,j);for(var d in l){var E=l[d];if(Array.isArray(E)){if(d in e.arrayKeywords){for(var R=0;R{"use strict";const s=n(5747);const l=n(5622);const{promisify:v}=n(1669);const r=n(2519);const b=r.satisfies(process.version,">=10.12.0");const g=f=>{if(process.platform==="win32"){const e=/[<>:"|?*]/.test(f.replace(l.parse(f).root,""));if(e){const e=new Error(`Path contains invalid characters: ${f}`);e.code="EINVAL";throw e}}};const w=f=>{const e={mode:511&~process.umask(),fs:s};return{...e,...f}};const j=f=>{const e=new Error(`operation not permitted, mkdir '${f}'`);e.code="EPERM";e.errno=-4048;e.path=f;e.syscall="mkdir";return e};const d=async(f,e)=>{g(f);e=w(e);const n=v(e.fs.mkdir);const r=v(e.fs.stat);if(b&&e.fs.mkdir===s.mkdir){const s=l.resolve(f);await n(s,{mode:e.mode,recursive:true});return s}const d=async f=>{try{await n(f,e.mode);return f}catch(e){if(e.code==="EPERM"){throw e}if(e.code==="ENOENT"){if(l.dirname(f)===f){throw j(f)}if(e.message.includes("null bytes")){throw e}await d(l.dirname(f));return d(f)}try{const n=await r(f);if(!n.isDirectory()){throw new Error("The path is not a directory")}}catch(f){throw e}return f}};return d(l.resolve(f))};f.exports=d;f.exports.sync=((f,e)=>{g(f);e=w(e);if(b&&e.fs.mkdirSync===s.mkdirSync){const n=l.resolve(f);s.mkdirSync(n,{mode:e.mode,recursive:true});return n}const n=f=>{try{e.fs.mkdirSync(f,e.mode)}catch(s){if(s.code==="EPERM"){throw s}if(s.code==="ENOENT"){if(l.dirname(f)===f){throw j(f)}if(s.message.includes("null bytes")){throw s}n(l.dirname(f));return n(f)}try{if(!e.fs.statSync(f).isDirectory()){throw new Error("The path is not a directory")}}catch(f){throw s}}return f};return n(l.resolve(f))})},6536:(f,e,n)=>{"use strict";const s=n(4442);f.exports=(async({cwd:f}={})=>s("package.json",{cwd:f}));f.exports.sync=(({cwd:f}={})=>s.sync("package.json",{cwd:f}))},2317:(f,e,n)=>{var s=n(2357);var l=n(2935);var v=n(8614);if(typeof v!=="function"){v=v.EventEmitter}var r;if(process.__signal_exit_emitter__){r=process.__signal_exit_emitter__}else{r=process.__signal_exit_emitter__=new v;r.count=0;r.emitted={}}if(!r.infinite){r.setMaxListeners(Infinity);r.infinite=true}f.exports=function(f,e){s.equal(typeof f,"function","a callback must be provided for exit handler");if(g===false){load()}var n="exit";if(e&&e.alwaysLast){n="afterexit"}var l=function(){r.removeListener(n,f);if(r.listeners("exit").length===0&&r.listeners("afterexit").length===0){unload()}};r.on(n,f);return l};f.exports.unload=unload;function unload(){if(!g){return}g=false;l.forEach(function(f){try{process.removeListener(f,b[f])}catch(f){}});process.emit=j;process.reallyExit=w;r.count-=1}function emit(f,e,n){if(r.emitted[f]){return}r.emitted[f]=true;r.emit(f,e,n)}var b={};l.forEach(function(f){b[f]=function listener(){var e=process.listeners(f);if(e.length===r.count){unload();emit("exit",null,f);emit("afterexit",null,f);process.kill(process.pid,f)}}});f.exports.signals=function(){return l};f.exports.load=load;var g=false;function load(){if(g){return}g=true;r.count+=1;l=l.filter(function(f){try{process.on(f,b[f]);return true}catch(f){return false}});process.emit=processEmit;process.reallyExit=processReallyExit}var w=process.reallyExit;function processReallyExit(f){process.exitCode=f||0;emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);w.call(process,process.exitCode)}var j=process.emit;function processEmit(f,e){if(f==="exit"){if(e!==undefined){process.exitCode=e}var n=j.apply(this,arguments);emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);return n}else{return j.apply(this,arguments)}}},2935:f=>{f.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){f.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){f.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},4005:(f,e,n)=>{var s=n(3010).strict;f.exports=function typedarrayToBuffer(f){if(s(f)){var e=Buffer.from(f.buffer);if(f.byteLength!==f.buffer.byteLength){e=e.slice(f.byteOffset,f.byteOffset+f.byteLength)}return e}else{return Buffer.from(f)}}},4007:function(f,e){(function(f,n){true?n(e):0})(this,function(f){"use strict";function merge(){for(var f=arguments.length,e=Array(f),n=0;n1){e[0]=e[0].slice(0,-1);var s=e.length-1;for(var l=1;l= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var x=r-b;var z=Math.floor;var U=String.fromCharCode;function error$1(f){throw new RangeError(I[f])}function map(f,e){var n=[];var s=f.length;while(s--){n[s]=e(f[s])}return n}function mapDomain(f,e){var n=f.split("@");var s="";if(n.length>1){s=n[0]+"@";f=n[1]}f=f.replace(p,".");var l=f.split(".");var v=map(l,e).join(".");return s+v}function ucs2decode(f){var e=[];var n=0;var s=f.length;while(n=55296&&l<=56319&&n>1;f+=z(f/e);for(;f>x*g>>1;s+=r){f=z(f/x)}return z(s+(x+1)*f/(f+w))};var C=function decode(f){var e=[];var n=f.length;var s=0;var l=E;var w=d;var j=f.lastIndexOf(R);if(j<0){j=0}for(var A=0;A=128){error$1("not-basic")}e.push(f.charCodeAt(A))}for(var F=j>0?j+1:0;F=n){error$1("invalid-input")}var U=Q(f.charCodeAt(F++));if(U>=r||U>z((v-s)/I)){error$1("overflow")}s+=U*I;var N=x<=w?b:x>=w+g?g:x-w;if(Uz(v/q)){error$1("overflow")}I*=q}var C=e.length+1;w=O(s-p,C,p==0);if(z(s/C)>v-l){error$1("overflow")}l+=z(s/C);s%=C;e.splice(s++,0,l)}return String.fromCodePoint.apply(String,e)};var L=function encode(f){var e=[];f=ucs2decode(f);var n=f.length;var s=E;var l=0;var w=d;var j=true;var A=false;var F=undefined;try{for(var p=f[Symbol.iterator](),I;!(j=(I=p.next()).done);j=true){var x=I.value;if(x<128){e.push(U(x))}}}catch(f){A=true;F=f}finally{try{if(!j&&p.return){p.return()}}finally{if(A){throw F}}}var N=e.length;var Q=N;if(N){e.push(R)}while(Q=s&&Xz((v-l)/M)){error$1("overflow")}l+=(C-s)*M;s=C;var Y=true;var W=false;var B=undefined;try{for(var c=f[Symbol.iterator](),Z;!(Y=(Z=c.next()).done);Y=true){var D=Z.value;if(Dv){error$1("overflow")}if(D==s){var K=l;for(var V=r;;V+=r){var y=V<=w?b:V>=w+g?g:V-w;if(K>6|192).toString(16).toUpperCase()+"%"+(e&63|128).toString(16).toUpperCase();else n="%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(e&63|128).toString(16).toUpperCase();return n}function pctDecChars(f){var e="";var n=0;var s=f.length;while(n=194&&l<224){if(s-n>=6){var v=parseInt(f.substr(n+4,2),16);e+=String.fromCharCode((l&31)<<6|v&63)}else{e+=f.substr(n,6)}n+=6}else if(l>=224){if(s-n>=9){var r=parseInt(f.substr(n+4,2),16);var b=parseInt(f.substr(n+7,2),16);e+=String.fromCharCode((l&15)<<12|(r&63)<<6|b&63)}else{e+=f.substr(n,9)}n+=9}else{e+=f.substr(n,3);n+=3}}return e}function _normalizeComponentEncoding(f,e){function decodeUnreserved(f){var n=pctDecChars(f);return!n.match(e.UNRESERVED)?f:n}if(f.scheme)f.scheme=String(f.scheme).replace(e.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(e.NOT_SCHEME,"");if(f.userinfo!==undefined)f.userinfo=String(f.userinfo).replace(e.PCT_ENCODED,decodeUnreserved).replace(e.NOT_USERINFO,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);if(f.host!==undefined)f.host=String(f.host).replace(e.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(e.NOT_HOST,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);if(f.path!==undefined)f.path=String(f.path).replace(e.PCT_ENCODED,decodeUnreserved).replace(f.scheme?e.NOT_PATH:e.NOT_PATH_NOSCHEME,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);if(f.query!==undefined)f.query=String(f.query).replace(e.PCT_ENCODED,decodeUnreserved).replace(e.NOT_QUERY,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);if(f.fragment!==undefined)f.fragment=String(f.fragment).replace(e.PCT_ENCODED,decodeUnreserved).replace(e.NOT_FRAGMENT,pctEncChar).replace(e.PCT_ENCODED,toUpperCase);return f}function _stripLeadingZeros(f){return f.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(f,e){var n=f.match(e.IPV4ADDRESS)||[];var l=s(n,2),v=l[1];if(v){return v.split(".").map(_stripLeadingZeros).join(".")}else{return f}}function _normalizeIPv6(f,e){var n=f.match(e.IPV6ADDRESS)||[];var l=s(n,3),v=l[1],r=l[2];if(v){var b=v.toLowerCase().split("::").reverse(),g=s(b,2),w=g[0],j=g[1];var d=j?j.split(":").map(_stripLeadingZeros):[];var E=w.split(":").map(_stripLeadingZeros);var R=e.IPV4ADDRESS.test(E[E.length-1]);var A=R?7:8;var F=E.length-A;var p=Array(A);for(var I=0;I1){var N=p.slice(0,z.index);var Q=p.slice(z.index+z.length);U=N.join(":")+"::"+Q.join(":")}else{U=p.join(":")}if(r){U+="%"+r}return U}else{return f}}var X=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var M="".match(/(){0}/)[1]===undefined;function parse(f){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var l={};var v=s.iri!==false?n:e;if(s.reference==="suffix")f=(s.scheme?s.scheme+":":"")+"//"+f;var r=f.match(X);if(r){if(M){l.scheme=r[1];l.userinfo=r[3];l.host=r[4];l.port=parseInt(r[5],10);l.path=r[6]||"";l.query=r[7];l.fragment=r[8];if(isNaN(l.port)){l.port=r[5]}}else{l.scheme=r[1]||undefined;l.userinfo=f.indexOf("@")!==-1?r[3]:undefined;l.host=f.indexOf("//")!==-1?r[4]:undefined;l.port=parseInt(r[5],10);l.path=r[6]||"";l.query=f.indexOf("?")!==-1?r[7]:undefined;l.fragment=f.indexOf("#")!==-1?r[8]:undefined;if(isNaN(l.port)){l.port=f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?r[4]:undefined}}if(l.host){l.host=_normalizeIPv6(_normalizeIPv4(l.host,v),v)}if(l.scheme===undefined&&l.userinfo===undefined&&l.host===undefined&&l.port===undefined&&!l.path&&l.query===undefined){l.reference="same-document"}else if(l.scheme===undefined){l.reference="relative"}else if(l.fragment===undefined){l.reference="absolute"}else{l.reference="uri"}if(s.reference&&s.reference!=="suffix"&&s.reference!==l.reference){l.error=l.error||"URI is not a "+s.reference+" reference."}var b=H[(s.scheme||l.scheme||"").toLowerCase()];if(!s.unicodeSupport&&(!b||!b.unicodeSupport)){if(l.host&&(s.domainHost||b&&b.domainHost)){try{l.host=G.toASCII(l.host.replace(v.PCT_ENCODED,pctDecChars).toLowerCase())}catch(f){l.error=l.error||"Host's domain name can not be converted to ASCII via punycode: "+f}}_normalizeComponentEncoding(l,e)}else{_normalizeComponentEncoding(l,v)}if(b&&b.parse){b.parse(l,s)}}else{l.error=l.error||"URI can not be parsed."}return l}function _recomposeAuthority(f,s){var l=s.iri!==false?n:e;var v=[];if(f.userinfo!==undefined){v.push(f.userinfo);v.push("@")}if(f.host!==undefined){v.push(_normalizeIPv6(_normalizeIPv4(String(f.host),l),l).replace(l.IPV6ADDRESS,function(f,e,n){return"["+e+(n?"%25"+n:"")+"]"}))}if(typeof f.port==="number"){v.push(":");v.push(f.port.toString(10))}return v.length?v.join(""):undefined}var Y=/^\.\.?\//;var W=/^\/\.(\/|$)/;var B=/^\/\.\.(\/|$)/;var c=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(f){var e=[];while(f.length){if(f.match(Y)){f=f.replace(Y,"")}else if(f.match(W)){f=f.replace(W,"/")}else if(f.match(B)){f=f.replace(B,"/");e.pop()}else if(f==="."||f===".."){f=""}else{var n=f.match(c);if(n){var s=n[0];f=f.slice(s.length);e.push(s)}else{throw new Error("Unexpected dot segment condition")}}}return e.join("")}function serialize(f){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var l=s.iri?n:e;var v=[];var r=H[(s.scheme||f.scheme||"").toLowerCase()];if(r&&r.serialize)r.serialize(f,s);if(f.host){if(l.IPV6ADDRESS.test(f.host)){}else if(s.domainHost||r&&r.domainHost){try{f.host=!s.iri?G.toASCII(f.host.replace(l.PCT_ENCODED,pctDecChars).toLowerCase()):G.toUnicode(f.host)}catch(e){f.error=f.error||"Host's domain name can not be converted to "+(!s.iri?"ASCII":"Unicode")+" via punycode: "+e}}}_normalizeComponentEncoding(f,l);if(s.reference!=="suffix"&&f.scheme){v.push(f.scheme);v.push(":")}var b=_recomposeAuthority(f,s);if(b!==undefined){if(s.reference!=="suffix"){v.push("//")}v.push(b);if(f.path&&f.path.charAt(0)!=="/"){v.push("/")}}if(f.path!==undefined){var g=f.path;if(!s.absolutePath&&(!r||!r.absolutePath)){g=removeDotSegments(g)}if(b===undefined){g=g.replace(/^\/\//,"/%2F")}v.push(g)}if(f.query!==undefined){v.push("?");v.push(f.query)}if(f.fragment!==undefined){v.push("#");v.push(f.fragment)}return v.join("")}function resolveComponents(f,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var s=arguments[3];var l={};if(!s){f=parse(serialize(f,n),n);e=parse(serialize(e,n),n)}n=n||{};if(!n.tolerant&&e.scheme){l.scheme=e.scheme;l.userinfo=e.userinfo;l.host=e.host;l.port=e.port;l.path=removeDotSegments(e.path||"");l.query=e.query}else{if(e.userinfo!==undefined||e.host!==undefined||e.port!==undefined){l.userinfo=e.userinfo;l.host=e.host;l.port=e.port;l.path=removeDotSegments(e.path||"");l.query=e.query}else{if(!e.path){l.path=f.path;if(e.query!==undefined){l.query=e.query}else{l.query=f.query}}else{if(e.path.charAt(0)==="/"){l.path=removeDotSegments(e.path)}else{if((f.userinfo!==undefined||f.host!==undefined||f.port!==undefined)&&!f.path){l.path="/"+e.path}else if(!f.path){l.path=e.path}else{l.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+e.path}l.path=removeDotSegments(l.path)}l.query=e.query}l.userinfo=f.userinfo;l.host=f.host;l.port=f.port}l.scheme=f.scheme}l.fragment=e.fragment;return l}function resolve(f,e,n){var s=assign({scheme:"null"},n);return serialize(resolveComponents(parse(f,s),parse(e,s),s,true),s)}function normalize(f,e){if(typeof f==="string"){f=serialize(parse(f,e),e)}else if(typeOf(f)==="object"){f=parse(serialize(f,e),e)}return f}function equal(f,e,n){if(typeof f==="string"){f=serialize(parse(f,n),n)}else if(typeOf(f)==="object"){f=serialize(f,n)}if(typeof e==="string"){e=serialize(parse(e,n),n)}else if(typeOf(e)==="object"){e=serialize(e,n)}return f===e}function escapeComponent(f,s){return f&&f.toString().replace(!s||!s.iri?e.ESCAPE:n.ESCAPE,pctEncChar)}function unescapeComponent(f,s){return f&&f.toString().replace(!s||!s.iri?e.PCT_ENCODED:n.PCT_ENCODED,pctDecChars)}var Z={scheme:"http",domainHost:true,parse:function parse(f,e){if(!f.host){f.error=f.error||"HTTP URIs must have a host."}return f},serialize:function serialize(f,e){if(f.port===(String(f.scheme).toLowerCase()!=="https"?80:443)||f.port===""){f.port=undefined}if(!f.path){f.path="/"}return f}};var D={scheme:"https",domainHost:Z.domainHost,parse:Z.parse,serialize:Z.serialize};var K={};var V=true;var y="[A-Za-z0-9\\-\\.\\_\\~"+(V?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var k="[0-9A-Fa-f]";var h=subexp(subexp("%[EFef]"+k+"%"+k+k+"%"+k+k)+"|"+subexp("%[89A-Fa-f]"+k+"%"+k+k)+"|"+subexp("%"+k+k));var a="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var S="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var m=merge(S,'[\\"\\\\]');var P="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var i=new RegExp(y,"g");var _=new RegExp(h,"g");var u=new RegExp(merge("[^]",a,"[\\.]",'[\\"]',m),"g");var o=new RegExp(merge("[^]",y,P),"g");var $=o;function decodeUnreserved(f){var e=pctDecChars(f);return!e.match(i)?f:e}var t={scheme:"mailto",parse:function parse$$1(f,e){var n=f;var s=n.to=n.path?n.path.split(","):[];n.path=undefined;if(n.query){var l=false;var v={};var r=n.query.split("&");for(var b=0,g=r.length;b{"use strict";f.exports=require("assert")},6417:f=>{"use strict";f.exports=require("crypto")},8614:f=>{"use strict";f.exports=require("events")},5747:f=>{"use strict";f.exports=require("fs")},4442:f=>{"use strict";f.exports=require("next/dist/compiled/find-up")},2519:f=>{"use strict";f.exports=require("next/dist/compiled/semver")},2087:f=>{"use strict";f.exports=require("os")},5622:f=>{"use strict";f.exports=require("path")},1669:f=>{"use strict";f.exports=require("util")},5013:f=>{"use strict";f.exports=require("worker_threads")}};var e={};function __nccwpck_require__(n){if(e[n]){return e[n].exports}var s=e[n]={id:n,loaded:false,exports:{}};var l=true;try{f[n].call(s.exports,s,s.exports,__nccwpck_require__);l=false}finally{if(l)delete e[n]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.nmd=(f=>{f.paths=[];if(!f.children)f.children=[];return f})})();__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(3331)})(); \ No newline at end of file diff --git a/packages/next/compiled/css-loader/cjs.js b/packages/next/compiled/css-loader/cjs.js index c399f60e8182..946ad30364b8 100644 --- a/packages/next/compiled/css-loader/cjs.js +++ b/packages/next/compiled/css-loader/cjs.js @@ -1 +1 @@ -module.exports=function(){var e={5455:function(e){"use strict";var t={};var r=t.hasOwnProperty;var i=function merge(e,t){if(!e){return t}var i={};for(var n in t){i[n]=r.call(e,n)?e[n]:t[n]}return i};var n=/[ -,\.\/:-@\[-\^`\{-~]/;var s=/[ -,\.\/:-@\[\]\^`\{-~]/;var o=/['"\\]/;var u=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var a=function cssesc(e,t){t=i(t,cssesc.options);if(t.quotes!="single"&&t.quotes!="double"){t.quotes="single"}var r=t.quotes=="double"?'"':"'";var o=t.isIdentifier;var a=e.charAt(0);var f="";var l=0;var c=e.length;while(l126){if(p>=55296&&p<=56319&&l{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const i=t.indexOf(r+e);const n=t.indexOf("--");return i!==-1&&(n===-1?true:i{return Object.keys(e).map(t=>{const r=e[t];const n=Object.keys(r).map(e=>i.default.decl({prop:e,value:r[e],raws:{before:"\n "}}));const s=n.length>0;const o=i.default.rule({selector:`:import('${t}')`,raws:{after:s?"\n":""}});if(s){o.append(n)}return o})};const s=e=>{const t=Object.keys(e).map(t=>i.default.decl({prop:t,value:e[t],raws:{before:"\n "}}));if(t.length===0){return[]}const r=i.default.rule({selector:`:export`,raws:{after:"\n"}}).append(t);return[r]};const o=(e,t)=>[...n(e),...s(t)];var u=o;t.default=u},2032:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;const r=/^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;const i=e=>{const t={};e.walkDecls(e=>{const r=e.raws.before?e.raws.before.trim():"";t[r+e.prop]=e.value});return t};const n=(e,t=true)=>{const n={};const s={};e.each(e=>{if(e.type==="rule"){if(e.selector.slice(0,7)===":import"){const s=r.exec(e.selector);if(s){const r=s[1].replace(/'|"/g,"");n[r]=Object.assign(n[r]||{},i(e));if(t){e.remove()}}}if(e.selector===":export"){Object.assign(s,i(e));if(t){e.remove()}}}});return{icssImports:n,icssExports:s}};var s=n;t.default=s},3656:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"replaceValueSymbols",{enumerable:true,get:function get(){return i.default}});Object.defineProperty(t,"replaceSymbols",{enumerable:true,get:function get(){return n.default}});Object.defineProperty(t,"extractICSS",{enumerable:true,get:function get(){return s.default}});Object.defineProperty(t,"createICSSRules",{enumerable:true,get:function get(){return o.default}});var i=_interopRequireDefault(r(621));var n=_interopRequireDefault(r(287));var s=_interopRequireDefault(r(2032));var o=_interopRequireDefault(r(1159));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},287:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var i=_interopRequireDefault(r(621));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const n=(e,t)=>{e.walk(e=>{if(e.type==="decl"&&e.value){e.value=(0,i.default)(e.value.toString(),t)}else if(e.type==="rule"&&e.selector){e.selector=(0,i.default)(e.selector.toString(),t)}else if(e.type==="atrule"&&e.params){e.params=(0,i.default)(e.params.toString(),t)}})};var s=n;t.default=s},621:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;const r=/[$]?[\w-]+/g;const i=(e,t)=>{let i;while(i=r.exec(e)){const n=t[i[0]];if(n){e=e.slice(0,i.index)+n+e.slice(r.lastIndex);r.lastIndex-=i[0].length-n.length}}return e};var n=i;t.default=n},4751:function(e){e.exports=function(e,t){var r=-1,i=[];while((r=e.indexOf(t,r+1))!==-1)i.push(r);return i}},1571:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(3509));var n=_interopRequireWildcard(r(4267));function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){var i=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};if(i.get||i.set){Object.defineProperty(t,r,i)}else{t[r]=e[r]}}}}t.default=e;return t}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function parser(e){return new i.default(e)};Object.assign(s,n);delete s.__esModule;var o=s;t.default=o;e.exports=t.default},6557:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(4751));var n=_interopRequireDefault(r(5632));var s=_interopRequireDefault(r(1682));var o=_interopRequireDefault(r(4955));var u=_interopRequireDefault(r(586));var a=_interopRequireDefault(r(6435));var f=_interopRequireDefault(r(1733));var l=_interopRequireDefault(r(5201));var c=_interopRequireDefault(r(1193));var h=_interopRequireDefault(r(716));var p=_interopRequireWildcard(r(7223));var d=_interopRequireDefault(r(3261));var v=_interopRequireDefault(r(1632));var g=_interopRequireDefault(r(8081));var m=_interopRequireDefault(r(5664));var y=_interopRequireWildcard(r(5648));var w=_interopRequireWildcard(r(7024));var b=_interopRequireWildcard(r(9107));var S=r(5431);var R,C;function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){var i=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};if(i.get||i.set){Object.defineProperty(t,r,i)}else{t[r]=e[r]}}}}t.default=e;return t}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){var i=this.current.last;if(i){var n=this.convertWhitespaceNodesToSpace(r),s=n.space,o=n.rawSpace;if(o!==undefined){i.rawSpaceAfter+=o}i.spaces.after+=s}else{r.forEach(function(t){return e.newNode(t)})}}return}var u=this.currToken;var a=undefined;if(t>this.position){a=this.parseWhitespaceEquivalentTokens(t)}var f;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[y.FIELDS.TYPE]===w.combinator){f=new v.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[y.FIELDS.START_POS]});this.position++}else if(O[this.currToken[y.FIELDS.TYPE]]){}else if(!a){this.unexpected()}if(f){if(a){var l=this.convertWhitespaceNodesToSpace(a),c=l.space,h=l.rawSpace;f.spaces.before=c;f.rawSpaceBefore=h}}else{var p=this.convertWhitespaceNodesToSpace(a,true),d=p.space,g=p.rawSpace;if(!g){g=d}var m={};var b={spaces:{}};if(d.endsWith(" ")&&g.endsWith(" ")){m.before=d.slice(0,d.length-1);b.spaces.before=g.slice(0,g.length-1)}else if(d.startsWith(" ")&&g.startsWith(" ")){m.after=d.slice(1);b.spaces.after=g.slice(1)}else{b.value=g}f=new v.default({value:" ",source:getTokenSourceSpan(u,this.tokens[this.position-1]),sourceIndex:u[y.FIELDS.START_POS],spaces:m,raws:b})}if(this.currToken&&this.currToken[y.FIELDS.TYPE]===w.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};e.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new o.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};e.comment=function comment(){var e=this.currToken;this.newNode(new a.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[y.FIELDS.START_POS]}));this.position++};e.error=function error(e,t){throw this.root.error(e,t)};e.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[y.FIELDS.START_POS]})};e.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[y.FIELDS.START_POS])};e.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[y.FIELDS.START_POS])};e.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[y.FIELDS.START_POS])};e.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[y.FIELDS.TYPE]===w.word){this.position++;return this.word(e)}else if(this.nextToken[y.FIELDS.TYPE]===w.asterisk){this.position++;return this.universal(e)}};e.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var t=this.currToken;this.newNode(new g.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[y.FIELDS.START_POS]}));this.position++};e.parentheses=function parentheses(){var e=this.current.last;var t=1;this.position++;if(e&&e.type===b.PSEUDO){var r=new o.default({source:{start:tokenStart(this.tokens[this.position-1])}});var i=this.current;e.append(r);this.current=r;while(this.position1&&e.nextToken&&e.nextToken[y.FIELDS.TYPE]===w.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[y.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[y.FIELDS.START_POS])}};e.space=function space(){var e=this.content();if(this.position===0||this.prevToken[y.FIELDS.TYPE]===w.comma||this.prevToken[y.FIELDS.TYPE]===w.openParenthesis||this.current.nodes.every(function(e){return e.type==="comment"})){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[y.FIELDS.TYPE]===w.comma||this.nextToken[y.FIELDS.TYPE]===w.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};e.string=function string(){var e=this.currToken;this.newNode(new c.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[y.FIELDS.START_POS]}));this.position++};e.universal=function universal(e){var t=this.nextToken;if(t&&this.content(t)==="|"){this.position++;return this.namespace()}var r=this.currToken;this.newNode(new d.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[y.FIELDS.START_POS]}),e);this.position++};e.splitWord=function splitWord(e,t){var r=this;var s=this.nextToken;var o=this.content();while(s&&~[w.dollar,w.caret,w.equals,w.word].indexOf(s[y.FIELDS.TYPE])){this.position++;var a=this.content();o+=a;if(a.lastIndexOf("\\")===a.length-1){var c=this.nextToken;if(c&&c[y.FIELDS.TYPE]===w.space){o+=this.requiredSpace(this.content(c));this.position++}}s=this.nextToken}var h=(0,i.default)(o,".").filter(function(e){return o[e-1]!=="\\"});var p=(0,i.default)(o,"#").filter(function(e){return o[e-1]!=="\\"});var d=(0,i.default)(o,"#{");if(d.length){p=p.filter(function(e){return!~d.indexOf(e)})}var v=(0,m.default)((0,n.default)([0].concat(h,p)));v.forEach(function(i,n){var s=v[n+1]||o.length;var a=o.slice(i,s);if(n===0&&t){return t.call(r,a,v.length)}var c;var d=r.currToken;var g=d[y.FIELDS.START_POS]+v[n];var m=getSource(d[1],d[2]+i,d[3],d[2]+(s-1));if(~h.indexOf(i)){var w={value:a.slice(1),source:m,sourceIndex:g};c=new u.default(unescapeProp(w,"value"))}else if(~p.indexOf(i)){var b={value:a.slice(1),source:m,sourceIndex:g};c=new f.default(unescapeProp(b,"value"))}else{var S={value:a,source:m,sourceIndex:g};unescapeProp(S,"value");c=new l.default(S)}r.newNode(c,e);e=null});this.position++};e.word=function word(e){var t=this.nextToken;if(t&&this.content(t)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};e.loop=function loop(){while(this.position0&&!e.quoted&&r.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){r.before=" "}return defaultAttrConcat(t,r)}))}t.push("]");t.push(this.rawSpaceAfter);return t.join("")};_createClass(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){c()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var t=unescapeValue(e),r=t.deprecatedUsage,i=t.unescaped,n=t.quoteMark;if(r){l()}if(i===this._value&&n===this._quoteMark){return}this._value=i;this._quoteMark=n;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(s.default);t.default=p;p.NO_QUOTE=null;p.SINGLE_QUOTE="'";p.DOUBLE_QUOTE='"';var d=(u={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},u[null]={isIdentifier:true},u);function defaultAttrConcat(e,t){return""+t.before+e+t.after}},586:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5455));var n=r(5431);var s=_interopRequireDefault(r(5731));var o=r(9107);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;n.parent=undefined}this.nodes=[];return this};t.empty=function empty(){return this.removeAll()};t.insertAfter=function insertAfter(e,t){t.parent=this;var r=this.index(e);this.nodes.splice(r+1,0,t);t.parent=this;var i;for(var n in this.indexes){i=this.indexes[n];if(r<=i){this.indexes[n]=i+1}}return this};t.insertBefore=function insertBefore(e,t){t.parent=this;var r=this.index(e);this.nodes.splice(r,0,t);t.parent=this;var i;for(var n in this.indexes){i=this.indexes[n];if(i<=r){this.indexes[n]=i+1}}return this};t._findChildAtPosition=function _findChildAtPosition(e,t){var r=undefined;this.each(function(i){if(i.atPosition){var n=i.atPosition(e,t);if(n){r=n;return false}}else if(i.isAtPosition(e,t)){r=i;return false}});return r};t.atPosition=function atPosition(e,t){if(this.isAtPosition(e,t)){return this._findChildAtPosition(e,t)||this}else{return undefined}};t._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};t.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var t=this.lastEach;this.indexes[t]=0;if(!this.length){return undefined}var r,i;while(this.indexes[t]e){return false}if(this.source.end.linet){return false}if(this.source.end.line===e&&this.source.end.column0){w=u+g;b=y-m[g].length}else{w=u;b=o}R=i.comment;u=w;p=w;h=y-b}else if(l===i.slash){y=a;R=l;p=u;h=a-o;f=y+1}else{y=consumeWord(r,a);R=i.word;p=u;h=y-o}f=y+1;break}t.push([R,u,a-o,p,h,a,f]);if(b){o=b;b=null}a=f}return t}},7378:function(e,t){"use strict";t.__esModule=true;t.default=ensureObject;function ensureObject(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i0){var n=r.shift();if(!e[n]){e[n]={}}e=e[n]}}e.exports=t.default},2585:function(e,t){"use strict";t.__esModule=true;t.default=getProp;function getProp(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i0){var n=r.shift();if(!e[n]){return undefined}e=e[n]}return e}e.exports=t.default},5431:function(e,t,r){"use strict";t.__esModule=true;t.stripComments=t.ensureObject=t.getProp=t.unesc=void 0;var i=_interopRequireDefault(r(8127));t.unesc=i.default;var n=_interopRequireDefault(r(2585));t.getProp=n.default;var s=_interopRequireDefault(r(7378));t.ensureObject=s.default;var o=_interopRequireDefault(r(4585));t.stripComments=o.default;function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},4585:function(e,t){"use strict";t.__esModule=true;t.default=stripComments;function stripComments(e){var t="";var r=e.indexOf("/*");var i=0;while(r>=0){t=t+e.slice(i,r);var n=e.indexOf("*/",r+2);if(n<0){return t}i=n+2;r=e.indexOf("/*",i)}t=t+e.slice(i);return t}e.exports=t.default},8127:function(e,t){"use strict";t.__esModule=true;t.default=unesc;var r="[\\x20\\t\\r\\n\\f]";var i=new RegExp("\\\\([\\da-f]{1,6}"+r+"?|("+r+")|.)","ig");function unesc(e){return e.replace(i,function(e,t,r){var i="0x"+t-65536;return i!==i||r?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,i&1023|56320)})}e.exports=t.default},4217:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,i=new Array(r),n=0;n=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var i=this.normalize(t,this.nodes[e],r).reverse();for(var n=i,s=Array.isArray(n),o=0,n=s?n:n[Symbol.iterator]();;){var u;if(s){if(o>=n.length)break;u=n[o++]}else{o=n.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+i.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var i=r,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(s>=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;n.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(i){if(t.props&&t.props.indexOf(i.prop)===-1)return;if(t.fast&&i.value.indexOf(t.fast)===-1)return;i.value=i.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(3749);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new i.default(e)]}else if(e.selector){var m=r(7797);e=[new m(e)]}else if(e.name){var y=r(4217);e=[new y(e)]}else if(e.text){e=[new n.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},9535:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(8327));var n=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(8300));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var i=[null];i.push.apply(i,t);var n=Function.bind.apply(e,i);var s=new n;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,i,n,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(n){u.source=n}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof i!=="undefined"){u.line=r;u.column=i}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=i.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&n.default.red){return n.default.red.bold(t)}return t}function aside(t){if(e&&n.default.gray){return n.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var i=u+1+r;var n=" "+(" "+i).slice(-f)+" | ";if(i===t.line){var s=aside(n.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(n)+e+"\n "+s+mark("^")}return" "+aside(n)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},3605:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(1497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(i.default);var s=n;t.default=s;e.exports=t.default},4905:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5622));var n=_interopRequireDefault(r(9535));var s=_interopRequireDefault(r(2713));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,i){if(i===void 0){i={}}var s;var o=this.origin(t,r);if(o){s=new n.default(e,o.line,o.column,o.source,o.file,i.plugin)}else{s=new n.default(e,t,r,this.css,this.file,i.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var i=r.originalPositionFor({line:e,column:t});if(!i.source)return false;var n={file:this.mapResolve(i.source),line:i.line,column:i.column};var s=r.sourceContentFor(i.source);if(s)n.source=s;return n};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return i.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},1169:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(3595));var n=_interopRequireDefault(r(7549));var s=_interopRequireDefault(r(3831));var o=_interopRequireDefault(r(7613));var u=_interopRequireDefault(r(3749));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+n+", but "+r+" uses "+i+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var i=this.processor.plugins[this.plugin];var n=this.run(i);this.plugin+=1;if(isPromise(n)){n.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,i);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;var s=this.run(n);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=n.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new i.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},7009:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var i=[];var n="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(n!=="")i.push(n.trim());n="";split=false}else{n+=f}}if(r||n!=="")i.push(n.trim());return i},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var i=r;t.default=i;e.exports=t.default},3595:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6241));var n=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var i=r.source.input.from;if(i&&!t[i]){t[i]=true;var n=e.relative(i);e.map.setSourceContent(n,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||n.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new i.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?n.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=n.default.dirname(n.default.resolve(t,this.mapOpts.annotation))}e=n.default.relative(t,e);if(n.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new i.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var n,s;this.stringify(this.root,function(i,o,u){e.css+=i;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}n=i.match(/\n/g);if(n){t+=n.length;s=i.lastIndexOf("\n");r=i.length-s}else{r+=i.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},1497:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9535));var n=_interopRequireDefault(r(3935));var s=_interopRequireDefault(r(7549));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var i in e){if(!e.hasOwnProperty(i))continue;var n=e[i];var s=typeof n;if(i==="parent"&&s==="object"){if(t)r[i]=t}else if(i==="source"){r[i]=n}else if(n instanceof Array){r[i]=n.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&n!==null)n=cloneNode(n);r[i]=n}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new i.default(e)};e.warn=function warn(e,t,r){var i={node:this};for(var n in r){i[n]=r[n]}return e.warn(t,i)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(n);if(t&&i){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new i.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var n=e[0][0];if(n===":"||n==="space"||n==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var i;var n=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){i=u.length-1;r=u[i];while(r&&r[0]==="space"){r=u[--i]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){n=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(n){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var i,n;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;n--){i=e[n];if(i[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",i[2],i[3])};return Parser}();t.default=f;e.exports=t.default},4633:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(3605));var n=_interopRequireDefault(r(8074));var s=_interopRequireDefault(r(7549));var o=_interopRequireDefault(r(8259));var u=_interopRequireDefault(r(4217));var a=_interopRequireDefault(r(216));var f=_interopRequireDefault(r(3749));var l=_interopRequireDefault(r(7009));var c=_interopRequireDefault(r(7797));var h=_interopRequireDefault(r(5907));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var i="data:application/json,";if(this.startWith(e,i)){return decodeURIComponent(e.substr(i.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof i.default.SourceMapConsumer){return i.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof i.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=n.default.join(n.default.dirname(e),o);this.root=n.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},8074:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(1169));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var n=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new i.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=n;t.default=s;e.exports=t.default},7613:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(7338));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[i].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,i){var n=e.prototype.normalize.call(this,t);if(r){if(i==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=n,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return n};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(1169);var i=r(8074);var n=new t(new i,this,e);return n.stringify()};return Root}(i.default);var s=n;t.default=s;e.exports=t.default},7797:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5878));var n=_interopRequireDefault(r(7009));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var i=0;i0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var i=e.parent;var n=0;while(i&&i.type!=="root"){n+=1;i=i.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;E=D.charCodeAt(G);if(E===o||E===a||E===l&&D.charCodeAt(G+1)!==o){W=G;V+=1}switch(E){case o:case u:case f:case l:case a:M=G;do{M+=1;E=D.charCodeAt(M);if(E===o){W=M;V+=1}}while(E===u||E===o||E===f||E===l||E===a);z=["space",D.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var Q=String.fromCharCode(E);z=[Q,Q,V,G-W];break;case p:x=Y.length?Y.pop()[1]:"";$=D.charCodeAt(G+1);if(x==="url"&&$!==r&&$!==i&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=D.indexOf(")",M+1);if(M===-1){if(A||t){M=G;break}else{unclosed("bracket")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);z=["brackets",D.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=D.indexOf(")",G+1);F=D.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case i:q=E===r?"'":'"';M=G;do{j=false;M=D.indexOf(q,M+1);if(M===-1){if(A||t){M=G+1;break}else{unclosed("string")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["string",D.slice(G,M+1),V,G-W,N,M-L];W=L;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(D);if(S.lastIndex===0){M=D.length-1}else{M=S.lastIndex-2}z=["at-word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;case n:M=G;k=true;while(D.charCodeAt(M+1)===n){M+=1;k=!k}E=D.charCodeAt(M+1);if(k&&E!==s&&E!==u&&E!==o&&E!==f&&E!==l&&E!==a){M+=1;if(O.test(D.charAt(M))){while(O.test(D.charAt(M+1))){M+=1}if(D.charCodeAt(M+1)===u){M+=1}}}z=["word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(E===s&&D.charCodeAt(G+1)===y){M=D.indexOf("*/",G+2)+1;if(M===0){if(A||t){M=D.length}else{unclosed("comment")}}F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["comment",F,V,G-W,N,M-L];W=L;V=N;G=M}else{R.lastIndex=G+1;R.test(D);if(R.lastIndex===0){M=D.length-1}else{M=R.lastIndex-2}z=["word",D.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},216:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var i=r;t.default=i;e.exports=t.default},3831:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},7338:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var i in t){this[i]=t[i]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var i=r;t.default=i;e.exports=t.default},8327:function(e,t,r){"use strict";const i=r(2087);const n=r(8379);const{env:s}=process;let o;if(n("no-color")||n("no-colors")||n("color=false")||n("color=never")){o=0}else if(n("color")||n("colors")||n("color=true")||n("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(n("color=16m")||n("color=full")||n("color=truecolor")){return 3}if(n("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=i.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},5632:function(e){"use strict";function unique_pred(e,t){var r=1,i=e.length,n=e[0],s=e[0];for(var o=1;o{let r=false;let i=false;let n=false;for(let s=0;s{return e.replace(/^[\p{Lu}](?![\p{Lu}])/gu,e=>e.toLowerCase())};const i=(e,t)=>{return e.replace(/[_.\- ]+([\p{Alpha}\p{N}_]|$)/gu,(e,r)=>r.toLocaleUpperCase(t.locale)).replace(/\d+([\p{Alpha}\p{N}_]|$)/gu,e=>e.toLocaleUpperCase(t.locale))};const n=(e,n)=>{if(!(typeof e==="string"||Array.isArray(e))){throw new TypeError("Expected the input to be `string | string[]`")}n={pascalCase:false,preserveConsecutiveUppercase:false,...n};if(Array.isArray(e)){e=e.map(e=>e.trim()).filter(e=>e.length).join("-")}else{e=e.trim()}if(e.length===0){return""}if(e.length===1){return n.pascalCase?e.toLocaleUpperCase(n.locale):e.toLocaleLowerCase(n.locale)}const s=e!==e.toLocaleLowerCase(n.locale);if(s){e=t(e,n.locale)}e=e.replace(/^[_.\- ]+/,"");if(n.preserveConsecutiveUppercase){e=r(e)}else{e=e.toLocaleLowerCase()}if(n.pascalCase){e=e.charAt(0).toLocaleUpperCase(n.locale)+e.slice(1)}return i(e,n)};e.exports=n;e.exports.default=n},6124:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;class CssSyntaxError extends Error{constructor(e){super(e);const{reason:t,line:r,column:i}=e;this.name="CssSyntaxError";this.message=`${this.name}\n\n`;if(typeof r!=="undefined"){this.message+=`(${r}:${i}) `}this.message+=`${t}`;const n=e.showSourceCode();if(n){this.message+=`\n\n${n}\n`}this.stack=false}}t.default=CssSyntaxError},8363:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;class Warning extends Error{constructor(e){super(e);const{text:t,line:r,column:i}=e;this.name="Warning";this.message=`${this.name}\n\n`;if(typeof r!=="undefined"){this.message+=`(${r}:${i}) `}this.message+=`${t}`;this.stack=false}}t.default=Warning},7583:function(e,t,r){"use strict";const i=r(5462);e.exports=i.default},5462:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=loader;var i=r(3443);var n=_interopRequireDefault(r(66));var s=_interopRequireDefault(r(5976));var o=_interopRequireDefault(r(3225));var u=r(2519);var a=_interopRequireDefault(r(6124));var f=_interopRequireDefault(r(8363));var l=_interopRequireDefault(r(8735));var c=r(6780);var h=r(2474);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}async function loader(e,t,p){const d=(0,i.getOptions)(this);(0,o.default)(l.default,d,{name:"CSS Loader",baseDataPath:"options"});const v=[];const g=this.async();let m;try{m=(0,h.normalizeOptions)(d,this)}catch(e){g(e);return}const y=[];const w=[];if((0,h.shouldUseModulesPlugins)(m)){v.push(...(0,h.getModulesPlugins)(m,this))}const b=[];const S=[];if((0,h.shouldUseImportPlugin)(m)){const e=this.getResolve({conditionNames:["style"],extensions:[".css"],mainFields:["css","style","main","..."],mainFiles:["index","..."],restrictions:[/\.css$/i]});v.push((0,c.importParser)({imports:b,api:S,context:this.context,rootContext:this.rootContext,filter:(0,h.getFilter)(m.import,this.resourcePath),resolver:e,urlHandler:e=>(0,i.stringifyRequest)(this,(0,h.getPreRequester)(this)(m.importLoaders)+e)}))}const R=[];if((0,h.shouldUseURLPlugin)(m)){const e=this.getResolve({conditionNames:["asset"],mainFields:["asset"],mainFiles:[],extensions:[]});v.push((0,c.urlParser)({imports:R,replacements:y,context:this.context,rootContext:this.rootContext,filter:(0,h.getFilter)(m.url,this.resourcePath),resolver:e,urlHandler:e=>(0,i.stringifyRequest)(this,e)}))}const C=[];const O=[];if((0,h.shouldUseIcssPlugin)(m)){const e=this.getResolve({conditionNames:["style"],extensions:[],mainFields:["css","style","main","..."],mainFiles:["index","..."]});v.push((0,c.icssParser)({imports:C,api:O,replacements:y,exports:w,context:this.context,rootContext:this.rootContext,resolver:e,urlHandler:e=>(0,i.stringifyRequest)(this,(0,h.getPreRequester)(this)(m.importLoaders)+e)}))}if(p){const{ast:t}=p;if(t&&t.type==="postcss"&&(0,u.satisfies)(t.version,`^${s.default.version}`)){e=t.root}}const{resourcePath:D}=this;let A;try{A=await(0,n.default)(v).process(e,{from:D,to:D,map:m.sourceMap?{prev:t?(0,h.normalizeSourceMap)(t,D):null,inline:false,annotation:false}:false})}catch(e){if(e.file){this.addDependency(e.file)}g(e.name==="CssSyntaxError"?new a.default(e):e);return}for(const e of A.warnings()){this.emitWarning(new f.default(e))}const E=[].concat(C.sort(h.sort)).concat(b.sort(h.sort)).concat(R.sort(h.sort));const M=[].concat(S.sort(h.sort)).concat(O.sort(h.sort));if(m.modules.exportOnlyLocals!==true){E.unshift({importName:"___CSS_LOADER_API_IMPORT___",url:(0,i.stringifyRequest)(this,r.ab+"api.js")})}const q=(0,h.getImportCode)(E,m);const T=(0,h.getModuleCode)(A,M,y,m,this);const I=(0,h.getExportCode)(w,y,m);g(null,`${q}${T}${I}`)}},6780:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"importParser",{enumerable:true,get:function(){return i.default}});Object.defineProperty(t,"icssParser",{enumerable:true,get:function(){return n.default}});Object.defineProperty(t,"urlParser",{enumerable:true,get:function(){return s.default}});var i=_interopRequireDefault(r(9063));var n=_interopRequireDefault(r(9454));var s=_interopRequireDefault(r(7097));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},9454:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var i=_interopRequireDefault(r(66));var n=r(3656);var s=r(2474);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o=i.default.plugin("postcss-icss-parser",e=>async t=>{const r=Object.create(null);const{icssImports:i,icssExports:o}=(0,n.extractICSS)(t);const u=new Map;const a=[];for(const t in i){const r=i[t];if(Object.keys(r).length===0){continue}let n=t;let o="";const u=n.split("!");if(u.length>1){n=u.pop();o=u.join("!")}const f=(0,s.requestify)((0,s.normalizeUrl)(n,true),e.rootContext);const l=async()=>{const{resolver:t,context:i}=e;const u=await(0,s.resolveRequests)(t,i,[...new Set([n,f])]);return{url:u,prefix:o,tokens:r}};a.push(l())}const f=await Promise.all(a);for(let t=0;t<=f.length-1;t++){const{url:i,prefix:n,tokens:s}=f[t];const o=n?`${n}!${i}`:i;const a=o;let l=u.get(a);if(!l){l=`___CSS_LOADER_ICSS_IMPORT_${u.size}___`;u.set(a,l);e.imports.push({importName:l,url:e.urlHandler(o),icss:true,index:t});e.api.push({importName:l,dedupe:true,index:t})}for(const[i,n]of Object.keys(s).entries()){const o=`___CSS_LOADER_ICSS_IMPORT_${t}_REPLACEMENT_${i}___`;const u=s[n];r[n]=o;e.replacements.push({replacementName:o,importName:l,localName:u})}}if(Object.keys(r).length>0){(0,n.replaceSymbols)(t,r)}for(const t of Object.keys(o)){const i=(0,n.replaceValueSymbols)(o[t],r);e.exports.push({name:t,value:i})}});t.default=o},9063:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var i=r(1669);var n=_interopRequireDefault(r(66));var s=_interopRequireDefault(r(9285));var o=r(2474);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const u="postcss-import-parser";function walkAtRules(e,t,r,i){const n=[];e.walkAtRules(/^import$/i,e=>{if(e.parent.type!=="root"){return}if(e.nodes){t.warn("It looks like you didn't end your @import statement correctly. Child nodes are attached to it.",{node:e});return}const{nodes:r}=(0,s.default)(e.params);if(r.length===0||r[0].type!=="string"&&r[0].type!=="function"){t.warn(`Unable to find uri in "${e.toString()}"`,{node:e});return}let i;let o;if(r[0].type==="string"){i=true;o=r[0].value}else{if(r[0].value.toLowerCase()!=="url"){t.warn(`Unable to find uri in "${e.toString()}"`,{node:e});return}i=r[0].nodes.length!==0&&r[0].nodes[0].type==="string";o=i?r[0].nodes[0].value:s.default.stringify(r[0].nodes)}if(o.trim().length===0){t.warn(`Unable to find uri in "${e.toString()}"`,{node:e});return}n.push({atRule:e,url:o,isStringValue:i,mediaNodes:r.slice(1)})});i(null,n)}const a=(0,i.promisify)(walkAtRules);var f=n.default.plugin(u,e=>async(t,r)=>{const i=await a(t,r,e);if(i.length===0){return Promise.resolve()}const n=new Map;const u=[];for(const t of i){const{atRule:i,url:n,isStringValue:a,mediaNodes:f}=t;let l=n;let c="";const h=(0,o.isUrlRequestable)(l);if(h){const e=l.split("!");if(e.length>1){l=e.pop();c=e.join("!")}l=(0,o.normalizeUrl)(l,a);if(l.trim().length===0){r.warn(`Unable to find uri in "${i.toString()}"`,{node:i});continue}}let p;if(f.length>0){p=s.default.stringify(f).trim().toLowerCase()}if(e.filter&&!e.filter(l,p)){continue}i.remove();if(h){const t=(0,o.requestify)(l,e.rootContext);u.push((async()=>{const{resolver:r,context:i}=e;const n=await(0,o.resolveRequests)(r,i,[...new Set([t,l])]);return{url:n,media:p,prefix:c,isRequestable:h}})())}else{u.push({url:n,media:p,prefix:c,isRequestable:h})}}const f=await Promise.all(u);for(let t=0;t<=f.length-1;t++){const{url:r,isRequestable:i,media:s}=f[t];if(i){const{prefix:i}=f[t];const o=i?`${i}!${r}`:r;const u=o;let a=n.get(u);if(!a){a=`___CSS_LOADER_AT_RULE_IMPORT_${n.size}___`;n.set(u,a);e.imports.push({importName:a,url:e.urlHandler(o),index:t})}e.api.push({importName:a,media:s,index:t});continue}e.api.push({url:r,media:s,index:t})}return Promise.resolve()});t.default=f},7097:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var i=r(1669);var n=_interopRequireDefault(r(66));var s=_interopRequireDefault(r(9285));var o=r(2474);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const u="postcss-url-parser";const a=/url/i;const f=/^(?:-webkit-)?image-set$/i;const l=/(?:url|(?:-webkit-)?image-set)\(/i;function getNodeFromUrlFunc(e){return e.nodes&&e.nodes[0]}function shouldHandleRule(e,t,r){if(e.url.replace(/^[\s]+|[\s]+$/g,"").length===0){r.warn(`Unable to find uri in '${t.toString()}'`,{node:t});return false}if(!(0,o.isUrlRequestable)(e.url)){return false}return true}function walkCss(e,t,r,i){const n=[];e.walkDecls(e=>{if(!l.test(e.value)){return}const r=(0,s.default)(e.value);r.walk(i=>{if(i.type!=="function"){return}if(a.test(i.value)){const{nodes:o}=i;const u=o.length!==0&&o[0].type==="string";const a=u?o[0].value:s.default.stringify(o);const f={node:getNodeFromUrlFunc(i),url:a,needQuotes:false,isStringValue:u};if(shouldHandleRule(f,e,t)){n.push({decl:e,rule:f,parsed:r})}return false}else if(f.test(i.value)){for(const o of i.nodes){const{type:i,value:u}=o;if(i==="function"&&a.test(u)){const{nodes:i}=o;const u=i.length!==0&&i[0].type==="string";const a=u?i[0].value:s.default.stringify(i);const f={node:getNodeFromUrlFunc(o),url:a,needQuotes:false,isStringValue:u};if(shouldHandleRule(f,e,t)){n.push({decl:e,rule:f,parsed:r})}}else if(i==="string"){const i={node:o,url:u,needQuotes:true,isStringValue:true};if(shouldHandleRule(i,e,t)){n.push({decl:e,rule:i,parsed:r})}}}return false}})});i(null,n)}const c=(0,i.promisify)(walkCss);var h=n.default.plugin(u,e=>async(t,i)=>{const n=await c(t,i,e);if(n.length===0){return Promise.resolve()}const s=[];const u=new Map;const a=new Map;let f=false;for(const t of n){const{url:i,isStringValue:n}=t.rule;let u=i;let a="";const l=u.split("!");if(l.length>1){u=l.pop();a=l.join("!")}u=(0,o.normalizeUrl)(u,n);if(!e.filter(u)){continue}if(!f){e.imports.push({importName:"___CSS_LOADER_GET_URL_IMPORT___",url:e.urlHandler(r.ab+"getUrl.js"),index:-1});f=true}const c=u.split(/(\?)?#/);const[h,p,d]=c;let v=p?"?":"";v+=d?`#${d}`:"";const g=(0,o.requestify)(h,e.rootContext);s.push((async()=>{const{resolver:r,context:i}=e;const n=await(0,o.resolveRequests)(r,i,[...new Set([g,u])]);return{url:n,prefix:a,hash:v,parsedResult:t}})())}const l=await Promise.all(s);for(let t=0;t<=l.length-1;t++){const{url:r,prefix:i,hash:n,parsedResult:{decl:s,rule:o,parsed:f}}=l[t];const c=i?`${i}!${r}`:r;const h=c;let p=u.get(h);if(!p){p=`___CSS_LOADER_URL_IMPORT_${u.size}___`;u.set(h,p);e.imports.push({importName:p,url:e.urlHandler(c),index:t})}const{needQuotes:d}=o;const v=JSON.stringify({newUrl:c,hash:n,needQuotes:d});let g=a.get(v);if(!g){g=`___CSS_LOADER_URL_REPLACEMENT_${a.size}___`;a.set(v,g);e.replacements.push({replacementName:g,importName:p,hash:n,needQuotes:d})}o.node.type="word";o.node.value=g;s.value=f.toString()}return Promise.resolve()});t.default=h},2474:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.normalizeOptions=normalizeOptions;t.shouldUseModulesPlugins=shouldUseModulesPlugins;t.shouldUseImportPlugin=shouldUseImportPlugin;t.shouldUseURLPlugin=shouldUseURLPlugin;t.shouldUseIcssPlugin=shouldUseIcssPlugin;t.normalizeUrl=normalizeUrl;t.requestify=requestify;t.getFilter=getFilter;t.getModulesOptions=getModulesOptions;t.getModulesPlugins=getModulesPlugins;t.normalizeSourceMap=normalizeSourceMap;t.getPreRequester=getPreRequester;t.getImportCode=getImportCode;t.getModuleCode=getModuleCode;t.getExportCode=getExportCode;t.resolveRequests=resolveRequests;t.isUrlRequestable=isUrlRequestable;t.sort=sort;var i=r(8835);var n=_interopRequireDefault(r(5622));var s=r(3443);var o=_interopRequireDefault(r(5455));var u=_interopRequireDefault(r(4270));var a=_interopRequireDefault(r(1005));var f=_interopRequireDefault(r(4192));var l=_interopRequireDefault(r(7475));var c=_interopRequireDefault(r(1362));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const h="[\\x20\\t\\r\\n\\f]";const p=new RegExp(`\\\\([\\da-f]{1,6}${h}?|(${h})|.)`,"ig");const d=/^[A-Z]:[/\\]|^\\\\/i;function unescape(e){return e.replace(p,(e,t,r)=>{const i=`0x${t}`-65536;return i!==i||r?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,i&1023|56320)})}function normalizePath(e){return n.default.sep==="\\"?e.replace(/\\/g,"/"):e}const v=/[<>:"/\\|?*]/g;const g=/[\u0000-\u001f\u0080-\u009f]/g;function defaultGetLocalIdent(e,t,r,i){const{context:u,hashPrefix:a}=i;const{resourcePath:f}=e;const l=normalizePath(n.default.relative(u,f));i.content=`${a+l}\0${unescape(r)}`;return(0,o.default)((0,s.interpolateName)(e,t,i).replace(/^((-?[0-9])|--)/,"_$1").replace(v,"-").replace(g,"-").replace(/\./g,"-"),{isIdentifier:true}).replace(/\\\[local\\]/gi,r)}function normalizeUrl(e,t){let r=e;if(t&&/\\(\n|\r\n|\r|\f)/.test(r)){r=r.replace(/\\(\n|\r\n|\r|\f)/g,"")}if(d.test(e)){return decodeURIComponent(r)}return decodeURIComponent(unescape(r))}function requestify(e,t){if(/^file:/i.test(e)){return(0,i.fileURLToPath)(e)}return e.charAt(0)==="/"?(0,s.urlToRequest)(e,t):(0,s.urlToRequest)(e)}function getFilter(e,t){return(...r)=>{if(typeof e==="function"){return e(...r,t)}return true}}const m=/\.module\.\w+$/i;function getModulesOptions(e,t){const{resourcePath:r}=t;if(typeof e.modules==="undefined"){const e=m.test(r);if(!e){return false}}else if(typeof e.modules==="boolean"&&e.modules===false){return false}let i={compileType:e.icss?"icss":"module",auto:true,mode:"local",exportGlobals:false,localIdentName:"[hash:base64]",localIdentContext:t.rootContext,localIdentHashPrefix:"",localIdentRegExp:undefined,getLocalIdent:defaultGetLocalIdent,namedExport:false,exportLocalsConvention:"asIs",exportOnlyLocals:false};if(typeof e.modules==="boolean"||typeof e.modules==="string"){i.mode=typeof e.modules==="string"?e.modules:"local"}else{if(e.modules){if(typeof e.modules.auto==="boolean"){const t=e.modules.auto&&m.test(r);if(!t){return false}}else if(e.modules.auto instanceof RegExp){const t=e.modules.auto.test(r);if(!t){return false}}else if(typeof e.modules.auto==="function"){const t=e.modules.auto(r);if(!t){return false}}if(e.modules.namedExport===true&&typeof e.modules.exportLocalsConvention==="undefined"){i.exportLocalsConvention="camelCaseOnly"}}i={...i,...e.modules||{}}}if(typeof i.mode==="function"){i.mode=i.mode(t.resourcePath)}if(i.namedExport===true){if(e.esModule===false){throw new Error('The "modules.namedExport" option requires the "esModules" option to be enabled')}if(i.exportLocalsConvention!=="camelCaseOnly"){throw new Error('The "modules.namedExport" option requires the "modules.exportLocalsConvention" option to be "camelCaseOnly"')}}return i}function normalizeOptions(e,t){if(e.icss){t.emitWarning(new Error('The "icss" option is deprecated, use "modules.compileType: "icss"" instead'))}const r=getModulesOptions(e,t);return{url:typeof e.url==="undefined"?true:e.url,import:typeof e.import==="undefined"?true:e.import,modules:r,icss:typeof e.icss==="undefined"?false:e.icss,sourceMap:typeof e.sourceMap==="boolean"?e.sourceMap:t.sourceMap,importLoaders:typeof e.importLoaders==="string"?parseInt(e.importLoaders,10):e.importLoaders,esModule:typeof e.esModule==="undefined"?true:e.esModule}}function shouldUseImportPlugin(e){if(e.modules.exportOnlyLocals){return false}if(typeof e.import==="boolean"){return e.import}return true}function shouldUseURLPlugin(e){if(e.modules.exportOnlyLocals){return false}if(typeof e.url==="boolean"){return e.url}return true}function shouldUseModulesPlugins(e){return e.modules.compileType==="module"}function shouldUseIcssPlugin(e){return e.icss===true||Boolean(e.modules)}function getModulesPlugins(e,t){const{mode:r,getLocalIdent:i,localIdentName:n,localIdentContext:s,localIdentHashPrefix:o,localIdentRegExp:c}=e.modules;let h=[];try{h=[u.default,(0,a.default)({mode:r}),(0,f.default)(),(0,l.default)({generateScopedName(e){return i(t,n,e,{context:s,hashPrefix:o,regExp:c})},exportGlobals:e.modules.exportGlobals})]}catch(e){t.emitError(e)}return h}const y=/^[a-z]:[/\\]|^\\\\/i;const w=/^[a-z0-9+\-.]+:/i;function getURLType(e){if(e[0]==="/"){if(e[1]==="/"){return"scheme-relative"}return"path-absolute"}if(y.test(e)){return"path-absolute"}return w.test(e)?"absolute":"path-relative"}function normalizeSourceMap(e,t){let r=e;if(typeof r==="string"){r=JSON.parse(r)}delete r.file;const{sourceRoot:i}=r;delete r.sourceRoot;if(r.sources){r.sources=r.sources.map(e=>{if(e.indexOf("<")===0){return e}const r=getURLType(e);if(r==="path-relative"||r==="path-absolute"){const s=r==="path-relative"&&i?n.default.resolve(i,normalizePath(e)):normalizePath(e);return n.default.relative(n.default.dirname(t),s)}return e})}return r}function getPreRequester({loaders:e,loaderIndex:t}){const r=Object.create(null);return i=>{if(r[i]){return r[i]}if(i===false){r[i]=""}else{const n=e.slice(t,t+1+(typeof i!=="number"?0:i)).map(e=>e.request).join("!");r[i]=`-!${n}!`}return r[i]}}function getImportCode(e,t){let r="";for(const i of e){const{importName:e,url:n,icss:s}=i;if(t.esModule){if(s&&t.modules.namedExport){r+=`import ${t.modules.exportOnlyLocals?"":`${e}, `}* as ${e}_NAMED___ from ${n};\n`}else{r+=`import ${e} from ${n};\n`}}else{r+=`var ${e} = require(${n});\n`}}return r?`// Imports\n${r}`:""}function normalizeSourceMapForRuntime(e,t){const r=e?e.toJSON():null;if(r){delete r.file;r.sourceRoot="";r.sources=r.sources.map(e=>{if(e.indexOf("<")===0){return e}const r=getURLType(e);if(r!=="path-relative"){return e}const i=n.default.dirname(t.resourcePath);const s=n.default.resolve(i,e);const o=normalizePath(n.default.relative(t.rootContext,s));return`webpack://${o}`})}return JSON.stringify(r)}function getModuleCode(e,t,r,i,n){if(i.modules.exportOnlyLocals===true){return""}const s=i.sourceMap?`,${normalizeSourceMapForRuntime(e.map,n)}`:"";let o=JSON.stringify(e.css);let u=`var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(${i.sourceMap});\n`;for(const e of t){const{url:t,media:r,dedupe:i}=e;u+=t?`___CSS_LOADER_EXPORT___.push([module.id, ${JSON.stringify(`@import url(${t});`)}${r?`, ${JSON.stringify(r)}`:""}]);\n`:`___CSS_LOADER_EXPORT___.i(${e.importName}${r?`, ${JSON.stringify(r)}`:i?', ""':""}${i?", true":""});\n`}for(const e of r){const{replacementName:t,importName:r,localName:n}=e;if(n){o=o.replace(new RegExp(t,"g"),()=>i.modules.namedExport?`" + ${r}_NAMED___[${JSON.stringify((0,c.default)(n))}] + "`:`" + ${r}.locals[${JSON.stringify(n)}] + "`)}else{const{hash:i,needQuotes:n}=e;const s=[].concat(i?[`hash: ${JSON.stringify(i)}`]:[]).concat(n?"needQuotes: true":[]);const a=s.length>0?`, { ${s.join(", ")} }`:"";u+=`var ${t} = ___CSS_LOADER_GET_URL_IMPORT___(${r}${a});\n`;o=o.replace(new RegExp(t,"g"),()=>`" + ${t} + "`)}}return`${u}// Module\n___CSS_LOADER_EXPORT___.push([module.id, ${o}, ""${s}]);\n`}function dashesCamelCase(e){return e.replace(/-+(\w)/g,(e,t)=>t.toUpperCase())}function getExportCode(e,t,r){let i="// Exports\n";let n="";const s=(e,t)=>{if(r.modules.namedExport){n+=`export const ${(0,c.default)(e)} = ${JSON.stringify(t)};\n`}else{if(n){n+=`,\n`}n+=`\t${JSON.stringify(e)}: ${JSON.stringify(t)}`}};for(const{name:t,value:i}of e){switch(r.modules.exportLocalsConvention){case"camelCase":{s(t,i);const e=(0,c.default)(t);if(e!==t){s(e,i)}break}case"camelCaseOnly":{s((0,c.default)(t),i);break}case"dashes":{s(t,i);const e=dashesCamelCase(t);if(e!==t){s(e,i)}break}case"dashesOnly":{s(dashesCamelCase(t),i);break}case"asIs":default:s(t,i);break}}for(const e of t){const{replacementName:t,localName:i}=e;if(i){const{importName:s}=e;n=n.replace(new RegExp(t,"g"),()=>{if(r.modules.namedExport){return`" + ${s}_NAMED___[${JSON.stringify((0,c.default)(i))}] + "`}else if(r.modules.exportOnlyLocals){return`" + ${s}[${JSON.stringify(i)}] + "`}return`" + ${s}.locals[${JSON.stringify(i)}] + "`})}else{n=n.replace(new RegExp(t,"g"),()=>`" + ${t} + "`)}}if(r.modules.exportOnlyLocals){i+=r.modules.namedExport?n:`${r.esModule?"export default":"module.exports ="} {\n${n}\n};\n`;return i}if(n){i+=r.modules.namedExport?n:`___CSS_LOADER_EXPORT___.locals = {\n${n}\n};\n`}i+=`${r.esModule?"export default":"module.exports ="} ___CSS_LOADER_EXPORT___;\n`;return i}async function resolveRequests(e,t,r){return e(t,r[0]).then(e=>{return e}).catch(i=>{const[,...n]=r;if(n.length===0){throw i}return resolveRequests(e,t,n)})}function isUrlRequestable(e){if(/^\/\//.test(e)){return false}if(/^file:/i.test(e)){return true}if(/^[a-z][a-z0-9+.-]*:/i.test(e)&&!d.test(e)){return false}if(/^#/.test(e)){return false}return true}function sort(e,t){return e.index-t.index}},7218:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(8725));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,i=new Array(r),n=0;n=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var i=this.normalize(t,this.nodes[e],r).reverse();for(var n=i,s=Array.isArray(n),o=0,n=s?n:n[Symbol.iterator]();;){var u;if(s){if(o>=n.length)break;u=n[o++]}else{o=n.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+i.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var i=r,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(s>=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;n.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(i){if(t.props&&t.props.indexOf(i.prop)===-1)return;if(t.fast&&i.value.indexOf(t.fast)===-1)return;i.value=i.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(571);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new i.default(e)]}else if(e.selector){var m=r(7229);e=[new m(e)]}else if(e.name){var y=r(7218);e=[new y(e)]}else if(e.text){e=[new n.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},5571:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9318));var n=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(6513));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var i=[null];i.push.apply(i,t);var n=Function.bind.apply(e,i);var s=new n;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,i,n,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(n){u.source=n}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof i!=="undefined"){u.line=r;u.column=i}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=i.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&n.default.red){return n.default.red.bold(t)}return t}function aside(t){if(e&&n.default.gray){return n.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var i=u+1+r;var n=" "+(" "+i).slice(-f)+" | ";if(i===t.line){var s=aside(n.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(n)+e+"\n "+s+mark("^")}return" "+aside(n)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},2849:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(4635));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(i.default);var s=n;t.default=s;e.exports=t.default},7127:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5622));var n=_interopRequireDefault(r(5571));var s=_interopRequireDefault(r(6683));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,i){if(i===void 0){i={}}var s;var o=this.origin(t,r);if(o){s=new n.default(e,o.line,o.column,o.source,o.file,i.plugin)}else{s=new n.default(e,t,r,this.css,this.file,i.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var i=r.originalPositionFor({line:e,column:t});if(!i.source)return false;var n={file:this.mapResolve(i.source),line:i.line,column:i.column};var s=r.sourceContentFor(i.source);if(s)n.source=s;return n};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return i.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},5409:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(439));var n=_interopRequireDefault(r(7317));var s=_interopRequireDefault(r(8539));var o=_interopRequireDefault(r(2461));var u=_interopRequireDefault(r(571));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+n+", but "+r+" uses "+i+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var i=this.processor.plugins[this.plugin];var n=this.run(i);this.plugin+=1;if(isPromise(n)){n.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,i);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;var s=this.run(n);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=n.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new i.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},2378:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var i=[];var n="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(n!=="")i.push(n.trim());n="";split=false}else{n+=f}}if(r||n!=="")i.push(n.trim());return i},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var i=r;t.default=i;e.exports=t.default},439:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6241));var n=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var i=r.source.input.from;if(i&&!t[i]){t[i]=true;var n=e.relative(i);e.map.setSourceContent(n,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||n.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new i.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?n.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=n.default.dirname(n.default.resolve(t,this.mapOpts.annotation))}e=n.default.relative(t,e);if(n.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new i.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var n,s;this.stringify(this.root,function(i,o,u){e.css+=i;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}n=i.match(/\n/g);if(n){t+=n.length;s=i.lastIndexOf("\n");r=i.length-s}else{r+=i.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},4635:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5571));var n=_interopRequireDefault(r(2928));var s=_interopRequireDefault(r(7317));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var i in e){if(!e.hasOwnProperty(i))continue;var n=e[i];var s=typeof n;if(i==="parent"&&s==="object"){if(t)r[i]=t}else if(i==="source"){r[i]=n}else if(n instanceof Array){r[i]=n.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&n!==null)n=cloneNode(n);r[i]=n}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new i.default(e)};e.warn=function warn(e,t,r){var i={node:this};for(var n in r){i[n]=r[n]}return e.warn(t,i)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(n);if(t&&i){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new i.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var n=e[0][0];if(n===":"||n==="space"||n==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var i;var n=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){i=u.length-1;r=u[i];while(r&&r[0]==="space"){r=u[--i]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){n=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(n){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var i,n;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;n--){i=e[n];if(i[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",i[2],i[3])};return Parser}();t.default=f;e.exports=t.default},66:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(2849));var n=_interopRequireDefault(r(4884));var s=_interopRequireDefault(r(7317));var o=_interopRequireDefault(r(499));var u=_interopRequireDefault(r(7218));var a=_interopRequireDefault(r(255));var f=_interopRequireDefault(r(571));var l=_interopRequireDefault(r(2378));var c=_interopRequireDefault(r(7229));var h=_interopRequireDefault(r(5400));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var i="data:application/json,";if(this.startWith(e,i)){return decodeURIComponent(e.substr(i.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof i.default.SourceMapConsumer){return i.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof i.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=n.default.join(n.default.dirname(e),o);this.root=n.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},4884:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5409));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var n=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new i.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=n;t.default=s;e.exports=t.default},2461:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(575));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[i].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,i){var n=e.prototype.normalize.call(this,t);if(r){if(i==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=n,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return n};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(5409);var i=r(4884);var n=new t(new i,this,e);return n.stringify()};return Root}(i.default);var s=n;t.default=s;e.exports=t.default},7229:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(8725));var n=_interopRequireDefault(r(2378));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var i=0;i0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var i=e.parent;var n=0;while(i&&i.type!=="root"){n+=1;i=i.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;E=D.charCodeAt(G);if(E===o||E===a||E===l&&D.charCodeAt(G+1)!==o){W=G;V+=1}switch(E){case o:case u:case f:case l:case a:M=G;do{M+=1;E=D.charCodeAt(M);if(E===o){W=M;V+=1}}while(E===u||E===o||E===f||E===l||E===a);z=["space",D.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var Q=String.fromCharCode(E);z=[Q,Q,V,G-W];break;case p:x=Y.length?Y.pop()[1]:"";$=D.charCodeAt(G+1);if(x==="url"&&$!==r&&$!==i&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=D.indexOf(")",M+1);if(M===-1){if(A||t){M=G;break}else{unclosed("bracket")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);z=["brackets",D.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=D.indexOf(")",G+1);F=D.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case i:q=E===r?"'":'"';M=G;do{j=false;M=D.indexOf(q,M+1);if(M===-1){if(A||t){M=G+1;break}else{unclosed("string")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["string",D.slice(G,M+1),V,G-W,N,M-L];W=L;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(D);if(S.lastIndex===0){M=D.length-1}else{M=S.lastIndex-2}z=["at-word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;case n:M=G;k=true;while(D.charCodeAt(M+1)===n){M+=1;k=!k}E=D.charCodeAt(M+1);if(k&&E!==s&&E!==u&&E!==o&&E!==f&&E!==l&&E!==a){M+=1;if(O.test(D.charAt(M))){while(O.test(D.charAt(M+1))){M+=1}if(D.charCodeAt(M+1)===u){M+=1}}}z=["word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(E===s&&D.charCodeAt(G+1)===y){M=D.indexOf("*/",G+2)+1;if(M===0){if(A||t){M=D.length}else{unclosed("comment")}}F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["comment",F,V,G-W,N,M-L];W=L;V=N;G=M}else{R.lastIndex=G+1;R.test(D);if(R.lastIndex===0){M=D.length-1}else{M=R.lastIndex-2}z=["word",D.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},255:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var i=r;t.default=i;e.exports=t.default},8539:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},575:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var i in t){this[i]=t[i]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var i=r;t.default=i;e.exports=t.default},5236:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(8979));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,i=new Array(r),n=0;n=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var i=this.normalize(t,this.nodes[e],r).reverse();for(var n=i,s=Array.isArray(n),o=0,n=s?n:n[Symbol.iterator]();;){var u;if(s){if(o>=n.length)break;u=n[o++]}else{o=n.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+i.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var i=r,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(s>=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;n.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(i){if(t.props&&t.props.indexOf(i.prop)===-1)return;if(t.fast&&i.value.indexOf(t.fast)===-1)return;i.value=i.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(9744);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new i.default(e)]}else if(e.selector){var m=r(3027);e=[new m(e)]}else if(e.name){var y=r(5236);e=[new y(e)]}else if(e.text){e=[new n.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},9693:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9318));var n=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(5849));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var i=[null];i.push.apply(i,t);var n=Function.bind.apply(e,i);var s=new n;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,i,n,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(n){u.source=n}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof i!=="undefined"){u.line=r;u.column=i}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=i.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&n.default.red){return n.default.red.bold(t)}return t}function aside(t){if(e&&n.default.gray){return n.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var i=u+1+r;var n=" "+(" "+i).slice(-f)+" | ";if(i===t.line){var s=aside(n.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(n)+e+"\n "+s+mark("^")}return" "+aside(n)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},2033:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(8097));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(i.default);var s=n;t.default=s;e.exports=t.default},1164:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5622));var n=_interopRequireDefault(r(9693));var s=_interopRequireDefault(r(5941));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,i){if(i===void 0){i={}}var s;var o=this.origin(t,r);if(o){s=new n.default(e,o.line,o.column,o.source,o.file,i.plugin)}else{s=new n.default(e,t,r,this.css,this.file,i.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var i=r.originalPositionFor({line:e,column:t});if(!i.source)return false;var n={file:this.mapResolve(i.source),line:i.line,column:i.column};var s=r.sourceContentFor(i.source);if(s)n.source=s;return n};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return i.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},6724:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(2240));var n=_interopRequireDefault(r(9206));var s=_interopRequireDefault(r(5332));var o=_interopRequireDefault(r(2168));var u=_interopRequireDefault(r(9744));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+n+", but "+r+" uses "+i+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var i=this.processor.plugins[this.plugin];var n=this.run(i);this.plugin+=1;if(isPromise(n)){n.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,i);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;var s=this.run(n);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=n.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new i.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},1023:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var i=[];var n="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(n!=="")i.push(n.trim());n="";split=false}else{n+=f}}if(r||n!=="")i.push(n.trim());return i},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var i=r;t.default=i;e.exports=t.default},2240:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6241));var n=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var i=r.source.input.from;if(i&&!t[i]){t[i]=true;var n=e.relative(i);e.map.setSourceContent(n,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||n.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new i.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?n.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=n.default.dirname(n.default.resolve(t,this.mapOpts.annotation))}e=n.default.relative(t,e);if(n.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new i.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var n,s;this.stringify(this.root,function(i,o,u){e.css+=i;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}n=i.match(/\n/g);if(n){t+=n.length;s=i.lastIndexOf("\n");r=i.length-s}else{r+=i.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},8097:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9693));var n=_interopRequireDefault(r(6762));var s=_interopRequireDefault(r(9206));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var i in e){if(!e.hasOwnProperty(i))continue;var n=e[i];var s=typeof n;if(i==="parent"&&s==="object"){if(t)r[i]=t}else if(i==="source"){r[i]=n}else if(n instanceof Array){r[i]=n.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&n!==null)n=cloneNode(n);r[i]=n}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new i.default(e)};e.warn=function warn(e,t,r){var i={node:this};for(var n in r){i[n]=r[n]}return e.warn(t,i)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(n);if(t&&i){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new i.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var n=e[0][0];if(n===":"||n==="space"||n==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var i;var n=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){i=u.length-1;r=u[i];while(r&&r[0]==="space"){r=u[--i]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){n=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(n){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var i,n;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;n--){i=e[n];if(i[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",i[2],i[3])};return Parser}();t.default=f;e.exports=t.default},3326:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(2033));var n=_interopRequireDefault(r(7890));var s=_interopRequireDefault(r(9206));var o=_interopRequireDefault(r(3267));var u=_interopRequireDefault(r(5236));var a=_interopRequireDefault(r(5082));var f=_interopRequireDefault(r(9744));var l=_interopRequireDefault(r(1023));var c=_interopRequireDefault(r(3027));var h=_interopRequireDefault(r(8995));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var i="data:application/json,";if(this.startWith(e,i)){return decodeURIComponent(e.substr(i.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof i.default.SourceMapConsumer){return i.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof i.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=n.default.join(n.default.dirname(e),o);this.root=n.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},7890:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6724));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var n=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new i.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=n;t.default=s;e.exports=t.default},2168:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5432));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[i].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,i){var n=e.prototype.normalize.call(this,t);if(r){if(i==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=n,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return n};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(6724);var i=r(7890);var n=new t(new i,this,e);return n.stringify()};return Root}(i.default);var s=n;t.default=s;e.exports=t.default},3027:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(8979));var n=_interopRequireDefault(r(1023));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var i=0;i0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var i=e.parent;var n=0;while(i&&i.type!=="root"){n+=1;i=i.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;E=D.charCodeAt(G);if(E===o||E===a||E===l&&D.charCodeAt(G+1)!==o){W=G;V+=1}switch(E){case o:case u:case f:case l:case a:M=G;do{M+=1;E=D.charCodeAt(M);if(E===o){W=M;V+=1}}while(E===u||E===o||E===f||E===l||E===a);z=["space",D.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var Q=String.fromCharCode(E);z=[Q,Q,V,G-W];break;case p:x=Y.length?Y.pop()[1]:"";$=D.charCodeAt(G+1);if(x==="url"&&$!==r&&$!==i&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=D.indexOf(")",M+1);if(M===-1){if(A||t){M=G;break}else{unclosed("bracket")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);z=["brackets",D.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=D.indexOf(")",G+1);F=D.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case i:q=E===r?"'":'"';M=G;do{j=false;M=D.indexOf(q,M+1);if(M===-1){if(A||t){M=G+1;break}else{unclosed("string")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["string",D.slice(G,M+1),V,G-W,N,M-L];W=L;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(D);if(S.lastIndex===0){M=D.length-1}else{M=S.lastIndex-2}z=["at-word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;case n:M=G;k=true;while(D.charCodeAt(M+1)===n){M+=1;k=!k}E=D.charCodeAt(M+1);if(k&&E!==s&&E!==u&&E!==o&&E!==f&&E!==l&&E!==a){M+=1;if(O.test(D.charAt(M))){while(O.test(D.charAt(M+1))){M+=1}if(D.charCodeAt(M+1)===u){M+=1}}}z=["word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(E===s&&D.charCodeAt(G+1)===y){M=D.indexOf("*/",G+2)+1;if(M===0){if(A||t){M=D.length}else{unclosed("comment")}}F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["comment",F,V,G-W,N,M-L];W=L;V=N;G=M}else{R.lastIndex=G+1;R.test(D);if(R.lastIndex===0){M=D.length-1}else{M=R.lastIndex-2}z=["word",D.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},5082:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var i=r;t.default=i;e.exports=t.default},5332:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},5432:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var i in t){this[i]=t[i]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var i=r;t.default=i;e.exports=t.default},4192:function(e,t,r){const i=r(3326);const n=r(118);const s=["composes"];const o=new RegExp(`^(${s.join("|")})$`);const u=/^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;const a=/^:import\((?:"([^"]+)"|'([^']+)')\)/;const f=1;function createParentName(e,t){return`__${t.index(e.parent)}_${e.selector}`}function serializeImports(e){return e.map(e=>"`"+e+"`").join(", ")}function addImportToGraph(e,t,r,i){const n=t+"_"+"siblings";const s=t+"_"+e;if(i[s]!==f){if(!Array.isArray(i[n]))i[n]=[];const t=i[n];if(Array.isArray(r[e]))r[e]=r[e].concat(t);else r[e]=t.slice();i[s]=f;t.push(e)}}e.exports=i.plugin("modules-extract-imports",function(e={}){const t=e.failOnWrongOrder;return r=>{const s={};const f={};const l={};const c={};const h={};let p=0;const d=typeof e.createImportedName!=="function"?e=>`i__imported_${e.replace(/\W/g,"_")}_${p++}`:e.createImportedName;r.walkRules(e=>{const t=a.exec(e.selector);if(t){const[,r,i]=t;const n=r||i;addImportToGraph(n,"root",s,f);l[n]=e}});r.walkDecls(o,e=>{let t=e.value.match(u);let i;if(t){let[,n,o,u,a]=t;if(a){i=n.split(/\s+/).map(e=>`global(${e})`)}else{const t=o||u;const a=createParentName(e.parent,r);addImportToGraph(t,a,s,f);c[t]=e;h[t]=h[t]||{};i=n.split(/\s+/).map(e=>{if(!h[t][e]){h[t][e]=d(e,t)}return h[t][e]})}e.value=i.join(" ")}});const v=n(s,t);if(v instanceof Error){const e=v.nodes.find(e=>c.hasOwnProperty(e));const t=c[e];const r="Failed to resolve order of composed modules "+serializeImports(v.nodes)+".";throw t.error(r,{plugin:"modules-extract-imports",word:"composes"})}let g;v.forEach(e=>{const t=h[e];let n=l[e];if(!n&&t){n=i.rule({selector:`:import("${e}")`,raws:{after:"\n"}});if(g)r.insertAfter(g,n);else r.prepend(n)}g=n;if(!t)return;Object.keys(t).forEach(e=>{n.append(i.decl({value:e,prop:t[e],raws:{before:"\n "}}))})})}})},118:function(e){const t=2;const r=1;function createError(e,t){const r=new Error("Nondeterministic import's order");const i=t[e];const n=i.find(r=>t[r].indexOf(e)>-1);r.nodes=[e,n];return r}function walkGraph(e,i,n,s,o){if(n[e]===t)return;if(n[e]===r){if(o)return createError(e,i);return}n[e]=r;const u=i[e];const a=u.length;for(let e=0;ee.type==="combinator"&&e.value===" ";function getImportLocalAliases(e){const t=new Map;Object.keys(e).forEach(r=>{Object.keys(e[r]).forEach(i=>{t.set(i,e[r][i])})});return t}function maybeLocalizeValue(e,t){if(t.has(e))return e}function normalizeNodeArray(e){const t=[];e.forEach(function(e){if(Array.isArray(e)){normalizeNodeArray(e).forEach(function(e){t.push(e)})}else if(e){t.push(e)}});if(t.length>0&&u(t[t.length-1])){t.pop()}return t}function localizeNode(e,t,r){const i=e=>e.value===":local"||e.value===":global";const s=e=>e.value===":import"||e.value===":export";const o=(e,t)=>{if(t.ignoreNextSpacing&&!u(e)){throw new Error("Missing whitespace after "+t.ignoreNextSpacing)}if(t.enforceNoSpacing&&u(e)){throw new Error("Missing whitespace before "+t.enforceNoSpacing)}let a;switch(e.type){case"root":{let r;t.hasPureGlobals=false;a=e.nodes.map(function(i){const n={global:t.global,lastWasSpacing:true,hasLocals:false,explicit:false};i=o(i,n);if(typeof r==="undefined"){r=n.global}else if(r!==n.global){throw new Error('Inconsistent rule global/local result in rule "'+e+'" (multiple selectors must result in the same mode for the rule)')}if(!n.hasLocals){t.hasPureGlobals=true}return i});t.global=r;e.nodes=normalizeNodeArray(a);break}case"selector":{a=e.map(e=>o(e,t));e=e.clone();e.nodes=normalizeNodeArray(a);break}case"combinator":{if(u(e)){if(t.ignoreNextSpacing){t.ignoreNextSpacing=false;t.lastWasSpacing=false;t.enforceNoSpacing=false;return null}t.lastWasSpacing=true;return e}break}case"pseudo":{let r;const u=!!e.length;const f=i(e);const l=s(e);if(l){t.hasLocals=true}else if(u){if(f){if(e.nodes.length===0){throw new Error(`${e.value}() can't be empty`)}if(t.inside){throw new Error(`A ${e.value} is not allowed inside of a ${t.inside}(...)`)}r={global:e.value===":global",inside:e.value,hasLocals:false,explicit:true};a=e.map(e=>o(e,r)).reduce((e,t)=>e.concat(t.nodes),[]);if(a.length){const{before:t,after:r}=e.spaces;const i=a[0];const n=a[a.length-1];i.spaces={before:t,after:i.spaces.after};n.spaces={before:n.spaces.before,after:r}}e=a;break}else{r={global:t.global,inside:t.inside,lastWasSpacing:true,hasLocals:false,explicit:t.explicit};a=e.map(e=>o(e,r));e=e.clone();e.nodes=normalizeNodeArray(a);if(r.hasLocals){t.hasLocals=true}}break}else if(f){if(t.inside){throw new Error(`A ${e.value} is not allowed inside of a ${t.inside}(...)`)}const r=!!e.spaces.before;t.ignoreNextSpacing=t.lastWasSpacing?e.value:false;t.enforceNoSpacing=t.lastWasSpacing?false:e.value;t.global=e.value===":global";t.explicit=true;return r?n.combinator({value:" "}):null}break}case"id":case"class":{if(!e.value){throw new Error("Invalid class or id selector syntax")}if(t.global){break}const i=r.has(e.value);const s=i&&t.explicit;if(!i||s){const r=e.clone();r.spaces={before:"",after:""};e=n.pseudo({value:":local",nodes:[r],spaces:e.spaces});t.hasLocals=true}break}}t.lastWasSpacing=false;t.ignoreNextSpacing=false;t.enforceNoSpacing=false;return e};const a={global:t==="global",hasPureGlobals:false};a.selector=n(e=>{o(e,a)}).processSync(e,{updateSelector:false,lossless:true});return a}function localizeDeclNode(e,t){switch(e.type){case"word":if(t.localizeNextItem){if(!t.localAliasMap.has(e.value)){e.value=":local("+e.value+")";t.localizeNextItem=false}}break;case"function":if(t.options&&t.options.rewriteUrl&&e.value.toLowerCase()==="url"){e.nodes.map(e=>{if(e.type!=="string"&&e.type!=="word"){return}let r=t.options.rewriteUrl(t.global,e.value);switch(e.type){case"string":if(e.quote==="'"){r=r.replace(/(\\)/g,"\\$1").replace(/'/g,"\\'")}if(e.quote==='"'){r=r.replace(/(\\)/g,"\\$1").replace(/"/g,'\\"')}break;case"word":r=r.replace(/("|'|\)|\\)/g,"\\$1");break}e.value=r})}break}return e}function isWordAFunctionArgument(e,t){return t?t.nodes.some(t=>t.sourceIndex===e.sourceIndex):false}function localizeAnimationShorthandDeclValues(e,t){const r=/^-?[_a-z][_a-z0-9-]*$/i;const i={$alternate:1,"$alternate-reverse":1,$backwards:1,$both:1,$ease:1,"$ease-in":1,"$ease-in-out":1,"$ease-out":1,$forwards:1,$infinite:1,$linear:1,$none:Infinity,$normal:1,$paused:1,$reverse:1,$running:1,"$step-end":1,"$step-start":1,$initial:Infinity,$inherit:Infinity,$unset:Infinity};const n=false;let o={};let u=null;const a=s(e.value).walk(e=>{if(e.type==="div"){o={}}if(e.type==="function"&&e.value.toLowerCase()==="steps"){u=e}const s=e.type==="word"&&!isWordAFunctionArgument(e,u)?e.value.toLowerCase():null;let a=false;if(!n&&s&&r.test(s)){if("$"+s in i){o["$"+s]="$"+s in o?o["$"+s]+1:0;a=o["$"+s]>=i["$"+s]}else{a=true}}const f={options:t.options,global:t.global,localizeNextItem:a&&!t.global,localAliasMap:t.localAliasMap};return localizeDeclNode(e,f)});e.value=a.toString()}function localizeDeclValues(e,t,r){const i=s(t.value);i.walk((t,i,n)=>{const s={options:r.options,global:r.global,localizeNextItem:e&&!r.global,localAliasMap:r.localAliasMap};n[i]=localizeDeclNode(t,s)});t.value=i.toString()}function localizeDecl(e,t){const r=/animation$/i.test(e.prop);if(r){return localizeAnimationShorthandDeclValues(e,t)}const i=/animation(-name)?$/i.test(e.prop);if(i){return localizeDeclValues(true,e,t)}const n=/url\(/i.test(e.value);if(n){return localizeDeclValues(false,e,t)}}e.exports=i.plugin("postcss-modules-local-by-default",function(e){if(typeof e!=="object"){e={}}if(e&&e.mode){if(e.mode!=="global"&&e.mode!=="local"&&e.mode!=="pure"){throw new Error('options.mode must be either "global", "local" or "pure" (default "local")')}}const t=e&&e.mode==="pure";const r=e&&e.mode==="global";return function(i){const{icssImports:n}=o(i,false);const s=getImportLocalAliases(n);i.walkAtRules(function(i){if(/keyframes$/i.test(i.name)){const n=/^\s*:global\s*\((.+)\)\s*$/.exec(i.params);const o=/^\s*:local\s*\((.+)\)\s*$/.exec(i.params);let u=r;if(n){if(t){throw i.error("@keyframes :global(...) is not allowed in pure mode")}i.params=n[1];u=true}else if(o){i.params=o[0];u=false}else if(!r){if(i.params&&!s.has(i.params))i.params=":local("+i.params+")"}i.walkDecls(function(t){localizeDecl(t,{localAliasMap:s,options:e,global:u})})}else if(i.nodes){i.nodes.forEach(function(t){if(t.type==="decl"){localizeDecl(t,{localAliasMap:s,options:e,global:r})}})}});i.walkRules(function(r){if(r.parent&&r.parent.type==="atrule"&&/keyframes$/i.test(r.parent.name)){return}if(r.nodes&&r.selector.slice(0,2)==="--"&&r.selector.slice(-1)===":"){return}const i=localizeNode(r,e.mode,s);i.options=e;i.localAliasMap=s;if(t&&i.hasPureGlobals){throw r.error('Selector "'+r.selector+'" is not pure '+"(pure selectors must contain at least one local class or id)")}r.selector=i.selector;if(r.nodes){r.nodes.forEach(e=>localizeDecl(e,i))}})}})},9707:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6011));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,i=new Array(r),n=0;n=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var i=this.normalize(t,this.nodes[e],r).reverse();for(var n=i,s=Array.isArray(n),o=0,n=s?n:n[Symbol.iterator]();;){var u;if(s){if(o>=n.length)break;u=n[o++]}else{o=n.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+i.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var i=r,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(s>=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;n.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(i){if(t.props&&t.props.indexOf(i.prop)===-1)return;if(t.fast&&i.value.indexOf(t.fast)===-1)return;i.value=i.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(9186);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new i.default(e)]}else if(e.selector){var m=r(4598);e=[new m(e)]}else if(e.name){var y=r(9707);e=[new y(e)]}else if(e.text){e=[new n.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},6877:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9318));var n=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(5979));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var i=[null];i.push.apply(i,t);var n=Function.bind.apply(e,i);var s=new n;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,i,n,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(n){u.source=n}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof i!=="undefined"){u.line=r;u.column=i}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=i.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&n.default.red){return n.default.red.bold(t)}return t}function aside(t){if(e&&n.default.gray){return n.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var i=u+1+r;var n=" "+(" "+i).slice(-f)+" | ";if(i===t.line){var s=aside(n.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(n)+e+"\n "+s+mark("^")}return" "+aside(n)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},9591:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(8772));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(i.default);var s=n;t.default=s;e.exports=t.default},2776:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5622));var n=_interopRequireDefault(r(6877));var s=_interopRequireDefault(r(5155));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,i){if(i===void 0){i={}}var s;var o=this.origin(t,r);if(o){s=new n.default(e,o.line,o.column,o.source,o.file,i.plugin)}else{s=new n.default(e,t,r,this.css,this.file,i.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var i=r.originalPositionFor({line:e,column:t});if(!i.source)return false;var n={file:this.mapResolve(i.source),line:i.line,column:i.column};var s=r.sourceContentFor(i.source);if(s)n.source=s;return n};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return i.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},981:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(7532));var n=_interopRequireDefault(r(8170));var s=_interopRequireDefault(r(3711));var o=_interopRequireDefault(r(9603));var u=_interopRequireDefault(r(9186));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+n+", but "+r+" uses "+i+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var i=this.processor.plugins[this.plugin];var n=this.run(i);this.plugin+=1;if(isPromise(n)){n.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,i);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;var s=this.run(n);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=n.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new i.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},6558:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var i=[];var n="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(n!=="")i.push(n.trim());n="";split=false}else{n+=f}}if(r||n!=="")i.push(n.trim());return i},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var i=r;t.default=i;e.exports=t.default},7532:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6241));var n=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var i=r.source.input.from;if(i&&!t[i]){t[i]=true;var n=e.relative(i);e.map.setSourceContent(n,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||n.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new i.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?n.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=n.default.dirname(n.default.resolve(t,this.mapOpts.annotation))}e=n.default.relative(t,e);if(n.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new i.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var n,s;this.stringify(this.root,function(i,o,u){e.css+=i;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}n=i.match(/\n/g);if(n){t+=n.length;s=i.lastIndexOf("\n");r=i.length-s}else{r+=i.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},8772:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6877));var n=_interopRequireDefault(r(2136));var s=_interopRequireDefault(r(8170));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var i in e){if(!e.hasOwnProperty(i))continue;var n=e[i];var s=typeof n;if(i==="parent"&&s==="object"){if(t)r[i]=t}else if(i==="source"){r[i]=n}else if(n instanceof Array){r[i]=n.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&n!==null)n=cloneNode(n);r[i]=n}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new i.default(e)};e.warn=function warn(e,t,r){var i={node:this};for(var n in r){i[n]=r[n]}return e.warn(t,i)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(n);if(t&&i){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new i.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var n=e[0][0];if(n===":"||n==="space"||n==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var i;var n=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){i=u.length-1;r=u[i];while(r&&r[0]==="space"){r=u[--i]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){n=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(n){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var i,n;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;n--){i=e[n];if(i[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",i[2],i[3])};return Parser}();t.default=f;e.exports=t.default},8679:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9591));var n=_interopRequireDefault(r(8005));var s=_interopRequireDefault(r(8170));var o=_interopRequireDefault(r(7165));var u=_interopRequireDefault(r(9707));var a=_interopRequireDefault(r(8181));var f=_interopRequireDefault(r(9186));var l=_interopRequireDefault(r(6558));var c=_interopRequireDefault(r(4598));var h=_interopRequireDefault(r(2362));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var i="data:application/json,";if(this.startWith(e,i)){return decodeURIComponent(e.substr(i.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof i.default.SourceMapConsumer){return i.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof i.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=n.default.join(n.default.dirname(e),o);this.root=n.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},8005:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(981));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var n=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new i.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=n;t.default=s;e.exports=t.default},9603:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5222));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[i].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,i){var n=e.prototype.normalize.call(this,t);if(r){if(i==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=n,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return n};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(981);var i=r(8005);var n=new t(new i,this,e);return n.stringify()};return Root}(i.default);var s=n;t.default=s;e.exports=t.default},4598:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6011));var n=_interopRequireDefault(r(6558));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var i=0;i0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var i=e.parent;var n=0;while(i&&i.type!=="root"){n+=1;i=i.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;E=D.charCodeAt(G);if(E===o||E===a||E===l&&D.charCodeAt(G+1)!==o){W=G;V+=1}switch(E){case o:case u:case f:case l:case a:M=G;do{M+=1;E=D.charCodeAt(M);if(E===o){W=M;V+=1}}while(E===u||E===o||E===f||E===l||E===a);z=["space",D.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var Q=String.fromCharCode(E);z=[Q,Q,V,G-W];break;case p:x=Y.length?Y.pop()[1]:"";$=D.charCodeAt(G+1);if(x==="url"&&$!==r&&$!==i&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=D.indexOf(")",M+1);if(M===-1){if(A||t){M=G;break}else{unclosed("bracket")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);z=["brackets",D.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=D.indexOf(")",G+1);F=D.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case i:q=E===r?"'":'"';M=G;do{j=false;M=D.indexOf(q,M+1);if(M===-1){if(A||t){M=G+1;break}else{unclosed("string")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["string",D.slice(G,M+1),V,G-W,N,M-L];W=L;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(D);if(S.lastIndex===0){M=D.length-1}else{M=S.lastIndex-2}z=["at-word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;case n:M=G;k=true;while(D.charCodeAt(M+1)===n){M+=1;k=!k}E=D.charCodeAt(M+1);if(k&&E!==s&&E!==u&&E!==o&&E!==f&&E!==l&&E!==a){M+=1;if(O.test(D.charAt(M))){while(O.test(D.charAt(M+1))){M+=1}if(D.charCodeAt(M+1)===u){M+=1}}}z=["word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(E===s&&D.charCodeAt(G+1)===y){M=D.indexOf("*/",G+2)+1;if(M===0){if(A||t){M=D.length}else{unclosed("comment")}}F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["comment",F,V,G-W,N,M-L];W=L;V=N;G=M}else{R.lastIndex=G+1;R.test(D);if(R.lastIndex===0){M=D.length-1}else{M=R.lastIndex-2}z=["word",D.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},8181:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var i=r;t.default=i;e.exports=t.default},3711:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},5222:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var i in t){this[i]=t[i]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var i=r;t.default=i;e.exports=t.default},3638:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(783));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,i=new Array(r),n=0;n=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var i=this.normalize(t,this.nodes[e],r).reverse();for(var n=i,s=Array.isArray(n),o=0,n=s?n:n[Symbol.iterator]();;){var u;if(s){if(o>=n.length)break;u=n[o++]}else{o=n.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+i.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var i=r,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(s>=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;n.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(i){if(t.props&&t.props.indexOf(i.prop)===-1)return;if(t.fast&&i.value.indexOf(t.fast)===-1)return;i.value=i.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(8681);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new i.default(e)]}else if(e.selector){var m=r(7284);e=[new m(e)]}else if(e.name){var y=r(3638);e=[new y(e)]}else if(e.text){e=[new n.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},2330:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9318));var n=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(7312));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var i=[null];i.push.apply(i,t);var n=Function.bind.apply(e,i);var s=new n;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,i,n,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(n){u.source=n}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof i!=="undefined"){u.line=r;u.column=i}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=i.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&n.default.red){return n.default.red.bold(t)}return t}function aside(t){if(e&&n.default.gray){return n.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var i=u+1+r;var n=" "+(" "+i).slice(-f)+" | ";if(i===t.line){var s=aside(n.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(n)+e+"\n "+s+mark("^")}return" "+aside(n)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},2654:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(3710));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(i.default);var s=n;t.default=s;e.exports=t.default},3808:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5622));var n=_interopRequireDefault(r(2330));var s=_interopRequireDefault(r(3597));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,i){if(i===void 0){i={}}var s;var o=this.origin(t,r);if(o){s=new n.default(e,o.line,o.column,o.source,o.file,i.plugin)}else{s=new n.default(e,t,r,this.css,this.file,i.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var i=r.originalPositionFor({line:e,column:t});if(!i.source)return false;var n={file:this.mapResolve(i.source),line:i.line,column:i.column};var s=r.sourceContentFor(i.source);if(s)n.source=s;return n};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return i.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},9241:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(4397));var n=_interopRequireDefault(r(5942));var s=_interopRequireDefault(r(7012));var o=_interopRequireDefault(r(3480));var u=_interopRequireDefault(r(8681));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+n+", but "+r+" uses "+i+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var i=this.processor.plugins[this.plugin];var n=this.run(i);this.plugin+=1;if(isPromise(n)){n.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,i);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;var s=this.run(n);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=n.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new i.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},9882:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var i=[];var n="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(n!=="")i.push(n.trim());n="";split=false}else{n+=f}}if(r||n!=="")i.push(n.trim());return i},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var i=r;t.default=i;e.exports=t.default},4397:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6241));var n=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var i=r.source.input.from;if(i&&!t[i]){t[i]=true;var n=e.relative(i);e.map.setSourceContent(n,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||n.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new i.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?n.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=n.default.dirname(n.default.resolve(t,this.mapOpts.annotation))}e=n.default.relative(t,e);if(n.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new i.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var n,s;this.stringify(this.root,function(i,o,u){e.css+=i;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}n=i.match(/\n/g);if(n){t+=n.length;s=i.lastIndexOf("\n");r=i.length-s}else{r+=i.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},3710:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(2330));var n=_interopRequireDefault(r(4284));var s=_interopRequireDefault(r(5942));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var i in e){if(!e.hasOwnProperty(i))continue;var n=e[i];var s=typeof n;if(i==="parent"&&s==="object"){if(t)r[i]=t}else if(i==="source"){r[i]=n}else if(n instanceof Array){r[i]=n.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&n!==null)n=cloneNode(n);r[i]=n}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new i.default(e)};e.warn=function warn(e,t,r){var i={node:this};for(var n in r){i[n]=r[n]}return e.warn(t,i)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(n);if(t&&i){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new i.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var n=e[0][0];if(n===":"||n==="space"||n==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var i;var n=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){i=u.length-1;r=u[i];while(r&&r[0]==="space"){r=u[--i]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){n=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(n){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var i,n;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;n--){i=e[n];if(i[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",i[2],i[3])};return Parser}();t.default=f;e.exports=t.default},6578:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(2654));var n=_interopRequireDefault(r(9596));var s=_interopRequireDefault(r(5942));var o=_interopRequireDefault(r(18));var u=_interopRequireDefault(r(3638));var a=_interopRequireDefault(r(9628));var f=_interopRequireDefault(r(8681));var l=_interopRequireDefault(r(9882));var c=_interopRequireDefault(r(7284));var h=_interopRequireDefault(r(5782));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var i="data:application/json,";if(this.startWith(e,i)){return decodeURIComponent(e.substr(i.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof i.default.SourceMapConsumer){return i.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof i.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=n.default.join(n.default.dirname(e),o);this.root=n.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},9596:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9241));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var n=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new i.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=n;t.default=s;e.exports=t.default},3480:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(4904));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[i].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,i){var n=e.prototype.normalize.call(this,t);if(r){if(i==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=n,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return n};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(9241);var i=r(9596);var n=new t(new i,this,e);return n.stringify()};return Root}(i.default);var s=n;t.default=s;e.exports=t.default},7284:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(783));var n=_interopRequireDefault(r(9882));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var i=0;i0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var i=e.parent;var n=0;while(i&&i.type!=="root"){n+=1;i=i.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;E=D.charCodeAt(G);if(E===o||E===a||E===l&&D.charCodeAt(G+1)!==o){W=G;V+=1}switch(E){case o:case u:case f:case l:case a:M=G;do{M+=1;E=D.charCodeAt(M);if(E===o){W=M;V+=1}}while(E===u||E===o||E===f||E===l||E===a);z=["space",D.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var Q=String.fromCharCode(E);z=[Q,Q,V,G-W];break;case p:x=Y.length?Y.pop()[1]:"";$=D.charCodeAt(G+1);if(x==="url"&&$!==r&&$!==i&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=D.indexOf(")",M+1);if(M===-1){if(A||t){M=G;break}else{unclosed("bracket")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);z=["brackets",D.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=D.indexOf(")",G+1);F=D.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case i:q=E===r?"'":'"';M=G;do{j=false;M=D.indexOf(q,M+1);if(M===-1){if(A||t){M=G+1;break}else{unclosed("string")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["string",D.slice(G,M+1),V,G-W,N,M-L];W=L;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(D);if(S.lastIndex===0){M=D.length-1}else{M=S.lastIndex-2}z=["at-word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;case n:M=G;k=true;while(D.charCodeAt(M+1)===n){M+=1;k=!k}E=D.charCodeAt(M+1);if(k&&E!==s&&E!==u&&E!==o&&E!==f&&E!==l&&E!==a){M+=1;if(O.test(D.charAt(M))){while(O.test(D.charAt(M+1))){M+=1}if(D.charCodeAt(M+1)===u){M+=1}}}z=["word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(E===s&&D.charCodeAt(G+1)===y){M=D.indexOf("*/",G+2)+1;if(M===0){if(A||t){M=D.length}else{unclosed("comment")}}F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["comment",F,V,G-W,N,M-L];W=L;V=N;G=M}else{R.lastIndex=G+1;R.test(D);if(R.lastIndex===0){M=D.length-1}else{M=R.lastIndex-2}z=["word",D.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},9628:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var i=r;t.default=i;e.exports=t.default},7012:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},4904:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var i in t){this[i]=t[i]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var i=r;t.default=i;e.exports=t.default},7475:function(e,t,r){"use strict";const i=r(6578);const n=r(1571);const s=Object.prototype.hasOwnProperty;function getSingleLocalNamesForComposes(e){return e.nodes.map(t=>{if(t.type!=="selector"||t.nodes.length!==1){throw new Error(`composition is only allowed when selector is single :local class name not in "${e}"`)}t=t.nodes[0];if(t.type!=="pseudo"||t.value!==":local"||t.nodes.length!==1){throw new Error('composition is only allowed when selector is single :local class name not in "'+e+'", "'+t+'" is weird')}t=t.first;if(t.type!=="selector"||t.length!==1){throw new Error('composition is only allowed when selector is single :local class name not in "'+e+'", "'+t+'" is weird')}t=t.first;if(t.type!=="class"){throw new Error('composition is only allowed when selector is single :local class name not in "'+e+'", "'+t+'" is weird')}return t.value})}const o="[\\x20\\t\\r\\n\\f]";const u=new RegExp("\\\\([\\da-f]{1,6}"+o+"?|("+o+")|.)","ig");function unescape(e){return e.replace(u,(e,t,r)=>{const i="0x"+t-65536;return i!==i||r?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,i&1023|56320)})}const a=i.plugin("postcss-modules-scope",function(e){return t=>{const r=e&&e.generateScopedName||a.generateScopedName;const o=e&&e.generateExportEntry||a.generateExportEntry;const u=e&&e.exportGlobals;const f=Object.create(null);function exportScopedName(e,i){const n=r(i?i:e,t.source.input.from,t.source.input.css);const s=o(i?i:e,n,t.source.input.from,t.source.input.css);const{key:u,value:a}=s;f[u]=f[u]||[];if(f[u].indexOf(a)<0){f[u].push(a)}return n}function localizeNode(e){switch(e.type){case"selector":e.nodes=e.map(localizeNode);return e;case"class":return n.className({value:exportScopedName(e.value,e.raws&&e.raws.value?e.raws.value:null)});case"id":{return n.id({value:exportScopedName(e.value,e.raws&&e.raws.value?e.raws.value:null)})}}throw new Error(`${e.type} ("${e}") is not allowed in a :local block`)}function traverseNode(e){switch(e.type){case"pseudo":if(e.value===":local"){if(e.nodes.length!==1){throw new Error('Unexpected comma (",") in :local block')}const t=localizeNode(e.first,e.spaces);t.first.spaces=e.spaces;const r=e.next();if(r&&r.type==="combinator"&&r.value===" "&&/\\[A-F0-9]{1,6}$/.test(t.last.value)){t.last.spaces.after=" "}e.replaceWith(t);return}case"root":case"selector":{e.each(traverseNode);break}case"id":case"class":if(u){f[e.value]=[e.value]}break}return e}const l={};t.walkRules(e=>{if(/^:import\(.+\)$/.test(e.selector)){e.walkDecls(e=>{l[e.prop]=true})}});t.walkRules(e=>{if(e.nodes&&e.selector.slice(0,2)==="--"&&e.selector.slice(-1)===":"){return}let t=n().astSync(e);e.selector=traverseNode(t.clone()).toString();e.walkDecls(/composes|compose-with/,e=>{const r=getSingleLocalNamesForComposes(t);const i=e.value.split(/\s+/);i.forEach(t=>{const i=/^global\(([^\)]+)\)$/.exec(t);if(i){r.forEach(e=>{f[e].push(i[1])})}else if(s.call(l,t)){r.forEach(e=>{f[e].push(t)})}else if(s.call(f,t)){r.forEach(e=>{f[t].forEach(t=>{f[e].push(t)})})}else{throw e.error(`referenced class name "${t}" in ${e.prop} not found`)}});e.remove()});e.walkDecls(e=>{let t=e.value.split(/(,|'[^']*'|"[^"]*")/);t=t.map((e,r)=>{if(r===0||t[r-1]===","){const t=/^(\s*):local\s*\((.+?)\)/.exec(e);if(t){return t[1]+exportScopedName(t[2])+e.substr(t[0].length)}else{return e}}else{return e}});e.value=t.join("")})});t.walkAtRules(e=>{if(/keyframes$/i.test(e.name)){const t=/^\s*:local\s*\((.+?)\)\s*$/.exec(e.params);if(t){e.params=exportScopedName(t[1])}}});const c=Object.keys(f);if(c.length>0){const e=i.rule({selector:":export"});c.forEach(t=>e.append({prop:t,value:f[t].join(" "),raws:{before:"\n "}}));t.append(e)}}});a.generateScopedName=function(e,t){const r=t.replace(/\.[^\.\/\\]+$/,"").replace(/[\W_]+/g,"_").replace(/^_|_$/g,"");return`_${r}__${e}`.trim()};a.generateExportEntry=function(e,t){return{key:unescape(e),value:unescape(t)}};e.exports=a},9616:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(7859));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,i=new Array(r),n=0;n=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var i=this.normalize(t,this.nodes[e],r).reverse();for(var n=i,s=Array.isArray(n),o=0,n=s?n:n[Symbol.iterator]();;){var u;if(s){if(o>=n.length)break;u=n[o++]}else{o=n.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+i.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var i=r,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(s>=i.length)break;o=i[s++]}else{s=i.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;n.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(i){if(t.props&&t.props.indexOf(i.prop)===-1)return;if(t.fast&&i.value.indexOf(t.fast)===-1)return;i.value=i.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(5955);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new i.default(e)]}else if(e.selector){var m=r(5953);e=[new m(e)]}else if(e.name){var y=r(9616);e=[new y(e)]}else if(e.text){e=[new n.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},2354:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(9318));var n=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(5903));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var i=[null];i.push.apply(i,t);var n=Function.bind.apply(e,i);var s=new n;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,i,n,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(n){u.source=n}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof i!=="undefined"){u.line=r;u.column=i}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=i.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&n.default.red){return n.default.red.bold(t)}return t}function aside(t){if(e&&n.default.gray){return n.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var i=u+1+r;var n=" "+(" "+i).slice(-f)+" | ";if(i===t.line){var s=aside(n.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(n)+e+"\n "+s+mark("^")}return" "+aside(n)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},6622:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(2689));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(i.default);var s=n;t.default=s;e.exports=t.default},8902:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(5622));var n=_interopRequireDefault(r(2354));var s=_interopRequireDefault(r(5540));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,i){if(i===void 0){i={}}var s;var o=this.origin(t,r);if(o){s=new n.default(e,o.line,o.column,o.source,o.file,i.plugin)}else{s=new n.default(e,t,r,this.css,this.file,i.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var i=r.originalPositionFor({line:e,column:t});if(!i.source)return false;var n={file:this.mapResolve(i.source),line:i.line,column:i.column};var s=r.sourceContentFor(i.source);if(s)n.source=s;return n};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return i.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},7023:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(3782));var n=_interopRequireDefault(r(3057));var s=_interopRequireDefault(r(2508));var o=_interopRequireDefault(r(3172));var u=_interopRequireDefault(r(5955));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+n+", but "+r+" uses "+i+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var i=this.processor.plugins[this.plugin];var n=this.run(i);this.plugin+=1;if(isPromise(n)){n.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,i);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var i;if(t){if(r>=e.length)break;i=e[r++]}else{r=e.next();if(r.done)break;i=r.value}var n=i;var s=this.run(n);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=n.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new i.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},5450:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var i=[];var n="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(n!=="")i.push(n.trim());n="";split=false}else{n+=f}}if(r||n!=="")i.push(n.trim());return i},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var i=r;t.default=i;e.exports=t.default},3782:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6241));var n=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var i=r.source.input.from;if(i&&!t[i]){t[i]=true;var n=e.relative(i);e.map.setSourceContent(n,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||n.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new i.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?n.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=n.default.dirname(n.default.resolve(t,this.mapOpts.annotation))}e=n.default.relative(t,e);if(n.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new i.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var n,s;this.stringify(this.root,function(i,o,u){e.css+=i;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}n=i.match(/\n/g);if(n){t+=n.length;s=i.lastIndexOf("\n");r=i.length-s}else{r+=i.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},2689:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(2354));var n=_interopRequireDefault(r(5291));var s=_interopRequireDefault(r(3057));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var i in e){if(!e.hasOwnProperty(i))continue;var n=e[i];var s=typeof n;if(i==="parent"&&s==="object"){if(t)r[i]=t}else if(i==="source"){r[i]=n}else if(n instanceof Array){r[i]=n.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&n!==null)n=cloneNode(n);r[i]=n}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new i.default(e)};e.warn=function warn(e,t,r){var i={node:this};for(var n in r){i[n]=r[n]}return e.warn(t,i)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(n);if(t&&i){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new i.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var n=e[0][0];if(n===":"||n==="space"||n==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var i;var n=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){i=u.length-1;r=u[i];while(r&&r[0]==="space"){r=u[--i]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){n=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(n){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var i,n;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;n--){i=e[n];if(i[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",i[2],i[3])};return Parser}();t.default=f;e.exports=t.default},5848:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(6622));var n=_interopRequireDefault(r(8295));var s=_interopRequireDefault(r(3057));var o=_interopRequireDefault(r(5051));var u=_interopRequireDefault(r(9616));var a=_interopRequireDefault(r(235));var f=_interopRequireDefault(r(5955));var l=_interopRequireDefault(r(5450));var c=_interopRequireDefault(r(5953));var h=_interopRequireDefault(r(8813));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var i="data:application/json,";if(this.startWith(e,i)){return decodeURIComponent(e.substr(i.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof i.default.SourceMapConsumer){return i.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof i.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=n.default.join(n.default.dirname(e),o);this.root=n.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},8295:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(7023));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var n=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new i.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,i=Array.isArray(r),n=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(n>=r.length)break;s=r[n++]}else{n=r.next();if(n.done)break;s=n.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=n;t.default=s;e.exports=t.default},3172:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(43));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[i].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,i){var n=e.prototype.normalize.call(this,t);if(r){if(i==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=n,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return n};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(7023);var i=r(8295);var n=new t(new i,this,e);return n.stringify()};return Root}(i.default);var s=n;t.default=s;e.exports=t.default},5953:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var i=_interopRequireDefault(r(7859));var n=_interopRequireDefault(r(5450));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var i=0;i0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var i=e.parent;var n=0;while(i&&i.type!=="root"){n+=1;i=i.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;E=D.charCodeAt(G);if(E===o||E===a||E===l&&D.charCodeAt(G+1)!==o){W=G;V+=1}switch(E){case o:case u:case f:case l:case a:M=G;do{M+=1;E=D.charCodeAt(M);if(E===o){W=M;V+=1}}while(E===u||E===o||E===f||E===l||E===a);z=["space",D.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var Q=String.fromCharCode(E);z=[Q,Q,V,G-W];break;case p:x=Y.length?Y.pop()[1]:"";$=D.charCodeAt(G+1);if(x==="url"&&$!==r&&$!==i&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=D.indexOf(")",M+1);if(M===-1){if(A||t){M=G;break}else{unclosed("bracket")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);z=["brackets",D.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=D.indexOf(")",G+1);F=D.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case i:q=E===r?"'":'"';M=G;do{j=false;M=D.indexOf(q,M+1);if(M===-1){if(A||t){M=G+1;break}else{unclosed("string")}}B=M;while(D.charCodeAt(B-1)===n){B-=1;j=!j}}while(j);F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["string",D.slice(G,M+1),V,G-W,N,M-L];W=L;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(D);if(S.lastIndex===0){M=D.length-1}else{M=S.lastIndex-2}z=["at-word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;case n:M=G;k=true;while(D.charCodeAt(M+1)===n){M+=1;k=!k}E=D.charCodeAt(M+1);if(k&&E!==s&&E!==u&&E!==o&&E!==f&&E!==l&&E!==a){M+=1;if(O.test(D.charAt(M))){while(O.test(D.charAt(M+1))){M+=1}if(D.charCodeAt(M+1)===u){M+=1}}}z=["word",D.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(E===s&&D.charCodeAt(G+1)===y){M=D.indexOf("*/",G+2)+1;if(M===0){if(A||t){M=D.length}else{unclosed("comment")}}F=D.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;L=M-T[I].length}else{N=V;L=W}z=["comment",F,V,G-W,N,M-L];W=L;V=N;G=M}else{R.lastIndex=G+1;R.test(D);if(R.lastIndex===0){M=D.length-1}else{M=R.lastIndex-2}z=["word",D.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},235:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var i=r;t.default=i;e.exports=t.default},2508:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},43:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var i in t){this[i]=t[i]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var i=r;t.default=i;e.exports=t.default},4270:function(e,t,r){"use strict";const i=r(5848);const n=r(3656);const s=/^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;const o=/(?:\s+|^)([\w-]+):?\s+(.+?)\s*$/g;const u=/^([\w-]+)(?:\s+as\s+([\w-]+))?/;let a={};let f=0;let l=a&&a.createImportedName||(e=>`i__const_${e.replace(/\W/g,"_")}_${f++}`);e.exports=i.plugin("postcss-modules-values",()=>(e,t)=>{const r=[];const a={};const f=e=>{let t;while(t=o.exec(e.params)){let[,r,i]=t;a[r]=n.replaceValueSymbols(i,a);e.remove()}};const c=e=>{const t=s.exec(e.params);if(t){let[,i,n]=t;if(a[n]){n=a[n]}const s=i.replace(/^\(\s*([\s\S]+)\s*\)$/,"$1").split(/\s*,\s*/).map(e=>{const t=u.exec(e);if(t){const[,e,r=e]=t;const i=l(r);a[r]=i;return{theirName:e,importedName:i}}else{throw new Error(`@import statement "${e}" is invalid!`)}});r.push({path:n,imports:s});e.remove()}};e.walkAtRules("value",e=>{if(s.exec(e.params)){c(e)}else{if(e.params.indexOf("@value")!==-1){t.warn("Invalid value definition: "+e.params)}f(e)}});const h=Object.keys(a).map(e=>i.decl({value:a[e],prop:e,raws:{before:"\n "}}));if(!Object.keys(a).length){return}n.replaceSymbols(e,a);if(h.length>0){const t=i.rule({selector:":export",raws:{after:"\n"}});t.append(h);e.prepend(t)}r.reverse().forEach(({path:t,imports:r})=>{const n=i.rule({selector:`:import(${t})`,raws:{after:"\n"}});r.forEach(({theirName:e,importedName:t})=>{n.append({value:e,prop:t,raws:{before:"\n "}})});e.prepend(n)})})},9285:function(e,t,r){var i=r(5920);var n=r(9987);var s=r(7952);function ValueParser(e){if(this instanceof ValueParser){this.nodes=i(e);return this}return new ValueParser(e)}ValueParser.prototype.toString=function(){return Array.isArray(this.nodes)?s(this.nodes):""};ValueParser.prototype.walk=function(e,t){n(this.nodes,e,t);return this};ValueParser.unit=r(5148);ValueParser.walk=n;ValueParser.stringify=s;e.exports=ValueParser},5920:function(e){var t="(".charCodeAt(0);var r=")".charCodeAt(0);var i="'".charCodeAt(0);var n='"'.charCodeAt(0);var s="\\".charCodeAt(0);var o="/".charCodeAt(0);var u=",".charCodeAt(0);var a=":".charCodeAt(0);var f="*".charCodeAt(0);var l="u".charCodeAt(0);var c="U".charCodeAt(0);var h="+".charCodeAt(0);var p=/^[a-f0-9?-]+$/i;e.exports=function(e){var d=[];var v=e;var g,m,y,w,b,S,R,C;var O=0;var D=v.charCodeAt(O);var A=v.length;var E=[{nodes:d}];var M=0;var q;var T="";var I="";var F="";while(O=48&&s<=57){return true}var o=e.charCodeAt(2);if(s===i&&o>=48&&o<=57){return true}return false}if(n===i){s=e.charCodeAt(1);if(s>=48&&s<=57){return true}return false}if(n>=48&&n<=57){return true}return false}e.exports=function(e){var o=0;var u=e.length;var a;var f;var l;if(u===0||!likeNumber(e)){return false}a=e.charCodeAt(o);if(a===r||a===t){o++}while(o57){break}o+=1}a=e.charCodeAt(o);f=e.charCodeAt(o+1);if(a===i&&f>=48&&f<=57){o+=2;while(o57){break}o+=1}}a=e.charCodeAt(o);f=e.charCodeAt(o+1);l=e.charCodeAt(o+2);if((a===n||a===s)&&(f>=48&&f<=57||(f===r||f===t)&&l>=48&&l<=57)){o+=f===r||f===t?3:2;while(o57){break}o+=1}}return{number:e.slice(0,o),unit:e.slice(o)}}},9987:function(e){e.exports=function walk(e,t,r){var i,n,s,o;for(i=0,n=e.length;i=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(n("color=16m")||n("color=full")||n("color=truecolor")){return 3}if(n("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=i.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},8735:function(e){"use strict";e.exports=JSON.parse('{"additionalProperties":false,"properties":{"url":{"description":"Enables/Disables \'url\'/\'image-set\' functions handling (https://github.com/webpack-contrib/css-loader#url).","anyOf":[{"type":"boolean"},{"instanceof":"Function"}]},"import":{"description":"Enables/Disables \'@import\' at-rules handling (https://github.com/webpack-contrib/css-loader#import).","anyOf":[{"type":"boolean"},{"instanceof":"Function"}]},"modules":{"description":"Enables/Disables CSS Modules and their configuration (https://github.com/webpack-contrib/css-loader#modules).","anyOf":[{"type":"boolean"},{"enum":["local","global","pure"]},{"type":"object","additionalProperties":false,"properties":{"compileType":{"description":"Controls the extent to which css-loader will process module code (https://github.com/webpack-contrib/css-loader#type)","enum":["module","icss"]},"auto":{"description":"Allows auto enable CSS modules based on filename (https://github.com/webpack-contrib/css-loader#auto).","anyOf":[{"instanceof":"RegExp"},{"instanceof":"Function"},{"type":"boolean"}]},"mode":{"description":"Setup `mode` option (https://github.com/webpack-contrib/css-loader#mode).","anyOf":[{"enum":["local","global","pure"]},{"instanceof":"Function"}]},"localIdentName":{"description":"Allows to configure the generated local ident name (https://github.com/webpack-contrib/css-loader#localidentname).","type":"string","minLength":1},"localIdentContext":{"description":"Allows to redefine basic loader context for local ident name (https://github.com/webpack-contrib/css-loader#localidentcontext).","type":"string","minLength":1},"localIdentHashPrefix":{"description":"Allows to add custom hash to generate more unique classes (https://github.com/webpack-contrib/css-loader#localidenthashprefix).","type":"string","minLength":1},"localIdentRegExp":{"description":"Allows to specify custom RegExp for local ident name (https://github.com/webpack-contrib/css-loader#localidentregexp).","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"getLocalIdent":{"description":"Allows to specify a function to generate the classname (https://github.com/webpack-contrib/css-loader#getlocalident).","instanceof":"Function"},"namedExport":{"description":"Enables/disables ES modules named export for locals (https://github.com/webpack-contrib/css-loader#namedexport).","type":"boolean"},"exportGlobals":{"description":"Allows to export names from global class or id, so you can use that as local name (https://github.com/webpack-contrib/css-loader#exportglobals).","type":"boolean"},"exportLocalsConvention":{"description":"Style of exported classnames (https://github.com/webpack-contrib/css-loader#localsconvention).","enum":["asIs","camelCase","camelCaseOnly","dashes","dashesOnly"]},"exportOnlyLocals":{"description":"Export only locals (https://github.com/webpack-contrib/css-loader#exportonlylocals).","type":"boolean"}}}]},"icss":{"description":"Enables/Disables handling the CSS module interoperable import/export format ((https://github.com/webpack-contrib/css-loader#icss)","type":"boolean"},"sourceMap":{"description":"Enables/Disables generation of source maps (https://github.com/webpack-contrib/css-loader#sourcemap).","type":"boolean"},"importLoaders":{"description":"Enables/Disables or setups number of loaders applied before CSS loader (https://github.com/webpack-contrib/css-loader#importloaders).","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"integer"}]},"esModule":{"description":"Use the ES modules syntax (https://github.com/webpack-contrib/css-loader#esmodule).","type":"boolean"}},"type":"object"}')},5976:function(e){"use strict";e.exports=JSON.parse('{"name":"postcss","version":"7.0.32","description":"Tool for transforming styles with JS plugins","engines":{"node":">=6.0.0"},"keywords":["css","postcss","rework","preprocessor","parser","source map","transform","manipulation","transpiler"],"funding":{"type":"tidelift","url":"https://tidelift.com/funding/github/npm/postcss"},"author":"Andrey Sitnik ","license":"MIT","homepage":"https://postcss.org/","repository":"postcss/postcss","dependencies":{"chalk":"^2.4.2","source-map":"^0.6.1","supports-color":"^6.1.0"},"main":"lib/postcss","types":"lib/postcss.d.ts","husky":{"hooks":{"pre-commit":"lint-staged"}},"browser":{"./lib/terminal-highlight":false,"supports-color":false,"chalk":false,"fs":false},"browserslist":["last 2 version","not dead","not Explorer 11","not ExplorerMobile 11","node 6"]}')},2242:function(e){"use strict";e.exports=require("chalk")},5747:function(e){"use strict";e.exports=require("fs")},3443:function(e){"use strict";e.exports=require("next/dist/compiled/loader-utils")},3225:function(e){"use strict";e.exports=require("next/dist/compiled/schema-utils")},2519:function(e){"use strict";e.exports=require("next/dist/compiled/semver")},6241:function(e){"use strict";e.exports=require("next/dist/compiled/source-map")},2087:function(e){"use strict";e.exports=require("os")},5622:function(e){"use strict";e.exports=require("path")},8835:function(e){"use strict";e.exports=require("url")},1669:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var i=t[r]={exports:{}};var n=true;try{e[r](i,i.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}return i.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(7583)}(); \ No newline at end of file +module.exports=function(){var e={5455:function(e){"use strict";var t={};var r=t.hasOwnProperty;var n=function merge(e,t){if(!e){return t}var n={};for(var i in t){n[i]=r.call(e,i)?e[i]:t[i]}return n};var i=/[ -,\.\/:-@\[-\^`\{-~]/;var s=/[ -,\.\/:-@\[\]\^`\{-~]/;var o=/['"\\]/;var u=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var a=function cssesc(e,t){t=n(t,cssesc.options);if(t.quotes!="single"&&t.quotes!="double"){t.quotes="single"}var r=t.quotes=="double"?'"':"'";var o=t.isIdentifier;var a=e.charAt(0);var f="";var l=0;var c=e.length;while(l126){if(p>=55296&&p<=56319&&l{return Object.keys(e).map(t=>{const r=e[t];const i=Object.keys(r).map(e=>n.default.decl({prop:e,value:r[e],raws:{before:"\n "}}));const s=i.length>0;const o=n.default.rule({selector:`:import('${t}')`,raws:{after:s?"\n":""}});if(s){o.append(i)}return o})};const s=e=>{const t=Object.keys(e).map(t=>n.default.decl({prop:t,value:e[t],raws:{before:"\n "}}));if(t.length===0){return[]}const r=n.default.rule({selector:`:export`,raws:{after:"\n"}}).append(t);return[r]};const o=(e,t)=>[...i(e),...s(t)];var u=o;t.default=u},2032:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;const r=/^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;const n=e=>{const t={};e.walkDecls(e=>{const r=e.raws.before?e.raws.before.trim():"";t[r+e.prop]=e.value});return t};const i=(e,t=true)=>{const i={};const s={};e.each(e=>{if(e.type==="rule"){if(e.selector.slice(0,7)===":import"){const s=r.exec(e.selector);if(s){const r=s[1].replace(/'|"/g,"");i[r]=Object.assign(i[r]||{},n(e));if(t){e.remove()}}}if(e.selector===":export"){Object.assign(s,n(e));if(t){e.remove()}}}});return{icssImports:i,icssExports:s}};var s=i;t.default=s},3656:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"replaceValueSymbols",{enumerable:true,get:function get(){return n.default}});Object.defineProperty(t,"replaceSymbols",{enumerable:true,get:function get(){return i.default}});Object.defineProperty(t,"extractICSS",{enumerable:true,get:function get(){return s.default}});Object.defineProperty(t,"createICSSRules",{enumerable:true,get:function get(){return o.default}});var n=_interopRequireDefault(r(621));var i=_interopRequireDefault(r(287));var s=_interopRequireDefault(r(2032));var o=_interopRequireDefault(r(1159));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},287:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(621));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const i=(e,t)=>{e.walk(e=>{if(e.type==="decl"&&e.value){e.value=(0,n.default)(e.value.toString(),t)}else if(e.type==="rule"&&e.selector){e.selector=(0,n.default)(e.selector.toString(),t)}else if(e.type==="atrule"&&e.params){e.params=(0,n.default)(e.params.toString(),t)}})};var s=i;t.default=s},621:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;const r=/[$]?[\w-]+/g;const n=(e,t)=>{let n;while(n=r.exec(e)){const i=t[n[0]];if(i){e=e.slice(0,n.index)+i+e.slice(r.lastIndex);r.lastIndex-=n[0].length-i.length}}return e};var i=n;t.default=i},4751:function(e){e.exports=function(e,t){var r=-1,n=[];while((r=e.indexOf(t,r+1))!==-1)n.push(r);return n}},1571:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3509));var i=_interopRequireWildcard(r(4267));function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};if(n.get||n.set){Object.defineProperty(t,r,n)}else{t[r]=e[r]}}}}t.default=e;return t}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function parser(e){return new n.default(e)};Object.assign(s,i);delete s.__esModule;var o=s;t.default=o;e.exports=t.default},6557:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(4751));var i=_interopRequireDefault(r(5632));var s=_interopRequireDefault(r(1682));var o=_interopRequireDefault(r(4955));var u=_interopRequireDefault(r(586));var a=_interopRequireDefault(r(6435));var f=_interopRequireDefault(r(1733));var l=_interopRequireDefault(r(5201));var c=_interopRequireDefault(r(1193));var h=_interopRequireDefault(r(716));var p=_interopRequireWildcard(r(7223));var d=_interopRequireDefault(r(3261));var v=_interopRequireDefault(r(1632));var g=_interopRequireDefault(r(8081));var m=_interopRequireDefault(r(5664));var y=_interopRequireWildcard(r(5648));var w=_interopRequireWildcard(r(7024));var b=_interopRequireWildcard(r(9107));var S=r(5431);var R,C;function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};if(n.get||n.set){Object.defineProperty(t,r,n)}else{t[r]=e[r]}}}}t.default=e;return t}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(r),s=i.space,o=i.rawSpace;if(o!==undefined){n.rawSpaceAfter+=o}n.spaces.after+=s}else{r.forEach(function(t){return e.newNode(t)})}}return}var u=this.currToken;var a=undefined;if(t>this.position){a=this.parseWhitespaceEquivalentTokens(t)}var f;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[y.FIELDS.TYPE]===w.combinator){f=new v.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[y.FIELDS.START_POS]});this.position++}else if(O[this.currToken[y.FIELDS.TYPE]]){}else if(!a){this.unexpected()}if(f){if(a){var l=this.convertWhitespaceNodesToSpace(a),c=l.space,h=l.rawSpace;f.spaces.before=c;f.rawSpaceBefore=h}}else{var p=this.convertWhitespaceNodesToSpace(a,true),d=p.space,g=p.rawSpace;if(!g){g=d}var m={};var b={spaces:{}};if(d.endsWith(" ")&&g.endsWith(" ")){m.before=d.slice(0,d.length-1);b.spaces.before=g.slice(0,g.length-1)}else if(d.startsWith(" ")&&g.startsWith(" ")){m.after=d.slice(1);b.spaces.after=g.slice(1)}else{b.value=g}f=new v.default({value:" ",source:getTokenSourceSpan(u,this.tokens[this.position-1]),sourceIndex:u[y.FIELDS.START_POS],spaces:m,raws:b})}if(this.currToken&&this.currToken[y.FIELDS.TYPE]===w.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};e.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new o.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};e.comment=function comment(){var e=this.currToken;this.newNode(new a.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[y.FIELDS.START_POS]}));this.position++};e.error=function error(e,t){throw this.root.error(e,t)};e.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[y.FIELDS.START_POS]})};e.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[y.FIELDS.START_POS])};e.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[y.FIELDS.START_POS])};e.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[y.FIELDS.START_POS])};e.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[y.FIELDS.TYPE]===w.word){this.position++;return this.word(e)}else if(this.nextToken[y.FIELDS.TYPE]===w.asterisk){this.position++;return this.universal(e)}};e.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var t=this.currToken;this.newNode(new g.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[y.FIELDS.START_POS]}));this.position++};e.parentheses=function parentheses(){var e=this.current.last;var t=1;this.position++;if(e&&e.type===b.PSEUDO){var r=new o.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(r);this.current=r;while(this.position1&&e.nextToken&&e.nextToken[y.FIELDS.TYPE]===w.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[y.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[y.FIELDS.START_POS])}};e.space=function space(){var e=this.content();if(this.position===0||this.prevToken[y.FIELDS.TYPE]===w.comma||this.prevToken[y.FIELDS.TYPE]===w.openParenthesis||this.current.nodes.every(function(e){return e.type==="comment"})){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[y.FIELDS.TYPE]===w.comma||this.nextToken[y.FIELDS.TYPE]===w.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};e.string=function string(){var e=this.currToken;this.newNode(new c.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[y.FIELDS.START_POS]}));this.position++};e.universal=function universal(e){var t=this.nextToken;if(t&&this.content(t)==="|"){this.position++;return this.namespace()}var r=this.currToken;this.newNode(new d.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[y.FIELDS.START_POS]}),e);this.position++};e.splitWord=function splitWord(e,t){var r=this;var s=this.nextToken;var o=this.content();while(s&&~[w.dollar,w.caret,w.equals,w.word].indexOf(s[y.FIELDS.TYPE])){this.position++;var a=this.content();o+=a;if(a.lastIndexOf("\\")===a.length-1){var c=this.nextToken;if(c&&c[y.FIELDS.TYPE]===w.space){o+=this.requiredSpace(this.content(c));this.position++}}s=this.nextToken}var h=(0,n.default)(o,".").filter(function(e){return o[e-1]!=="\\"});var p=(0,n.default)(o,"#").filter(function(e){return o[e-1]!=="\\"});var d=(0,n.default)(o,"#{");if(d.length){p=p.filter(function(e){return!~d.indexOf(e)})}var v=(0,m.default)((0,i.default)([0].concat(h,p)));v.forEach(function(n,i){var s=v[i+1]||o.length;var a=o.slice(n,s);if(i===0&&t){return t.call(r,a,v.length)}var c;var d=r.currToken;var g=d[y.FIELDS.START_POS]+v[i];var m=getSource(d[1],d[2]+n,d[3],d[2]+(s-1));if(~h.indexOf(n)){var w={value:a.slice(1),source:m,sourceIndex:g};c=new u.default(unescapeProp(w,"value"))}else if(~p.indexOf(n)){var b={value:a.slice(1),source:m,sourceIndex:g};c=new f.default(unescapeProp(b,"value"))}else{var S={value:a,source:m,sourceIndex:g};unescapeProp(S,"value");c=new l.default(S)}r.newNode(c,e);e=null});this.position++};e.word=function word(e){var t=this.nextToken;if(t&&this.content(t)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};e.loop=function loop(){while(this.position0&&!e.quoted&&r.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){r.before=" "}return defaultAttrConcat(t,r)}))}t.push("]");t.push(this.rawSpaceAfter);return t.join("")};_createClass(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){c()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var t=unescapeValue(e),r=t.deprecatedUsage,n=t.unescaped,i=t.quoteMark;if(r){l()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(s.default);t.default=p;p.NO_QUOTE=null;p.SINGLE_QUOTE="'";p.DOUBLE_QUOTE='"';var d=(u={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},u[null]={isIdentifier:true},u);function defaultAttrConcat(e,t){return""+t.before+e+t.after}},586:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5455));var i=r(5431);var s=_interopRequireDefault(r(5731));var o=r(9107);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.empty=function empty(){return this.removeAll()};t.insertAfter=function insertAfter(e,t){t.parent=this;var r=this.index(e);this.nodes.splice(r+1,0,t);t.parent=this;var n;for(var i in this.indexes){n=this.indexes[i];if(r<=n){this.indexes[i]=n+1}}return this};t.insertBefore=function insertBefore(e,t){t.parent=this;var r=this.index(e);this.nodes.splice(r,0,t);t.parent=this;var n;for(var i in this.indexes){n=this.indexes[i];if(n<=r){this.indexes[i]=n+1}}return this};t._findChildAtPosition=function _findChildAtPosition(e,t){var r=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,t);if(i){r=i;return false}}else if(n.isAtPosition(e,t)){r=n;return false}});return r};t.atPosition=function atPosition(e,t){if(this.isAtPosition(e,t)){return this._findChildAtPosition(e,t)||this}else{return undefined}};t._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};t.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var t=this.lastEach;this.indexes[t]=0;if(!this.length){return undefined}var r,n;while(this.indexes[t]e){return false}if(this.source.end.linet){return false}if(this.source.end.line===e&&this.source.end.column0){w=u+g;b=y-m[g].length}else{w=u;b=o}R=n.comment;u=w;p=w;h=y-b}else if(l===n.slash){y=a;R=l;p=u;h=a-o;f=y+1}else{y=consumeWord(r,a);R=n.word;p=u;h=y-o}f=y+1;break}t.push([R,u,a-o,p,h,a,f]);if(b){o=b;b=null}a=f}return t}},7378:function(e,t){"use strict";t.__esModule=true;t.default=ensureObject;function ensureObject(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0){var i=r.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=t.default},2585:function(e,t){"use strict";t.__esModule=true;t.default=getProp;function getProp(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0){var i=r.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=t.default},5431:function(e,t,r){"use strict";t.__esModule=true;t.stripComments=t.ensureObject=t.getProp=t.unesc=void 0;var n=_interopRequireDefault(r(8127));t.unesc=n.default;var i=_interopRequireDefault(r(2585));t.getProp=i.default;var s=_interopRequireDefault(r(7378));t.ensureObject=s.default;var o=_interopRequireDefault(r(4585));t.stripComments=o.default;function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},4585:function(e,t){"use strict";t.__esModule=true;t.default=stripComments;function stripComments(e){var t="";var r=e.indexOf("/*");var n=0;while(r>=0){t=t+e.slice(n,r);var i=e.indexOf("*/",r+2);if(i<0){return t}n=i+2;r=e.indexOf("/*",n)}t=t+e.slice(n);return t}e.exports=t.default},8127:function(e,t){"use strict";t.__esModule=true;t.default=unesc;var r="[\\x20\\t\\r\\n\\f]";var n=new RegExp("\\\\([\\da-f]{1,6}"+r+"?|("+r+")|.)","ig");function unesc(e){return e.replace(n,function(e,t,r){var n="0x"+t-65536;return n!==n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)})}e.exports=t.default},4217:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(3749);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(7797);e=[new m(e)]}else if(e.name){var y=r(4217);e=[new y(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},9535:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(8327));var i=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(8300));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},3605:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(1497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},4905:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5622));var i=_interopRequireDefault(r(9535));var s=_interopRequireDefault(r(2713));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},1169:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3595));var i=_interopRequireDefault(r(7549));var s=_interopRequireDefault(r(3831));var o=_interopRequireDefault(r(7613));var u=_interopRequireDefault(r(3749));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},7009:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},3595:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6241));var i=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},1497:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(9535));var i=_interopRequireDefault(r(3935));var s=_interopRequireDefault(r(7549));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},4633:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3605));var i=_interopRequireDefault(r(8074));var s=_interopRequireDefault(r(7549));var o=_interopRequireDefault(r(8259));var u=_interopRequireDefault(r(4217));var a=_interopRequireDefault(r(216));var f=_interopRequireDefault(r(3749));var l=_interopRequireDefault(r(7009));var c=_interopRequireDefault(r(7797));var h=_interopRequireDefault(r(5907));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},8074:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(1169));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},7613:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(7338));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(1169);var n=r(8074);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},7797:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5878));var i=_interopRequireDefault(r(7009));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;A=E.charCodeAt(G);if(A===o||A===a||A===l&&E.charCodeAt(G+1)!==o){W=G;V+=1}switch(A){case o:case u:case f:case l:case a:M=G;do{M+=1;A=E.charCodeAt(M);if(A===o){W=M;V+=1}}while(A===u||A===o||A===f||A===l||A===a);z=["space",E.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var _=String.fromCharCode(A);z=[_,_,V,G-W];break;case p:B=Y.length?Y.pop()[1]:"";$=E.charCodeAt(G+1);if(B==="url"&&$!==r&&$!==n&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=E.indexOf(")",M+1);if(M===-1){if(D||t){M=G;break}else{unclosed("bracket")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);z=["brackets",E.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=E.indexOf(")",G+1);F=E.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case n:q=A===r?"'":'"';M=G;do{j=false;M=E.indexOf(q,M+1);if(M===-1){if(D||t){M=G+1;break}else{unclosed("string")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["string",E.slice(G,M+1),V,G-W,N,M-k];W=k;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(E);if(S.lastIndex===0){M=E.length-1}else{M=S.lastIndex-2}z=["at-word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;case i:M=G;L=true;while(E.charCodeAt(M+1)===i){M+=1;L=!L}A=E.charCodeAt(M+1);if(L&&A!==s&&A!==u&&A!==o&&A!==f&&A!==l&&A!==a){M+=1;if(O.test(E.charAt(M))){while(O.test(E.charAt(M+1))){M+=1}if(E.charCodeAt(M+1)===u){M+=1}}}z=["word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(A===s&&E.charCodeAt(G+1)===y){M=E.indexOf("*/",G+2)+1;if(M===0){if(D||t){M=E.length}else{unclosed("comment")}}F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["comment",F,V,G-W,N,M-k];W=k;V=N;G=M}else{R.lastIndex=G+1;R.test(E);if(R.lastIndex===0){M=E.length-1}else{M=R.lastIndex-2}z=["word",E.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},216:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},3831:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},7338:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},183:function(e){"use strict";e.exports=((e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},5632:function(e){"use strict";function unique_pred(e,t){var r=1,n=e.length,i=e[0],s=e[0];for(var o=1;o{let r=false;let n=false;let i=false;for(let s=0;s{return e.replace(/^[\p{Lu}](?![\p{Lu}])/gu,e=>e.toLowerCase())};const n=(e,t)=>{return e.replace(/[_.\- ]+([\p{Alpha}\p{N}_]|$)/gu,(e,r)=>r.toLocaleUpperCase(t.locale)).replace(/\d+([\p{Alpha}\p{N}_]|$)/gu,e=>e.toLocaleUpperCase(t.locale))};const i=(e,i)=>{if(!(typeof e==="string"||Array.isArray(e))){throw new TypeError("Expected the input to be `string | string[]`")}i={pascalCase:false,preserveConsecutiveUppercase:false,...i};if(Array.isArray(e)){e=e.map(e=>e.trim()).filter(e=>e.length).join("-")}else{e=e.trim()}if(e.length===0){return""}if(e.length===1){return i.pascalCase?e.toLocaleUpperCase(i.locale):e.toLocaleLowerCase(i.locale)}const s=e!==e.toLocaleLowerCase(i.locale);if(s){e=t(e,i.locale)}e=e.replace(/^[_.\- ]+/,"");if(i.preserveConsecutiveUppercase){e=r(e)}else{e=e.toLocaleLowerCase()}if(i.pascalCase){e=e.charAt(0).toLocaleUpperCase(i.locale)+e.slice(1)}return n(e,i)};e.exports=i;e.exports.default=i},6124:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;class CssSyntaxError extends Error{constructor(e){super(e);const{reason:t,line:r,column:n}=e;this.name="CssSyntaxError";this.message=`${this.name}\n\n`;if(typeof r!=="undefined"){this.message+=`(${r}:${n}) `}this.message+=`${t}`;const i=e.showSourceCode();if(i){this.message+=`\n\n${i}\n`}this.stack=false}}t.default=CssSyntaxError},8363:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;class Warning extends Error{constructor(e){super(e);const{text:t,line:r,column:n}=e;this.name="Warning";this.message=`${this.name}\n\n`;if(typeof r!=="undefined"){this.message+=`(${r}:${n}) `}this.message+=`${t}`;this.stack=false}}t.default=Warning},7583:function(e,t,r){"use strict";const n=r(5462);e.exports=n.default},5462:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=loader;var n=r(3443);var i=_interopRequireDefault(r(66));var s=_interopRequireDefault(r(5976));var o=_interopRequireDefault(r(3225));var u=r(2519);var a=_interopRequireDefault(r(6124));var f=_interopRequireDefault(r(8363));var l=_interopRequireDefault(r(8735));var c=r(6780);var h=r(2474);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}async function loader(e,t,p){const d=(0,n.getOptions)(this);(0,o.default)(l.default,d,{name:"CSS Loader",baseDataPath:"options"});const v=[];const g=this.async();let m;try{m=(0,h.normalizeOptions)(d,this)}catch(e){g(e);return}const y=[];const w=[];if((0,h.shouldUseModulesPlugins)(m)){v.push(...(0,h.getModulesPlugins)(m,this))}const b=[];const S=[];if((0,h.shouldUseImportPlugin)(m)){const e=this.getResolve({conditionNames:["style"],extensions:[".css"],mainFields:["css","style","main","..."],mainFiles:["index","..."],restrictions:[/\.css$/i]});v.push((0,c.importParser)({imports:b,api:S,context:this.context,rootContext:this.rootContext,filter:(0,h.getFilter)(m.import,this.resourcePath),resolver:e,urlHandler:e=>(0,n.stringifyRequest)(this,(0,h.getPreRequester)(this)(m.importLoaders)+e)}))}const R=[];if((0,h.shouldUseURLPlugin)(m)){const e=this.getResolve({conditionNames:["asset"],mainFields:["asset"],mainFiles:[],extensions:[]});v.push((0,c.urlParser)({imports:R,replacements:y,context:this.context,rootContext:this.rootContext,filter:(0,h.getFilter)(m.url,this.resourcePath),resolver:e,urlHandler:e=>(0,n.stringifyRequest)(this,e)}))}const C=[];const O=[];if((0,h.shouldUseIcssPlugin)(m)){const e=this.getResolve({conditionNames:["style"],extensions:[],mainFields:["css","style","main","..."],mainFiles:["index","..."]});v.push((0,c.icssParser)({imports:C,api:O,replacements:y,exports:w,context:this.context,rootContext:this.rootContext,resolver:e,urlHandler:e=>(0,n.stringifyRequest)(this,(0,h.getPreRequester)(this)(m.importLoaders)+e)}))}if(p){const{ast:t}=p;if(t&&t.type==="postcss"&&(0,u.satisfies)(t.version,`^${s.default.version}`)){e=t.root}}const{resourcePath:E}=this;let D;try{D=await(0,i.default)(v).process(e,{from:E,to:E,map:m.sourceMap?{prev:t?(0,h.normalizeSourceMap)(t,E):null,inline:false,annotation:false}:false})}catch(e){if(e.file){this.addDependency(e.file)}g(e.name==="CssSyntaxError"?new a.default(e):e);return}for(const e of D.warnings()){this.emitWarning(new f.default(e))}const A=[].concat(C.sort(h.sort)).concat(b.sort(h.sort)).concat(R.sort(h.sort));const M=[].concat(S.sort(h.sort)).concat(O.sort(h.sort));if(m.modules.exportOnlyLocals!==true){A.unshift({importName:"___CSS_LOADER_API_IMPORT___",url:(0,n.stringifyRequest)(this,r.ab+"api.js")})}const q=(0,h.getImportCode)(A,m);const T=(0,h.getModuleCode)(D,M,y,m,this);const I=(0,h.getExportCode)(w,y,m);g(null,`${q}${T}${I}`)}},6780:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"importParser",{enumerable:true,get:function(){return n.default}});Object.defineProperty(t,"icssParser",{enumerable:true,get:function(){return i.default}});Object.defineProperty(t,"urlParser",{enumerable:true,get:function(){return s.default}});var n=_interopRequireDefault(r(9063));var i=_interopRequireDefault(r(9454));var s=_interopRequireDefault(r(7097));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},9454:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(66));var i=r(3656);var s=r(2474);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o=n.default.plugin("postcss-icss-parser",e=>async t=>{const r=Object.create(null);const{icssImports:n,icssExports:o}=(0,i.extractICSS)(t);const u=new Map;const a=[];for(const t in n){const r=n[t];if(Object.keys(r).length===0){continue}let i=t;let o="";const u=i.split("!");if(u.length>1){i=u.pop();o=u.join("!")}const f=(0,s.requestify)((0,s.normalizeUrl)(i,true),e.rootContext);const l=async()=>{const{resolver:t,context:n}=e;const u=await(0,s.resolveRequests)(t,n,[...new Set([i,f])]);return{url:u,prefix:o,tokens:r}};a.push(l())}const f=await Promise.all(a);for(let t=0;t<=f.length-1;t++){const{url:n,prefix:i,tokens:s}=f[t];const o=i?`${i}!${n}`:n;const a=o;let l=u.get(a);if(!l){l=`___CSS_LOADER_ICSS_IMPORT_${u.size}___`;u.set(a,l);e.imports.push({importName:l,url:e.urlHandler(o),icss:true,index:t});e.api.push({importName:l,dedupe:true,index:t})}for(const[n,i]of Object.keys(s).entries()){const o=`___CSS_LOADER_ICSS_IMPORT_${t}_REPLACEMENT_${n}___`;const u=s[i];r[i]=o;e.replacements.push({replacementName:o,importName:l,localName:u})}}if(Object.keys(r).length>0){(0,i.replaceSymbols)(t,r)}for(const t of Object.keys(o)){const n=(0,i.replaceValueSymbols)(o[t],r);e.exports.push({name:t,value:n})}});t.default=o},9063:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=r(1669);var i=_interopRequireDefault(r(66));var s=_interopRequireDefault(r(9285));var o=r(2474);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const u="postcss-import-parser";function walkAtRules(e,t,r,n){const i=[];e.walkAtRules(/^import$/i,e=>{if(e.parent.type!=="root"){return}if(e.nodes){t.warn("It looks like you didn't end your @import statement correctly. Child nodes are attached to it.",{node:e});return}const{nodes:r}=(0,s.default)(e.params);if(r.length===0||r[0].type!=="string"&&r[0].type!=="function"){t.warn(`Unable to find uri in "${e.toString()}"`,{node:e});return}let n;let o;if(r[0].type==="string"){n=true;o=r[0].value}else{if(r[0].value.toLowerCase()!=="url"){t.warn(`Unable to find uri in "${e.toString()}"`,{node:e});return}n=r[0].nodes.length!==0&&r[0].nodes[0].type==="string";o=n?r[0].nodes[0].value:s.default.stringify(r[0].nodes)}if(o.trim().length===0){t.warn(`Unable to find uri in "${e.toString()}"`,{node:e});return}i.push({atRule:e,url:o,isStringValue:n,mediaNodes:r.slice(1)})});n(null,i)}const a=(0,n.promisify)(walkAtRules);var f=i.default.plugin(u,e=>async(t,r)=>{const n=await a(t,r,e);if(n.length===0){return Promise.resolve()}const i=new Map;const u=[];for(const t of n){const{atRule:n,url:i,isStringValue:a,mediaNodes:f}=t;let l=i;let c="";const h=(0,o.isUrlRequestable)(l);if(h){const e=l.split("!");if(e.length>1){l=e.pop();c=e.join("!")}l=(0,o.normalizeUrl)(l,a);if(l.trim().length===0){r.warn(`Unable to find uri in "${n.toString()}"`,{node:n});continue}}let p;if(f.length>0){p=s.default.stringify(f).trim().toLowerCase()}if(e.filter&&!e.filter(l,p)){continue}n.remove();if(h){const t=(0,o.requestify)(l,e.rootContext);u.push((async()=>{const{resolver:r,context:n}=e;const i=await(0,o.resolveRequests)(r,n,[...new Set([t,l])]);return{url:i,media:p,prefix:c,isRequestable:h}})())}else{u.push({url:i,media:p,prefix:c,isRequestable:h})}}const f=await Promise.all(u);for(let t=0;t<=f.length-1;t++){const{url:r,isRequestable:n,media:s}=f[t];if(n){const{prefix:n}=f[t];const o=n?`${n}!${r}`:r;const u=o;let a=i.get(u);if(!a){a=`___CSS_LOADER_AT_RULE_IMPORT_${i.size}___`;i.set(u,a);e.imports.push({importName:a,url:e.urlHandler(o),index:t})}e.api.push({importName:a,media:s,index:t});continue}e.api.push({url:r,media:s,index:t})}return Promise.resolve()});t.default=f},7097:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=r(1669);var i=_interopRequireDefault(r(66));var s=_interopRequireDefault(r(9285));var o=r(2474);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const u="postcss-url-parser";const a=/url/i;const f=/^(?:-webkit-)?image-set$/i;const l=/(?:url|(?:-webkit-)?image-set)\(/i;function getNodeFromUrlFunc(e){return e.nodes&&e.nodes[0]}function shouldHandleRule(e,t,r){if(e.url.replace(/^[\s]+|[\s]+$/g,"").length===0){r.warn(`Unable to find uri in '${t.toString()}'`,{node:t});return false}if(!(0,o.isUrlRequestable)(e.url)){return false}return true}function walkCss(e,t,r,n){const i=[];e.walkDecls(e=>{if(!l.test(e.value)){return}const r=(0,s.default)(e.value);r.walk(n=>{if(n.type!=="function"){return}if(a.test(n.value)){const{nodes:o}=n;const u=o.length!==0&&o[0].type==="string";const a=u?o[0].value:s.default.stringify(o);const f={node:getNodeFromUrlFunc(n),url:a,needQuotes:false,isStringValue:u};if(shouldHandleRule(f,e,t)){i.push({decl:e,rule:f,parsed:r})}return false}else if(f.test(n.value)){for(const o of n.nodes){const{type:n,value:u}=o;if(n==="function"&&a.test(u)){const{nodes:n}=o;const u=n.length!==0&&n[0].type==="string";const a=u?n[0].value:s.default.stringify(n);const f={node:getNodeFromUrlFunc(o),url:a,needQuotes:false,isStringValue:u};if(shouldHandleRule(f,e,t)){i.push({decl:e,rule:f,parsed:r})}}else if(n==="string"){const n={node:o,url:u,needQuotes:true,isStringValue:true};if(shouldHandleRule(n,e,t)){i.push({decl:e,rule:n,parsed:r})}}}return false}})});n(null,i)}const c=(0,n.promisify)(walkCss);var h=i.default.plugin(u,e=>async(t,n)=>{const i=await c(t,n,e);if(i.length===0){return Promise.resolve()}const s=[];const u=new Map;const a=new Map;let f=false;for(const t of i){const{url:n,isStringValue:i}=t.rule;let u=n;let a="";const l=u.split("!");if(l.length>1){u=l.pop();a=l.join("!")}u=(0,o.normalizeUrl)(u,i);if(!e.filter(u)){continue}if(!f){e.imports.push({importName:"___CSS_LOADER_GET_URL_IMPORT___",url:e.urlHandler(r.ab+"getUrl.js"),index:-1});f=true}const c=u.split(/(\?)?#/);const[h,p,d]=c;let v=p?"?":"";v+=d?`#${d}`:"";const g=(0,o.requestify)(h,e.rootContext);s.push((async()=>{const{resolver:r,context:n}=e;const i=await(0,o.resolveRequests)(r,n,[...new Set([g,u])]);return{url:i,prefix:a,hash:v,parsedResult:t}})())}const l=await Promise.all(s);for(let t=0;t<=l.length-1;t++){const{url:r,prefix:n,hash:i,parsedResult:{decl:s,rule:o,parsed:f}}=l[t];const c=n?`${n}!${r}`:r;const h=c;let p=u.get(h);if(!p){p=`___CSS_LOADER_URL_IMPORT_${u.size}___`;u.set(h,p);e.imports.push({importName:p,url:e.urlHandler(c),index:t})}const{needQuotes:d}=o;const v=JSON.stringify({newUrl:c,hash:i,needQuotes:d});let g=a.get(v);if(!g){g=`___CSS_LOADER_URL_REPLACEMENT_${a.size}___`;a.set(v,g);e.replacements.push({replacementName:g,importName:p,hash:i,needQuotes:d})}o.node.type="word";o.node.value=g;s.value=f.toString()}return Promise.resolve()});t.default=h},2474:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.normalizeOptions=normalizeOptions;t.shouldUseModulesPlugins=shouldUseModulesPlugins;t.shouldUseImportPlugin=shouldUseImportPlugin;t.shouldUseURLPlugin=shouldUseURLPlugin;t.shouldUseIcssPlugin=shouldUseIcssPlugin;t.normalizeUrl=normalizeUrl;t.requestify=requestify;t.getFilter=getFilter;t.getModulesOptions=getModulesOptions;t.getModulesPlugins=getModulesPlugins;t.normalizeSourceMap=normalizeSourceMap;t.getPreRequester=getPreRequester;t.getImportCode=getImportCode;t.getModuleCode=getModuleCode;t.getExportCode=getExportCode;t.resolveRequests=resolveRequests;t.isUrlRequestable=isUrlRequestable;t.sort=sort;var n=r(8835);var i=_interopRequireDefault(r(5622));var s=r(3443);var o=_interopRequireDefault(r(5455));var u=_interopRequireDefault(r(4270));var a=_interopRequireDefault(r(1005));var f=_interopRequireDefault(r(4192));var l=_interopRequireDefault(r(7475));var c=_interopRequireDefault(r(1362));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const h="[\\x20\\t\\r\\n\\f]";const p=new RegExp(`\\\\([\\da-f]{1,6}${h}?|(${h})|.)`,"ig");const d=/^[A-Z]:[/\\]|^\\\\/i;function unescape(e){return e.replace(p,(e,t,r)=>{const n=`0x${t}`-65536;return n!==n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)})}function normalizePath(e){return i.default.sep==="\\"?e.replace(/\\/g,"/"):e}const v=/[<>:"/\\|?*]/g;const g=/[\u0000-\u001f\u0080-\u009f]/g;function defaultGetLocalIdent(e,t,r,n){const{context:u,hashPrefix:a}=n;const{resourcePath:f}=e;const l=normalizePath(i.default.relative(u,f));n.content=`${a+l}\0${unescape(r)}`;return(0,o.default)((0,s.interpolateName)(e,t,n).replace(/^((-?[0-9])|--)/,"_$1").replace(v,"-").replace(g,"-").replace(/\./g,"-"),{isIdentifier:true}).replace(/\\\[local\\]/gi,r)}function normalizeUrl(e,t){let r=e;if(t&&/\\(\n|\r\n|\r|\f)/.test(r)){r=r.replace(/\\(\n|\r\n|\r|\f)/g,"")}if(d.test(e)){return decodeURIComponent(r)}return decodeURIComponent(unescape(r))}function requestify(e,t){if(/^file:/i.test(e)){return(0,n.fileURLToPath)(e)}return e.charAt(0)==="/"?(0,s.urlToRequest)(e,t):(0,s.urlToRequest)(e)}function getFilter(e,t){return(...r)=>{if(typeof e==="function"){return e(...r,t)}return true}}const m=/\.module\.\w+$/i;function getModulesOptions(e,t){const{resourcePath:r}=t;if(typeof e.modules==="undefined"){const e=m.test(r);if(!e){return false}}else if(typeof e.modules==="boolean"&&e.modules===false){return false}let n={compileType:e.icss?"icss":"module",auto:true,mode:"local",exportGlobals:false,localIdentName:"[hash:base64]",localIdentContext:t.rootContext,localIdentHashPrefix:"",localIdentRegExp:undefined,getLocalIdent:defaultGetLocalIdent,namedExport:false,exportLocalsConvention:"asIs",exportOnlyLocals:false};if(typeof e.modules==="boolean"||typeof e.modules==="string"){n.mode=typeof e.modules==="string"?e.modules:"local"}else{if(e.modules){if(typeof e.modules.auto==="boolean"){const t=e.modules.auto&&m.test(r);if(!t){return false}}else if(e.modules.auto instanceof RegExp){const t=e.modules.auto.test(r);if(!t){return false}}else if(typeof e.modules.auto==="function"){const t=e.modules.auto(r);if(!t){return false}}if(e.modules.namedExport===true&&typeof e.modules.exportLocalsConvention==="undefined"){n.exportLocalsConvention="camelCaseOnly"}}n={...n,...e.modules||{}}}if(typeof n.mode==="function"){n.mode=n.mode(t.resourcePath)}if(n.namedExport===true){if(e.esModule===false){throw new Error('The "modules.namedExport" option requires the "esModules" option to be enabled')}if(n.exportLocalsConvention!=="camelCaseOnly"){throw new Error('The "modules.namedExport" option requires the "modules.exportLocalsConvention" option to be "camelCaseOnly"')}}return n}function normalizeOptions(e,t){if(e.icss){t.emitWarning(new Error('The "icss" option is deprecated, use "modules.compileType: "icss"" instead'))}const r=getModulesOptions(e,t);return{url:typeof e.url==="undefined"?true:e.url,import:typeof e.import==="undefined"?true:e.import,modules:r,icss:typeof e.icss==="undefined"?false:e.icss,sourceMap:typeof e.sourceMap==="boolean"?e.sourceMap:t.sourceMap,importLoaders:typeof e.importLoaders==="string"?parseInt(e.importLoaders,10):e.importLoaders,esModule:typeof e.esModule==="undefined"?true:e.esModule}}function shouldUseImportPlugin(e){if(e.modules.exportOnlyLocals){return false}if(typeof e.import==="boolean"){return e.import}return true}function shouldUseURLPlugin(e){if(e.modules.exportOnlyLocals){return false}if(typeof e.url==="boolean"){return e.url}return true}function shouldUseModulesPlugins(e){return e.modules.compileType==="module"}function shouldUseIcssPlugin(e){return e.icss===true||Boolean(e.modules)}function getModulesPlugins(e,t){const{mode:r,getLocalIdent:n,localIdentName:i,localIdentContext:s,localIdentHashPrefix:o,localIdentRegExp:c}=e.modules;let h=[];try{h=[u.default,(0,a.default)({mode:r}),(0,f.default)(),(0,l.default)({generateScopedName(e){return n(t,i,e,{context:s,hashPrefix:o,regExp:c})},exportGlobals:e.modules.exportGlobals})]}catch(e){t.emitError(e)}return h}const y=/^[a-z]:[/\\]|^\\\\/i;const w=/^[a-z0-9+\-.]+:/i;function getURLType(e){if(e[0]==="/"){if(e[1]==="/"){return"scheme-relative"}return"path-absolute"}if(y.test(e)){return"path-absolute"}return w.test(e)?"absolute":"path-relative"}function normalizeSourceMap(e,t){let r=e;if(typeof r==="string"){r=JSON.parse(r)}delete r.file;const{sourceRoot:n}=r;delete r.sourceRoot;if(r.sources){r.sources=r.sources.map(e=>{if(e.indexOf("<")===0){return e}const r=getURLType(e);if(r==="path-relative"||r==="path-absolute"){const s=r==="path-relative"&&n?i.default.resolve(n,normalizePath(e)):normalizePath(e);return i.default.relative(i.default.dirname(t),s)}return e})}return r}function getPreRequester({loaders:e,loaderIndex:t}){const r=Object.create(null);return n=>{if(r[n]){return r[n]}if(n===false){r[n]=""}else{const i=e.slice(t,t+1+(typeof n!=="number"?0:n)).map(e=>e.request).join("!");r[n]=`-!${i}!`}return r[n]}}function getImportCode(e,t){let r="";for(const n of e){const{importName:e,url:i,icss:s}=n;if(t.esModule){if(s&&t.modules.namedExport){r+=`import ${t.modules.exportOnlyLocals?"":`${e}, `}* as ${e}_NAMED___ from ${i};\n`}else{r+=`import ${e} from ${i};\n`}}else{r+=`var ${e} = require(${i});\n`}}return r?`// Imports\n${r}`:""}function normalizeSourceMapForRuntime(e,t){const r=e?e.toJSON():null;if(r){delete r.file;r.sourceRoot="";r.sources=r.sources.map(e=>{if(e.indexOf("<")===0){return e}const r=getURLType(e);if(r!=="path-relative"){return e}const n=i.default.dirname(t.resourcePath);const s=i.default.resolve(n,e);const o=normalizePath(i.default.relative(t.rootContext,s));return`webpack://${o}`})}return JSON.stringify(r)}function getModuleCode(e,t,r,n,i){if(n.modules.exportOnlyLocals===true){return""}const s=n.sourceMap?`,${normalizeSourceMapForRuntime(e.map,i)}`:"";let o=JSON.stringify(e.css);let u=`var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(${n.sourceMap});\n`;for(const e of t){const{url:t,media:r,dedupe:n}=e;u+=t?`___CSS_LOADER_EXPORT___.push([module.id, ${JSON.stringify(`@import url(${t});`)}${r?`, ${JSON.stringify(r)}`:""}]);\n`:`___CSS_LOADER_EXPORT___.i(${e.importName}${r?`, ${JSON.stringify(r)}`:n?', ""':""}${n?", true":""});\n`}for(const e of r){const{replacementName:t,importName:r,localName:i}=e;if(i){o=o.replace(new RegExp(t,"g"),()=>n.modules.namedExport?`" + ${r}_NAMED___[${JSON.stringify((0,c.default)(i))}] + "`:`" + ${r}.locals[${JSON.stringify(i)}] + "`)}else{const{hash:n,needQuotes:i}=e;const s=[].concat(n?[`hash: ${JSON.stringify(n)}`]:[]).concat(i?"needQuotes: true":[]);const a=s.length>0?`, { ${s.join(", ")} }`:"";u+=`var ${t} = ___CSS_LOADER_GET_URL_IMPORT___(${r}${a});\n`;o=o.replace(new RegExp(t,"g"),()=>`" + ${t} + "`)}}return`${u}// Module\n___CSS_LOADER_EXPORT___.push([module.id, ${o}, ""${s}]);\n`}function dashesCamelCase(e){return e.replace(/-+(\w)/g,(e,t)=>t.toUpperCase())}function getExportCode(e,t,r){let n="// Exports\n";let i="";const s=(e,t)=>{if(r.modules.namedExport){i+=`export const ${(0,c.default)(e)} = ${JSON.stringify(t)};\n`}else{if(i){i+=`,\n`}i+=`\t${JSON.stringify(e)}: ${JSON.stringify(t)}`}};for(const{name:t,value:n}of e){switch(r.modules.exportLocalsConvention){case"camelCase":{s(t,n);const e=(0,c.default)(t);if(e!==t){s(e,n)}break}case"camelCaseOnly":{s((0,c.default)(t),n);break}case"dashes":{s(t,n);const e=dashesCamelCase(t);if(e!==t){s(e,n)}break}case"dashesOnly":{s(dashesCamelCase(t),n);break}case"asIs":default:s(t,n);break}}for(const e of t){const{replacementName:t,localName:n}=e;if(n){const{importName:s}=e;i=i.replace(new RegExp(t,"g"),()=>{if(r.modules.namedExport){return`" + ${s}_NAMED___[${JSON.stringify((0,c.default)(n))}] + "`}else if(r.modules.exportOnlyLocals){return`" + ${s}[${JSON.stringify(n)}] + "`}return`" + ${s}.locals[${JSON.stringify(n)}] + "`})}else{i=i.replace(new RegExp(t,"g"),()=>`" + ${t} + "`)}}if(r.modules.exportOnlyLocals){n+=r.modules.namedExport?i:`${r.esModule?"export default":"module.exports ="} {\n${i}\n};\n`;return n}if(i){n+=r.modules.namedExport?i:`___CSS_LOADER_EXPORT___.locals = {\n${i}\n};\n`}n+=`${r.esModule?"export default":"module.exports ="} ___CSS_LOADER_EXPORT___;\n`;return n}async function resolveRequests(e,t,r){return e(t,r[0]).then(e=>{return e}).catch(n=>{const[,...i]=r;if(i.length===0){throw n}return resolveRequests(e,t,i)})}function isUrlRequestable(e){if(/^\/\//.test(e)){return false}if(/^file:/i.test(e)){return true}if(/^[a-z][a-z0-9+.-]*:/i.test(e)&&!d.test(e)){return false}if(/^#/.test(e)){return false}return true}function sort(e,t){return e.index-t.index}},7218:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(8725));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(571);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(7229);e=[new m(e)]}else if(e.name){var y=r(7218);e=[new y(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},5571:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5020));var i=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(6513));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},2849:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(4635));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},7127:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5622));var i=_interopRequireDefault(r(5571));var s=_interopRequireDefault(r(6683));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},5409:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(439));var i=_interopRequireDefault(r(7317));var s=_interopRequireDefault(r(8539));var o=_interopRequireDefault(r(2461));var u=_interopRequireDefault(r(571));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},2378:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},439:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6241));var i=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},4635:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5571));var i=_interopRequireDefault(r(2928));var s=_interopRequireDefault(r(7317));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},66:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(2849));var i=_interopRequireDefault(r(4884));var s=_interopRequireDefault(r(7317));var o=_interopRequireDefault(r(499));var u=_interopRequireDefault(r(7218));var a=_interopRequireDefault(r(255));var f=_interopRequireDefault(r(571));var l=_interopRequireDefault(r(2378));var c=_interopRequireDefault(r(7229));var h=_interopRequireDefault(r(5400));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},4884:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5409));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},2461:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(575));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(5409);var n=r(4884);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},7229:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(8725));var i=_interopRequireDefault(r(2378));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;A=E.charCodeAt(G);if(A===o||A===a||A===l&&E.charCodeAt(G+1)!==o){W=G;V+=1}switch(A){case o:case u:case f:case l:case a:M=G;do{M+=1;A=E.charCodeAt(M);if(A===o){W=M;V+=1}}while(A===u||A===o||A===f||A===l||A===a);z=["space",E.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var _=String.fromCharCode(A);z=[_,_,V,G-W];break;case p:B=Y.length?Y.pop()[1]:"";$=E.charCodeAt(G+1);if(B==="url"&&$!==r&&$!==n&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=E.indexOf(")",M+1);if(M===-1){if(D||t){M=G;break}else{unclosed("bracket")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);z=["brackets",E.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=E.indexOf(")",G+1);F=E.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case n:q=A===r?"'":'"';M=G;do{j=false;M=E.indexOf(q,M+1);if(M===-1){if(D||t){M=G+1;break}else{unclosed("string")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["string",E.slice(G,M+1),V,G-W,N,M-k];W=k;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(E);if(S.lastIndex===0){M=E.length-1}else{M=S.lastIndex-2}z=["at-word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;case i:M=G;L=true;while(E.charCodeAt(M+1)===i){M+=1;L=!L}A=E.charCodeAt(M+1);if(L&&A!==s&&A!==u&&A!==o&&A!==f&&A!==l&&A!==a){M+=1;if(O.test(E.charAt(M))){while(O.test(E.charAt(M+1))){M+=1}if(E.charCodeAt(M+1)===u){M+=1}}}z=["word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(A===s&&E.charCodeAt(G+1)===y){M=E.indexOf("*/",G+2)+1;if(M===0){if(D||t){M=E.length}else{unclosed("comment")}}F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["comment",F,V,G-W,N,M-k];W=k;V=N;G=M}else{R.lastIndex=G+1;R.test(E);if(R.lastIndex===0){M=E.length-1}else{M=R.lastIndex-2}z=["word",E.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},255:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},8539:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},575:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},5020:function(e,t,r){"use strict";const n=r(2087);const i=r(1621);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},1621:function(e){"use strict";e.exports=((e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(9744);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(3027);e=[new m(e)]}else if(e.name){var y=r(5236);e=[new y(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},9693:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(565));var i=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(5849));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},2033:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(8097));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},1164:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5622));var i=_interopRequireDefault(r(9693));var s=_interopRequireDefault(r(5941));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},6724:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(2240));var i=_interopRequireDefault(r(9206));var s=_interopRequireDefault(r(5332));var o=_interopRequireDefault(r(2168));var u=_interopRequireDefault(r(9744));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},1023:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},2240:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6241));var i=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},8097:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(9693));var i=_interopRequireDefault(r(6762));var s=_interopRequireDefault(r(9206));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},3326:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(2033));var i=_interopRequireDefault(r(7890));var s=_interopRequireDefault(r(9206));var o=_interopRequireDefault(r(3267));var u=_interopRequireDefault(r(5236));var a=_interopRequireDefault(r(5082));var f=_interopRequireDefault(r(9744));var l=_interopRequireDefault(r(1023));var c=_interopRequireDefault(r(3027));var h=_interopRequireDefault(r(8995));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},7890:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6724));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},2168:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5432));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(6724);var n=r(7890);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},3027:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(8979));var i=_interopRequireDefault(r(1023));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;A=E.charCodeAt(G);if(A===o||A===a||A===l&&E.charCodeAt(G+1)!==o){W=G;V+=1}switch(A){case o:case u:case f:case l:case a:M=G;do{M+=1;A=E.charCodeAt(M);if(A===o){W=M;V+=1}}while(A===u||A===o||A===f||A===l||A===a);z=["space",E.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var _=String.fromCharCode(A);z=[_,_,V,G-W];break;case p:B=Y.length?Y.pop()[1]:"";$=E.charCodeAt(G+1);if(B==="url"&&$!==r&&$!==n&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=E.indexOf(")",M+1);if(M===-1){if(D||t){M=G;break}else{unclosed("bracket")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);z=["brackets",E.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=E.indexOf(")",G+1);F=E.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case n:q=A===r?"'":'"';M=G;do{j=false;M=E.indexOf(q,M+1);if(M===-1){if(D||t){M=G+1;break}else{unclosed("string")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["string",E.slice(G,M+1),V,G-W,N,M-k];W=k;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(E);if(S.lastIndex===0){M=E.length-1}else{M=S.lastIndex-2}z=["at-word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;case i:M=G;L=true;while(E.charCodeAt(M+1)===i){M+=1;L=!L}A=E.charCodeAt(M+1);if(L&&A!==s&&A!==u&&A!==o&&A!==f&&A!==l&&A!==a){M+=1;if(O.test(E.charAt(M))){while(O.test(E.charAt(M+1))){M+=1}if(E.charCodeAt(M+1)===u){M+=1}}}z=["word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(A===s&&E.charCodeAt(G+1)===y){M=E.indexOf("*/",G+2)+1;if(M===0){if(D||t){M=E.length}else{unclosed("comment")}}F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["comment",F,V,G-W,N,M-k];W=k;V=N;G=M}else{R.lastIndex=G+1;R.test(E);if(R.lastIndex===0){M=E.length-1}else{M=R.lastIndex-2}z=["word",E.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},5082:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},5332:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},5432:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},565:function(e,t,r){"use strict";const n=r(2087);const i=r(1621);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},4192:function(e,t,r){const n=r(3326);const i=r(118);const s=["composes"];const o=new RegExp(`^(${s.join("|")})$`);const u=/^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;const a=/^:import\((?:"([^"]+)"|'([^']+)')\)/;const f=1;function createParentName(e,t){return`__${t.index(e.parent)}_${e.selector}`}function serializeImports(e){return e.map(e=>"`"+e+"`").join(", ")}function addImportToGraph(e,t,r,n){const i=t+"_"+"siblings";const s=t+"_"+e;if(n[s]!==f){if(!Array.isArray(n[i]))n[i]=[];const t=n[i];if(Array.isArray(r[e]))r[e]=r[e].concat(t);else r[e]=t.slice();n[s]=f;t.push(e)}}e.exports=n.plugin("modules-extract-imports",function(e={}){const t=e.failOnWrongOrder;return r=>{const s={};const f={};const l={};const c={};const h={};let p=0;const d=typeof e.createImportedName!=="function"?e=>`i__imported_${e.replace(/\W/g,"_")}_${p++}`:e.createImportedName;r.walkRules(e=>{const t=a.exec(e.selector);if(t){const[,r,n]=t;const i=r||n;addImportToGraph(i,"root",s,f);l[i]=e}});r.walkDecls(o,e=>{let t=e.value.match(u);let n;if(t){let[,i,o,u,a]=t;if(a){n=i.split(/\s+/).map(e=>`global(${e})`)}else{const t=o||u;const a=createParentName(e.parent,r);addImportToGraph(t,a,s,f);c[t]=e;h[t]=h[t]||{};n=i.split(/\s+/).map(e=>{if(!h[t][e]){h[t][e]=d(e,t)}return h[t][e]})}e.value=n.join(" ")}});const v=i(s,t);if(v instanceof Error){const e=v.nodes.find(e=>c.hasOwnProperty(e));const t=c[e];const r="Failed to resolve order of composed modules "+serializeImports(v.nodes)+".";throw t.error(r,{plugin:"modules-extract-imports",word:"composes"})}let g;v.forEach(e=>{const t=h[e];let i=l[e];if(!i&&t){i=n.rule({selector:`:import("${e}")`,raws:{after:"\n"}});if(g)r.insertAfter(g,i);else r.prepend(i)}g=i;if(!t)return;Object.keys(t).forEach(e=>{i.append(n.decl({value:e,prop:t[e],raws:{before:"\n "}}))})})}})},118:function(e){const t=2;const r=1;function createError(e,t){const r=new Error("Nondeterministic import's order");const n=t[e];const i=n.find(r=>t[r].indexOf(e)>-1);r.nodes=[e,i];return r}function walkGraph(e,n,i,s,o){if(i[e]===t)return;if(i[e]===r){if(o)return createError(e,n);return}i[e]=r;const u=n[e];const a=u.length;for(let e=0;ee.type==="combinator"&&e.value===" ";function getImportLocalAliases(e){const t=new Map;Object.keys(e).forEach(r=>{Object.keys(e[r]).forEach(n=>{t.set(n,e[r][n])})});return t}function maybeLocalizeValue(e,t){if(t.has(e))return e}function normalizeNodeArray(e){const t=[];e.forEach(function(e){if(Array.isArray(e)){normalizeNodeArray(e).forEach(function(e){t.push(e)})}else if(e){t.push(e)}});if(t.length>0&&u(t[t.length-1])){t.pop()}return t}function localizeNode(e,t,r){const n=e=>e.value===":local"||e.value===":global";const s=e=>e.value===":import"||e.value===":export";const o=(e,t)=>{if(t.ignoreNextSpacing&&!u(e)){throw new Error("Missing whitespace after "+t.ignoreNextSpacing)}if(t.enforceNoSpacing&&u(e)){throw new Error("Missing whitespace before "+t.enforceNoSpacing)}let a;switch(e.type){case"root":{let r;t.hasPureGlobals=false;a=e.nodes.map(function(n){const i={global:t.global,lastWasSpacing:true,hasLocals:false,explicit:false};n=o(n,i);if(typeof r==="undefined"){r=i.global}else if(r!==i.global){throw new Error('Inconsistent rule global/local result in rule "'+e+'" (multiple selectors must result in the same mode for the rule)')}if(!i.hasLocals){t.hasPureGlobals=true}return n});t.global=r;e.nodes=normalizeNodeArray(a);break}case"selector":{a=e.map(e=>o(e,t));e=e.clone();e.nodes=normalizeNodeArray(a);break}case"combinator":{if(u(e)){if(t.ignoreNextSpacing){t.ignoreNextSpacing=false;t.lastWasSpacing=false;t.enforceNoSpacing=false;return null}t.lastWasSpacing=true;return e}break}case"pseudo":{let r;const u=!!e.length;const f=n(e);const l=s(e);if(l){t.hasLocals=true}else if(u){if(f){if(e.nodes.length===0){throw new Error(`${e.value}() can't be empty`)}if(t.inside){throw new Error(`A ${e.value} is not allowed inside of a ${t.inside}(...)`)}r={global:e.value===":global",inside:e.value,hasLocals:false,explicit:true};a=e.map(e=>o(e,r)).reduce((e,t)=>e.concat(t.nodes),[]);if(a.length){const{before:t,after:r}=e.spaces;const n=a[0];const i=a[a.length-1];n.spaces={before:t,after:n.spaces.after};i.spaces={before:i.spaces.before,after:r}}e=a;break}else{r={global:t.global,inside:t.inside,lastWasSpacing:true,hasLocals:false,explicit:t.explicit};a=e.map(e=>o(e,r));e=e.clone();e.nodes=normalizeNodeArray(a);if(r.hasLocals){t.hasLocals=true}}break}else if(f){if(t.inside){throw new Error(`A ${e.value} is not allowed inside of a ${t.inside}(...)`)}const r=!!e.spaces.before;t.ignoreNextSpacing=t.lastWasSpacing?e.value:false;t.enforceNoSpacing=t.lastWasSpacing?false:e.value;t.global=e.value===":global";t.explicit=true;return r?i.combinator({value:" "}):null}break}case"id":case"class":{if(!e.value){throw new Error("Invalid class or id selector syntax")}if(t.global){break}const n=r.has(e.value);const s=n&&t.explicit;if(!n||s){const r=e.clone();r.spaces={before:"",after:""};e=i.pseudo({value:":local",nodes:[r],spaces:e.spaces});t.hasLocals=true}break}}t.lastWasSpacing=false;t.ignoreNextSpacing=false;t.enforceNoSpacing=false;return e};const a={global:t==="global",hasPureGlobals:false};a.selector=i(e=>{o(e,a)}).processSync(e,{updateSelector:false,lossless:true});return a}function localizeDeclNode(e,t){switch(e.type){case"word":if(t.localizeNextItem){if(!t.localAliasMap.has(e.value)){e.value=":local("+e.value+")";t.localizeNextItem=false}}break;case"function":if(t.options&&t.options.rewriteUrl&&e.value.toLowerCase()==="url"){e.nodes.map(e=>{if(e.type!=="string"&&e.type!=="word"){return}let r=t.options.rewriteUrl(t.global,e.value);switch(e.type){case"string":if(e.quote==="'"){r=r.replace(/(\\)/g,"\\$1").replace(/'/g,"\\'")}if(e.quote==='"'){r=r.replace(/(\\)/g,"\\$1").replace(/"/g,'\\"')}break;case"word":r=r.replace(/("|'|\)|\\)/g,"\\$1");break}e.value=r})}break}return e}function isWordAFunctionArgument(e,t){return t?t.nodes.some(t=>t.sourceIndex===e.sourceIndex):false}function localizeAnimationShorthandDeclValues(e,t){const r=/^-?[_a-z][_a-z0-9-]*$/i;const n={$alternate:1,"$alternate-reverse":1,$backwards:1,$both:1,$ease:1,"$ease-in":1,"$ease-in-out":1,"$ease-out":1,$forwards:1,$infinite:1,$linear:1,$none:Infinity,$normal:1,$paused:1,$reverse:1,$running:1,"$step-end":1,"$step-start":1,$initial:Infinity,$inherit:Infinity,$unset:Infinity};const i=false;let o={};let u=null;const a=s(e.value).walk(e=>{if(e.type==="div"){o={}}if(e.type==="function"&&e.value.toLowerCase()==="steps"){u=e}const s=e.type==="word"&&!isWordAFunctionArgument(e,u)?e.value.toLowerCase():null;let a=false;if(!i&&s&&r.test(s)){if("$"+s in n){o["$"+s]="$"+s in o?o["$"+s]+1:0;a=o["$"+s]>=n["$"+s]}else{a=true}}const f={options:t.options,global:t.global,localizeNextItem:a&&!t.global,localAliasMap:t.localAliasMap};return localizeDeclNode(e,f)});e.value=a.toString()}function localizeDeclValues(e,t,r){const n=s(t.value);n.walk((t,n,i)=>{const s={options:r.options,global:r.global,localizeNextItem:e&&!r.global,localAliasMap:r.localAliasMap};i[n]=localizeDeclNode(t,s)});t.value=n.toString()}function localizeDecl(e,t){const r=/animation$/i.test(e.prop);if(r){return localizeAnimationShorthandDeclValues(e,t)}const n=/animation(-name)?$/i.test(e.prop);if(n){return localizeDeclValues(true,e,t)}const i=/url\(/i.test(e.value);if(i){return localizeDeclValues(false,e,t)}}e.exports=n.plugin("postcss-modules-local-by-default",function(e){if(typeof e!=="object"){e={}}if(e&&e.mode){if(e.mode!=="global"&&e.mode!=="local"&&e.mode!=="pure"){throw new Error('options.mode must be either "global", "local" or "pure" (default "local")')}}const t=e&&e.mode==="pure";const r=e&&e.mode==="global";return function(n){const{icssImports:i}=o(n,false);const s=getImportLocalAliases(i);n.walkAtRules(function(n){if(/keyframes$/i.test(n.name)){const i=/^\s*:global\s*\((.+)\)\s*$/.exec(n.params);const o=/^\s*:local\s*\((.+)\)\s*$/.exec(n.params);let u=r;if(i){if(t){throw n.error("@keyframes :global(...) is not allowed in pure mode")}n.params=i[1];u=true}else if(o){n.params=o[0];u=false}else if(!r){if(n.params&&!s.has(n.params))n.params=":local("+n.params+")"}n.walkDecls(function(t){localizeDecl(t,{localAliasMap:s,options:e,global:u})})}else if(n.nodes){n.nodes.forEach(function(t){if(t.type==="decl"){localizeDecl(t,{localAliasMap:s,options:e,global:r})}})}});n.walkRules(function(r){if(r.parent&&r.parent.type==="atrule"&&/keyframes$/i.test(r.parent.name)){return}if(r.nodes&&r.selector.slice(0,2)==="--"&&r.selector.slice(-1)===":"){return}const n=localizeNode(r,e.mode,s);n.options=e;n.localAliasMap=s;if(t&&n.hasPureGlobals){throw r.error('Selector "'+r.selector+'" is not pure '+"(pure selectors must contain at least one local class or id)")}r.selector=n.selector;if(r.nodes){r.nodes.forEach(e=>localizeDecl(e,n))}})}})},9707:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6011));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(9186);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(4598);e=[new m(e)]}else if(e.name){var y=r(9707);e=[new y(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},6877:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(2642));var i=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(5979));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},9591:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(8772));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},2776:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5622));var i=_interopRequireDefault(r(6877));var s=_interopRequireDefault(r(5155));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},981:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(7532));var i=_interopRequireDefault(r(8170));var s=_interopRequireDefault(r(3711));var o=_interopRequireDefault(r(9603));var u=_interopRequireDefault(r(9186));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},6558:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},7532:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6241));var i=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},8772:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6877));var i=_interopRequireDefault(r(2136));var s=_interopRequireDefault(r(8170));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},8679:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(9591));var i=_interopRequireDefault(r(8005));var s=_interopRequireDefault(r(8170));var o=_interopRequireDefault(r(7165));var u=_interopRequireDefault(r(9707));var a=_interopRequireDefault(r(8181));var f=_interopRequireDefault(r(9186));var l=_interopRequireDefault(r(6558));var c=_interopRequireDefault(r(4598));var h=_interopRequireDefault(r(2362));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},8005:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(981));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},9603:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5222));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(981);var n=r(8005);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},4598:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6011));var i=_interopRequireDefault(r(6558));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;A=E.charCodeAt(G);if(A===o||A===a||A===l&&E.charCodeAt(G+1)!==o){W=G;V+=1}switch(A){case o:case u:case f:case l:case a:M=G;do{M+=1;A=E.charCodeAt(M);if(A===o){W=M;V+=1}}while(A===u||A===o||A===f||A===l||A===a);z=["space",E.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var _=String.fromCharCode(A);z=[_,_,V,G-W];break;case p:B=Y.length?Y.pop()[1]:"";$=E.charCodeAt(G+1);if(B==="url"&&$!==r&&$!==n&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=E.indexOf(")",M+1);if(M===-1){if(D||t){M=G;break}else{unclosed("bracket")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);z=["brackets",E.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=E.indexOf(")",G+1);F=E.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case n:q=A===r?"'":'"';M=G;do{j=false;M=E.indexOf(q,M+1);if(M===-1){if(D||t){M=G+1;break}else{unclosed("string")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["string",E.slice(G,M+1),V,G-W,N,M-k];W=k;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(E);if(S.lastIndex===0){M=E.length-1}else{M=S.lastIndex-2}z=["at-word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;case i:M=G;L=true;while(E.charCodeAt(M+1)===i){M+=1;L=!L}A=E.charCodeAt(M+1);if(L&&A!==s&&A!==u&&A!==o&&A!==f&&A!==l&&A!==a){M+=1;if(O.test(E.charAt(M))){while(O.test(E.charAt(M+1))){M+=1}if(E.charCodeAt(M+1)===u){M+=1}}}z=["word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(A===s&&E.charCodeAt(G+1)===y){M=E.indexOf("*/",G+2)+1;if(M===0){if(D||t){M=E.length}else{unclosed("comment")}}F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["comment",F,V,G-W,N,M-k];W=k;V=N;G=M}else{R.lastIndex=G+1;R.test(E);if(R.lastIndex===0){M=E.length-1}else{M=R.lastIndex-2}z=["word",E.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},8181:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},3711:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},5222:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},2642:function(e,t,r){"use strict";const n=r(2087);const i=r(1621);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},3638:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(783));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(8681);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(7284);e=[new m(e)]}else if(e.name){var y=r(3638);e=[new y(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},2330:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3298));var i=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(7312));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},2654:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3710));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},3808:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5622));var i=_interopRequireDefault(r(2330));var s=_interopRequireDefault(r(3597));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},9241:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(4397));var i=_interopRequireDefault(r(5942));var s=_interopRequireDefault(r(7012));var o=_interopRequireDefault(r(3480));var u=_interopRequireDefault(r(8681));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},9882:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},4397:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6241));var i=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},3710:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(2330));var i=_interopRequireDefault(r(4284));var s=_interopRequireDefault(r(5942));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},6578:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(2654));var i=_interopRequireDefault(r(9596));var s=_interopRequireDefault(r(5942));var o=_interopRequireDefault(r(18));var u=_interopRequireDefault(r(3638));var a=_interopRequireDefault(r(9628));var f=_interopRequireDefault(r(8681));var l=_interopRequireDefault(r(9882));var c=_interopRequireDefault(r(7284));var h=_interopRequireDefault(r(5782));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},9596:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(9241));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},3480:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(4904));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(9241);var n=r(9596);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},7284:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(783));var i=_interopRequireDefault(r(9882));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;A=E.charCodeAt(G);if(A===o||A===a||A===l&&E.charCodeAt(G+1)!==o){W=G;V+=1}switch(A){case o:case u:case f:case l:case a:M=G;do{M+=1;A=E.charCodeAt(M);if(A===o){W=M;V+=1}}while(A===u||A===o||A===f||A===l||A===a);z=["space",E.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var _=String.fromCharCode(A);z=[_,_,V,G-W];break;case p:B=Y.length?Y.pop()[1]:"";$=E.charCodeAt(G+1);if(B==="url"&&$!==r&&$!==n&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=E.indexOf(")",M+1);if(M===-1){if(D||t){M=G;break}else{unclosed("bracket")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);z=["brackets",E.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=E.indexOf(")",G+1);F=E.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case n:q=A===r?"'":'"';M=G;do{j=false;M=E.indexOf(q,M+1);if(M===-1){if(D||t){M=G+1;break}else{unclosed("string")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["string",E.slice(G,M+1),V,G-W,N,M-k];W=k;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(E);if(S.lastIndex===0){M=E.length-1}else{M=S.lastIndex-2}z=["at-word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;case i:M=G;L=true;while(E.charCodeAt(M+1)===i){M+=1;L=!L}A=E.charCodeAt(M+1);if(L&&A!==s&&A!==u&&A!==o&&A!==f&&A!==l&&A!==a){M+=1;if(O.test(E.charAt(M))){while(O.test(E.charAt(M+1))){M+=1}if(E.charCodeAt(M+1)===u){M+=1}}}z=["word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(A===s&&E.charCodeAt(G+1)===y){M=E.indexOf("*/",G+2)+1;if(M===0){if(D||t){M=E.length}else{unclosed("comment")}}F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["comment",F,V,G-W,N,M-k];W=k;V=N;G=M}else{R.lastIndex=G+1;R.test(E);if(R.lastIndex===0){M=E.length-1}else{M=R.lastIndex-2}z=["word",E.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},9628:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},7012:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},4904:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},3298:function(e,t,r){"use strict";const n=r(2087);const i=r(1621);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},7475:function(e,t,r){"use strict";const n=r(6578);const i=r(1571);const s=Object.prototype.hasOwnProperty;function getSingleLocalNamesForComposes(e){return e.nodes.map(t=>{if(t.type!=="selector"||t.nodes.length!==1){throw new Error(`composition is only allowed when selector is single :local class name not in "${e}"`)}t=t.nodes[0];if(t.type!=="pseudo"||t.value!==":local"||t.nodes.length!==1){throw new Error('composition is only allowed when selector is single :local class name not in "'+e+'", "'+t+'" is weird')}t=t.first;if(t.type!=="selector"||t.length!==1){throw new Error('composition is only allowed when selector is single :local class name not in "'+e+'", "'+t+'" is weird')}t=t.first;if(t.type!=="class"){throw new Error('composition is only allowed when selector is single :local class name not in "'+e+'", "'+t+'" is weird')}return t.value})}const o="[\\x20\\t\\r\\n\\f]";const u=new RegExp("\\\\([\\da-f]{1,6}"+o+"?|("+o+")|.)","ig");function unescape(e){return e.replace(u,(e,t,r)=>{const n="0x"+t-65536;return n!==n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)})}const a=n.plugin("postcss-modules-scope",function(e){return t=>{const r=e&&e.generateScopedName||a.generateScopedName;const o=e&&e.generateExportEntry||a.generateExportEntry;const u=e&&e.exportGlobals;const f=Object.create(null);function exportScopedName(e,n){const i=r(n?n:e,t.source.input.from,t.source.input.css);const s=o(n?n:e,i,t.source.input.from,t.source.input.css);const{key:u,value:a}=s;f[u]=f[u]||[];if(f[u].indexOf(a)<0){f[u].push(a)}return i}function localizeNode(e){switch(e.type){case"selector":e.nodes=e.map(localizeNode);return e;case"class":return i.className({value:exportScopedName(e.value,e.raws&&e.raws.value?e.raws.value:null)});case"id":{return i.id({value:exportScopedName(e.value,e.raws&&e.raws.value?e.raws.value:null)})}}throw new Error(`${e.type} ("${e}") is not allowed in a :local block`)}function traverseNode(e){switch(e.type){case"pseudo":if(e.value===":local"){if(e.nodes.length!==1){throw new Error('Unexpected comma (",") in :local block')}const t=localizeNode(e.first,e.spaces);t.first.spaces=e.spaces;const r=e.next();if(r&&r.type==="combinator"&&r.value===" "&&/\\[A-F0-9]{1,6}$/.test(t.last.value)){t.last.spaces.after=" "}e.replaceWith(t);return}case"root":case"selector":{e.each(traverseNode);break}case"id":case"class":if(u){f[e.value]=[e.value]}break}return e}const l={};t.walkRules(e=>{if(/^:import\(.+\)$/.test(e.selector)){e.walkDecls(e=>{l[e.prop]=true})}});t.walkRules(e=>{if(e.nodes&&e.selector.slice(0,2)==="--"&&e.selector.slice(-1)===":"){return}let t=i().astSync(e);e.selector=traverseNode(t.clone()).toString();e.walkDecls(/composes|compose-with/,e=>{const r=getSingleLocalNamesForComposes(t);const n=e.value.split(/\s+/);n.forEach(t=>{const n=/^global\(([^\)]+)\)$/.exec(t);if(n){r.forEach(e=>{f[e].push(n[1])})}else if(s.call(l,t)){r.forEach(e=>{f[e].push(t)})}else if(s.call(f,t)){r.forEach(e=>{f[t].forEach(t=>{f[e].push(t)})})}else{throw e.error(`referenced class name "${t}" in ${e.prop} not found`)}});e.remove()});e.walkDecls(e=>{let t=e.value.split(/(,|'[^']*'|"[^"]*")/);t=t.map((e,r)=>{if(r===0||t[r-1]===","){const t=/^(\s*):local\s*\((.+?)\)/.exec(e);if(t){return t[1]+exportScopedName(t[2])+e.substr(t[0].length)}else{return e}}else{return e}});e.value=t.join("")})});t.walkAtRules(e=>{if(/keyframes$/i.test(e.name)){const t=/^\s*:local\s*\((.+?)\)\s*$/.exec(e.params);if(t){e.params=exportScopedName(t[1])}}});const c=Object.keys(f);if(c.length>0){const e=n.rule({selector:":export"});c.forEach(t=>e.append({prop:t,value:f[t].join(" "),raws:{before:"\n "}}));t.append(e)}}});a.generateScopedName=function(e,t){const r=t.replace(/\.[^\.\/\\]+$/,"").replace(/[\W_]+/g,"_").replace(/^_|_$/g,"");return`_${r}__${e}`.trim()};a.generateExportEntry=function(e,t){return{key:unescape(e),value:unescape(t)}};e.exports=a},9616:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(7859));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(5955);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var g=v;if(g.parent)g.parent.removeChild(g,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(5953);e=[new m(e)]}else if(e.name){var y=r(9616);e=[new y(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var w=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return w};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},2354:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6358));var i=_interopRequireDefault(r(2242));var s=_interopRequireDefault(r(5903));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},6622:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(2689));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},8902:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(5622));var i=_interopRequireDefault(r(2354));var s=_interopRequireDefault(r(5540));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},7023:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3782));var i=_interopRequireDefault(r(3057));var s=_interopRequireDefault(r(2508));var o=_interopRequireDefault(r(3172));var u=_interopRequireDefault(r(5955));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},5450:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},3782:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6241));var i=_interopRequireDefault(r(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},2689:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(2354));var i=_interopRequireDefault(r(5291));var s=_interopRequireDefault(r(3057));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},5848:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(6622));var i=_interopRequireDefault(r(8295));var s=_interopRequireDefault(r(3057));var o=_interopRequireDefault(r(5051));var u=_interopRequireDefault(r(9616));var a=_interopRequireDefault(r(235));var f=_interopRequireDefault(r(5955));var l=_interopRequireDefault(r(5450));var c=_interopRequireDefault(r(5953));var h=_interopRequireDefault(r(8813));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},8295:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(7023));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},3172:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(43));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(7023);var n=r(8295);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},5953:function(e,t,r){"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(7859));var i=_interopRequireDefault(r(5450));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o=U}function nextToken(e){if(J.length)return J.pop();if(G>=U)return;var t=e?e.ignoreUnclosed:false;A=E.charCodeAt(G);if(A===o||A===a||A===l&&E.charCodeAt(G+1)!==o){W=G;V+=1}switch(A){case o:case u:case f:case l:case a:M=G;do{M+=1;A=E.charCodeAt(M);if(A===o){W=M;V+=1}}while(A===u||A===o||A===f||A===l||A===a);z=["space",E.slice(G,M)];G=M-1;break;case c:case h:case v:case g:case w:case m:case d:var _=String.fromCharCode(A);z=[_,_,V,G-W];break;case p:B=Y.length?Y.pop()[1]:"";$=E.charCodeAt(G+1);if(B==="url"&&$!==r&&$!==n&&$!==u&&$!==o&&$!==f&&$!==a&&$!==l){M=G;do{j=false;M=E.indexOf(")",M+1);if(M===-1){if(D||t){M=G;break}else{unclosed("bracket")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);z=["brackets",E.slice(G,M+1),V,G-W,V,M-W];G=M}else{M=E.indexOf(")",G+1);F=E.slice(G,M+1);if(M===-1||C.test(F)){z=["(","(",V,G-W]}else{z=["brackets",F,V,G-W,V,M-W];G=M}}break;case r:case n:q=A===r?"'":'"';M=G;do{j=false;M=E.indexOf(q,M+1);if(M===-1){if(D||t){M=G+1;break}else{unclosed("string")}}x=M;while(E.charCodeAt(x-1)===i){x-=1;j=!j}}while(j);F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["string",E.slice(G,M+1),V,G-W,N,M-k];W=k;V=N;G=M;break;case b:S.lastIndex=G+1;S.test(E);if(S.lastIndex===0){M=E.length-1}else{M=S.lastIndex-2}z=["at-word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;case i:M=G;L=true;while(E.charCodeAt(M+1)===i){M+=1;L=!L}A=E.charCodeAt(M+1);if(L&&A!==s&&A!==u&&A!==o&&A!==f&&A!==l&&A!==a){M+=1;if(O.test(E.charAt(M))){while(O.test(E.charAt(M+1))){M+=1}if(E.charCodeAt(M+1)===u){M+=1}}}z=["word",E.slice(G,M+1),V,G-W,V,M-W];G=M;break;default:if(A===s&&E.charCodeAt(G+1)===y){M=E.indexOf("*/",G+2)+1;if(M===0){if(D||t){M=E.length}else{unclosed("comment")}}F=E.slice(G,M+1);T=F.split("\n");I=T.length-1;if(I>0){N=V+I;k=M-T[I].length}else{N=V;k=W}z=["comment",F,V,G-W,N,M-k];W=k;V=N;G=M}else{R.lastIndex=G+1;R.test(E);if(R.lastIndex===0){M=E.length-1}else{M=R.lastIndex-2}z=["word",E.slice(G,M+1),V,G-W,V,M-W];Y.push(z);G=M}break}G++;return z}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},235:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},2508:function(e,t){"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},43:function(e,t){"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},6358:function(e,t,r){"use strict";const n=r(2087);const i=r(1621);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},4270:function(e,t,r){"use strict";const n=r(5848);const i=r(3656);const s=/^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;const o=/(?:\s+|^)([\w-]+):?\s+(.+?)\s*$/g;const u=/^([\w-]+)(?:\s+as\s+([\w-]+))?/;let a={};let f=0;let l=a&&a.createImportedName||(e=>`i__const_${e.replace(/\W/g,"_")}_${f++}`);e.exports=n.plugin("postcss-modules-values",()=>(e,t)=>{const r=[];const a={};const f=e=>{let t;while(t=o.exec(e.params)){let[,r,n]=t;a[r]=i.replaceValueSymbols(n,a);e.remove()}};const c=e=>{const t=s.exec(e.params);if(t){let[,n,i]=t;if(a[i]){i=a[i]}const s=n.replace(/^\(\s*([\s\S]+)\s*\)$/,"$1").split(/\s*,\s*/).map(e=>{const t=u.exec(e);if(t){const[,e,r=e]=t;const n=l(r);a[r]=n;return{theirName:e,importedName:n}}else{throw new Error(`@import statement "${e}" is invalid!`)}});r.push({path:i,imports:s});e.remove()}};e.walkAtRules("value",e=>{if(s.exec(e.params)){c(e)}else{if(e.params.indexOf("@value")!==-1){t.warn("Invalid value definition: "+e.params)}f(e)}});const h=Object.keys(a).map(e=>n.decl({value:a[e],prop:e,raws:{before:"\n "}}));if(!Object.keys(a).length){return}i.replaceSymbols(e,a);if(h.length>0){const t=n.rule({selector:":export",raws:{after:"\n"}});t.append(h);e.prepend(t)}r.reverse().forEach(({path:t,imports:r})=>{const i=n.rule({selector:`:import(${t})`,raws:{after:"\n"}});r.forEach(({theirName:e,importedName:t})=>{i.append({value:e,prop:t,raws:{before:"\n "}})});e.prepend(i)})})},9285:function(e,t,r){var n=r(5920);var i=r(9987);var s=r(7952);function ValueParser(e){if(this instanceof ValueParser){this.nodes=n(e);return this}return new ValueParser(e)}ValueParser.prototype.toString=function(){return Array.isArray(this.nodes)?s(this.nodes):""};ValueParser.prototype.walk=function(e,t){i(this.nodes,e,t);return this};ValueParser.unit=r(5148);ValueParser.walk=i;ValueParser.stringify=s;e.exports=ValueParser},5920:function(e){var t="(".charCodeAt(0);var r=")".charCodeAt(0);var n="'".charCodeAt(0);var i='"'.charCodeAt(0);var s="\\".charCodeAt(0);var o="/".charCodeAt(0);var u=",".charCodeAt(0);var a=":".charCodeAt(0);var f="*".charCodeAt(0);var l="u".charCodeAt(0);var c="U".charCodeAt(0);var h="+".charCodeAt(0);var p=/^[a-f0-9?-]+$/i;e.exports=function(e){var d=[];var v=e;var g,m,y,w,b,S,R,C;var O=0;var E=v.charCodeAt(O);var D=v.length;var A=[{nodes:d}];var M=0;var q;var T="";var I="";var F="";while(O=48&&s<=57){return true}var o=e.charCodeAt(2);if(s===n&&o>=48&&o<=57){return true}return false}if(i===n){s=e.charCodeAt(1);if(s>=48&&s<=57){return true}return false}if(i>=48&&i<=57){return true}return false}e.exports=function(e){var o=0;var u=e.length;var a;var f;var l;if(u===0||!likeNumber(e)){return false}a=e.charCodeAt(o);if(a===r||a===t){o++}while(o57){break}o+=1}a=e.charCodeAt(o);f=e.charCodeAt(o+1);if(a===n&&f>=48&&f<=57){o+=2;while(o57){break}o+=1}}a=e.charCodeAt(o);f=e.charCodeAt(o+1);l=e.charCodeAt(o+2);if((a===i||a===s)&&(f>=48&&f<=57||(f===r||f===t)&&l>=48&&l<=57)){o+=f===r||f===t?3:2;while(o57){break}o+=1}}return{number:e.slice(0,o),unit:e.slice(o)}}},9987:function(e){e.exports=function walk(e,t,r){var n,i,s,o;for(n=0,i=e.length;n=6.0.0"},"keywords":["css","postcss","rework","preprocessor","parser","source map","transform","manipulation","transpiler"],"funding":{"type":"tidelift","url":"https://tidelift.com/funding/github/npm/postcss"},"author":"Andrey Sitnik ","license":"MIT","homepage":"https://postcss.org/","repository":"postcss/postcss","dependencies":{"chalk":"^2.4.2","source-map":"^0.6.1","supports-color":"^6.1.0"},"main":"lib/postcss","types":"lib/postcss.d.ts","husky":{"hooks":{"pre-commit":"lint-staged"}},"browser":{"./lib/terminal-highlight":false,"supports-color":false,"chalk":false,"fs":false},"browserslist":["last 2 version","not dead","not Explorer 11","not ExplorerMobile 11","node 6"]}')},2242:function(e){"use strict";e.exports=require("chalk")},5747:function(e){"use strict";e.exports=require("fs")},3443:function(e){"use strict";e.exports=require("next/dist/compiled/loader-utils")},3225:function(e){"use strict";e.exports=require("next/dist/compiled/schema-utils")},2519:function(e){"use strict";e.exports=require("next/dist/compiled/semver")},6241:function(e){"use strict";e.exports=require("next/dist/compiled/source-map")},2087:function(e){"use strict";e.exports=require("os")},5622:function(e){"use strict";e.exports=require("path")},8835:function(e){"use strict";e.exports=require("url")},1669:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var n=t[r]={exports:{}};var i=true;try{e[r](n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return n.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(7583)}(); \ No newline at end of file diff --git a/packages/next/compiled/debug/index.js b/packages/next/compiled/debug/index.js index 68e3e139f7bb..e9b8ce9ddbe7 100644 --- a/packages/next/compiled/debug/index.js +++ b/packages/next/compiled/debug/index.js @@ -1 +1 @@ -module.exports=(()=>{var e={369:(e,t,r)=>{t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0;let n=0;t[0].replace(/%[a-zA-Z%]/g,e=>{if(e==="%%"){return}s++;if(e==="%c"){n=s}});t.splice(n,0,r)}function log(...e){return typeof console==="object"&&console.log&&console.log(...e)}function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=r(507)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},507:(e,t,r)=>{function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=r(4);Object.keys(e).forEach(t=>{createDebug[t]=e[t]});createDebug.instances=[];createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let r=0;r{if(t==="%%"){return t}o++;const n=createDebug.formatters[s];if(typeof n==="function"){const s=e[o];t=n.call(r,s);e.splice(o,1);o--}return t});createDebug.formatArgs.call(r,e);const c=r.log||createDebug.log;c.apply(r,e)}debug.namespace=e;debug.enabled=createDebug.enabled(e);debug.useColors=createDebug.useColors();debug.color=selectColor(e);debug.destroy=destroy;debug.extend=extend;if(typeof createDebug.init==="function"){createDebug.init(debug)}createDebug.instances.push(debug);return debug}function destroy(){const e=createDebug.instances.indexOf(this);if(e!==-1){createDebug.instances.splice(e,1);return true}return false}function extend(e,t){const r=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);r.log=this.log;return r}function enable(e){createDebug.save(e);createDebug.names=[];createDebug.skips=[];let t;const r=(typeof e==="string"?e:"").split(/[\s,]+/);const s=r.length;for(t=0;t"-"+e)].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let t;let r;for(t=0,r=createDebug.skips.length;t{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=r(369)}else{e.exports=r(296)}},296:(e,t,r)=>{const s=r(867);const n=r(669);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.colors=[6,2,3,4,5,1];try{const e=r(106);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>{return/^debug_/i.test(e)}).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>{return t.toUpperCase()});let s=process.env[t];if(/^(yes|on|true|enabled)$/i.test(s)){s=true}else if(/^(no|off|false|disabled)$/i.test(s)){s=false}else if(s==="null"){s=null}else{s=Number(s)}e[r]=s;return e},{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:r,useColors:s}=this;if(s){const s=this.color;const n="[3"+(s<8?s:"8;5;"+s);const o=` ${n};1m${r} `;t[0]=o+t[0].split("\n").join("\n"+o);t.push(n+"m+"+e.exports.humanize(this.diff)+"")}else{t[0]=getDate()+r+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(n.format(...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let s=0;s{"use strict";e.exports=((e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const s=t.indexOf(r+e);const n=t.indexOf("--");return s!==-1&&(n===-1?true:s{var t=1e3;var r=t*60;var s=r*60;var n=s*24;var o=n*7;var c=n*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!u){return}var a=parseFloat(u[1]);var i=(u[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return a*c;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*s;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return undefined}}function fmtShort(e){var o=Math.abs(e);if(o>=n){return Math.round(e/n)+"d"}if(o>=s){return Math.round(e/s)+"h"}if(o>=r){return Math.round(e/r)+"m"}if(o>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var o=Math.abs(e);if(o>=n){return plural(e,o,n,"day")}if(o>=s){return plural(e,o,s,"hour")}if(o>=r){return plural(e,o,r,"minute")}if(o>=t){return plural(e,o,t,"second")}return e+" ms"}function plural(e,t,r,s){var n=t>=r*1.5;return Math.round(e/r)+" "+s+(n?"s":"")}},106:(e,t,r)=>{"use strict";const s=r(87);const n=r(379);const o=process.env;let c;if(n("no-color")||n("no-colors")||n("color=false")){c=false}else if(n("color")||n("colors")||n("color=true")||n("color=always")){c=true}if("FORCE_COLOR"in o){c=o.FORCE_COLOR.length===0||parseInt(o.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(c===false){return 0}if(n("color=16m")||n("color=full")||n("color=truecolor")){return 3}if(n("color=256")){return 2}if(e&&!e.isTTY&&c!==true){return 0}const t=c?1:0;if(process.platform==="win32"){const e=s.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in o)||o.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}if(o.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},87:e=>{"use strict";e.exports=require("os")},867:e=>{"use strict";e.exports=require("tty")},669:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var s=t[r]={exports:{}};var n=true;try{e[r](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}return s.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(787)})(); \ No newline at end of file +module.exports=(()=>{var e={369:(e,t,r)=>{t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0;let n=0;t[0].replace(/%[a-zA-Z%]/g,e=>{if(e==="%%"){return}s++;if(e==="%c"){n=s}});t.splice(n,0,r)}function log(...e){return typeof console==="object"&&console.log&&console.log(...e)}function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=r(507)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},507:(e,t,r)=>{function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=r(4);Object.keys(e).forEach(t=>{createDebug[t]=e[t]});createDebug.instances=[];createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let r=0;r{if(t==="%%"){return t}o++;const n=createDebug.formatters[s];if(typeof n==="function"){const s=e[o];t=n.call(r,s);e.splice(o,1);o--}return t});createDebug.formatArgs.call(r,e);const u=r.log||createDebug.log;u.apply(r,e)}debug.namespace=e;debug.enabled=createDebug.enabled(e);debug.useColors=createDebug.useColors();debug.color=selectColor(e);debug.destroy=destroy;debug.extend=extend;if(typeof createDebug.init==="function"){createDebug.init(debug)}createDebug.instances.push(debug);return debug}function destroy(){const e=createDebug.instances.indexOf(this);if(e!==-1){createDebug.instances.splice(e,1);return true}return false}function extend(e,t){const r=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);r.log=this.log;return r}function enable(e){createDebug.save(e);createDebug.names=[];createDebug.skips=[];let t;const r=(typeof e==="string"?e:"").split(/[\s,]+/);const s=r.length;for(t=0;t"-"+e)].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let t;let r;for(t=0,r=createDebug.skips.length;t{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=r(369)}else{e.exports=r(296)}},296:(e,t,r)=>{const s=r(867);const n=r(669);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.colors=[6,2,3,4,5,1];try{const e=r(106);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>{return/^debug_/i.test(e)}).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>{return t.toUpperCase()});let s=process.env[t];if(/^(yes|on|true|enabled)$/i.test(s)){s=true}else if(/^(no|off|false|disabled)$/i.test(s)){s=false}else if(s==="null"){s=null}else{s=Number(s)}e[r]=s;return e},{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:r,useColors:s}=this;if(s){const s=this.color;const n="[3"+(s<8?s:"8;5;"+s);const o=` ${n};1m${r} `;t[0]=o+t[0].split("\n").join("\n"+o);t.push(n+"m+"+e.exports.humanize(this.diff)+"")}else{t[0]=getDate()+r+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(n.format(...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let s=0;s{"use strict";e.exports=((e,t=process.argv)=>{const r=e.startsWith("-")?"":e.length===1?"-":"--";const s=t.indexOf(r+e);const n=t.indexOf("--");return s!==-1&&(n===-1||s{var t=1e3;var r=t*60;var s=r*60;var n=s*24;var o=n*7;var u=n*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!c){return}var a=parseFloat(c[1]);var i=(c[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return a*u;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*s;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return undefined}}function fmtShort(e){var o=Math.abs(e);if(o>=n){return Math.round(e/n)+"d"}if(o>=s){return Math.round(e/s)+"h"}if(o>=r){return Math.round(e/r)+"m"}if(o>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var o=Math.abs(e);if(o>=n){return plural(e,o,n,"day")}if(o>=s){return plural(e,o,s,"hour")}if(o>=r){return plural(e,o,r,"minute")}if(o>=t){return plural(e,o,t,"second")}return e+" ms"}function plural(e,t,r,s){var n=t>=r*1.5;return Math.round(e/r)+" "+s+(n?"s":"")}},106:(e,t,r)=>{"use strict";const s=r(87);const n=r(867);const o=r(379);const{env:u}=process;let c;if(o("no-color")||o("no-colors")||o("color=false")||o("color=never")){c=0}else if(o("color")||o("colors")||o("color=true")||o("color=always")){c=1}if("FORCE_COLOR"in u){if(u.FORCE_COLOR==="true"){c=1}else if(u.FORCE_COLOR==="false"){c=0}else{c=u.FORCE_COLOR.length===0?1:Math.min(parseInt(u.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(c===0){return 0}if(o("color=16m")||o("color=full")||o("color=truecolor")){return 3}if(o("color=256")){return 2}if(e&&!t&&c===undefined){return 0}const r=c||0;if(u.TERM==="dumb"){return r}if(process.platform==="win32"){const e=s.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in u){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in u)||u.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in u){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0}if(u.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in u){const e=parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(u.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)){return 1}if("COLORTERM"in u){return 1}return r}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,n.isatty(1))),stderr:translateLevel(supportsColor(true,n.isatty(2)))}},87:e=>{"use strict";e.exports=require("os")},867:e=>{"use strict";e.exports=require("tty")},669:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var s=t[r]={exports:{}};var n=true;try{e[r](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}return s.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(787)})(); \ No newline at end of file diff --git a/packages/next/compiled/find-cache-dir/index.js b/packages/next/compiled/find-cache-dir/index.js index 7000c7c3130b..b237dc808489 100644 --- a/packages/next/compiled/find-cache-dir/index.js +++ b/packages/next/compiled/find-cache-dir/index.js @@ -1 +1 @@ -module.exports=(()=>{var r={192:(r,e,t)=>{var s=t(622);r.exports=function(r,e){if(e){var t=e.map(function(e){return s.resolve(r,e)})}else{var t=r}var n=t.slice(1).reduce(function(r,e){if(!e.match(/^([A-Za-z]:)?\/|\\/)){throw new Error("relative path without a basedir")}var t=e.split(/\/+|\\+/);for(var s=0;r[s]===t[s]&&s1?n.join("/"):"/"}},19:(r,e,t)=>{"use strict";const s=t(622);const n=t(747);const o=t(192);const c=t(860);const i=t(240);const{env:a,cwd:u}=process;const d=r=>{try{n.accessSync(r,n.constants.W_OK);return true}catch(r){return false}};function useDirectory(r,e){if(e.create){i.sync(r)}if(e.thunk){return(...e)=>s.join(r,...e)}return r}function getNodeModuleDirectory(r){const e=s.join(r,"node_modules");if(!d(e)&&(n.existsSync(e)||!d(s.join(r)))){return}return e}r.exports=((r={})=>{if(a.CACHE_DIR&&!["true","false","1","0"].includes(a.CACHE_DIR)){return useDirectory(s.join(a.CACHE_DIR,"find-cache-dir"),r)}let{cwd:e=u()}=r;if(r.files){e=o(e,r.files)}e=c.sync(e);if(!e){return}const t=getNodeModuleDirectory(e);if(!t){return undefined}return useDirectory(s.join(e,"node_modules",".cache",r.name),r)})},240:(r,e,t)=>{"use strict";const s=t(747);const n=t(622);const{promisify:o}=t(669);const c=t(519);const i=c.satisfies(process.version,">=10.12.0");const a=r=>{if(process.platform==="win32"){const e=/[<>:"|?*]/.test(r.replace(n.parse(r).root,""));if(e){const e=new Error(`Path contains invalid characters: ${r}`);e.code="EINVAL";throw e}}};const u=r=>{const e={mode:511&~process.umask(),fs:s};return{...e,...r}};const d=r=>{const e=new Error(`operation not permitted, mkdir '${r}'`);e.code="EPERM";e.errno=-4048;e.path=r;e.syscall="mkdir";return e};const f=async(r,e)=>{a(r);e=u(e);const t=o(e.fs.mkdir);const c=o(e.fs.stat);if(i&&e.fs.mkdir===s.mkdir){const s=n.resolve(r);await t(s,{mode:e.mode,recursive:true});return s}const f=async r=>{try{await t(r,e.mode);return r}catch(e){if(e.code==="EPERM"){throw e}if(e.code==="ENOENT"){if(n.dirname(r)===r){throw d(r)}if(e.message.includes("null bytes")){throw e}await f(n.dirname(r));return f(r)}try{const t=await c(r);if(!t.isDirectory()){throw new Error("The path is not a directory")}}catch(r){throw e}return r}};return f(n.resolve(r))};r.exports=f;r.exports.sync=((r,e)=>{a(r);e=u(e);if(i&&e.fs.mkdirSync===s.mkdirSync){const t=n.resolve(r);s.mkdirSync(t,{mode:e.mode,recursive:true});return t}const t=r=>{try{e.fs.mkdirSync(r,e.mode)}catch(s){if(s.code==="EPERM"){throw s}if(s.code==="ENOENT"){if(n.dirname(r)===r){throw d(r)}if(s.message.includes("null bytes")){throw s}t(n.dirname(r));return t(r)}try{if(!e.fs.statSync(r).isDirectory()){throw new Error("The path is not a directory")}}catch(r){throw s}}return r};return t(n.resolve(r))})},860:(r,e,t)=>{"use strict";const s=t(622);const n=t(442);const o=async r=>{const e=await n("package.json",{cwd:r});return e&&s.dirname(e)};r.exports=o;r.exports.default=o;r.exports.sync=(r=>{const e=n.sync("package.json",{cwd:r});return e&&s.dirname(e)})},747:r=>{"use strict";r.exports=require("fs")},442:r=>{"use strict";r.exports=require("next/dist/compiled/find-up")},519:r=>{"use strict";r.exports=require("next/dist/compiled/semver")},622:r=>{"use strict";r.exports=require("path")},669:r=>{"use strict";r.exports=require("util")}};var e={};function __nccwpck_require__(t){if(e[t]){return e[t].exports}var s=e[t]={exports:{}};var n=true;try{r[t](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete e[t]}return s.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(19)})(); \ No newline at end of file +module.exports=(()=>{var r={192:(r,e,t)=>{var s=t(622);r.exports=function(r,e){if(e){var t=e.map(function(e){return s.resolve(r,e)})}else{var t=r}var n=t.slice(1).reduce(function(r,e){if(!e.match(/^([A-Za-z]:)?\/|\\/)){throw new Error("relative path without a basedir")}var t=e.split(/\/+|\\+/);for(var s=0;r[s]===t[s]&&s1?n.join("/"):"/"}},19:(r,e,t)=>{"use strict";const s=t(622);const n=t(747);const o=t(192);const c=t(477);const i=t(293);const{env:a,cwd:u}=process;const d=r=>{try{n.accessSync(r,n.constants.W_OK);return true}catch(r){return false}};function useDirectory(r,e){if(e.create){i.sync(r)}if(e.thunk){return(...e)=>s.join(r,...e)}return r}function getNodeModuleDirectory(r){const e=s.join(r,"node_modules");if(!d(e)&&(n.existsSync(e)||!d(s.join(r)))){return}return e}r.exports=((r={})=>{if(a.CACHE_DIR&&!["true","false","1","0"].includes(a.CACHE_DIR)){return useDirectory(s.join(a.CACHE_DIR,"find-cache-dir"),r)}let{cwd:e=u()}=r;if(r.files){e=o(e,r.files)}e=c.sync(e);if(!e){return}const t=getNodeModuleDirectory(e);if(!t){return undefined}return useDirectory(s.join(e,"node_modules",".cache",r.name),r)})},293:(r,e,t)=>{"use strict";const s=t(747);const n=t(622);const{promisify:o}=t(669);const c=t(519);const i=c.satisfies(process.version,">=10.12.0");const a=r=>{if(process.platform==="win32"){const e=/[<>:"|?*]/.test(r.replace(n.parse(r).root,""));if(e){const e=new Error(`Path contains invalid characters: ${r}`);e.code="EINVAL";throw e}}};const u=r=>{const e={mode:511&~process.umask(),fs:s};return{...e,...r}};const d=r=>{const e=new Error(`operation not permitted, mkdir '${r}'`);e.code="EPERM";e.errno=-4048;e.path=r;e.syscall="mkdir";return e};const f=async(r,e)=>{a(r);e=u(e);const t=o(e.fs.mkdir);const c=o(e.fs.stat);if(i&&e.fs.mkdir===s.mkdir){const s=n.resolve(r);await t(s,{mode:e.mode,recursive:true});return s}const f=async r=>{try{await t(r,e.mode);return r}catch(e){if(e.code==="EPERM"){throw e}if(e.code==="ENOENT"){if(n.dirname(r)===r){throw d(r)}if(e.message.includes("null bytes")){throw e}await f(n.dirname(r));return f(r)}try{const t=await c(r);if(!t.isDirectory()){throw new Error("The path is not a directory")}}catch(r){throw e}return r}};return f(n.resolve(r))};r.exports=f;r.exports.sync=((r,e)=>{a(r);e=u(e);if(i&&e.fs.mkdirSync===s.mkdirSync){const t=n.resolve(r);s.mkdirSync(t,{mode:e.mode,recursive:true});return t}const t=r=>{try{e.fs.mkdirSync(r,e.mode)}catch(s){if(s.code==="EPERM"){throw s}if(s.code==="ENOENT"){if(n.dirname(r)===r){throw d(r)}if(s.message.includes("null bytes")){throw s}t(n.dirname(r));return t(r)}try{if(!e.fs.statSync(r).isDirectory()){throw new Error("The path is not a directory")}}catch(r){throw s}}return r};return t(n.resolve(r))})},477:(r,e,t)=>{"use strict";const s=t(622);const n=t(442);const o=async r=>{const e=await n("package.json",{cwd:r});return e&&s.dirname(e)};r.exports=o;r.exports.default=o;r.exports.sync=(r=>{const e=n.sync("package.json",{cwd:r});return e&&s.dirname(e)})},747:r=>{"use strict";r.exports=require("fs")},442:r=>{"use strict";r.exports=require("next/dist/compiled/find-up")},519:r=>{"use strict";r.exports=require("next/dist/compiled/semver")},622:r=>{"use strict";r.exports=require("path")},669:r=>{"use strict";r.exports=require("util")}};var e={};function __nccwpck_require__(t){if(e[t]){return e[t].exports}var s=e[t]={exports:{}};var n=true;try{r[t](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete e[t]}return s.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(19)})(); \ No newline at end of file diff --git a/packages/next/compiled/postcss-flexbugs-fixes/index.js b/packages/next/compiled/postcss-flexbugs-fixes/index.js index 161a4eb98e3e..e19d37965fa4 100644 --- a/packages/next/compiled/postcss-flexbugs-fixes/index.js +++ b/packages/next/compiled/postcss-flexbugs-fixes/index.js @@ -1 +1 @@ -module.exports=(()=>{var e={379:e=>{"use strict";e.exports=((e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n{var n=r(633);function shouldSetZeroBasis(e){if(!e){return false}return e==="0"||e.replace(/\s/g,"")==="0px"}function properBasis(e){if(shouldSetZeroBasis(e)){return"0%"}return e}e.exports=function(e){if(e.prop==="flex"){var t=n.list.space(e.value);var r="0";var i="1";var s="0%";if(t[0]){r=t[0]}if(t[1]){if(!isNaN(t[1])){i=t[1]}else{s=t[1]}}if(t[2]){s=t[2]}e.value=r+" "+i+" "+properBasis(s)}}},196:(e,t,r)=>{var n=r(633);e.exports=function(e){if(e.prop==="flex"){var t=n.list.space(e.value);var r=t[0];var i=t[1]||"1";var s=t[2]||"0%";if(s==="0%")s=null;e.value=r+" "+i+(s?" "+s:"")}}},136:(e,t,r)=>{var n=r(633);e.exports=function(e){var t=/(\d{1,}) (\d{1,}) (calc\(.*\))/g;var r=t.exec(e.value);if(e.prop==="flex"&&r){var i=n.decl({prop:"flex-grow",value:r[1],source:e.source});var s=n.decl({prop:"flex-shrink",value:r[2],source:e.source});var o=n.decl({prop:"flex-basis",value:r[3],source:e.source});e.parent.insertBefore(e,i);e.parent.insertBefore(e,s);e.parent.insertBefore(e,o);e.remove()}}},350:(e,t,r)=>{var n=r(633);var i=r(369);var s=r(196);var o=r(136);var u=["none","auto","content","inherit","initial","unset"];e.exports=n.plugin("postcss-flexbugs-fixes",function(e){var t=Object.assign({bug4:true,bug6:true,bug81a:true},e);return function(e){e.walkDecls(function(e){if(e.value.indexOf("var(")>-1){return}if(e.value==="none"){return}var r=n.list.space(e.value);if(u.indexOf(e.value)>0&&r.length===1){return}if(t.bug4){i(e)}if(t.bug6){s(e)}if(t.bug81a){o(e)}})}})},217:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Comment,e);function Comment(t){var r;r=e.call(this,t)||this;r.type="comment";return r}return Comment}(n.default);var s=i;t.default=s;e.exports=t.default},878:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(605));var i=_interopRequireDefault(r(259));var s=_interopRequireDefault(r(497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(749);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var w=v;if(w.parent)w.parent.removeChild(w,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(797);e=[new m(e)]}else if(e.name){var g=r(217);e=[new g(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var y=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return y};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},535:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(327));var i=_interopRequireDefault(r(242));var s=_interopRequireDefault(r(300));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},605:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},905:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(622));var i=_interopRequireDefault(r(535));var s=_interopRequireDefault(r(713));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},169:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(595));var i=_interopRequireDefault(r(549));var s=_interopRequireDefault(r(831));var o=_interopRequireDefault(r(613));var u=_interopRequireDefault(r(749));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},9:(e,t)=>{"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},595:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(241));var i=_interopRequireDefault(r(622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},497:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(535));var i=_interopRequireDefault(r(935));var s=_interopRequireDefault(r(549));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(570));var i=_interopRequireDefault(r(905));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e,t){var r=new i.default(e,t);var s=new n.default(r);try{s.parse()}catch(e){if(process.env.NODE_ENV!=="production"){if(e.name==="CssSyntaxError"&&t&&t.from){if(/\.scss$/i.test(t.from)){e.message+="\nYou tried to parse SCSS with "+"the standard CSS parser; "+"try again with the postcss-scss parser"}else if(/\.sass/i.test(t.from)){e.message+="\nYou tried to parse Sass with "+"the standard CSS parser; "+"try again with the postcss-sass parser"}else if(/\.less$/i.test(t.from)){e.message+="\nYou tried to parse Less with "+"the standard CSS parser; "+"try again with the postcss-less parser"}}}throw e}return s.root}var s=parse;t.default=s;e.exports=t.default},570:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(605));var i=_interopRequireDefault(r(926));var s=_interopRequireDefault(r(259));var o=_interopRequireDefault(r(217));var u=_interopRequireDefault(r(907));var a=_interopRequireDefault(r(797));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f=function(){function Parser(e){this.input=e;this.root=new u.default;this.current=this.root;this.spaces="";this.semicolon=false;this.createTokenizer();this.root.source={input:e,start:{line:1,column:1}}}var e=Parser.prototype;e.createTokenizer=function createTokenizer(){this.tokenizer=(0,i.default)(this.input)};e.parse=function parse(){var e;while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();switch(e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}}this.endFile()};e.comment=function comment(e){var t=new s.default;this.init(t,e[2],e[3]);t.source.end={line:e[4],column:e[5]};var r=e[1].slice(2,-2);if(/^\s*$/.test(r)){t.text="";t.raws.left=r;t.raws.right=""}else{var n=r.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=n[2];t.raws.left=n[1];t.raws.right=n[3]}};e.emptyRule=function emptyRule(e){var t=new a.default;this.init(t,e[2],e[3]);t.selector="";t.raws.between="";this.current=t};e.other=function other(e){var t=false;var r=null;var n=false;var i=null;var s=[];var o=[];var u=e;while(u){r=u[0];o.push(u);if(r==="("||r==="["){if(!i)i=u;s.push(r==="("?")":"]")}else if(s.length===0){if(r===";"){if(n){this.decl(o);return}else{break}}else if(r==="{"){this.rule(o);return}else if(r==="}"){this.tokenizer.back(o.pop());t=true;break}else if(r===":"){n=true}}else if(r===s[s.length-1]){s.pop();if(s.length===0)i=null}u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())t=true;if(s.length>0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},633:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(605));var i=_interopRequireDefault(r(74));var s=_interopRequireDefault(r(549));var o=_interopRequireDefault(r(259));var u=_interopRequireDefault(r(217));var a=_interopRequireDefault(r(216));var f=_interopRequireDefault(r(749));var l=_interopRequireDefault(r(9));var c=_interopRequireDefault(r(797));var h=_interopRequireDefault(r(907));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(241));var i=_interopRequireDefault(r(622));var s=_interopRequireDefault(r(747));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function fromBase64(e){if(Buffer){return Buffer.from(e,"base64").toString()}else{return window.atob(e)}}var o=function(){function PreviousMap(e,t){this.loadAnnotation(e);this.inline=this.startWith(this.annotation,"data:");var r=t.map?t.map.prev:undefined;var n=this.loadMap(t.from,r);if(n)this.text=n}var e=PreviousMap.prototype;e.consumer=function consumer(){if(!this.consumerCache){this.consumerCache=new n.default.SourceMapConsumer(this.text)}return this.consumerCache};e.withContent=function withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},74:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(169));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},613:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(338));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Root,e);function Root(t){var r;r=e.call(this,t)||this;r.type="root";if(!r.nodes)r.nodes=[];return r}var t=Root.prototype;t.removeChild=function removeChild(t,r){var n=this.index(t);if(!r&&n===0&&this.nodes.length>1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(169);var n=r(74);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},797:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(878));var i=_interopRequireDefault(r(9));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r{"use strict";t.__esModule=true;t.default=void 0;var r={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:false};function capitalize(e){return e[0].toUpperCase()+e.slice(1)}var n=function(){function Stringifier(e){this.builder=e}var e=Stringifier.prototype;e.stringify=function stringify(e,t){this[e.type](e,t)};e.root=function root(e){this.body(e);if(e.raws.after)this.builder(e.raws.after)};e.comment=function comment(e){var t=this.raw(e,"left","commentLeft");var r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)};e.decl=function decl(e,t){var r=this.raw(e,"between","colon");var n=e.prop+r+this.rawValue(e,"value");if(e.important){n+=e.raws.important||" !important"}if(t)n+=";";this.builder(n,e)};e.rule=function rule(e){this.block(e,this.rawValue(e,"selector"));if(e.raws.ownSemicolon){this.builder(e.raws.ownSemicolon,e,"end")}};e.atrule=function atrule(e,t){var r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!=="undefined"){r+=e.raws.afterName}else if(n){r+=" "}if(e.nodes){this.block(e,r+n)}else{var i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}};e.body=function body(e){var t=e.nodes.length-1;while(t>0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(935));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringify(e,t){var r=new n.default(t);r.stringify(e)}var i=stringify;t.default=i;e.exports=t.default},300:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(242));var i=_interopRequireDefault(r(926));var s=_interopRequireDefault(r(905));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o={brackets:n.default.cyan,"at-word":n.default.cyan,comment:n.default.gray,string:n.default.green,class:n.default.yellow,call:n.default.cyan,hash:n.default.magenta,"(":n.default.cyan,")":n.default.cyan,"{":n.default.yellow,"}":n.default.yellow,"[":n.default.yellow,"]":n.default.yellow,":":n.default.yellow,";":n.default.yellow};function getTokenType(e,t){var r=e[0],n=e[1];if(r==="word"){if(n[0]==="."){return"class"}if(n[0]==="#"){return"hash"}}if(!t.endOfFile()){var i=t.nextToken();t.back(i);if(i[0]==="brackets"||i[0]==="(")return"call"}return r}function terminalHighlight(e){var t=(0,i.default)(new s.default(e),{ignoreErrors:true});var r="";var n=function _loop(){var e=t.nextToken();var n=o[getTokenType(e,t)];if(n){r+=e[1].split(/\r?\n/).map(function(e){return n(e)}).join("\n")}else{r+=e[1]}};while(!t.endOfFile()){n()}return r}var u=terminalHighlight;t.default=u;e.exports=t.default},926:(e,t)=>{"use strict";t.__esModule=true;t.default=tokenizer;var r="'".charCodeAt(0);var n='"'.charCodeAt(0);var i="\\".charCodeAt(0);var s="/".charCodeAt(0);var o="\n".charCodeAt(0);var u=" ".charCodeAt(0);var a="\f".charCodeAt(0);var f="\t".charCodeAt(0);var l="\r".charCodeAt(0);var c="[".charCodeAt(0);var h="]".charCodeAt(0);var p="(".charCodeAt(0);var d=")".charCodeAt(0);var v="{".charCodeAt(0);var w="}".charCodeAt(0);var m=";".charCodeAt(0);var g="*".charCodeAt(0);var y=":".charCodeAt(0);var b="@".charCodeAt(0);var R=/[ \n\t\r\f{}()'"\\;/[\]#]/g;var C=/[ \n\t\r\f(){}:;@!'"\\\][#]|\/(?=\*)/g;var S=/.[\\/("'\n]/;var O=/[a-f0-9]/i;function tokenizer(e,t){if(t===void 0){t={}}var A=e.css.valueOf();var M=t.ignoreErrors;var D,k,x,E,q,N,B;var I,F,T,j,z,L,P;var V=A.length;var W=-1;var U=1;var $=0;var G=[];var Y=[];function position(){return $}function unclosed(t){throw e.error("Unclosed "+t,U,$-W)}function endOfFile(){return Y.length===0&&$>=V}function nextToken(e){if(Y.length)return Y.pop();if($>=V)return;var t=e?e.ignoreUnclosed:false;D=A.charCodeAt($);if(D===o||D===a||D===l&&A.charCodeAt($+1)!==o){W=$;U+=1}switch(D){case o:case u:case f:case l:case a:k=$;do{k+=1;D=A.charCodeAt(k);if(D===o){W=k;U+=1}}while(D===u||D===o||D===f||D===l||D===a);P=["space",A.slice($,k)];$=k-1;break;case c:case h:case v:case w:case y:case m:case d:var J=String.fromCharCode(D);P=[J,J,U,$-W];break;case p:z=G.length?G.pop()[1]:"";L=A.charCodeAt($+1);if(z==="url"&&L!==r&&L!==n&&L!==u&&L!==o&&L!==f&&L!==a&&L!==l){k=$;do{T=false;k=A.indexOf(")",k+1);if(k===-1){if(M||t){k=$;break}else{unclosed("bracket")}}j=k;while(A.charCodeAt(j-1)===i){j-=1;T=!T}}while(T);P=["brackets",A.slice($,k+1),U,$-W,U,k-W];$=k}else{k=A.indexOf(")",$+1);N=A.slice($,k+1);if(k===-1||S.test(N)){P=["(","(",U,$-W]}else{P=["brackets",N,U,$-W,U,k-W];$=k}}break;case r:case n:x=D===r?"'":'"';k=$;do{T=false;k=A.indexOf(x,k+1);if(k===-1){if(M||t){k=$+1;break}else{unclosed("string")}}j=k;while(A.charCodeAt(j-1)===i){j-=1;T=!T}}while(T);N=A.slice($,k+1);E=N.split("\n");q=E.length-1;if(q>0){I=U+q;F=k-E[q].length}else{I=U;F=W}P=["string",A.slice($,k+1),U,$-W,I,k-F];W=F;U=I;$=k;break;case b:R.lastIndex=$+1;R.test(A);if(R.lastIndex===0){k=A.length-1}else{k=R.lastIndex-2}P=["at-word",A.slice($,k+1),U,$-W,U,k-W];$=k;break;case i:k=$;B=true;while(A.charCodeAt(k+1)===i){k+=1;B=!B}D=A.charCodeAt(k+1);if(B&&D!==s&&D!==u&&D!==o&&D!==f&&D!==l&&D!==a){k+=1;if(O.test(A.charAt(k))){while(O.test(A.charAt(k+1))){k+=1}if(A.charCodeAt(k+1)===u){k+=1}}}P=["word",A.slice($,k+1),U,$-W,U,k-W];$=k;break;default:if(D===s&&A.charCodeAt($+1)===g){k=A.indexOf("*/",$+2)+1;if(k===0){if(M||t){k=A.length}else{unclosed("comment")}}N=A.slice($,k+1);E=N.split("\n");q=E.length-1;if(q>0){I=U+q;F=k-E[q].length}else{I=U;F=W}P=["comment",N,U,$-W,I,k-F];W=F;U=I;$=k}else{C.lastIndex=$+1;C.test(A);if(C.lastIndex===0){k=A.length-1}else{k=C.lastIndex-2}P=["word",A.slice($,k+1),U,$-W,U,k-W];G.push(P);$=k}break}$++;return P}function back(e){Y.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},216:(e,t)=>{"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},831:(e,t)=>{"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},338:(e,t)=>{"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},327:(e,t,r)=>{"use strict";const n=r(87);const i=r(379);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},242:e=>{"use strict";e.exports=require("chalk")},747:e=>{"use strict";e.exports=require("fs")},241:e=>{"use strict";e.exports=require("next/dist/compiled/source-map")},87:e=>{"use strict";e.exports=require("os")},622:e=>{"use strict";e.exports=require("path")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var n=t[r]={exports:{}};var i=true;try{e[r](n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return n.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(350)})(); \ No newline at end of file +module.exports=(()=>{var e={369:(e,t,r)=>{var n=r(633);function shouldSetZeroBasis(e){if(!e){return false}return e==="0"||e.replace(/\s/g,"")==="0px"}function properBasis(e){if(shouldSetZeroBasis(e)){return"0%"}return e}e.exports=function(e){if(e.prop==="flex"){var t=n.list.space(e.value);var r="0";var i="1";var s="0%";if(t[0]){r=t[0]}if(t[1]){if(!isNaN(t[1])){i=t[1]}else{s=t[1]}}if(t[2]){s=t[2]}e.value=r+" "+i+" "+properBasis(s)}}},196:(e,t,r)=>{var n=r(633);e.exports=function(e){if(e.prop==="flex"){var t=n.list.space(e.value);var r=t[0];var i=t[1]||"1";var s=t[2]||"0%";if(s==="0%")s=null;e.value=r+" "+i+(s?" "+s:"")}}},136:(e,t,r)=>{var n=r(633);e.exports=function(e){var t=/(\d{1,}) (\d{1,}) (calc\(.*\))/g;var r=t.exec(e.value);if(e.prop==="flex"&&r){var i=n.decl({prop:"flex-grow",value:r[1],source:e.source});var s=n.decl({prop:"flex-shrink",value:r[2],source:e.source});var o=n.decl({prop:"flex-basis",value:r[3],source:e.source});e.parent.insertBefore(e,i);e.parent.insertBefore(e,s);e.parent.insertBefore(e,o);e.remove()}}},350:(e,t,r)=>{var n=r(633);var i=r(369);var s=r(196);var o=r(136);var u=["none","auto","content","inherit","initial","unset"];e.exports=n.plugin("postcss-flexbugs-fixes",function(e){var t=Object.assign({bug4:true,bug6:true,bug81a:true},e);return function(e){e.walkDecls(function(e){if(e.value.indexOf("var(")>-1){return}if(e.value==="none"){return}var r=n.list.space(e.value);if(u.indexOf(e.value)>0&&r.length===1){return}if(t.bug4){i(e)}if(t.bug6){s(e)}if(t.bug81a){o(e)}})}})},217:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Comment,e);function Comment(t){var r;r=e.call(this,t)||this;r.type="comment";return r}return Comment}(n.default);var s=i;t.default=s;e.exports=t.default},878:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(605));var i=_interopRequireDefault(r(259));var s=_interopRequireDefault(r(497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(749);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var w=v;if(w.parent)w.parent.removeChild(w,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(797);e=[new m(e)]}else if(e.name){var g=r(217);e=[new g(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var y=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return y};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},535:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(327));var i=_interopRequireDefault(r(242));var s=_interopRequireDefault(r(300));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},605:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},905:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(622));var i=_interopRequireDefault(r(535));var s=_interopRequireDefault(r(713));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},169:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(595));var i=_interopRequireDefault(r(549));var s=_interopRequireDefault(r(831));var o=_interopRequireDefault(r(613));var u=_interopRequireDefault(r(749));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},9:(e,t)=>{"use strict";t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},595:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(241));var i=_interopRequireDefault(r(622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},497:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(535));var i=_interopRequireDefault(r(935));var s=_interopRequireDefault(r(549));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(570));var i=_interopRequireDefault(r(905));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e,t){var r=new i.default(e,t);var s=new n.default(r);try{s.parse()}catch(e){if(process.env.NODE_ENV!=="production"){if(e.name==="CssSyntaxError"&&t&&t.from){if(/\.scss$/i.test(t.from)){e.message+="\nYou tried to parse SCSS with "+"the standard CSS parser; "+"try again with the postcss-scss parser"}else if(/\.sass/i.test(t.from)){e.message+="\nYou tried to parse Sass with "+"the standard CSS parser; "+"try again with the postcss-sass parser"}else if(/\.less$/i.test(t.from)){e.message+="\nYou tried to parse Less with "+"the standard CSS parser; "+"try again with the postcss-less parser"}}}throw e}return s.root}var s=parse;t.default=s;e.exports=t.default},570:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(605));var i=_interopRequireDefault(r(926));var s=_interopRequireDefault(r(259));var o=_interopRequireDefault(r(217));var u=_interopRequireDefault(r(907));var a=_interopRequireDefault(r(797));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f=function(){function Parser(e){this.input=e;this.root=new u.default;this.current=this.root;this.spaces="";this.semicolon=false;this.createTokenizer();this.root.source={input:e,start:{line:1,column:1}}}var e=Parser.prototype;e.createTokenizer=function createTokenizer(){this.tokenizer=(0,i.default)(this.input)};e.parse=function parse(){var e;while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();switch(e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}}this.endFile()};e.comment=function comment(e){var t=new s.default;this.init(t,e[2],e[3]);t.source.end={line:e[4],column:e[5]};var r=e[1].slice(2,-2);if(/^\s*$/.test(r)){t.text="";t.raws.left=r;t.raws.right=""}else{var n=r.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=n[2];t.raws.left=n[1];t.raws.right=n[3]}};e.emptyRule=function emptyRule(e){var t=new a.default;this.init(t,e[2],e[3]);t.selector="";t.raws.between="";this.current=t};e.other=function other(e){var t=false;var r=null;var n=false;var i=null;var s=[];var o=[];var u=e;while(u){r=u[0];o.push(u);if(r==="("||r==="["){if(!i)i=u;s.push(r==="("?")":"]")}else if(s.length===0){if(r===";"){if(n){this.decl(o);return}else{break}}else if(r==="{"){this.rule(o);return}else if(r==="}"){this.tokenizer.back(o.pop());t=true;break}else if(r===":"){n=true}}else if(r===s[s.length-1]){s.pop();if(s.length===0)i=null}u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())t=true;if(s.length>0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},633:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(605));var i=_interopRequireDefault(r(74));var s=_interopRequireDefault(r(549));var o=_interopRequireDefault(r(259));var u=_interopRequireDefault(r(217));var a=_interopRequireDefault(r(216));var f=_interopRequireDefault(r(749));var l=_interopRequireDefault(r(9));var c=_interopRequireDefault(r(797));var h=_interopRequireDefault(r(907));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(241));var i=_interopRequireDefault(r(622));var s=_interopRequireDefault(r(747));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function fromBase64(e){if(Buffer){return Buffer.from(e,"base64").toString()}else{return window.atob(e)}}var o=function(){function PreviousMap(e,t){this.loadAnnotation(e);this.inline=this.startWith(this.annotation,"data:");var r=t.map?t.map.prev:undefined;var n=this.loadMap(t.from,r);if(n)this.text=n}var e=PreviousMap.prototype;e.consumer=function consumer(){if(!this.consumerCache){this.consumerCache=new n.default.SourceMapConsumer(this.text)}return this.consumerCache};e.withContent=function withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(t&&t.length>0){var r=t[t.length-1];if(r){this.annotation=this.getAnnotationURL(r)}}};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},74:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(169));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},613:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(338));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Root,e);function Root(t){var r;r=e.call(this,t)||this;r.type="root";if(!r.nodes)r.nodes=[];return r}var t=Root.prototype;t.removeChild=function removeChild(t,r){var n=this.index(t);if(!r&&n===0&&this.nodes.length>1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(169);var n=r(74);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},797:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(878));var i=_interopRequireDefault(r(9));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r{"use strict";t.__esModule=true;t.default=void 0;var r={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:false};function capitalize(e){return e[0].toUpperCase()+e.slice(1)}var n=function(){function Stringifier(e){this.builder=e}var e=Stringifier.prototype;e.stringify=function stringify(e,t){this[e.type](e,t)};e.root=function root(e){this.body(e);if(e.raws.after)this.builder(e.raws.after)};e.comment=function comment(e){var t=this.raw(e,"left","commentLeft");var r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)};e.decl=function decl(e,t){var r=this.raw(e,"between","colon");var n=e.prop+r+this.rawValue(e,"value");if(e.important){n+=e.raws.important||" !important"}if(t)n+=";";this.builder(n,e)};e.rule=function rule(e){this.block(e,this.rawValue(e,"selector"));if(e.raws.ownSemicolon){this.builder(e.raws.ownSemicolon,e,"end")}};e.atrule=function atrule(e,t){var r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!=="undefined"){r+=e.raws.afterName}else if(n){r+=" "}if(e.nodes){this.block(e,r+n)}else{var i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}};e.body=function body(e){var t=e.nodes.length-1;while(t>0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(935));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringify(e,t){var r=new n.default(t);r.stringify(e)}var i=stringify;t.default=i;e.exports=t.default},300:(e,t,r)=>{"use strict";t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(242));var i=_interopRequireDefault(r(926));var s=_interopRequireDefault(r(905));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o={brackets:n.default.cyan,"at-word":n.default.cyan,comment:n.default.gray,string:n.default.green,class:n.default.yellow,call:n.default.cyan,hash:n.default.magenta,"(":n.default.cyan,")":n.default.cyan,"{":n.default.yellow,"}":n.default.yellow,"[":n.default.yellow,"]":n.default.yellow,":":n.default.yellow,";":n.default.yellow};function getTokenType(e,t){var r=e[0],n=e[1];if(r==="word"){if(n[0]==="."){return"class"}if(n[0]==="#"){return"hash"}}if(!t.endOfFile()){var i=t.nextToken();t.back(i);if(i[0]==="brackets"||i[0]==="(")return"call"}return r}function terminalHighlight(e){var t=(0,i.default)(new s.default(e),{ignoreErrors:true});var r="";var n=function _loop(){var e=t.nextToken();var n=o[getTokenType(e,t)];if(n){r+=e[1].split(/\r?\n/).map(function(e){return n(e)}).join("\n")}else{r+=e[1]}};while(!t.endOfFile()){n()}return r}var u=terminalHighlight;t.default=u;e.exports=t.default},926:(e,t)=>{"use strict";t.__esModule=true;t.default=tokenizer;var r="'".charCodeAt(0);var n='"'.charCodeAt(0);var i="\\".charCodeAt(0);var s="/".charCodeAt(0);var o="\n".charCodeAt(0);var u=" ".charCodeAt(0);var a="\f".charCodeAt(0);var f="\t".charCodeAt(0);var l="\r".charCodeAt(0);var c="[".charCodeAt(0);var h="]".charCodeAt(0);var p="(".charCodeAt(0);var d=")".charCodeAt(0);var v="{".charCodeAt(0);var w="}".charCodeAt(0);var m=";".charCodeAt(0);var g="*".charCodeAt(0);var y=":".charCodeAt(0);var b="@".charCodeAt(0);var R=/[ \n\t\r\f{}()'"\\;/[\]#]/g;var C=/[ \n\t\r\f(){}:;@!'"\\\][#]|\/(?=\*)/g;var S=/.[\\/("'\n]/;var O=/[a-f0-9]/i;function tokenizer(e,t){if(t===void 0){t={}}var A=e.css.valueOf();var M=t.ignoreErrors;var D,k,x,E,q,N,B;var I,F,T,j,z,L,P;var V=A.length;var W=-1;var U=1;var $=0;var G=[];var Y=[];function position(){return $}function unclosed(t){throw e.error("Unclosed "+t,U,$-W)}function endOfFile(){return Y.length===0&&$>=V}function nextToken(e){if(Y.length)return Y.pop();if($>=V)return;var t=e?e.ignoreUnclosed:false;D=A.charCodeAt($);if(D===o||D===a||D===l&&A.charCodeAt($+1)!==o){W=$;U+=1}switch(D){case o:case u:case f:case l:case a:k=$;do{k+=1;D=A.charCodeAt(k);if(D===o){W=k;U+=1}}while(D===u||D===o||D===f||D===l||D===a);P=["space",A.slice($,k)];$=k-1;break;case c:case h:case v:case w:case y:case m:case d:var J=String.fromCharCode(D);P=[J,J,U,$-W];break;case p:z=G.length?G.pop()[1]:"";L=A.charCodeAt($+1);if(z==="url"&&L!==r&&L!==n&&L!==u&&L!==o&&L!==f&&L!==a&&L!==l){k=$;do{T=false;k=A.indexOf(")",k+1);if(k===-1){if(M||t){k=$;break}else{unclosed("bracket")}}j=k;while(A.charCodeAt(j-1)===i){j-=1;T=!T}}while(T);P=["brackets",A.slice($,k+1),U,$-W,U,k-W];$=k}else{k=A.indexOf(")",$+1);N=A.slice($,k+1);if(k===-1||S.test(N)){P=["(","(",U,$-W]}else{P=["brackets",N,U,$-W,U,k-W];$=k}}break;case r:case n:x=D===r?"'":'"';k=$;do{T=false;k=A.indexOf(x,k+1);if(k===-1){if(M||t){k=$+1;break}else{unclosed("string")}}j=k;while(A.charCodeAt(j-1)===i){j-=1;T=!T}}while(T);N=A.slice($,k+1);E=N.split("\n");q=E.length-1;if(q>0){I=U+q;F=k-E[q].length}else{I=U;F=W}P=["string",A.slice($,k+1),U,$-W,I,k-F];W=F;U=I;$=k;break;case b:R.lastIndex=$+1;R.test(A);if(R.lastIndex===0){k=A.length-1}else{k=R.lastIndex-2}P=["at-word",A.slice($,k+1),U,$-W,U,k-W];$=k;break;case i:k=$;B=true;while(A.charCodeAt(k+1)===i){k+=1;B=!B}D=A.charCodeAt(k+1);if(B&&D!==s&&D!==u&&D!==o&&D!==f&&D!==l&&D!==a){k+=1;if(O.test(A.charAt(k))){while(O.test(A.charAt(k+1))){k+=1}if(A.charCodeAt(k+1)===u){k+=1}}}P=["word",A.slice($,k+1),U,$-W,U,k-W];$=k;break;default:if(D===s&&A.charCodeAt($+1)===g){k=A.indexOf("*/",$+2)+1;if(k===0){if(M||t){k=A.length}else{unclosed("comment")}}N=A.slice($,k+1);E=N.split("\n");q=E.length-1;if(q>0){I=U+q;F=k-E[q].length}else{I=U;F=W}P=["comment",N,U,$-W,I,k-F];W=F;U=I;$=k}else{C.lastIndex=$+1;C.test(A);if(C.lastIndex===0){k=A.length-1}else{k=C.lastIndex-2}P=["word",A.slice($,k+1),U,$-W,U,k-W];G.push(P);$=k}break}$++;return P}function back(e){Y.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},216:(e,t)=>{"use strict";t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},831:(e,t)=>{"use strict";t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},338:(e,t)=>{"use strict";t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},183:e=>{"use strict";e.exports=((e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n{"use strict";const n=r(87);const i=r(183);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},242:e=>{"use strict";e.exports=require("chalk")},747:e=>{"use strict";e.exports=require("fs")},241:e=>{"use strict";e.exports=require("next/dist/compiled/source-map")},87:e=>{"use strict";e.exports=require("os")},622:e=>{"use strict";e.exports=require("path")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var n=t[r]={exports:{}};var i=true;try{e[r](n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return n.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(350)})(); \ No newline at end of file diff --git a/packages/next/compiled/postcss-preset-env/index.js b/packages/next/compiled/postcss-preset-env/index.js index 4d2d66a0c748..67226efdc4fe 100644 --- a/packages/next/compiled/postcss-preset-env/index.js +++ b/packages/next/compiled/postcss-preset-env/index.js @@ -1 +1 @@ -module.exports=(()=>{var e={3094:e=>{"use strict";e.exports=JSON.parse('[{"id":"all-property","title":"`all` Property","description":"A property for defining the reset of all properties of an element","specification":"https://www.w3.org/TR/css-cascade-3/#all-shorthand","stage":3,"caniuse":"css-all","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/all"},"example":"a {\\n all: initial;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/maximkoretskiy/postcss-initial"}]},{"id":"any-link-pseudo-class","title":"`:any-link` Hyperlink Pseudo-Class","description":"A pseudo-class for matching anchor elements independent of whether they have been visited","specification":"https://www.w3.org/TR/selectors-4/#any-link-pseudo","stage":2,"caniuse":"css-any-link","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:any-link"},"example":"nav :any-link > span {\\n background-color: yellow;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-pseudo-class-any-link"}]},{"id":"blank-pseudo-class","title":"`:blank` Empty-Value Pseudo-Class","description":"A pseudo-class for matching form elements when they are empty","specification":"https://drafts.csswg.org/selectors-4/#blank","stage":1,"example":"input:blank {\\n background-color: yellow;\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/csstools/css-blank-pseudo"},{"type":"PostCSS Plugin","link":"https://github.com/csstools/css-blank-pseudo"}]},{"id":"break-properties","title":"Break Properties","description":"Properties for defining the break behavior between and within boxes","specification":"https://www.w3.org/TR/css-break-3/#breaking-controls","stage":3,"caniuse":"multicolumn","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/break-after"},"example":"a {\\n break-inside: avoid;\\n break-before: avoid-column;\\n break-after: always;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/shrpne/postcss-page-break"}]},{"id":"case-insensitive-attributes","title":"Case-Insensitive Attributes","description":"An attribute selector matching attribute values case-insensitively","specification":"https://www.w3.org/TR/selectors-4/#attribute-case","stage":2,"caniuse":"css-case-insensitive","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors"},"example":"[frame=hsides i] {\\n border-style: solid none;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/Semigradsky/postcss-attribute-case-insensitive"}]},{"id":"color-adjust","title":"`color-adjust` Property","description":"The color-adjust property is a non-standard CSS extension that can be used to force printing of background colors and images","specification":"https://www.w3.org/TR/css-color-4/#color-adjust","stage":2,"caniuse":"css-color-adjust","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/color-adjust"},"example":".background {\\n background-color:#ccc;\\n}\\n.background.color-adjust {\\n color-adjust: economy;\\n}\\n.background.color-adjust-exact {\\n color-adjust: exact;\\n}"},{"id":"color-functional-notation","title":"Color Functional Notation","description":"A space and slash separated notation for specifying colors","specification":"https://drafts.csswg.org/css-color/#ref-for-funcdef-rgb%E2%91%A1%E2%91%A0","stage":1,"example":"em {\\n background-color: hsl(120deg 100% 25%);\\n box-shadow: 0 0 0 10px hwb(120deg 100% 25% / 80%);\\n color: rgb(0 255 0);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-color-functional-notation"}]},{"id":"color-mod-function","title":"`color-mod()` Function","description":"A function for modifying colors","specification":"https://www.w3.org/TR/css-color-4/#funcdef-color-mod","stage":-1,"example":"p {\\n color: color-mod(black alpha(50%));\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-color-mod-function"}]},{"id":"custom-media-queries","title":"Custom Media Queries","description":"An at-rule for defining aliases that represent media queries","specification":"https://drafts.csswg.org/mediaqueries-5/#at-ruledef-custom-media","stage":1,"example":"@custom-media --narrow-window (max-width: 30em);\\n\\n@media (--narrow-window) {}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-custom-media"}]},{"id":"custom-properties","title":"Custom Properties","description":"A syntax for defining custom values accepted by all CSS properties","specification":"https://www.w3.org/TR/css-variables-1/","stage":3,"caniuse":"css-variables","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/var"},"example":"img {\\n --some-length: 32px;\\n\\n height: var(--some-length);\\n width: var(--some-length);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-custom-properties"}]},{"id":"custom-property-sets","title":"Custom Property Sets","description":"A syntax for storing properties in named variables, referenceable in other style rules","specification":"https://tabatkins.github.io/specs/css-apply-rule/","stage":-1,"caniuse":"css-apply-rule","example":"img {\\n --some-length-styles: {\\n height: 32px;\\n width: 32px;\\n };\\n\\n @apply --some-length-styles;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/pascalduez/postcss-apply"}]},{"id":"custom-selectors","title":"Custom Selectors","description":"An at-rule for defining aliases that represent selectors","specification":"https://drafts.csswg.org/css-extensions/#custom-selectors","stage":1,"example":"@custom-selector :--heading h1, h2, h3, h4, h5, h6;\\n\\narticle :--heading + p {}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-custom-selectors"}]},{"id":"dir-pseudo-class","title":"`:dir` Directionality Pseudo-Class","description":"A pseudo-class for matching elements based on their directionality","specification":"https://www.w3.org/TR/selectors-4/#dir-pseudo","stage":2,"caniuse":"css-dir-pseudo","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:dir"},"example":"blockquote:dir(rtl) {\\n margin-right: 10px;\\n}\\n\\nblockquote:dir(ltr) {\\n margin-left: 10px;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-dir-pseudo-class"}]},{"id":"double-position-gradients","title":"Double Position Gradients","description":"A syntax for using two positions in a gradient.","specification":"https://www.w3.org/TR/css-images-4/#color-stop-syntax","stage":2,"caniuse-compat":{"and_chr":{"71":"y"},"chrome":{"71":"y"}},"example":".pie_chart {\\n background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-double-position-gradients"}]},{"id":"environment-variables","title":"Custom Environment Variables","description":"A syntax for using custom values accepted by CSS globally","specification":"https://drafts.csswg.org/css-env-1/","stage":0,"caniuse-compat":{"and_chr":{"69":"y"},"chrome":{"69":"y"},"ios_saf":{"11.2":"y"},"safari":{"11.2":"y"}},"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/env"},"example":"@media (max-width: env(--brand-small)) {\\n body {\\n padding: env(--brand-spacing);\\n }\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-env-function"}]},{"id":"focus-visible-pseudo-class","title":"`:focus-visible` Focus-Indicated Pseudo-Class","description":"A pseudo-class for matching focused elements that indicate that focus to a user","specification":"https://www.w3.org/TR/selectors-4/#focus-visible-pseudo","stage":2,"caniuse":"css-focus-visible","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible"},"example":":focus:not(:focus-visible) {\\n outline: 0;\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/WICG/focus-visible"},{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-focus-visible"}]},{"id":"focus-within-pseudo-class","title":"`:focus-within` Focus Container Pseudo-Class","description":"A pseudo-class for matching elements that are either focused or that have focused descendants","specification":"https://www.w3.org/TR/selectors-4/#focus-within-pseudo","stage":2,"caniuse":"css-focus-within","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-within"},"example":"form:focus-within {\\n background: rgba(0, 0, 0, 0.3);\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/jonathantneal/focus-within"},{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-focus-within"}]},{"id":"font-variant-property","title":"`font-variant` Property","description":"A property for defining the usage of alternate glyphs in a font","specification":"https://www.w3.org/TR/css-fonts-3/#propdef-font-variant","stage":3,"caniuse":"font-variant-alternates","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant"},"example":"h2 {\\n font-variant: small-caps;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-font-variant"}]},{"id":"gap-properties","title":"Gap Properties","description":"Properties for defining gutters within a layout","specification":"https://www.w3.org/TR/css-grid-1/#gutters","stage":3,"caniuse-compat":{"chrome":{"66":"y"},"edge":{"16":"y"},"firefox":{"61":"y"},"safari":{"11.2":"y","TP":"y"}},"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/gap"},"example":".grid-1 {\\n gap: 20px;\\n}\\n\\n.grid-2 {\\n column-gap: 40px;\\n row-gap: 20px;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-gap-properties"}]},{"id":"gray-function","title":"`gray()` Function","description":"A function for specifying fully desaturated colors","specification":"https://www.w3.org/TR/css-color-4/#funcdef-gray","stage":2,"example":"p {\\n color: gray(50);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-color-gray"}]},{"id":"grid-layout","title":"Grid Layout","description":"A syntax for using a grid concept to lay out content","specification":"https://www.w3.org/TR/css-grid-1/","stage":3,"caniuse":"css-grid","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/grid"},"example":"section {\\n display: grid;\\n grid-template-columns: 100px 100px 100px;\\n grid-gap: 10px;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/autoprefixer"}]},{"id":"has-pseudo-class","title":"`:has()` Relational Pseudo-Class","description":"A pseudo-class for matching ancestor and sibling elements","specification":"https://www.w3.org/TR/selectors-4/#has-pseudo","stage":2,"caniuse":"css-has","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:has"},"example":"a:has(> img) {\\n display: block;\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/csstools/css-has-pseudo"},{"type":"PostCSS Plugin","link":"https://github.com/csstools/css-has-pseudo"}]},{"id":"hexadecimal-alpha-notation","title":"Hexadecimal Alpha Notation","description":"A 4 & 8 character hex color notation for specifying the opacity level","specification":"https://www.w3.org/TR/css-color-4/#hex-notation","stage":2,"caniuse":"css-rrggbbaa","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Syntax_2"},"example":"section {\\n background-color: #f3f3f3f3;\\n color: #0003;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-color-hex-alpha"}]},{"id":"hwb-function","title":"`hwb()` Function","description":"A function for specifying colors by hue and then a degree of whiteness and blackness to mix into it","specification":"https://www.w3.org/TR/css-color-4/#funcdef-hwb","stage":2,"example":"p {\\n color: hwb(120 44% 50%);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-color-hwb"}]},{"id":"image-set-function","title":"`image-set()` Function","description":"A function for specifying image sources based on the user’s resolution","specification":"https://www.w3.org/TR/css-images-4/#image-set-notation","stage":2,"caniuse":"css-image-set","example":"p {\\n background-image: image-set(\\n \\"foo.png\\" 1x,\\n \\"foo-2x.png\\" 2x,\\n \\"foo-print.png\\" 600dpi\\n );\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-image-set-function"}]},{"id":"in-out-of-range-pseudo-class","title":"`:in-range` and `:out-of-range` Pseudo-Classes","description":"A pseudo-class for matching elements that have range limitations","specification":"https://www.w3.org/TR/selectors-4/#range-pseudos","stage":2,"caniuse":"css-in-out-of-range","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:in-range"},"example":"input:in-range {\\n background-color: rgba(0, 255, 0, 0.25);\\n}\\ninput:out-of-range {\\n background-color: rgba(255, 0, 0, 0.25);\\n border: 2px solid red;\\n}"},{"id":"lab-function","title":"`lab()` Function","description":"A function for specifying colors expressed in the CIE Lab color space","specification":"https://www.w3.org/TR/css-color-4/#funcdef-lab","stage":2,"example":"body {\\n color: lab(240 50 20);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-lab-function"}]},{"id":"lch-function","title":"`lch()` Function","description":"A function for specifying colors expressed in the CIE Lab color space with chroma and hue","specification":"https://www.w3.org/TR/css-color-4/#funcdef-lch","stage":2,"example":"body {\\n color: lch(53 105 40);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-lab-function"}]},{"id":"logical-properties-and-values","title":"Logical Properties and Values","description":"Flow-relative (left-to-right or right-to-left) properties and values","specification":"https://www.w3.org/TR/css-logical-1/","stage":2,"caniuse":"css-logical-props","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties"},"example":"span:first-child {\\n float: inline-start;\\n margin-inline-start: 10px;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-logical-properties"}]},{"id":"matches-pseudo-class","title":"`:matches()` Matches-Any Pseudo-Class","description":"A pseudo-class for matching elements in a selector list","specification":"https://www.w3.org/TR/selectors-4/#matches-pseudo","stage":2,"caniuse":"css-matches-pseudo","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:matches"},"example":"p:matches(:first-child, .special) {\\n margin-top: 1em;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-selector-matches"}]},{"id":"media-query-ranges","title":"Media Query Ranges","description":"A syntax for defining media query ranges using ordinary comparison operators","specification":"https://www.w3.org/TR/mediaqueries-4/#range-context","stage":3,"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#Syntax_improvements_in_Level_4"},"example":"@media (width < 480px) {}\\n\\n@media (480px <= width < 768px) {}\\n\\n@media (width >= 768px) {}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-media-minmax"}]},{"id":"nesting-rules","title":"Nesting Rules","description":"A syntax for nesting relative rules within rules","specification":"https://drafts.csswg.org/css-nesting-1/","stage":1,"example":"article {\\n & p {\\n color: #333;\\n }\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-nesting"}]},{"id":"not-pseudo-class","title":"`:not()` Negation List Pseudo-Class","description":"A pseudo-class for ignoring elements in a selector list","specification":"https://www.w3.org/TR/selectors-4/#negation-pseudo","stage":2,"caniuse":"css-not-sel-list","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:not"},"example":"p:not(:first-child, .special) {\\n margin-top: 1em;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-selector-not"}]},{"id":"overflow-property","title":"`overflow` Shorthand Property","description":"A property for defining `overflow-x` and `overflow-y`","specification":"https://www.w3.org/TR/css-overflow-3/#propdef-overflow","stage":2,"caniuse":"css-overflow","caniuse-compat":{"and_chr":{"68":"y"},"and_ff":{"61":"y"},"chrome":{"68":"y"},"firefox":{"61":"y"}},"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/overflow"},"example":"html {\\n overflow: hidden auto;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-overflow-shorthand"}]},{"id":"overflow-wrap-property","title":"`overflow-wrap` Property","description":"A property for defining whether to insert line breaks within words to prevent overflowing","specification":"https://www.w3.org/TR/css-text-3/#overflow-wrap-property","stage":2,"caniuse":"wordwrap","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap"},"example":"p {\\n overflow-wrap: break-word;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/mattdimu/postcss-replace-overflow-wrap"}]},{"id":"overscroll-behavior-property","title":"`overscroll-behavior` Property","description":"Properties for controlling when the scroll position of a scroll container reaches the edge of a scrollport","specification":"https://drafts.csswg.org/css-overscroll-behavior","stage":1,"caniuse":"css-overscroll-behavior","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior"},"example":".messages {\\n height: 220px;\\n overflow: auto;\\n overscroll-behavior-y: contain;\\n}\\n\\nbody {\\n margin: 0;\\n overscroll-behavior: none;\\n}"},{"id":"place-properties","title":"Place Properties","description":"Properties for defining alignment within a layout","specification":"https://www.w3.org/TR/css-align-3/#place-items-property","stage":2,"caniuse-compat":{"chrome":{"59":"y"},"firefox":{"45":"y"}},"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/place-content"},"example":".example {\\n place-content: flex-end;\\n place-items: center / space-between;\\n place-self: flex-start / center;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-place"}]},{"id":"prefers-color-scheme-query","title":"`prefers-color-scheme` Media Query","description":"A media query to detect if the user has requested the system use a light or dark color theme","specification":"https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme","stage":1,"caniuse":"prefers-color-scheme","caniuse-compat":{"ios_saf":{"12.1":"y"},"safari":{"12.1":"y"}},"example":"body {\\n background-color: white;\\n color: black;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n body {\\n background-color: black;\\n color: white;\\n }\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/csstools/css-prefers-color-scheme"},{"type":"PostCSS Plugin","link":"https://github.com/csstools/css-prefers-color-scheme"}]},{"id":"prefers-reduced-motion-query","title":"`prefers-reduced-motion` Media Query","description":"A media query to detect if the user has requested less animation and general motion on the page","specification":"https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion","stage":1,"caniuse":"prefers-reduced-motion","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion"},"example":".animation {\\n animation: vibrate 0.3s linear infinite both; \\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n .animation {\\n animation: none;\\n }\\n}"},{"id":"read-only-write-pseudo-class","title":"`:read-only` and `:read-write` selectors","description":"Pseudo-classes to match elements which are considered user-alterable","specification":"https://www.w3.org/TR/selectors-4/#rw-pseudos","stage":2,"caniuse":"css-read-only-write","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:read-only"},"example":"input:read-only {\\n background-color: #ccc;\\n}"},{"id":"rebeccapurple-color","title":"`rebeccapurple` Color","description":"A particularly lovely shade of purple in memory of Rebecca Alison Meyer","specification":"https://www.w3.org/TR/css-color-4/#valdef-color-rebeccapurple","stage":2,"caniuse":"css-rebeccapurple","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/color_value"},"example":"html {\\n color: rebeccapurple;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-color-rebeccapurple"}]},{"id":"system-ui-font-family","title":"`system-ui` Font Family","description":"A generic font used to match the user’s interface","specification":"https://www.w3.org/TR/css-fonts-4/#system-ui-def","stage":2,"caniuse":"font-family-system-ui","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#Syntax"},"example":"body {\\n font-family: system-ui;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/JLHwung/postcss-font-family-system-ui"}]},{"id":"when-else-rules","title":"When/Else Rules","description":"At-rules for specifying media queries and support queries in a single grammar","specification":"https://tabatkins.github.io/specs/css-when-else/","stage":0,"example":"@when media(width >= 640px) and (supports(display: flex) or supports(display: grid)) {\\n /* A */\\n} @else media(pointer: coarse) {\\n /* B */\\n} @else {\\n /* C */\\n}"},{"id":"where-pseudo-class","title":"`:where()` Zero-Specificity Pseudo-Class","description":"A pseudo-class for matching elements in a selector list without contributing specificity","specification":"https://drafts.csswg.org/selectors-4/#where-pseudo","stage":1,"example":"a:where(:not(:hover)) {\\n text-decoration: none;\\n}"}]')},9614:e=>{"use strict";e.exports=JSON.parse('[{"prop":"animation","initial":"${animation-name} ${animation-duration} ${animation-timing-function} ${animation-delay} ${animation-iteration-count} ${animation-direction} ${animation-fill-mode} ${animation-play-state}","combined":true},{"prop":"animation-delay","initial":"0s"},{"prop":"animation-direction","initial":"normal"},{"prop":"animation-duration","initial":"0s"},{"prop":"animation-fill-mode","initial":"none"},{"prop":"animation-iteration-count","initial":"1"},{"prop":"animation-name","initial":"none"},{"prop":"animation-play-state","initial":"running"},{"prop":"animation-timing-function","initial":"ease"},{"prop":"backface-visibility","initial":"visible","basic":true},{"prop":"background","initial":"${background-color} ${background-image} ${background-repeat} ${background-position} / ${background-size} ${background-origin} ${background-clip} ${background-attachment}","combined":true},{"prop":"background-attachment","initial":"scroll"},{"prop":"background-clip","initial":"border-box"},{"prop":"background-color","initial":"transparent"},{"prop":"background-image","initial":"none"},{"prop":"background-origin","initial":"padding-box"},{"prop":"background-position","initial":"0 0"},{"prop":"background-position-x","initial":"0"},{"prop":"background-position-y","initial":"0"},{"prop":"background-repeat","initial":"repeat"},{"prop":"background-size","initial":"auto auto"},{"prop":"border","initial":"${border-width} ${border-style} ${border-color}","combined":true},{"prop":"border-style","initial":"none"},{"prop":"border-width","initial":"medium"},{"prop":"border-color","initial":"currentColor"},{"prop":"border-bottom","initial":"0"},{"prop":"border-bottom-color","initial":"currentColor"},{"prop":"border-bottom-left-radius","initial":"0"},{"prop":"border-bottom-right-radius","initial":"0"},{"prop":"border-bottom-style","initial":"none"},{"prop":"border-bottom-width","initial":"medium"},{"prop":"border-collapse","initial":"separate","basic":true,"inherited":true},{"prop":"border-image","initial":"none","basic":true},{"prop":"border-left","initial":"0"},{"prop":"border-left-color","initial":"currentColor"},{"prop":"border-left-style","initial":"none"},{"prop":"border-left-width","initial":"medium"},{"prop":"border-radius","initial":"0","basic":true},{"prop":"border-right","initial":"0"},{"prop":"border-right-color","initial":"currentColor"},{"prop":"border-right-style","initial":"none"},{"prop":"border-right-width","initial":"medium"},{"prop":"border-spacing","initial":"0","basic":true,"inherited":true},{"prop":"border-top","initial":"0"},{"prop":"border-top-color","initial":"currentColor"},{"prop":"border-top-left-radius","initial":"0"},{"prop":"border-top-right-radius","initial":"0"},{"prop":"border-top-style","initial":"none"},{"prop":"border-top-width","initial":"medium"},{"prop":"bottom","initial":"auto","basic":true},{"prop":"box-shadow","initial":"none","basic":true},{"prop":"box-sizing","initial":"content-box","basic":true},{"prop":"caption-side","initial":"top","basic":true,"inherited":true},{"prop":"clear","initial":"none","basic":true},{"prop":"clip","initial":"auto","basic":true},{"prop":"color","initial":"#000","basic":true},{"prop":"columns","initial":"auto","basic":true},{"prop":"column-count","initial":"auto","basic":true},{"prop":"column-fill","initial":"balance","basic":true},{"prop":"column-gap","initial":"normal","basic":true},{"prop":"column-rule","initial":"${column-rule-width} ${column-rule-style} ${column-rule-color}","combined":true},{"prop":"column-rule-color","initial":"currentColor"},{"prop":"column-rule-style","initial":"none"},{"prop":"column-rule-width","initial":"medium"},{"prop":"column-span","initial":"1","basic":true},{"prop":"column-width","initial":"auto","basic":true},{"prop":"content","initial":"normal","basic":true},{"prop":"counter-increment","initial":"none","basic":true},{"prop":"counter-reset","initial":"none","basic":true},{"prop":"cursor","initial":"auto","basic":true,"inherited":true},{"prop":"direction","initial":"ltr","basic":true,"inherited":true},{"prop":"display","initial":"inline","basic":true},{"prop":"empty-cells","initial":"show","basic":true,"inherited":true},{"prop":"float","initial":"none","basic":true},{"prop":"font","contains":["font-style","font-variant","font-weight","font-stretch","font-size","line-height","font-family"],"basic":true,"inherited":true},{"prop":"font-family","initial":"serif"},{"prop":"font-size","initial":"medium"},{"prop":"font-style","initial":"normal"},{"prop":"font-variant","initial":"normal"},{"prop":"font-weight","initial":"normal"},{"prop":"font-stretch","initial":"normal"},{"prop":"line-height","initial":"normal","inherited":true},{"prop":"height","initial":"auto","basic":true},{"prop":"hyphens","initial":"none","basic":true,"inherited":true},{"prop":"left","initial":"auto","basic":true},{"prop":"letter-spacing","initial":"normal","basic":true,"inherited":true},{"prop":"list-style","initial":"${list-style-type} ${list-style-position} ${list-style-image}","combined":true,"inherited":true},{"prop":"list-style-image","initial":"none"},{"prop":"list-style-position","initial":"outside"},{"prop":"list-style-type","initial":"disc"},{"prop":"margin","initial":"0","basic":true},{"prop":"margin-bottom","initial":"0"},{"prop":"margin-left","initial":"0"},{"prop":"margin-right","initial":"0"},{"prop":"margin-top","initial":"0"},{"prop":"max-height","initial":"none","basic":true},{"prop":"max-width","initial":"none","basic":true},{"prop":"min-height","initial":"0","basic":true},{"prop":"min-width","initial":"0","basic":true},{"prop":"opacity","initial":"1","basic":true},{"prop":"orphans","initial":"2","basic":true},{"prop":"outline","initial":"${outline-width} ${outline-style} ${outline-color}","combined":true},{"prop":"outline-color","initial":"invert"},{"prop":"outline-style","initial":"none"},{"prop":"outline-width","initial":"medium"},{"prop":"overflow","initial":"visible","basic":true},{"prop":"overflow-x","initial":"visible","basic":true},{"prop":"overflow-y","initial":"visible","basic":true},{"prop":"padding","initial":"0","basic":true},{"prop":"padding-bottom","initial":"0"},{"prop":"padding-left","initial":"0"},{"prop":"padding-right","initial":"0"},{"prop":"padding-top","initial":"0"},{"prop":"page-break-after","initial":"auto","basic":true},{"prop":"page-break-before","initial":"auto","basic":true},{"prop":"page-break-inside","initial":"auto","basic":true},{"prop":"perspective","initial":"none","basic":true},{"prop":"perspective-origin","initial":"50% 50%","basic":true},{"prop":"position","initial":"static","basic":true},{"prop":"quotes","initial":"“ ” ‘ ’"},{"prop":"right","initial":"auto","basic":true},{"prop":"tab-size","initial":"8","basic":true,"inherited":true},{"prop":"table-layout","initial":"auto","basic":true},{"prop":"text-align","initial":"left","basic":true,"inherited":true},{"prop":"text-align-last","initial":"auto","basic":true,"inherited":true},{"prop":"text-decoration","initial":"${text-decoration-line}","combined":true},{"prop":"text-decoration-color","initial":"inherited"},{"prop":"text-decoration-color","initial":"currentColor"},{"prop":"text-decoration-line","initial":"none"},{"prop":"text-decoration-style","initial":"solid"},{"prop":"text-indent","initial":"0","basic":true,"inherited":true},{"prop":"text-shadow","initial":"none","basic":true,"inherited":true},{"prop":"text-transform","initial":"none","basic":true,"inherited":true},{"prop":"top","initial":"auto","basic":true},{"prop":"transform","initial":"none","basic":true},{"prop":"transform-origin","initial":"50% 50% 0","basic":true},{"prop":"transform-style","initial":"flat","basic":true},{"prop":"transition","initial":"${transition-property} ${transition-duration} ${transition-timing-function} ${transition-delay}","combined":true},{"prop":"transition-delay","initial":"0s"},{"prop":"transition-duration","initial":"0s"},{"prop":"transition-property","initial":"none"},{"prop":"transition-timing-function","initial":"ease"},{"prop":"unicode-bidi","initial":"normal","basic":true},{"prop":"vertical-align","initial":"baseline","basic":true},{"prop":"visibility","initial":"visible","basic":true,"inherited":true},{"prop":"white-space","initial":"normal","basic":true,"inherited":true},{"prop":"widows","initial":"2","basic":true,"inherited":true},{"prop":"width","initial":"auto","basic":true},{"prop":"word-spacing","initial":"normal","basic":true,"inherited":true},{"prop":"z-index","initial":"auto","basic":true}]')},4567:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function rgb2hue(e,r,t){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var i=rgb2value(e,r,t);var o=rgb2whiteness(e,r,t);var s=i-o;if(s){var a=i===e?(r-t)/s:i===r?(t-e)/s:(e-r)/s;var u=i===e?a<0?360/60:0/60:i===r?120/60:240/60;var f=(a+u)*60;return f}else{return n}}function hue2rgb(e,r,t){var n=t<0?t+360:t>360?t-360:t;var i=n*6<360?e+(r-e)*n/60:n*2<360?r:n*3<720?e+(r-e)*(240-n)/60:e;return i}function rgb2value(e,r,t){var n=Math.max(e,r,t);return n}function rgb2whiteness(e,r,t){var n=Math.min(e,r,t);return n}function matrix(e,r){return r.map(function(r){return r.reduce(function(r,t,n){return r+e[n]*t},0)})}var t=96.42;var n=100;var i=82.49;var o=Math.pow(6,3)/Math.pow(29,3);var s=Math.pow(29,3)/Math.pow(3,3);function rgb2hsl(e,r,t,n){var i=rgb2hue(e,r,t,n);var o=rgb2value(e,r,t);var s=rgb2whiteness(e,r,t);var a=o-s;var u=(o+s)/2;var f=a===0?0:a/(100-Math.abs(2*u-100))*100;return[i,f,u]}function hsl2rgb(e,r,t){var n=t<=50?t*(r+100)/100:t+r-t*r/100;var i=t*2-n;var o=[hue2rgb(i,n,e+120),hue2rgb(i,n,e),hue2rgb(i,n,e-120)],s=o[0],a=o[1],u=o[2];return[s,a,u]}var a=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function rgb2hwb(e,r,t,n){var i=rgb2hue(e,r,t,n);var o=rgb2whiteness(e,r,t);var s=rgb2value(e,r,t);var a=100-s;return[i,o,a]}function hwb2rgb(e,r,t,n){var i=hsl2rgb(e,100,50,n).map(function(e){return e*(100-r-t)/100+r}),o=a(i,3),s=o[0],u=o[1],f=o[2];return[s,u,f]}var u=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function rgb2hsv(e,r,t,n){var i=rgb2value(e,r,t);var o=rgb2whiteness(e,r,t);var s=rgb2hue(e,r,t,n);var a=i===o?0:(i-o)/i*100;return[s,a,i]}function hsv2rgb(e,r,t){var n=Math.floor(e/60);var i=e/60-n&1?e/60-n:1-e/60-n;var o=t*(100-r)/100;var s=t*(100-r*i)/100;var a=n===5?[t,o,s]:n===4?[s,o,t]:n===3?[o,s,t]:n===2?[o,t,s]:n===1?[s,t,o]:[t,s,o],f=u(a,3),c=f[0],l=f[1],p=f[2];return[c,l,p]}var f=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function rgb2xyz(e,r,t){var n=[e,r,t].map(function(e){return e>4.045?Math.pow((e+5.5)/105.5,2.4)*100:e/12.92}),i=f(n,3),o=i[0],s=i[1],a=i[2];var u=matrix([o,s,a],[[.4124564,.3575761,.1804375],[.2126729,.7151522,.072175],[.0193339,.119192,.9503041]]),c=f(u,3),l=c[0],p=c[1],h=c[2];return[l,p,h]}function xyz2rgb(e,r,t){var n=matrix([e,r,t],[[3.2404542,-1.5371385,-.4985314],[-.969266,1.8760108,.041556],[.0556434,-.2040259,1.0572252]]),i=f(n,3),o=i[0],s=i[1],a=i[2];var u=[o,s,a].map(function(e){return e>.31308?1.055*Math.pow(e/100,1/2.4)*100-5.5:12.92*e}),c=f(u,3),l=c[0],p=c[1],h=c[2];return[l,p,h]}function hsl2hsv(e,r,t){var n=r*(t<50?t:100-t)/100;var i=n===0?0:2*n/(t+n)*100;var o=t+n;return[e,i,o]}function hsv2hsl(e,r,t){var n=(200-r)*t/100;var i=n===0||n===200?0:r*t/100/(n<=100?n:200-n)*100,o=n*5/10;return[e,i,o]}function hwb2hsv(e,r,t){var n=e,i=t===100?0:100-r/(100-t)*100,o=100-t;return[n,i,o]}function hsv2hwb(e,r,t){var n=e,i=(100-r)*t/100,o=100-t;return[n,i,o]}var c=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function lab2xyz(e,r,a){var u=(e+16)/116;var f=r/500+u;var l=u-a/200;var p=Math.pow(f,3)>o?Math.pow(f,3):(116*f-16)/s,h=e>s*o?Math.pow((e+16)/116,3):e/s,B=Math.pow(l,3)>o?Math.pow(l,3):(116*l-16)/s;var v=matrix([p*t,h*n,B*i],[[.9555766,-.0230393,.0631636],[-.0282895,1.0099416,.0210077],[.0122982,-.020483,1.3299098]]),d=c(v,3),b=d[0],y=d[1],g=d[2];return[b,y,g]}function xyz2lab(e,r,a){var u=matrix([e,r,a],[[1.0478112,.0228866,-.050127],[.0295424,.9904844,-.0170491],[-.0092345,.0150436,.7521316]]),f=c(u,3),l=f[0],p=f[1],h=f[2];var B=[l/t,p/n,h/i].map(function(e){return e>o?Math.cbrt(e):(s*e+16)/116}),v=c(B,3),d=v[0],b=v[1],y=v[2];var g=116*b-16,m=500*(d-b),C=200*(b-y);return[g,m,C]}function lab2lch(e,r,t){var n=[Math.sqrt(Math.pow(r,2)+Math.pow(t,2)),Math.atan2(t,r)*180/Math.PI],i=n[0],o=n[1];return[e,i,o]}function lch2lab(e,r,t){var n=r*Math.cos(t*Math.PI/180),i=r*Math.sin(t*Math.PI/180);return[e,n,i]}var l=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function rgb2lab(e,r,t){var n=rgb2xyz(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=xyz2lab(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function lab2rgb(e,r,t){var n=lab2xyz(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=xyz2rgb(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function rgb2lch(e,r,t){var n=rgb2xyz(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=xyz2lab(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=lab2lch(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function lch2rgb(e,r,t){var n=lch2lab(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=lab2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2rgb(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function hwb2hsl(e,r,t){var n=hwb2hsv(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=hsv2hsl(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function hsl2hwb(e,r,t){var n=hsl2hsv(e,r,t),i=l(n,3),o=i[1],s=i[2];var a=hsv2hwb(e,o,s),u=l(a,3),f=u[1],c=u[2];return[e,f,c]}function hsl2lab(e,r,t){var n=hsl2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function lab2hsl(e,r,t,n){var i=lab2xyz(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=xyz2rgb(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=rgb2hsl(p,h,B,n),d=l(v,3),b=d[0],y=d[1],g=d[2];return[b,y,g]}function hsl2lch(e,r,t){var n=hsl2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];var g=lab2lch(d,b,y),m=l(g,3),C=m[0],w=m[1],S=m[2];return[C,w,S]}function lch2hsl(e,r,t,n){var i=lch2lab(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=lab2xyz(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=xyz2rgb(p,h,B),d=l(v,3),b=d[0],y=d[1],g=d[2];var m=rgb2hsl(b,y,g,n),C=l(m,3),w=C[0],S=C[1],O=C[2];return[w,S,O]}function hsl2xyz(e,r,t){var n=hsl2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function xyz2hsl(e,r,t,n){var i=xyz2rgb(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=rgb2hsl(s,a,u,n),c=l(f,3),p=c[0],h=c[1],B=c[2];return[p,h,B]}function hwb2lab(e,r,t){var n=hwb2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function lab2hwb(e,r,t,n){var i=lab2xyz(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=xyz2rgb(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=rgb2hwb(p,h,B,n),d=l(v,3),b=d[0],y=d[1],g=d[2];return[b,y,g]}function hwb2lch(e,r,t){var n=hwb2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];var g=lab2lch(d,b,y),m=l(g,3),C=m[0],w=m[1],S=m[2];return[C,w,S]}function lch2hwb(e,r,t,n){var i=lch2lab(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=lab2xyz(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=xyz2rgb(p,h,B),d=l(v,3),b=d[0],y=d[1],g=d[2];var m=rgb2hwb(b,y,g,n),C=l(m,3),w=C[0],S=C[1],O=C[2];return[w,S,O]}function hwb2xyz(e,r,t){var n=hwb2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function xyz2hwb(e,r,t,n){var i=xyz2rgb(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=rgb2hwb(s,a,u,n),c=l(f,3),p=c[0],h=c[1],B=c[2];return[p,h,B]}function hsv2lab(e,r,t){var n=hsv2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function lab2hsv(e,r,t,n){var i=lab2xyz(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=xyz2rgb(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=rgb2hsv(p,h,B,n),d=l(v,3),b=d[0],y=d[1],g=d[2];return[b,y,g]}function hsv2lch(e,r,t){var n=hsv2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];var g=lab2lch(d,b,y),m=l(g,3),C=m[0],w=m[1],S=m[2];return[C,w,S]}function lch2hsv(e,r,t,n){var i=lch2lab(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=lab2xyz(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=xyz2rgb(p,h,B),d=l(v,3),b=d[0],y=d[1],g=d[2];var m=rgb2hsv(b,y,g,n),C=l(m,3),w=C[0],S=C[1],O=C[2];return[w,S,O]}function hsv2xyz(e,r,t){var n=hsv2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function xyz2hsv(e,r,t,n){var i=xyz2rgb(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=rgb2hsv(s,a,u,n),c=l(f,3),p=c[0],h=c[1],B=c[2];return[p,h,B]}function xyz2lch(e,r,t){var n=xyz2lab(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=lab2lch(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function lch2xyz(e,r,t){var n=lch2lab(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=lab2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}var p={rgb2hsl:rgb2hsl,rgb2hwb:rgb2hwb,rgb2lab:rgb2lab,rgb2lch:rgb2lch,rgb2hsv:rgb2hsv,rgb2xyz:rgb2xyz,hsl2rgb:hsl2rgb,hsl2hwb:hsl2hwb,hsl2lab:hsl2lab,hsl2lch:hsl2lch,hsl2hsv:hsl2hsv,hsl2xyz:hsl2xyz,hwb2rgb:hwb2rgb,hwb2hsl:hwb2hsl,hwb2lab:hwb2lab,hwb2lch:hwb2lch,hwb2hsv:hwb2hsv,hwb2xyz:hwb2xyz,lab2rgb:lab2rgb,lab2hsl:lab2hsl,lab2hwb:lab2hwb,lab2lch:lab2lch,lab2hsv:lab2hsv,lab2xyz:lab2xyz,lch2rgb:lch2rgb,lch2hsl:lch2hsl,lch2hwb:lch2hwb,lch2lab:lch2lab,lch2hsv:lch2hsv,lch2xyz:lch2xyz,hsv2rgb:hsv2rgb,hsv2hsl:hsv2hsl,hsv2hwb:hsv2hwb,hsv2lab:hsv2lab,hsv2lch:hsv2lch,hsv2xyz:hsv2xyz,xyz2rgb:xyz2rgb,xyz2hsl:xyz2hsl,xyz2hwb:xyz2hwb,xyz2lab:xyz2lab,xyz2lch:xyz2lch,xyz2hsv:xyz2hsv,rgb2hue:rgb2hue};r.rgb2hsl=rgb2hsl;r.rgb2hwb=rgb2hwb;r.rgb2lab=rgb2lab;r.rgb2lch=rgb2lch;r.rgb2hsv=rgb2hsv;r.rgb2xyz=rgb2xyz;r.hsl2rgb=hsl2rgb;r.hsl2hwb=hsl2hwb;r.hsl2lab=hsl2lab;r.hsl2lch=hsl2lch;r.hsl2hsv=hsl2hsv;r.hsl2xyz=hsl2xyz;r.hwb2rgb=hwb2rgb;r.hwb2hsl=hwb2hsl;r.hwb2lab=hwb2lab;r.hwb2lch=hwb2lch;r.hwb2hsv=hwb2hsv;r.hwb2xyz=hwb2xyz;r.lab2rgb=lab2rgb;r.lab2hsl=lab2hsl;r.lab2hwb=lab2hwb;r.lab2lch=lab2lch;r.lab2hsv=lab2hsv;r.lab2xyz=lab2xyz;r.lch2rgb=lch2rgb;r.lch2hsl=lch2hsl;r.lch2hwb=lch2hwb;r.lch2lab=lch2lab;r.lch2hsv=lch2hsv;r.lch2xyz=lch2xyz;r.hsv2rgb=hsv2rgb;r.hsv2hsl=hsv2hsl;r.hsv2hwb=hsv2hwb;r.hsv2lab=hsv2lab;r.hsv2lch=hsv2lch;r.hsv2xyz=hsv2xyz;r.xyz2rgb=xyz2rgb;r.xyz2hsl=xyz2hsl;r.xyz2hwb=xyz2hwb;r.xyz2lab=xyz2lab;r.xyz2lch=xyz2lch;r.xyz2hsv=xyz2hsv;r.rgb2hue=rgb2hue;r.default=p},4394:(e,r,t)=>{"use strict";var n=t(4338).feature;function browsersSort(e,r){e=e.split(" ");r=r.split(" ");if(e[0]>r[0]){return 1}else if(e[0]=t.length)break;s=t[o++]}else{o=t.next();if(o.done)break;s=o.value}var a=s;i[a]=Object.assign({},r)}}function add(e,r){for(var t=e,n=Array.isArray(t),o=0,t=n?t:t[Symbol.iterator]();;){var s;if(n){if(o>=t.length)break;s=t[o++]}else{o=t.next();if(o.done)break;s=o.value}var a=s;i[a].browsers=i[a].browsers.concat(r.browsers).sort(browsersSort)}}e.exports=i;f(t(5543),function(e){return prefix(["border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],{mistakes:["-khtml-","-ms-","-o-"],feature:"border-radius",browsers:e})});f(t(5861),function(e){return prefix(["box-shadow"],{mistakes:["-khtml-"],feature:"css-boxshadow",browsers:e})});f(t(8252),function(e){return prefix(["animation","animation-name","animation-duration","animation-delay","animation-direction","animation-fill-mode","animation-iteration-count","animation-play-state","animation-timing-function","@keyframes"],{mistakes:["-khtml-","-ms-"],feature:"css-animation",browsers:e})});f(t(5056),function(e){return prefix(["transition","transition-property","transition-duration","transition-delay","transition-timing-function"],{mistakes:["-khtml-","-ms-"],browsers:e,feature:"css-transitions"})});f(t(762),function(e){return prefix(["transform","transform-origin"],{feature:"transforms2d",browsers:e})});var o=t(58);f(o,function(e){prefix(["perspective","perspective-origin"],{feature:"transforms3d",browsers:e});return prefix(["transform-style"],{mistakes:["-ms-","-o-"],browsers:e,feature:"transforms3d"})});f(o,{match:/y\sx|y\s#2/},function(e){return prefix(["backface-visibility"],{mistakes:["-ms-","-o-"],feature:"transforms3d",browsers:e})});var s=t(1407);f(s,{match:/y\sx/},function(e){return prefix(["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient"],{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],mistakes:["-ms-"],feature:"css-gradients",browsers:e})});f(s,{match:/a\sx/},function(e){e=e.map(function(e){if(/firefox|op/.test(e)){return e}else{return e+" old"}});return add(["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient"],{feature:"css-gradients",browsers:e})});f(t(7759),function(e){return prefix(["box-sizing"],{feature:"css3-boxsizing",browsers:e})});f(t(9237),function(e){return prefix(["filter"],{feature:"css-filters",browsers:e})});f(t(6192),function(e){return prefix(["filter-function"],{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],feature:"css-filter-function",browsers:e})});var a=t(3613);f(a,{match:/y\sx|y\s#2/},function(e){return prefix(["backdrop-filter"],{feature:"css-backdrop-filter",browsers:e})});f(t(9666),function(e){return prefix(["element"],{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],feature:"css-element-function",browsers:e})});f(t(1448),function(e){prefix(["columns","column-width","column-gap","column-rule","column-rule-color","column-rule-width","column-count","column-rule-style","column-span","column-fill"],{feature:"multicolumn",browsers:e});var r=e.filter(function(e){return!/firefox/.test(e)});prefix(["break-before","break-after","break-inside"],{feature:"multicolumn",browsers:r})});f(t(7511),function(e){return prefix(["user-select"],{mistakes:["-khtml-"],feature:"user-select-none",browsers:e})});var u=t(3714);f(u,{match:/a\sx/},function(e){e=e.map(function(e){if(/ie|firefox/.test(e)){return e}else{return e+" 2009"}});prefix(["display-flex","inline-flex"],{props:["display"],feature:"flexbox",browsers:e});prefix(["flex","flex-grow","flex-shrink","flex-basis"],{feature:"flexbox",browsers:e});prefix(["flex-direction","flex-wrap","flex-flow","justify-content","order","align-items","align-self","align-content"],{feature:"flexbox",browsers:e})});f(u,{match:/y\sx/},function(e){add(["display-flex","inline-flex"],{feature:"flexbox",browsers:e});add(["flex","flex-grow","flex-shrink","flex-basis"],{feature:"flexbox",browsers:e});add(["flex-direction","flex-wrap","flex-flow","justify-content","order","align-items","align-self","align-content"],{feature:"flexbox",browsers:e})});f(t(3807),function(e){return prefix(["calc"],{props:["*"],feature:"calc",browsers:e})});f(t(2259),function(e){return prefix(["background-origin","background-size"],{feature:"background-img-opts",browsers:e})});f(t(1302),function(e){return prefix(["background-clip"],{feature:"background-clip-text",browsers:e})});f(t(7011),function(e){return prefix(["font-feature-settings","font-variant-ligatures","font-language-override"],{feature:"font-feature",browsers:e})});f(t(9195),function(e){return prefix(["font-kerning"],{feature:"font-kerning",browsers:e})});f(t(9847),function(e){return prefix(["border-image"],{feature:"border-image",browsers:e})});f(t(3347),function(e){return prefix(["::selection"],{selector:true,feature:"css-selection",browsers:e})});f(t(5117),function(e){prefix(["::placeholder"],{selector:true,feature:"css-placeholder",browsers:e.concat(["ie 10 old","ie 11 old","firefox 18 old"])})});f(t(9747),function(e){return prefix(["hyphens"],{feature:"css-hyphens",browsers:e})});var c=t(5833);f(c,function(e){return prefix([":fullscreen"],{selector:true,feature:"fullscreen",browsers:e})});f(c,{match:/x(\s#2|$)/},function(e){return prefix(["::backdrop"],{selector:true,feature:"fullscreen",browsers:e})});f(t(9807),function(e){return prefix(["tab-size"],{feature:"css3-tabsize",browsers:e})});var l=t(3794);var p=["width","min-width","max-width","height","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size","grid","grid-template","grid-template-rows","grid-template-columns","grid-auto-columns","grid-auto-rows"];f(l,function(e){return prefix(["max-content","min-content"],{props:p,feature:"intrinsic-width",browsers:e})});f(l,{match:/x|\s#4/},function(e){return prefix(["fill","fill-available","stretch"],{props:p,feature:"intrinsic-width",browsers:e})});f(l,{match:/x|\s#5/},function(e){return prefix(["fit-content"],{props:p,feature:"intrinsic-width",browsers:e})});f(t(8546),function(e){return prefix(["zoom-in","zoom-out"],{props:["cursor"],feature:"css3-cursors-newer",browsers:e})});f(t(4528),function(e){return prefix(["grab","grabbing"],{props:["cursor"],feature:"css3-cursors-grab",browsers:e})});f(t(3727),function(e){return prefix(["sticky"],{props:["position"],feature:"css-sticky",browsers:e})});f(t(6714),function(e){return prefix(["touch-action"],{feature:"pointer",browsers:e})});var h=t(6848);f(h,function(e){return prefix(["text-decoration-style","text-decoration-color","text-decoration-line","text-decoration"],{feature:"text-decoration",browsers:e})});f(h,{match:/x.*#[235]/},function(e){return prefix(["text-decoration-skip","text-decoration-skip-ink"],{feature:"text-decoration",browsers:e})});f(t(6421),function(e){return prefix(["text-size-adjust"],{feature:"text-size-adjust",browsers:e})});f(t(4613),function(e){prefix(["mask-clip","mask-composite","mask-image","mask-origin","mask-repeat","mask-border-repeat","mask-border-source"],{feature:"css-masks",browsers:e});prefix(["mask","mask-position","mask-size","mask-border","mask-border-outset","mask-border-width","mask-border-slice"],{feature:"css-masks",browsers:e})});f(t(147),function(e){return prefix(["clip-path"],{feature:"css-clip-path",browsers:e})});f(t(4016),function(e){return prefix(["box-decoration-break"],{feature:"css-boxdecorationbreak",browsers:e})});f(t(5147),function(e){return prefix(["object-fit","object-position"],{feature:"object-fit",browsers:e})});f(t(4298),function(e){return prefix(["shape-margin","shape-outside","shape-image-threshold"],{feature:"css-shapes",browsers:e})});f(t(123),function(e){return prefix(["text-overflow"],{feature:"text-overflow",browsers:e})});f(t(1779),function(e){return prefix(["@viewport"],{feature:"css-deviceadaptation",browsers:e})});var B=t(3588);f(B,{match:/( x($| )|a #2)/},function(e){return prefix(["@resolution"],{feature:"css-media-resolution",browsers:e})});f(t(9533),function(e){return prefix(["text-align-last"],{feature:"css-text-align-last",browsers:e})});var v=t(7794);f(v,{match:/y x|a x #1/},function(e){return prefix(["pixelated"],{props:["image-rendering"],feature:"css-crisp-edges",browsers:e})});f(v,{match:/a x #2/},function(e){return prefix(["image-rendering"],{feature:"css-crisp-edges",browsers:e})});var d=t(471);f(d,function(e){return prefix(["border-inline-start","border-inline-end","margin-inline-start","margin-inline-end","padding-inline-start","padding-inline-end"],{feature:"css-logical-props",browsers:e})});f(d,{match:/x\s#2/},function(e){return prefix(["border-block-start","border-block-end","margin-block-start","margin-block-end","padding-block-start","padding-block-end"],{feature:"css-logical-props",browsers:e})});var b=t(8672);f(b,{match:/#2|x/},function(e){return prefix(["appearance"],{feature:"css-appearance",browsers:e})});f(t(87),function(e){return prefix(["scroll-snap-type","scroll-snap-coordinate","scroll-snap-destination","scroll-snap-points-x","scroll-snap-points-y"],{feature:"css-snappoints",browsers:e})});f(t(5969),function(e){return prefix(["flow-into","flow-from","region-fragment"],{feature:"css-regions",browsers:e})});f(t(4197),function(e){return prefix(["image-set"],{props:["background","background-image","border-image","cursor","mask","mask-image","list-style","list-style-image","content"],feature:"css-image-set",browsers:e})});var y=t(8307);f(y,{match:/a|x/},function(e){return prefix(["writing-mode"],{feature:"css-writing-mode",browsers:e})});f(t(3323),function(e){return prefix(["cross-fade"],{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],feature:"css-cross-fade",browsers:e})});f(t(3502),function(e){return prefix([":read-only",":read-write"],{selector:true,feature:"css-read-only-write",browsers:e})});f(t(5802),function(e){return prefix(["text-emphasis","text-emphasis-position","text-emphasis-style","text-emphasis-color"],{feature:"text-emphasis",browsers:e})});var g=t(7776);f(g,function(e){prefix(["display-grid","inline-grid"],{props:["display"],feature:"css-grid",browsers:e});prefix(["grid-template-columns","grid-template-rows","grid-row-start","grid-column-start","grid-row-end","grid-column-end","grid-row","grid-column","grid-area","grid-template","grid-template-areas","place-self"],{feature:"css-grid",browsers:e})});f(g,{match:/a x/},function(e){return prefix(["grid-column-align","grid-row-align"],{feature:"css-grid",browsers:e})});f(t(8422),function(e){return prefix(["text-spacing"],{feature:"css-text-spacing",browsers:e})});f(t(1977),function(e){return prefix([":any-link"],{selector:true,feature:"css-any-link",browsers:e})});var m=t(1456);f(m,function(e){return prefix(["isolate"],{props:["unicode-bidi"],feature:"css-unicode-bidi",browsers:e})});f(m,{match:/y x|a x #2/},function(e){return prefix(["plaintext"],{props:["unicode-bidi"],feature:"css-unicode-bidi",browsers:e})});f(m,{match:/y x/},function(e){return prefix(["isolate-override"],{props:["unicode-bidi"],feature:"css-unicode-bidi",browsers:e})});var C=t(3043);f(C,{match:/a #1/},function(e){return prefix(["overscroll-behavior"],{feature:"css-overscroll-behavior",browsers:e})});f(t(664),function(e){return prefix(["color-adjust"],{feature:"css-color-adjust",browsers:e})});f(t(3100),function(e){return prefix(["text-orientation"],{feature:"css-text-orientation",browsers:e})})},7997:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;if(!r||r===s){this.add(e,s)}}};return AtRule}(n);e.exports=i},3501:(e,r,t)=>{"use strict";var n=t(3561);var i=t(4633);var o=t(4338).agents;var s=t(2242);var a=t(2319);var u=t(811);var f=t(4394);var c=t(6741);var l="\n"+" Replace Autoprefixer `browsers` option to Browserslist config.\n"+" Use `browserslist` key in `package.json` or `.browserslistrc` file.\n"+"\n"+" Using `browsers` option can cause errors. Browserslist config \n"+" can be used for Babel, Autoprefixer, postcss-normalize and other tools.\n"+"\n"+" If you really need to use option, rename it to `overrideBrowserslist`.\n"+"\n"+" Learn more at:\n"+" https://github.com/browserslist/browserslist#readme\n"+" https://twitter.com/browserslist\n"+"\n";function isPlainObject(e){return Object.prototype.toString.apply(e)==="[object Object]"}var p={};function timeCapsule(e,r){if(r.browsers.selected.length===0){return}if(r.add.selectors.length>0){return}if(Object.keys(r.add).length>2){return}e.warn("Greetings, time traveller. "+"We are in the golden age of prefix-less CSS, "+"where Autoprefixer is no longer needed for your stylesheet.")}e.exports=i.plugin("autoprefixer",function(){for(var r=arguments.length,t=new Array(r),n=0;n{"use strict";function last(e){return e[e.length-1]}var r={parse:function parse(e){var r=[""];var t=[r];for(var n=e,i=Array.isArray(n),o=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(o>=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;if(a==="("){r=[""];last(t).push(r);t.push(r);continue}if(a===")"){t.pop();r=last(t);r.push("");continue}r[r.length-1]+=a}return t[0]},stringify:function stringify(e){var t="";for(var n=e,i=Array.isArray(n),o=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(o>=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;if(typeof a==="object"){t+="("+r.stringify(a)+")";continue}t+=a}return t}};e.exports=r},2319:(e,r,t)=>{"use strict";var n=t(3561);var i=t(4338).agents;var o=t(772);var s=function(){Browsers.prefixes=function prefixes(){if(this.prefixesCache){return this.prefixesCache}this.prefixesCache=[];for(var e in i){this.prefixesCache.push("-"+i[e].prefix+"-")}this.prefixesCache=o.uniq(this.prefixesCache).sort(function(e,r){return r.length-e.length});return this.prefixesCache};Browsers.withPrefix=function withPrefix(e){if(!this.prefixesRegexp){this.prefixesRegexp=new RegExp(this.prefixes().join("|"))}return this.prefixesRegexp.test(e)};function Browsers(e,r,t,n){this.data=e;this.options=t||{};this.browserslistOpts=n||{};this.selected=this.parse(r)}var e=Browsers.prototype;e.parse=function parse(e){var r={};for(var t in this.browserslistOpts){r[t]=this.browserslistOpts[t]}r.path=this.options.from;r.env=this.options.env;return n(e,r)};e.prefix=function prefix(e){var r=e.split(" "),t=r[0],n=r[1];var i=this.data[t];var prefix=i.prefix_exceptions&&i.prefix_exceptions[n];if(!prefix){prefix=i.prefix}return"-"+prefix+"-"};e.isSelected=function isSelected(e){return this.selected.includes(e)};return Browsers}();e.exports=s},5753:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=t.length)break;s=t[o++]}else{o=t.next();if(o.done)break;s=o.value}var a=s;if(a===r){continue}if(e.includes(a)){return true}}return false};r.set=function set(e,r){e.prop=this.prefixed(e.prop,r);return e};r.needCascade=function needCascade(e){if(!e._autoprefixerCascade){e._autoprefixerCascade=this.all.options.cascade!==false&&e.raw("before").includes("\n")}return e._autoprefixerCascade};r.maxPrefixed=function maxPrefixed(e,r){if(r._autoprefixerMax){return r._autoprefixerMax}var t=0;for(var n=e,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{s=n.next();if(s.done)break;a=s.value}var u=a;u=o.removeNote(u);if(u.length>t){t=u.length}}r._autoprefixerMax=t;return r._autoprefixerMax};r.calcBefore=function calcBefore(e,r,t){if(t===void 0){t=""}var n=this.maxPrefixed(e,r);var i=n-o.removeNote(t).length;var s=r.raw("before");if(i>0){s+=Array(i).fill(" ").join("")}return s};r.restoreBefore=function restoreBefore(e){var r=e.raw("before").split("\n");var t=r[r.length-1];this.all.group(e).up(function(e){var r=e.raw("before").split("\n");var n=r[r.length-1];if(n.length{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";e.exports=function(e){var r;if(e==="-webkit- 2009"||e==="-moz-"){r=2009}else if(e==="-ms-"){r=2012}else if(e==="-webkit-"){r="final"}if(e==="-webkit- 2009"){e="-webkit-"}return[r,e]}},9315:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=i.length)break;a=i[s++]}else{s=i.next();if(s.done)break;a=s.value}var u=a;if(u.type==="function"&&u.value===this.name){u.nodes=this.newDirection(u.nodes);u.nodes=this.normalize(u.nodes);if(r==="-webkit- old"){var f=this.oldWebkit(u);if(!f){return false}}else{u.nodes=this.convertDirection(u.nodes);u.value=r+u.value}}}return t.toString()};r.replaceFirst=function replaceFirst(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;if(r==="before"&&s.type==="space"){r="at"}else if(r==="at"&&s.value==="at"){r="after"}else if(r==="after"&&s.type==="space"){return true}else if(s.type==="div"){break}else{r="before"}}return false};r.convertDirection=function convertDirection(e){if(e.length>0){if(e[0].value==="to"){this.fixDirection(e)}else if(e[0].value.includes("deg")){this.fixAngle(e)}else if(this.isRadial(e)){this.fixRadial(e)}}return e};r.fixDirection=function fixDirection(e){e.splice(0,2);for(var r=e,t=Array.isArray(r),n=0,r=t?r:r[Symbol.iterator]();;){var i;if(t){if(n>=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;if(o.type==="div"){break}if(o.type==="word"){o.value=this.revertDirection(o.value)}}};r.fixAngle=function fixAngle(e){var r=e[0].value;r=parseFloat(r);r=Math.abs(450-r)%360;r=this.roundFloat(r,3);e[0].value=r+"deg"};r.fixRadial=function fixRadial(e){var r=[];var t=[];var n,i,o,s,a;for(s=0;s=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;i[i.length-1].push(f);if(f.type==="div"&&f.value===","){i.push([])}}this.oldDirection(i);this.colorStops(i);e.nodes=[];for(var c=0,l=i;c=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;if(a.type==="word"){t.push(a.value.toLowerCase())}}t=t.join(" ");var u=this.oldDirections[t]||t;e[0]=[{type:"word",value:u},r];return e[0]}};r.cloneDiv=function cloneDiv(e){for(var r=e,t=Array.isArray(r),n=0,r=t?r:r[Symbol.iterator]();;){var i;if(t){if(n>=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;if(o.type==="div"&&o.value===","){return o}}return{type:"div",value:",",after:" "}};r.colorStops=function colorStops(e){var r=[];for(var t=0;t{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n1){r.cloneBefore({prop:"-ms-grid-rows",value:u({value:"repeat("+d.length+", auto)",gap:v.row}),raws:{}})}c({gap:v,hasColumns:p,decl:r,result:i});var b=o({rows:d,gap:v});s(b,r,i);return r};return GridTemplateAreas}(n);_defineProperty(p,"names",["grid-template-areas"]);e.exports=p},5193:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n0;var b=Boolean(h);var y=Boolean(B);u({gap:c,hasColumns:y,decl:r,result:i});s(v,r,i);if(b&&y||d){r.cloneBefore({prop:"-ms-grid-rows",value:h,raws:{}})}if(y){r.cloneBefore({prop:"-ms-grid-columns",value:B,raws:{}})}return r};return GridTemplate}(n);_defineProperty(c,"names",["grid-template"]);e.exports=c},5224:(e,r,t)=>{"use strict";var n=t(23);var i=t(4633).list;var o=t(772).uniq;var s=t(772).escapeRegexp;var a=t(772).splitSelector;function convert(e){if(e&&e.length===2&&e[0]==="span"&&parseInt(e[1],10)>0){return[false,parseInt(e[1],10)]}if(e&&e.length===1&&parseInt(e[0],10)>0){return[parseInt(e[0],10),false]}return[false,false]}function translate(e,r,t){var n=e[r];var i=e[t];if(!n){return[false,false]}var o=convert(n),s=o[0],a=o[1];var u=convert(i),f=u[0],c=u[1];if(s&&!i){return[s,false]}if(a&&f){return[f-a,a]}if(s&&c){return[s,c]}if(s&&f){return[s,f-s]}return[false,false]}function parse(e){var r=n(e.value);var t=[];var i=0;t[i]=[];for(var o=r.nodes,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;if(f.type==="div"){i+=1;t[i]=[]}else if(f.type==="word"){t[i].push(f.value)}}return t}function insertDecl(e,r,t){if(t&&!e.parent.some(function(e){return e.prop==="-ms-"+r})){e.cloneBefore({prop:"-ms-"+r,value:t.toString()})}}function prefixTrackProp(e){var r=e.prop,t=e.prefix;return t+r.replace("template-","")}function transformRepeat(e,r){var t=e.nodes;var i=r.gap;var o=t.reduce(function(e,r){if(r.type==="div"&&r.value===","){e.key="size"}else{e[e.key].push(n.stringify(r))}return e},{key:"count",size:[],count:[]}),s=o.count,a=o.size;if(i){var u=function(){a=a.filter(function(e){return e.trim()});var e=[];var r=function _loop(r){a.forEach(function(t,n){if(n>0||r>1){e.push(i)}e.push(t)})};for(var t=1;t<=s;t++){r(t)}return{v:e.join(" ")}}();if(typeof u==="object")return u.v}return"("+a.join("")+")["+s.join("")+"]"}function prefixTrackValue(e){var r=e.value,t=e.gap;var i=n(r).nodes.reduce(function(e,r){if(r.type==="function"&&r.value==="repeat"){return e.concat({type:"word",value:transformRepeat(r,{gap:t})})}if(t&&r.type==="space"){return e.concat({type:"space",value:" "},{type:"word",value:t},r)}return e.concat(r)},[]);return n.stringify(i)}var u=/^\.+$/;function track(e,r){return{start:e,end:r,span:r-e}}function getColumns(e){return e.trim().split(/\s+/g)}function parseGridAreas(e){var r=e.rows,t=e.gap;return r.reduce(function(e,r,n){if(t.row)n*=2;if(r.trim()==="")return e;getColumns(r).forEach(function(r,i){if(u.test(r))return;if(t.column)i*=2;if(typeof e[r]==="undefined"){e[r]={column:track(i+1,i+2),row:track(n+1,n+2)}}else{var o=e[r],s=o.column,a=o.row;s.start=Math.min(s.start,i+1);s.end=Math.max(s.end,i+2);s.span=s.end-s.start;a.start=Math.min(a.start,n+1);a.end=Math.max(a.end,n+2);a.span=a.end-a.start}});return e},{})}function testTrack(e){return e.type==="word"&&/^\[.+]$/.test(e.value)}function verifyRowSize(e){if(e.areas.length>e.rows.length){e.rows.push("auto")}return e}function parseTemplate(e){var r=e.decl,t=e.gap;var i=n(r.value).nodes.reduce(function(e,r){var t=r.type,i=r.value;if(testTrack(r)||t==="space")return e;if(t==="string"){e=verifyRowSize(e);e.areas.push(i)}if(t==="word"||t==="function"){e[e.key].push(n.stringify(r))}if(t==="div"&&i==="/"){e.key="columns";e=verifyRowSize(e)}return e},{key:"rows",columns:[],rows:[],areas:[]});return{areas:parseGridAreas({rows:i.areas,gap:t}),columns:prefixTrackValue({value:i.columns.join(" "),gap:t.column}),rows:prefixTrackValue({value:i.rows.join(" "),gap:t.row})}}function getMSDecls(e,r,t){if(r===void 0){r=false}if(t===void 0){t=false}return[].concat({prop:"-ms-grid-row",value:String(e.row.start)},e.row.span>1||r?{prop:"-ms-grid-row-span",value:String(e.row.span)}:[],{prop:"-ms-grid-column",value:String(e.column.start)},e.column.span>1||t?{prop:"-ms-grid-column-span",value:String(e.column.span)}:[])}function getParentMedia(e){if(e.type==="atrule"&&e.name==="media"){return e}if(!e.parent){return false}return getParentMedia(e.parent)}function changeDuplicateAreaSelectors(e,r){e=e.map(function(e){var r=i.space(e);var t=i.comma(e);if(r.length>t.length){e=r.slice(-1).join("")}return e});return e.map(function(e){var t=r.map(function(r,t){var n=t===0?"":" ";return""+n+r+" > "+e});return t})}function selectorsEqual(e,r){return e.selectors.some(function(e){return r.selectors.some(function(r){return r===e})})}function parseGridTemplatesData(e){var r=[];e.walkDecls(/grid-template(-areas)?$/,function(e){var t=e.parent;var n=getParentMedia(t);var i=getGridGap(e);var s=inheritGridGap(e,i);var a=parseTemplate({decl:e,gap:s||i}),u=a.areas;var f=Object.keys(u);if(f.length===0){return true}var c=r.reduce(function(e,r,t){var n=r.allAreas;var i=n&&f.some(function(e){return n.includes(e)});return i?t:e},null);if(c!==null){var l=r[c],p=l.allAreas,h=l.rules;var B=h.some(function(e){return e.hasDuplicates===false&&selectorsEqual(e,t)});var v=false;var d=h.reduce(function(e,r){if(!r.params&&selectorsEqual(r,t)){v=true;return r.duplicateAreaNames}if(!v){f.forEach(function(t){if(r.areas[t]){e.push(t)}})}return o(e)},[]);h.forEach(function(e){f.forEach(function(r){var t=e.areas[r];if(t&&t.row.span!==u[r].row.span){u[r].row.updateSpan=true}if(t&&t.column.span!==u[r].column.span){u[r].column.updateSpan=true}})});r[c].allAreas=o([].concat(p,f));r[c].rules.push({hasDuplicates:!B,params:n.params,selectors:t.selectors,node:t,duplicateAreaNames:d,areas:u})}else{r.push({allAreas:f,areasCount:0,rules:[{hasDuplicates:false,duplicateRules:[],params:n.params,selectors:t.selectors,node:t,duplicateAreaNames:[],areas:u}]})}return undefined});return r}function insertAreas(e,r){var t=parseGridTemplatesData(e);if(t.length===0){return undefined}var n={};e.walkDecls("grid-area",function(o){var s=o.parent;var a=s.first.prop==="-ms-grid-row";var u=getParentMedia(s);if(r(o)){return undefined}var f=u?e.index(u):e.index(s);var c=o.value;var l=t.filter(function(e){return e.allAreas.includes(c)})[0];if(!l){return true}var p=l.allAreas[l.allAreas.length-1];var h=i.space(s.selector);var B=i.comma(s.selector);var v=h.length>1&&h.length>B.length;if(a){return false}if(!n[p]){n[p]={}}var d=false;for(var b=l.rules,y=Array.isArray(b),g=0,b=y?b:b[Symbol.iterator]();;){var m;if(y){if(g>=b.length)break;m=b[g++]}else{g=b.next();if(g.done)break;m=g.value}var C=m;var w=C.areas[c];var S=C.duplicateAreaNames.includes(c);if(!w){var O=e.index(n[p].lastRule);if(f>O){n[p].lastRule=u||s}continue}if(C.params&&!n[p][C.params]){n[p][C.params]=[]}if((!C.hasDuplicates||!S)&&!C.params){getMSDecls(w,false,false).reverse().forEach(function(e){return s.prepend(Object.assign(e,{raws:{between:o.raws.between}}))});n[p].lastRule=s;d=true}else if(C.hasDuplicates&&!C.params&&!v){(function(){var e=s.clone();e.removeAll();getMSDecls(w,w.row.updateSpan,w.column.updateSpan).reverse().forEach(function(r){return e.prepend(Object.assign(r,{raws:{between:o.raws.between}}))});e.selectors=changeDuplicateAreaSelectors(e.selectors,C.selectors);if(n[p].lastRule){n[p].lastRule.after(e)}n[p].lastRule=e;d=true})()}else if(C.hasDuplicates&&!C.params&&v&&s.selector.includes(C.selectors[0])){s.walkDecls(/-ms-grid-(row|column)/,function(e){return e.remove()});getMSDecls(w,w.row.updateSpan,w.column.updateSpan).reverse().forEach(function(e){return s.prepend(Object.assign(e,{raws:{between:o.raws.between}}))})}else if(C.params){(function(){var r=s.clone();r.removeAll();getMSDecls(w,w.row.updateSpan,w.column.updateSpan).reverse().forEach(function(e){return r.prepend(Object.assign(e,{raws:{between:o.raws.between}}))});if(C.hasDuplicates&&S){r.selectors=changeDuplicateAreaSelectors(r.selectors,C.selectors)}r.raws=C.node.raws;if(e.index(C.node.parent)>f){C.node.parent.append(r)}else{n[p][C.params].push(r)}if(!d){n[p].lastRule=u||s}})()}}return undefined});Object.keys(n).forEach(function(e){var r=n[e];var t=r.lastRule;Object.keys(r).reverse().filter(function(e){return e!=="lastRule"}).forEach(function(e){if(r[e].length>0&&t){t.after({name:"media",params:e});t.next().append(r[e])}})});return undefined}function warnMissedAreas(e,r,t){var n=Object.keys(e);r.root().walkDecls("grid-area",function(e){n=n.filter(function(r){return r!==e.value})});if(n.length>0){r.warn(t,"Can not find grid areas: "+n.join(", "))}return undefined}function warnTemplateSelectorNotFound(e,r){var t=e.parent;var n=e.root();var o=false;var s=i.space(t.selector).filter(function(e){return e!==">"}).slice(0,-1);if(s.length>0){var a=false;var u=null;n.walkDecls(/grid-template(-areas)?$/,function(r){var t=r.parent;var n=t.selectors;var f=parseTemplate({decl:r,gap:getGridGap(r)}),c=f.areas;var l=c[e.value];for(var p=n,h=Array.isArray(p),B=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(B>=p.length)break;v=p[B++]}else{B=p.next();if(B.done)break;v=B.value}var d=v;if(a){break}var b=i.space(d).filter(function(e){return e!==">"});a=b.every(function(e,r){return e===s[r]})}if(a||!l){return true}if(!u){u=t.selector}if(u&&u!==t.selector){o=true}return undefined});if(!a&&o){e.warn(r,"Autoprefixer cannot find a grid-template "+('containing the duplicate grid-area "'+e.value+'" ')+("with full selector matching: "+s.join(" ")))}}}function warnIfGridRowColumnExists(e,r){var t=e.parent;var n=[];t.walkDecls(/^grid-(row|column)/,function(e){if(!e.prop.endsWith("-end")&&!e.value.startsWith("span")){n.push(e)}});if(n.length>0){n.forEach(function(e){e.warn(r,"You already have a grid-area declaration present in the rule. "+("You should use either grid-area or "+e.prop+", not both"))})}return undefined}function getGridGap(e){var r={};var t=/^(grid-)?((row|column)-)?gap$/;e.parent.walkDecls(t,function(e){var t=e.prop,i=e.value;if(/^(grid-)?gap$/.test(t)){var o=n(i).nodes,s=o[0],a=o[2];r.row=s&&n.stringify(s);r.column=a?n.stringify(a):r.row}if(/^(grid-)?row-gap$/.test(t))r.row=i;if(/^(grid-)?column-gap$/.test(t))r.column=i});return r}function parseMediaParams(e){if(!e){return false}var r=n(e);var t;var i;r.walk(function(e){if(e.type==="word"&&/min|max/g.test(e.value)){t=e.value}else if(e.value.includes("px")){i=parseInt(e.value.replace(/\D/g,""))}});return[t,i]}function shouldInheritGap(e,r){var t;var n=a(e);var i=a(r);if(n[0].lengthi[0].length){var o=n[0].reduce(function(e,r,t){var n=r[0];var o=i[0][0][0];if(n===o){return t}return false},false);if(o){t=i[0].every(function(e,r){return e.every(function(e,t){return n[0].slice(o)[r][t]===e})})}}else{t=i.some(function(e){return e.every(function(e,r){return e.every(function(e,t){return n[0][r][t]===e})})})}return t}function inheritGridGap(e,r){var t=e.parent;var n=getParentMedia(t);var i=t.root();var o=a(t.selector);if(Object.keys(r).length>0){return false}var u=parseMediaParams(n.params),f=u[0];var c=o[0];var l=s(c[c.length-1][0]);var p=new RegExp("("+l+"$)|("+l+"[,.])");var h;i.walkRules(p,function(e){var r;if(t.toString()===e.toString()){return false}e.walkDecls("grid-gap",function(e){return r=getGridGap(e)});if(!r||Object.keys(r).length===0){return true}if(!shouldInheritGap(t.selector,e.selector)){return true}var n=getParentMedia(e);if(n){var i=parseMediaParams(n.params)[0];if(i===f){h=r;return true}}else{h=r;return true}return undefined});if(h&&Object.keys(h).length>0){return h}return false}function warnGridGap(e){var r=e.gap,t=e.hasColumns,n=e.decl,i=e.result;var o=r.row&&r.column;if(!t&&(o||r.column&&!r.row)){delete r.column;n.warn(i,"Can not implement grid-gap without grid-template-columns")}}function normalizeRowColumn(e){var r=n(e).nodes.reduce(function(e,r){if(r.type==="function"&&r.value==="repeat"){var t="count";var i=r.nodes.reduce(function(e,r){if(r.type==="word"&&t==="count"){e[0]=Math.abs(parseInt(r.value));return e}if(r.type==="div"&&r.value===","){t="value";return e}if(t==="value"){e[1]+=n.stringify(r)}return e},[0,""]),o=i[0],s=i[1];if(o){for(var a=0;a *:nth-child("+(c.length-r)+")")}).join(", ");var s=i.clone().removeAll();s.selector=o;s.append({prop:"-ms-grid-row",value:n.start});s.append({prop:"-ms-grid-column",value:t.start});i.after(s)});return undefined}e.exports={parse:parse,translate:translate,parseTemplate:parseTemplate,parseGridAreas:parseGridAreas,warnMissedAreas:warnMissedAreas,insertAreas:insertAreas,insertDecl:insertDecl,prefixTrackProp:prefixTrackProp,prefixTrackValue:prefixTrackValue,getGridGap:getGridGap,warnGridGap:warnGridGap,warnTemplateSelectorNotFound:warnTemplateSelectorNotFound,warnIfGridRowColumnExists:warnIfGridRowColumnExists,inheritGridGap:inheritGridGap,autoplaceGridItems:autoplaceGridItems}},3463:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;if(e.value.includes(o+"(")){return true}}return false};r.set=function set(r,t){r=e.prototype.set.call(this,r,t);if(t==="-ms-"){r.value=r.value.replace(/rotatez/gi,"rotate")}return r};r.insert=function insert(r,t,n){if(t==="-ms-"){if(!this.contain3d(r)&&!this.keyframeParents(r)){return e.prototype.insert.call(this,r,t,n)}}else if(t==="-o-"){if(!this.contain3d(r)){return e.prototype.insert.call(this,r,t,n)}}else{return e.prototype.insert.call(this,r,t,n)}return undefined};return TransformDecl}(n);_defineProperty(i,"names",["transform","transform-origin"]);_defineProperty(i,"functions3d",["matrix3d","translate3d","translateZ","scale3d","scaleZ","rotate3d","rotateX","rotateY","perspective"]);e.exports=i},3251:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";var n=t(3561);function capitalize(e){return e.slice(0,1).toUpperCase()+e.slice(1)}var i={ie:"IE",ie_mob:"IE Mobile",ios_saf:"iOS",op_mini:"Opera Mini",op_mob:"Opera Mobile",and_chr:"Chrome for Android",and_ff:"Firefox for Android",and_uc:"UC for Android"};function prefix(e,r,t){var n=" "+e;if(t)n+=" *";n+=": ";n+=r.map(function(e){return e.replace(/^-(.*)-$/g,"$1")}).join(", ");n+="\n";return n}e.exports=function(e){if(e.browsers.selected.length===0){return"No browsers selected"}var r={};for(var t=e.browsers.selected,o=Array.isArray(t),s=0,t=o?t:t[Symbol.iterator]();;){var a;if(o){if(s>=t.length)break;a=t[s++]}else{s=t.next();if(s.done)break;a=s.value}var u=a;var f=u.split(" ");var c=f[0];var l=f[1];c=i[c]||capitalize(c);if(r[c]){r[c].push(l)}else{r[c]=[l]}}var p="Browsers:\n";for(var h in r){var B=r[h];B=B.sort(function(e,r){return parseFloat(r)-parseFloat(e)});p+=" "+h+": "+B.join(", ")+"\n"}var v=n.coverage(e.browsers.selected);var d=Math.round(v*100)/100;p+="\nThese browsers account for "+d+"% of all users globally\n";var b=[];for(var y in e.add){var g=e.add[y];if(y[0]==="@"&&g.prefixes){b.push(prefix(y,g.prefixes))}}if(b.length>0){p+="\nAt-Rules:\n"+b.sort().join("")}var m=[];for(var C=e.add.selectors,w=Array.isArray(C),S=0,C=w?C:C[Symbol.iterator]();;){var O;if(w){if(S>=C.length)break;O=C[S++]}else{S=C.next();if(S.done)break;O=S.value}var T=O;if(T.prefixes){m.push(prefix(T.name,T.prefixes))}}if(m.length>0){p+="\nSelectors:\n"+m.sort().join("")}var E=[];var k=[];var P=false;for(var D in e.add){var A=e.add[D];if(D[0]!=="@"&&A.prefixes){var R=D.indexOf("grid-")===0;if(R)P=true;k.push(prefix(D,A.prefixes,R))}if(!Array.isArray(A.values)){continue}for(var F=A.values,x=Array.isArray(F),j=0,F=x?F:F[Symbol.iterator]();;){var I;if(x){if(j>=F.length)break;I=F[j++]}else{j=F.next();if(j.done)break;I=j.value}var M=I;var _=M.name.includes("grid");if(_)P=true;var N=prefix(M.name,M.prefixes,_);if(!E.includes(N)){E.push(N)}}}if(k.length>0){p+="\nProperties:\n"+k.sort().join("")}if(E.length>0){p+="\nValues:\n"+E.sort().join("")}if(P){p+="\n* - Prefixes will be added only on grid: true option.\n"}if(!b.length&&!m.length&&!k.length&&!E.length){p+="\nAwesome! Your browsers don't require any vendor prefixes."+"\nNow you can remove Autoprefixer from build steps."}return p}},7471:e=>{"use strict";var r=function(){function OldSelector(e,r){this.prefix=r;this.prefixed=e.prefixed(this.prefix);this.regexp=e.regexp(this.prefix);this.prefixeds=e.possible().map(function(r){return[e.prefixed(r),e.regexp(r)]});this.unprefixed=e.name;this.nameRegexp=e.regexp()}var e=OldSelector.prototype;e.isHack=function isHack(e){var r=e.parent.index(e)+1;var t=e.parent.nodes;while(r=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u,c=f[0],l=f[1];if(n.includes(c)&&n.match(l)){i=true;break}}if(!i){return true}r+=1}return true};e.check=function check(e){if(!e.selector.includes(this.prefixed)){return false}if(!e.selector.match(this.regexp)){return false}if(this.isHack(e)){return false}return true};return OldSelector}();e.exports=r},6661:(e,r,t)=>{"use strict";var n=t(772);var i=function(){function OldValue(e,r,t,i){this.unprefixed=e;this.prefixed=r;this.string=t||r;this.regexp=i||n.regexp(r)}var e=OldValue.prototype;e.check=function check(e){if(e.includes(this.string)){return!!e.match(this.regexp)}return false};return OldValue}();e.exports=i},8428:(e,r,t)=>{"use strict";var n=t(4633).vendor;var i=t(2319);var o=t(772);function _clone(e,r){var t=new e.constructor;for(var n=0,i=Object.keys(e||{});n=s.length)break;f=s[u++]}else{u=s.next();if(u.done)break;f=u.value}var c=f;if(this.add(e,c,i.concat([c]),r)){i.push(c)}}return i};e.clone=function clone(e,r){return Prefixer.clone(e,r)};return Prefixer}();e.exports=s},811:(e,r,t)=>{"use strict";var n=t(4633).vendor;var i=t(5753);var o=t(9514);var s=t(7080);var a=t(8120);var u=t(3817);var f=t(2319);var c=t(4806);var l=t(7997);var p=t(1882);var h=t(772);c.hack(t(9231));c.hack(t(9478));i.hack(t(3629));i.hack(t(7017));i.hack(t(972));i.hack(t(1763));i.hack(t(3331));i.hack(t(7106));i.hack(t(3392));i.hack(t(9315));i.hack(t(6658));i.hack(t(1036));i.hack(t(7912));i.hack(t(7335));i.hack(t(3686));i.hack(t(5041));i.hack(t(7447));i.hack(t(9116));i.hack(t(180));i.hack(t(3251));i.hack(t(5035));i.hack(t(517));i.hack(t(5836));i.hack(t(1041));i.hack(t(3305));i.hack(t(4802));i.hack(t(657));i.hack(t(9423));i.hack(t(5193));i.hack(t(8322));i.hack(t(4689));i.hack(t(9801));i.hack(t(2112));i.hack(t(3463));i.hack(t(1262));i.hack(t(7509));i.hack(t(9936));i.hack(t(5230));i.hack(t(1150));i.hack(t(8360));i.hack(t(2456));i.hack(t(5422));i.hack(t(2681));i.hack(t(1719));i.hack(t(487));i.hack(t(9228));p.hack(t(2433));p.hack(t(1138));p.hack(t(4581));p.hack(t(291));p.hack(t(8485));p.hack(t(3692));p.hack(t(1665));p.hack(t(133));var B={};var v=function(){function Prefixes(e,r,t){if(t===void 0){t={}}this.data=e;this.browsers=r;this.options=t;var n=this.preprocess(this.select(this.data));this.add=n[0];this.remove=n[1];this.transition=new s(this);this.processor=new a(this)}var e=Prefixes.prototype;e.cleaner=function cleaner(){if(this.cleanerCache){return this.cleanerCache}if(this.browsers.selected.length){var e=new f(this.browsers.data,[]);this.cleanerCache=new Prefixes(this.data,e,this.options)}else{return this}return this.cleanerCache};e.select=function select(e){var r=this;var t={add:{},remove:{}};var n=function _loop(n){var i=e[n];var o=i.browsers.map(function(e){var r=e.split(" ");return{browser:r[0]+" "+r[1],note:r[2]}});var s=o.filter(function(e){return e.note}).map(function(e){return r.browsers.prefix(e.browser)+" "+e.note});s=h.uniq(s);o=o.filter(function(e){return r.browsers.isSelected(e.browser)}).map(function(e){var t=r.browsers.prefix(e.browser);if(e.note){return t+" "+e.note}else{return t}});o=r.sort(h.uniq(o));if(r.options.flexbox==="no-2009"){o=o.filter(function(e){return!e.includes("2009")})}var a=i.browsers.map(function(e){return r.browsers.prefix(e)});if(i.mistakes){a=a.concat(i.mistakes)}a=a.concat(s);a=h.uniq(a);if(o.length){t.add[n]=o;if(o.length=f.length)break;v=f[B++]}else{B=f.next();if(B.done)break;v=B.value}var d=v;if(!r[d]){r[d]={values:[]}}r[d].values.push(a)}}else{var b=r[t]&&r[t].values||[];r[t]=i.load(t,n,this);r[t].values=b}}}var y={selectors:[]};for(var g in e.remove){var m=e.remove[g];if(this.data[g].selector){var C=c.load(g,m);for(var w=m,S=Array.isArray(w),O=0,w=S?w:w[Symbol.iterator]();;){var T;if(S){if(O>=w.length)break;T=w[O++]}else{O=w.next();if(O.done)break;T=O.value}var E=T;y.selectors.push(C.old(E))}}else if(g==="@keyframes"||g==="@viewport"){for(var k=m,P=Array.isArray(k),D=0,k=P?k:k[Symbol.iterator]();;){var A;if(P){if(D>=k.length)break;A=k[D++]}else{D=k.next();if(D.done)break;A=D.value}var R=A;var F="@"+R+g.slice(1);y[F]={remove:true}}}else if(g==="@resolution"){y[g]=new o(g,m,this)}else{var x=this.data[g].props;if(x){var j=p.load(g,[],this);for(var I=m,M=Array.isArray(I),_=0,I=M?I:I[Symbol.iterator]();;){var N;if(M){if(_>=I.length)break;N=I[_++]}else{_=I.next();if(_.done)break;N=_.value}var L=N;var q=j.old(L);if(q){for(var G=x,U=Array.isArray(G),J=0,G=U?G:G[Symbol.iterator]();;){var W;if(U){if(J>=G.length)break;W=G[J++]}else{J=G.next();if(J.done)break;W=J.value}var Q=W;if(!y[Q]){y[Q]={}}if(!y[Q].values){y[Q].values=[]}y[Q].values.push(q)}}}}else{for(var H=m,K=Array.isArray(H),Y=0,H=K?H:H[Symbol.iterator]();;){var z;if(K){if(Y>=H.length)break;z=H[Y++]}else{Y=H.next();if(Y.done)break;z=Y.value}var $=z;var X=this.decl(g).old(g,$);if(g==="align-self"){var Z=r[g]&&r[g].prefixes;if(Z){if($==="-webkit- 2009"&&Z.includes("-webkit-")){continue}else if($==="-webkit-"&&Z.includes("-webkit- 2009")){continue}}}for(var V=X,ee=Array.isArray(V),re=0,V=ee?V:V[Symbol.iterator]();;){var te;if(ee){if(re>=V.length)break;te=V[re++]}else{re=V.next();if(re.done)break;te=re.value}var ne=te;if(!y[ne]){y[ne]={}}y[ne].remove=true}}}}}return[r,y]};e.decl=function decl(e){var decl=B[e];if(decl){return decl}else{B[e]=i.load(e);return B[e]}};e.unprefixed=function unprefixed(e){var r=this.normalize(n.unprefixed(e));if(r==="flex-direction"){r="flex-flow"}return r};e.normalize=function normalize(e){return this.decl(e).normalize(e)};e.prefixed=function prefixed(e,r){e=n.unprefixed(e);return this.decl(e).prefixed(e,r)};e.values=function values(e,r){var t=this[e];var n=t["*"]&&t["*"].values;var values=t[r]&&t[r].values;if(n&&values){return h.uniq(n.concat(values))}else{return n||values||[]}};e.group=function group(e){var r=this;var t=e.parent;var n=t.index(e);var i=t.nodes.length;var o=this.unprefixed(e.prop);var s=function checker(e,s){n+=e;while(n>=0&&n{"use strict";var n=t(23);var i=t(1882);var o=t(5224).insertAreas;var s=/(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i;var a=/(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i;var u=/(!\s*)?autoprefixer:\s*ignore\s+next/i;var f=/(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i;var c=["width","height","min-width","max-width","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size"];function hasGridTemplate(e){return e.parent.some(function(e){return e.prop==="grid-template"||e.prop==="grid-template-areas"})}function hasRowsAndColumns(e){var r=e.parent.some(function(e){return e.prop==="grid-template-rows"});var t=e.parent.some(function(e){return e.prop==="grid-template-columns"});return r&&t}var l=function(){function Processor(e){this.prefixes=e}var e=Processor.prototype;e.add=function add(e,r){var t=this;var u=this.prefixes.add["@resolution"];var f=this.prefixes.add["@keyframes"];var l=this.prefixes.add["@viewport"];var p=this.prefixes.add["@supports"];e.walkAtRules(function(e){if(e.name==="keyframes"){if(!t.disabled(e,r)){return f&&f.process(e)}}else if(e.name==="viewport"){if(!t.disabled(e,r)){return l&&l.process(e)}}else if(e.name==="supports"){if(t.prefixes.options.supports!==false&&!t.disabled(e,r)){return p.process(e)}}else if(e.name==="media"&&e.params.includes("-resolution")){if(!t.disabled(e,r)){return u&&u.process(e)}}return undefined});e.walkRules(function(e){if(t.disabled(e,r))return undefined;return t.prefixes.add.selectors.map(function(t){return t.process(e,r)})});function insideGrid(e){return e.parent.nodes.some(function(e){if(e.type!=="decl")return false;var r=e.prop==="display"&&/(inline-)?grid/.test(e.value);var t=e.prop.startsWith("grid-template");var n=/^grid-([A-z]+-)?gap/.test(e.prop);return r||t||n})}function insideFlex(e){return e.parent.some(function(e){return e.prop==="display"&&/(inline-)?flex/.test(e.value)})}var h=this.gridStatus(e,r)&&this.prefixes.add["grid-area"]&&this.prefixes.add["grid-area"].prefixes;e.walkDecls(function(e){if(t.disabledDecl(e,r))return undefined;var i=e.parent;var o=e.prop;var u=e.value;if(o==="grid-row-span"){r.warn("grid-row-span is not part of final Grid Layout. Use grid-row.",{node:e});return undefined}else if(o==="grid-column-span"){r.warn("grid-column-span is not part of final Grid Layout. Use grid-column.",{node:e});return undefined}else if(o==="display"&&u==="box"){r.warn("You should write display: flex by final spec "+"instead of display: box",{node:e});return undefined}else if(o==="text-emphasis-position"){if(u==="under"||u==="over"){r.warn("You should use 2 values for text-emphasis-position "+"For example, `under left` instead of just `under`.",{node:e})}}else if(/^(align|justify|place)-(items|content)$/.test(o)&&insideFlex(e)){if(u==="start"||u==="end"){r.warn(u+" value has mixed support, consider using "+("flex-"+u+" instead"),{node:e})}}else if(o==="text-decoration-skip"&&u==="ink"){r.warn("Replace text-decoration-skip: ink to "+"text-decoration-skip-ink: auto, because spec had been changed",{node:e})}else{if(h){if(/^(align|justify|place)-items$/.test(o)&&insideGrid(e)){var f=o.replace("-items","-self");r.warn("IE does not support "+o+" on grid containers. "+("Try using "+f+" on child elements instead: ")+(e.parent.selector+" > * { "+f+": "+e.value+" }"),{node:e})}else if(/^(align|justify|place)-content$/.test(o)&&insideGrid(e)){r.warn("IE does not support "+e.prop+" on grid containers",{node:e})}else if(o==="display"&&e.value==="contents"){r.warn("Please do not use display: contents; "+"if you have grid setting enabled",{node:e});return undefined}else if(e.prop==="grid-gap"){var l=t.gridStatus(e,r);if(l==="autoplace"&&!hasRowsAndColumns(e)&&!hasGridTemplate(e)){r.warn("grid-gap only works if grid-template(-areas) is being "+"used or both rows and columns have been declared "+"and cells have not been manually "+"placed inside the explicit grid",{node:e})}else if((l===true||l==="no-autoplace")&&!hasGridTemplate(e)){r.warn("grid-gap only works if grid-template(-areas) is being used",{node:e})}}else if(o==="grid-auto-columns"){r.warn("grid-auto-columns is not supported by IE",{node:e});return undefined}else if(o==="grid-auto-rows"){r.warn("grid-auto-rows is not supported by IE",{node:e});return undefined}else if(o==="grid-auto-flow"){var p=i.some(function(e){return e.prop==="grid-template-rows"});var B=i.some(function(e){return e.prop==="grid-template-columns"});if(hasGridTemplate(e)){r.warn("grid-auto-flow is not supported by IE",{node:e})}else if(u.includes("dense")){r.warn("grid-auto-flow: dense is not supported by IE",{node:e})}else if(!p&&!B){r.warn("grid-auto-flow works only if grid-template-rows and "+"grid-template-columns are present in the same rule",{node:e})}return undefined}else if(u.includes("auto-fit")){r.warn("auto-fit value is not supported by IE",{node:e,word:"auto-fit"});return undefined}else if(u.includes("auto-fill")){r.warn("auto-fill value is not supported by IE",{node:e,word:"auto-fill"});return undefined}else if(o.startsWith("grid-template")&&u.includes("[")){r.warn("Autoprefixer currently does not support line names. "+"Try using grid-template-areas instead.",{node:e,word:"["})}}if(u.includes("radial-gradient")){if(a.test(e.value)){r.warn("Gradient has outdated direction syntax. "+"New syntax is like `closest-side at 0 0` "+"instead of `0 0, closest-side`.",{node:e})}else{var v=n(u);for(var d=v.nodes,b=Array.isArray(d),y=0,d=b?d:d[Symbol.iterator]();;){var g;if(b){if(y>=d.length)break;g=d[y++]}else{y=d.next();if(y.done)break;g=y.value}var m=g;if(m.type==="function"&&m.value==="radial-gradient"){for(var C=m.nodes,w=Array.isArray(C),S=0,C=w?C:C[Symbol.iterator]();;){var O;if(w){if(S>=C.length)break;O=C[S++]}else{S=C.next();if(S.done)break;O=S.value}var T=O;if(T.type==="word"){if(T.value==="cover"){r.warn("Gradient has outdated direction syntax. "+"Replace `cover` to `farthest-corner`.",{node:e})}else if(T.value==="contain"){r.warn("Gradient has outdated direction syntax. "+"Replace `contain` to `closest-side`.",{node:e})}}}}}}}if(u.includes("linear-gradient")){if(s.test(u)){r.warn("Gradient has outdated direction syntax. "+"New syntax is like `to left` instead of `right`.",{node:e})}}}if(c.includes(e.prop)){if(!e.value.includes("-fill-available")){if(e.value.includes("fill-available")){r.warn("Replace fill-available to stretch, "+"because spec had been changed",{node:e})}else if(e.value.includes("fill")){var E=n(u);if(E.nodes.some(function(e){return e.type==="word"&&e.value==="fill"})){r.warn("Replace fill to stretch, because spec had been changed",{node:e})}}}}var k;if(e.prop==="transition"||e.prop==="transition-property"){return t.prefixes.transition.add(e,r)}else if(e.prop==="align-self"){var P=t.displayType(e);if(P!=="grid"&&t.prefixes.options.flexbox!==false){k=t.prefixes.add["align-self"];if(k&&k.prefixes){k.process(e)}}if(P!=="flex"&&t.gridStatus(e,r)!==false){k=t.prefixes.add["grid-row-align"];if(k&&k.prefixes){return k.process(e,r)}}}else if(e.prop==="justify-self"){var D=t.displayType(e);if(D!=="flex"&&t.gridStatus(e,r)!==false){k=t.prefixes.add["grid-column-align"];if(k&&k.prefixes){return k.process(e,r)}}}else if(e.prop==="place-self"){k=t.prefixes.add["place-self"];if(k&&k.prefixes&&t.gridStatus(e,r)!==false){return k.process(e,r)}}else{k=t.prefixes.add[e.prop];if(k&&k.prefixes){return k.process(e,r)}}return undefined});if(this.gridStatus(e,r)){o(e,this.disabled)}return e.walkDecls(function(e){if(t.disabledValue(e,r))return;var n=t.prefixes.unprefixed(e.prop);var o=t.prefixes.values("add",n);if(Array.isArray(o)){for(var s=o,a=Array.isArray(s),u=0,s=a?s:s[Symbol.iterator]();;){var f;if(a){if(u>=s.length)break;f=s[u++]}else{u=s.next();if(u.done)break;f=u.value}var c=f;if(c.process)c.process(e,r)}}i.save(t.prefixes,e)})};e.remove=function remove(e,r){var t=this;var n=this.prefixes.remove["@resolution"];e.walkAtRules(function(e,i){if(t.prefixes.remove["@"+e.name]){if(!t.disabled(e,r)){e.parent.removeChild(i)}}else if(e.name==="media"&&e.params.includes("-resolution")&&n){n.clean(e)}});var i=function _loop(){if(s){if(a>=o.length)return"break";u=o[a++]}else{a=o.next();if(a.done)return"break";u=a.value}var n=u;e.walkRules(function(e,i){if(n.check(e)){if(!t.disabled(e,r)){e.parent.removeChild(i)}}})};for(var o=this.prefixes.remove.selectors,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;var f=i();if(f==="break")break}return e.walkDecls(function(e,n){if(t.disabled(e,r))return;var i=e.parent;var o=t.prefixes.unprefixed(e.prop);if(e.prop==="transition"||e.prop==="transition-property"){t.prefixes.transition.remove(e)}if(t.prefixes.remove[e.prop]&&t.prefixes.remove[e.prop].remove){var s=t.prefixes.group(e).down(function(e){return t.prefixes.normalize(e.prop)===o});if(o==="flex-flow"){s=true}if(e.prop==="-webkit-box-orient"){var a={"flex-direction":true,"flex-flow":true};if(!e.parent.some(function(e){return a[e.prop]}))return}if(s&&!t.withHackValue(e)){if(e.raw("before").includes("\n")){t.reduceSpaces(e)}i.removeChild(n);return}}for(var u=t.prefixes.values("remove",o),f=Array.isArray(u),c=0,u=f?u:u[Symbol.iterator]();;){var l;if(f){if(c>=u.length)break;l=u[c++]}else{c=u.next();if(c.done)break;l=c.value}var p=l;if(!p.check)continue;if(!p.check(e.value))continue;o=p.unprefixed;var h=t.prefixes.group(e).down(function(e){return e.value.includes(o)});if(h){i.removeChild(n);return}}})};e.withHackValue=function withHackValue(e){return e.prop==="-webkit-background-clip"&&e.value==="text"};e.disabledValue=function disabledValue(e,r){if(this.gridStatus(e,r)===false&&e.type==="decl"){if(e.prop==="display"&&e.value.includes("grid")){return true}}if(this.prefixes.options.flexbox===false&&e.type==="decl"){if(e.prop==="display"&&e.value.includes("flex")){return true}}return this.disabled(e,r)};e.disabledDecl=function disabledDecl(e,r){if(this.gridStatus(e,r)===false&&e.type==="decl"){if(e.prop.includes("grid")||e.prop==="justify-items"){return true}}if(this.prefixes.options.flexbox===false&&e.type==="decl"){var t=["order","justify-content","align-items","align-content"];if(e.prop.includes("flex")||t.includes(e.prop)){return true}}return this.disabled(e,r)};e.disabled=function disabled(e,r){if(!e)return false;if(e._autoprefixerDisabled!==undefined){return e._autoprefixerDisabled}if(e.parent){var t=e.prev();if(t&&t.type==="comment"&&u.test(t.text)){e._autoprefixerDisabled=true;e._autoprefixerSelfDisabled=true;return true}}var n=null;if(e.nodes){var i;e.each(function(e){if(e.type!=="comment")return;if(/(!\s*)?autoprefixer:\s*(off|on)/i.test(e.text)){if(typeof i!=="undefined"){r.warn("Second Autoprefixer control comment "+"was ignored. Autoprefixer applies control "+"comment to whole block, not to next rules.",{node:e})}else{i=/on/i.test(e.text)}}});if(i!==undefined){n=!i}}if(!e.nodes||n===null){if(e.parent){var o=this.disabled(e.parent,r);if(e.parent._autoprefixerSelfDisabled===true){n=false}else{n=o}}else{n=false}}e._autoprefixerDisabled=n;return n};e.reduceSpaces=function reduceSpaces(e){var r=false;this.prefixes.group(e).up(function(){r=true;return true});if(r){return}var t=e.raw("before").split("\n");var n=t[t.length-1].length;var i=false;this.prefixes.group(e).down(function(e){t=e.raw("before").split("\n");var r=t.length-1;if(t[r].length>n){if(i===false){i=t[r].length-n}t[r]=t[r].slice(0,-i);e.raws.before=t.join("\n")}})};e.displayType=function displayType(e){for(var r=e.parent.nodes,t=Array.isArray(r),n=0,r=t?r:r[Symbol.iterator]();;){var i;if(t){if(n>=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;if(o.prop!=="display"){continue}if(o.value.includes("flex")){return"flex"}if(o.value.includes("grid")){return"grid"}}return false};e.gridStatus=function gridStatus(e,r){if(!e)return false;if(e._autoprefixerGridStatus!==undefined){return e._autoprefixerGridStatus}var t=null;if(e.nodes){var n;e.each(function(e){if(e.type!=="comment")return;if(f.test(e.text)){var t=/:\s*autoplace/i.test(e.text);var i=/no-autoplace/i.test(e.text);if(typeof n!=="undefined"){r.warn("Second Autoprefixer grid control comment was "+"ignored. Autoprefixer applies control comments to the whole "+"block, not to the next rules.",{node:e})}else if(t){n="autoplace"}else if(i){n=true}else{n=/on/i.test(e.text)}}});if(n!==undefined){t=n}}if(e.type==="atrule"&&e.name==="supports"){var i=e.params;if(i.includes("grid")&&i.includes("auto")){t=false}}if(!e.nodes||t===null){if(e.parent){var o=this.gridStatus(e.parent,r);if(e.parent._autoprefixerSelfDisabled===true){t=false}else{t=o}}else if(typeof this.prefixes.options.grid!=="undefined"){t=this.prefixes.options.grid}else if(typeof process.env.AUTOPREFIXER_GRID!=="undefined"){if(process.env.AUTOPREFIXER_GRID==="autoplace"){t="autoplace"}else{t=true}}else{t=false}}e._autoprefixerGridStatus=t;return t};return Processor}();e.exports=l},9514:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=t.length)break;s=t[i++]}else{i=t.next();if(i.done)break;s=i.value}var a=s;this.bad.push(this.prefixName(a,"min"));this.bad.push(this.prefixName(a,"max"))}}e.params=o.editList(e.params,function(e){return e.filter(function(e){return r.bad.every(function(r){return!e.includes(r)})})})};r.process=function process(e){var r=this;var t=this.parentPrefix(e);var n=t?[t]:this.prefixes;e.params=o.editList(e.params,function(e,t){for(var i=e,u=Array.isArray(i),f=0,i=u?i:i[Symbol.iterator]();;){var c;if(u){if(f>=i.length)break;c=i[f++]}else{f=i.next();if(f.done)break;c=f.value}var l=c;if(!l.includes("min-resolution")&&!l.includes("max-resolution")){t.push(l);continue}var p=function _loop(){if(B){if(v>=h.length)return"break";d=h[v++]}else{v=h.next();if(v.done)return"break";d=v.value}var e=d;var n=l.replace(s,function(t){var n=t.match(a);return r.prefixQuery(e,n[1],n[2],n[3],n[4])});t.push(n)};for(var h=n,B=Array.isArray(h),v=0,h=B?h:h[Symbol.iterator]();;){var d;var b=p();if(b==="break")break}t.push(l)}return o.uniq(t)})};return Resolution}(i);e.exports=u},4806:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=s.length)return"break";f=s[u++]}else{u=s.next();if(u.done)return"break";f=u.value}var e=f;prefixeds[e]=n.map(function(t){return r.replace(t,e)}).join(", ")};for(var s=this.possible(),a=Array.isArray(s),u=0,s=a?s:s[Symbol.iterator]();;){var f;var c=o();if(c==="break")break}}else{for(var l=this.possible(),p=Array.isArray(l),h=0,l=p?l:l[Symbol.iterator]();;){var B;if(p){if(h>=l.length)break;B=l[h++]}else{h=l.next();if(h.done)break;B=h.value}var v=B;prefixeds[v]=this.replace(e.selector,v)}}e._autoprefixerPrefixeds[this.name]=prefixeds;return e._autoprefixerPrefixeds};r.already=function already(e,r,t){var n=e.parent.index(e)-1;while(n>=0){var i=e.parent.nodes[n];if(i.type!=="rule"){return false}var o=false;for(var s in r[this.name]){var a=r[this.name][s];if(i.selector===a){if(t===s){return true}else{o=true;break}}}if(!o){return false}n-=1}return false};r.replace=function replace(e,r){return e.replace(this.regexp(),"$1"+this.prefixed(r))};r.add=function add(e,r){var t=this.prefixeds(e);if(this.already(e,t,r)){return}var n=this.clone(e,{selector:t[this.name][r]});e.parent.insertBefore(e,n)};r.old=function old(e){return new o(this,e)};return Selector}(s);e.exports=f},3817:(e,r,t)=>{"use strict";var n=t(4633);var i=t(4338).feature(t(6944));var o=t(2319);var s=t(6689);var a=t(1882);var u=t(772);var f=[];for(var c in i.stats){var l=i.stats[c];for(var p in l){var h=l[p];if(/y/.test(h)){f.push(c+" "+p)}}}var B=function(){function Supports(e,r){this.Prefixes=e;this.all=r}var e=Supports.prototype;e.prefixer=function prefixer(){if(this.prefixerCache){return this.prefixerCache}var e=this.all.browsers.selected.filter(function(e){return f.includes(e)});var r=new o(this.all.browsers.data,e,this.all.options);this.prefixerCache=new this.Prefixes(this.all.data,r,this.all.options);return this.prefixerCache};e.parse=function parse(e){var r=e.split(":");var t=r[0];var n=r[1];if(!n)n="";return[t.trim(),n.trim()]};e.virtual=function virtual(e){var r=this.parse(e),t=r[0],i=r[1];var o=n.parse("a{}").first;o.append({prop:t,value:i,raws:{before:""}});return o};e.prefixed=function prefixed(e){var r=this.virtual(e);if(this.disabled(r.first)){return r.nodes}var t={warn:function warn(){return null}};var n=this.prefixer().add[r.first.prop];n&&n.process&&n.process(r.first,t);for(var i=r.nodes,o=Array.isArray(i),s=0,i=o?i:i[Symbol.iterator]();;){var u;if(o){if(s>=i.length)break;u=i[s++]}else{s=i.next();if(s.done)break;u=s.value}var f=u;for(var c=this.prefixer().values("add",r.first.prop),l=Array.isArray(c),p=0,c=l?c:c[Symbol.iterator]();;){var h;if(l){if(p>=c.length)break;h=c[p++]}else{p=c.next();if(p.done)break;h=p.value}var B=h;B.process(f)}a.save(this.all,f)}return r.nodes};e.isNot=function isNot(e){return typeof e==="string"&&/not\s*/i.test(e)};e.isOr=function isOr(e){return typeof e==="string"&&/\s*or\s*/i.test(e)};e.isProp=function isProp(e){return typeof e==="object"&&e.length===1&&typeof e[0]==="string"};e.isHack=function isHack(e,r){var t=new RegExp("(\\(|\\s)"+u.escapeRegexp(r)+":");return!t.test(e)};e.toRemove=function toRemove(e,r){var t=this.parse(e),n=t[0],i=t[1];var o=this.all.unprefixed(n);var s=this.all.cleaner();if(s.remove[n]&&s.remove[n].remove&&!this.isHack(r,o)){return true}for(var a=s.values("remove",o),u=Array.isArray(a),f=0,a=u?a:a[Symbol.iterator]();;){var c;if(u){if(f>=a.length)break;c=a[f++]}else{f=a.next();if(f.done)break;c=f.value}var l=c;if(l.check(i)){return true}}return false};e.remove=function remove(e,r){var t=0;while(t=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;r.push([s.prop+": "+s.value]);r.push(" or ")}r[r.length-1]="";return r};e.normalize=function normalize(e){var r=this;if(typeof e!=="object"){return e}e=e.filter(function(e){return e!==""});if(typeof e[0]==="string"&&e[0].includes(":")){return[s.stringify(e)]}return e.map(function(e){return r.normalize(e)})};e.add=function add(e,r){var t=this;return e.map(function(e){if(t.isProp(e)){var n=t.prefixed(e[0]);if(n.length>1){return t.convert(n)}return e}if(typeof e==="object"){return t.add(e,r)}return e})};e.process=function process(e){var r=s.parse(e.params);r=this.normalize(r);r=this.remove(r,e.params);r=this.add(r,e.params);r=this.cleanBrackets(r);e.params=s.stringify(r)};e.disabled=function disabled(e){if(!this.all.options.grid){if(e.prop==="display"&&e.value.includes("grid")){return true}if(e.prop.includes("grid")||e.prop==="justify-items"){return true}}if(this.all.options.flexbox===false){if(e.prop==="display"&&e.value.includes("flex")){return true}var r=["order","justify-content","align-items","align-content"];if(e.prop.includes("flex")||r.includes(e.prop)){return true}}return false};return Supports}();e.exports=B},7080:(e,r,t)=>{"use strict";function _defineProperty(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}var n=t(23);var i=t(4633).vendor;var o=t(4633).list;var s=t(2319);var a=function(){function Transition(e){_defineProperty(this,"props",["transition","transition-property"]);this.prefixes=e}var e=Transition.prototype;e.add=function add(e,r){var t=this;var n,i;var add=this.prefixes.add[e.prop];var o=this.ruleVendorPrefixes(e);var s=o||add&&add.prefixes||[];var a=this.parse(e.value);var u=a.map(function(e){return t.findProp(e)});var f=[];if(u.some(function(e){return e[0]==="-"})){return}for(var c=a,l=Array.isArray(c),p=0,c=l?c:c[Symbol.iterator]();;){var h;if(l){if(p>=c.length)break;h=c[p++]}else{p=c.next();if(p.done)break;h=p.value}var B=h;i=this.findProp(B);if(i[0]==="-")continue;var v=this.prefixes.add[i];if(!v||!v.prefixes)continue;for(var d=v.prefixes,b=Array.isArray(d),y=0,d=b?d:d[Symbol.iterator]();;){if(b){if(y>=d.length)break;n=d[y++]}else{y=d.next();if(y.done)break;n=y.value}if(o&&!o.some(function(e){return n.includes(e)})){continue}var g=this.prefixes.prefixed(i,n);if(g!=="-ms-transform"&&!u.includes(g)){if(!this.disabled(i,n)){f.push(this.clone(i,g,B))}}}}a=a.concat(f);var m=this.stringify(a);var C=this.stringify(this.cleanFromUnprefixed(a,"-webkit-"));if(s.includes("-webkit-")){this.cloneBefore(e,"-webkit-"+e.prop,C)}this.cloneBefore(e,e.prop,C);if(s.includes("-o-")){var w=this.stringify(this.cleanFromUnprefixed(a,"-o-"));this.cloneBefore(e,"-o-"+e.prop,w)}for(var S=s,O=Array.isArray(S),T=0,S=O?S:S[Symbol.iterator]();;){if(O){if(T>=S.length)break;n=S[T++]}else{T=S.next();if(T.done)break;n=T.value}if(n!=="-webkit-"&&n!=="-o-"){var E=this.stringify(this.cleanOtherPrefixes(a,n));this.cloneBefore(e,n+e.prop,E)}}if(m!==e.value&&!this.already(e,e.prop,m)){this.checkForWarning(r,e);e.cloneBefore();e.value=m}};e.findProp=function findProp(e){var r=e[0].value;if(/^\d/.test(r)){for(var t=e.entries(),n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(i>=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o,a=s[0],u=s[1];if(a!==0&&u.type==="word"){return u.value}}}return r};e.already=function already(e,r,t){return e.parent.some(function(e){return e.prop===r&&e.value===t})};e.cloneBefore=function cloneBefore(e,r,t){if(!this.already(e,r,t)){e.cloneBefore({prop:r,value:t})}};e.checkForWarning=function checkForWarning(e,r){if(r.prop!=="transition-property"){return}r.parent.each(function(t){if(t.type!=="decl"){return undefined}if(t.prop.indexOf("transition-")!==0){return undefined}if(t.prop==="transition-property"){return undefined}if(o.comma(t.value).length>1){r.warn(e,"Replace transition-property to transition, "+"because Autoprefixer could not support "+"any cases of transition-property "+"and other transition-*")}return false})};e.remove=function remove(e){var r=this;var t=this.parse(e.value);t=t.filter(function(e){var t=r.prefixes.remove[r.findProp(e)];return!t||!t.remove});var n=this.stringify(t);if(e.value===n){return}if(t.length===0){e.remove();return}var i=e.parent.some(function(r){return r.prop===e.prop&&r.value===n});var o=e.parent.some(function(r){return r!==e&&r.prop===e.prop&&r.value.length>n.length});if(i||o){e.remove();return}e.value=n};e.parse=function parse(e){var r=n(e);var t=[];var i=[];for(var o=r.nodes,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;i.push(f);if(f.type==="div"&&f.value===","){t.push(i);i=[]}}t.push(i);return t.filter(function(e){return e.length>0})};e.stringify=function stringify(e){if(e.length===0){return""}var r=[];for(var t=e,i=Array.isArray(t),o=0,t=i?t:t[Symbol.iterator]();;){var s;if(i){if(o>=t.length)break;s=t[o++]}else{o=t.next();if(o.done)break;s=o.value}var a=s;if(a[a.length-1].type!=="div"){a.push(this.div(e))}r=r.concat(a)}if(r[0].type==="div"){r=r.slice(1)}if(r[r.length-1].type==="div"){r=r.slice(0,+-2+1||0)}return n.stringify({nodes:r})};e.clone=function clone(e,r,t){var n=[];var i=false;for(var o=t,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;if(!i&&f.type==="word"&&f.value===e){n.push({type:"word",value:r});i=true}else{n.push(f)}}return n};e.div=function div(e){for(var r=e,t=Array.isArray(r),n=0,r=t?r:r[Symbol.iterator]();;){var i;if(t){if(n>=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;for(var s=o,a=Array.isArray(s),u=0,s=a?s:s[Symbol.iterator]();;){var f;if(a){if(u>=s.length)break;f=s[u++]}else{u=s.next();if(u.done)break;f=u.value}var c=f;if(c.type==="div"&&c.value===","){return c}}}return{type:"div",value:",",after:" "}};e.cleanOtherPrefixes=function cleanOtherPrefixes(e,r){var t=this;return e.filter(function(e){var n=i.prefix(t.findProp(e));return n===""||n===r})};e.cleanFromUnprefixed=function cleanFromUnprefixed(e,r){var t=this;var n=e.map(function(e){return t.findProp(e)}).filter(function(e){return e.slice(0,r.length)===r}).map(function(e){return t.prefixes.unprefixed(e)});var o=[];for(var s=e,a=Array.isArray(s),u=0,s=a?s:s[Symbol.iterator]();;){var f;if(a){if(u>=s.length)break;f=s[u++]}else{u=s.next();if(u.done)break;f=u.value}var c=f;var l=this.findProp(c);var p=i.prefix(l);if(!n.includes(l)&&(p===r||p==="")){o.push(c)}}return o};e.disabled=function disabled(e,r){var t=["order","justify-content","align-self","align-content"];if(e.includes("flex")||t.includes(e)){if(this.prefixes.options.flexbox===false){return true}if(this.prefixes.options.flexbox==="no-2009"){return r.includes("2009")}}return undefined};e.ruleVendorPrefixes=function ruleVendorPrefixes(e){var r=e.parent;if(r.type!=="rule"){return false}else if(!r.selector.includes(":-")){return false}var t=s.prefixes().filter(function(e){return r.selector.includes(":"+e)});return t.length>0?t:false};return Transition}();e.exports=a},772:(e,r,t)=>{"use strict";var n=t(4633).list;e.exports={error:function error(e){var r=new Error(e);r.autoprefixer=true;throw r},uniq:function uniq(e){var r=[];for(var t=e,n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(i>=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;if(!r.includes(s)){r.push(s)}}return r},removeNote:function removeNote(e){if(!e.includes(" ")){return e}return e.split(" ")[0]},escapeRegexp:function escapeRegexp(e){return e.replace(/[$()*+-.?[\\\]^{|}]/g,"\\$&")},regexp:function regexp(e,r){if(r===void 0){r=true}if(r){e=this.escapeRegexp(e)}return new RegExp("(^|[\\s,(])("+e+"($|[\\s(,]))","gi")},editList:function editList(e,r){var t=n.comma(e);var i=r(t,[]);if(t===i){return e}var o=e.match(/,\s*/);o=o?o[0]:", ";return i.join(o)},splitSelector:function splitSelector(e){return n.comma(e).map(function(e){return n.space(e).map(function(e){return e.split(/(?=\.|#)/g)})})}}},1882:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{var n=t(2731);var i=t(2355);var o=t(3856);function ValueParser(e){if(this instanceof ValueParser){this.nodes=n(e);return this}return new ValueParser(e)}ValueParser.prototype.toString=function(){return Array.isArray(this.nodes)?o(this.nodes):""};ValueParser.prototype.walk=function(e,r){i(this.nodes,e,r);return this};ValueParser.unit=t(2137);ValueParser.walk=i;ValueParser.stringify=o;e.exports=ValueParser},2731:e=>{var r="(".charCodeAt(0);var t=")".charCodeAt(0);var n="'".charCodeAt(0);var i='"'.charCodeAt(0);var o="\\".charCodeAt(0);var s="/".charCodeAt(0);var a=",".charCodeAt(0);var u=":".charCodeAt(0);var f="*".charCodeAt(0);var c="u".charCodeAt(0);var l="U".charCodeAt(0);var p="+".charCodeAt(0);var h=/^[a-f0-9?-]+$/i;e.exports=function(e){var B=[];var v=e;var d,b,y,g,m,C,w,S;var O=0;var T=v.charCodeAt(O);var E=v.length;var k=[{nodes:B}];var P=0;var D;var A="";var R="";var F="";while(O{function stringifyNode(e,r){var t=e.type;var n=e.value;var i;var o;if(r&&(o=r(e))!==undefined){return o}else if(t==="word"||t==="space"){return n}else if(t==="string"){i=e.quote||"";return i+n+(e.unclosed?"":i)}else if(t==="comment"){return"/*"+n+(e.unclosed?"":"*/")}else if(t==="div"){return(e.before||"")+n+(e.after||"")}else if(Array.isArray(e.nodes)){i=stringify(e.nodes,r);if(t!=="function"){return i}return n+"("+(e.before||"")+i+(e.after||"")+(e.unclosed?"":")")}return n}function stringify(e,r){var t,n;if(Array.isArray(e)){t="";for(n=e.length-1;~n;n-=1){t=stringifyNode(e[n],r)+t}return t}return stringifyNode(e,r)}e.exports=stringify},2137:e=>{var r="-".charCodeAt(0);var t="+".charCodeAt(0);var n=".".charCodeAt(0);var i="e".charCodeAt(0);var o="E".charCodeAt(0);function likeNumber(e){var i=e.charCodeAt(0);var o;if(i===t||i===r){o=e.charCodeAt(1);if(o>=48&&o<=57){return true}var s=e.charCodeAt(2);if(o===n&&s>=48&&s<=57){return true}return false}if(i===n){o=e.charCodeAt(1);if(o>=48&&o<=57){return true}return false}if(i>=48&&i<=57){return true}return false}e.exports=function(e){var s=0;var a=e.length;var u;var f;var c;if(a===0||!likeNumber(e)){return false}u=e.charCodeAt(s);if(u===t||u===r){s++}while(s57){break}s+=1}u=e.charCodeAt(s);f=e.charCodeAt(s+1);if(u===n&&f>=48&&f<=57){s+=2;while(s57){break}s+=1}}u=e.charCodeAt(s);f=e.charCodeAt(s+1);c=e.charCodeAt(s+2);if((u===i||u===o)&&(f>=48&&f<=57||(f===t||f===r)&&c>=48&&c<=57)){s+=f===t||f===r?3:2;while(s57){break}s+=1}}return{number:e.slice(0,s),unit:e.slice(s)}}},2355:e=>{e.exports=function walk(e,r,t){var n,i,o,s;for(n=0,i=e.length;n{"use strict";e.exports=balanced;function balanced(e,r,t){if(e instanceof RegExp)e=maybeMatch(e,t);if(r instanceof RegExp)r=maybeMatch(r,t);var n=range(e,r,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+e.length,n[1]),post:t.slice(n[1]+r.length)}}function maybeMatch(e,r){var t=r.match(e);return t?t[0]:null}balanced.range=range;function range(e,r,t){var n,i,o,s,a;var u=t.indexOf(e);var f=t.indexOf(r,u+1);var c=u;if(u>=0&&f>0){n=[];o=t.length;while(c>=0&&!a){if(c==u){n.push(c);u=t.indexOf(e,c+1)}else if(n.length==1){a=[n.pop(),f]}else{i=n.pop();if(i=0?u:f}if(n.length){a=[o,s]}}return a}},1302:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{36:"Y LB M N S T U V",257:"P J K L",548:"C O H"},C:{1:"4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",16:"0 1 2 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",130:"3"},D:{36:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{16:"eB XB",36:"G Z I D F E A B C O H gB hB iB jB YB W Q nB oB"},F:{16:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{16:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{16:"EC"},I:{16:"bB G M FC GC HC IC aB JC KC"},J:{16:"D A"},K:{16:"A B C EB W ZB Q"},L:{16:"V"},M:{16:"N"},N:{16:"A B"},O:{16:"LC"},P:{16:"G MC NC OC PC QC YB RC SC TC"},Q:{16:"UC"},R:{16:"VC"},S:{130:"fB"}},B:1,C:"CSS3 Background-clip: text"}},2259:e=>{e.exports={A:{A:{1:"E A B",2:"I D F mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB",36:"wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",516:"G Z I D F E A B C O H"},E:{1:"D F E A B C O H iB jB YB W Q nB oB",772:"G Z I eB XB gB hB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X rB sB W ZB uB Q",2:"E pB",36:"qB"},G:{1:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",4:"XB vB aB WC",516:"xB"},H:{132:"EC"},I:{1:"M JC KC",36:"FC",516:"bB G IC aB",548:"GC HC"},J:{1:"D A"},K:{1:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 Background-image options"}},9847:e=>{e.exports={A:{A:{1:"B",2:"I D F E A mB"},B:{1:"H P J K L Y LB M N S T U V",129:"C O"},C:{1:"5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",260:"0 1 2 3 4 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",804:"G Z I D F E A B C O H tB wB"},D:{1:"BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",260:"6 7 8 9 AB",388:"0 1 2 3 4 5 l m n o p q r s t u v w x y z",1412:"P J K L a b c d e f g h i j k",1956:"G Z I D F E A B C O H"},E:{129:"A B C O H jB YB W Q nB oB",1412:"I D F E hB iB",1956:"G Z eB XB gB"},F:{1:"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E pB qB",260:"t u v w x",388:"P J K L a b c d e f g h i j k l m n o p q r s",1796:"rB sB",1828:"B C W ZB uB Q"},G:{129:"2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",1412:"F WC zB 0B 1B",1956:"XB vB aB xB"},H:{1828:"EC"},I:{388:"M JC KC",1956:"bB G FC GC HC IC aB"},J:{1412:"A",1924:"D"},K:{1:"EB",2:"A",1828:"B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{1:"B",2:"A"},O:{388:"LC"},P:{1:"OC PC QC YB RC SC TC",260:"MC NC",388:"G"},Q:{260:"UC"},R:{260:"VC"},S:{260:"fB"}},B:4,C:"CSS3 Border images"}},3807:e=>{e.exports={A:{A:{2:"I D F mB",260:"E",516:"A B"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB wB",33:"G Z I D F E A B C O H P"},D:{1:"0 1 2 3 4 5 6 7 8 9 h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L",33:"a b c d e f g"},E:{1:"D F E A B C O H hB iB jB YB W Q nB oB",2:"G Z eB XB gB",33:"I"},F:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q"},G:{1:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB",33:"WC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB",132:"JC KC"},J:{1:"A",2:"D"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"calc() as CSS unit value"}},8252:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G tB wB",33:"Z I D F E A B C O H P"},D:{1:"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x"},E:{1:"E A B C O H jB YB W Q nB oB",2:"eB XB",33:"I D F gB hB iB",292:"G Z"},F:{1:"0 1 2 3 4 5 6 7 8 9 l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E B pB qB rB sB W ZB uB",33:"C P J K L a b c d e f g h i j k"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"F WC zB 0B",164:"XB vB aB xB"},H:{2:"EC"},I:{1:"M",33:"G IC aB JC KC",164:"bB FC GC HC"},J:{33:"D A"},K:{1:"EB Q",2:"A B C W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS Animation"}},1977:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{1:"5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",16:"lB",33:"0 1 2 3 4 bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB"},D:{1:"KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",16:"G Z I D F E A B C O H",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB"},E:{1:"E A B C O H jB YB W Q nB oB",16:"G Z I eB XB gB",33:"D F hB iB"},F:{1:"7 8 9 AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"0 1 2 3 4 5 6 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",16:"XB vB aB xB",33:"F WC zB 0B"},H:{2:"EC"},I:{1:"M",16:"bB G FC GC HC IC aB",33:"JC KC"},J:{16:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{33:"LC"},P:{1:"QC YB RC SC TC",16:"G",33:"MC NC OC PC"},Q:{1:"UC"},R:{1:"VC"},S:{33:"fB"}},B:5,C:"CSS :any-link selector"}},8672:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"S T U V",33:"N",164:"Y LB M",388:"C O H P J K L"},C:{1:"LB M kB N S T U",164:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y",676:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p tB wB"},D:{1:"S T U V yB cB dB",33:"N",164:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M"},E:{164:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",33:"PB GB X",164:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB"},G:{164:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{164:"bB G M FC GC HC IC aB JC KC"},J:{164:"D A"},K:{2:"A B C W ZB Q",164:"EB"},L:{1:"V"},M:{164:"N"},N:{2:"A",388:"B"},O:{164:"LC"},P:{164:"G MC NC OC PC QC YB RC SC TC"},Q:{164:"UC"},R:{164:"VC"},S:{164:"fB"}},B:5,C:"CSS Appearance"}},3613:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J",257:"K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB tB wB",578:"PB GB X WB SB TB UB VB QB Y LB M kB N S T U"},D:{1:"UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",194:"2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB"},E:{2:"G Z I D F eB XB gB hB iB",33:"E A B C O H jB YB W Q nB oB"},F:{1:"JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e f g h i j k l m n o pB qB rB sB W ZB uB Q",194:"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB BB CB DB FB HB IB"},G:{2:"F XB vB aB xB WC zB 0B",33:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{578:"N"},N:{2:"A B"},O:{2:"LC"},P:{1:"SC TC",2:"G",194:"MC NC OC PC QC YB RC"},Q:{194:"UC"},R:{194:"VC"},S:{2:"fB"}},B:7,C:"CSS Backdrop Filter"}},4016:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",164:"Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m tB wB"},D:{2:"G Z I D F E A B C O H P J K L a b c",164:"0 1 2 3 4 5 6 7 8 9 d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I eB XB gB",164:"D F E A B C O H hB iB jB YB W Q nB oB"},F:{2:"E pB qB rB sB",129:"B C W ZB uB Q",164:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB aB xB WC",164:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{132:"EC"},I:{2:"bB G FC GC HC IC aB",164:"M JC KC"},J:{2:"D",164:"A"},K:{2:"A",129:"B C W ZB Q",164:"EB"},L:{164:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{164:"G MC NC OC PC QC YB RC SC TC"},Q:{164:"UC"},R:{164:"VC"},S:{1:"fB"}},B:5,C:"CSS box-decoration-break"}},5861:e=>{e.exports={A:{A:{1:"E A B",2:"I D F mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",33:"tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E"},E:{1:"I D F E A B C O H gB hB iB jB YB W Q nB oB",33:"Z",164:"G eB XB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X rB sB W ZB uB Q",2:"E pB qB"},G:{1:"F xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"vB aB",164:"XB"},H:{2:"EC"},I:{1:"G M IC aB JC KC",164:"bB FC GC HC"},J:{1:"A",33:"D"},K:{1:"B C EB W ZB Q",2:"A"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 Box-shadow"}},147:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K",260:"Y LB M N S T U V",3138:"L"},C:{1:"9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",132:"0 1 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",644:"2 3 4 5 6 7 8"},D:{2:"G Z I D F E A B C O H P J K L a b c d e",260:"AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",292:"0 1 2 3 4 5 6 7 8 9 f g h i j k l m n o p q r s t u v w x y z"},E:{2:"G Z I eB XB gB hB",292:"D F E A B C O H iB jB YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",260:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",292:"P J K L a b c d e f g h i j k l m n o p q r s t u v w"},G:{2:"XB vB aB xB WC",292:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",260:"M",292:"JC KC"},J:{2:"D A"},K:{2:"A B C W ZB Q",260:"EB"},L:{260:"V"},M:{1:"N"},N:{2:"A B"},O:{292:"LC"},P:{292:"G MC NC OC PC QC YB RC SC TC"},Q:{292:"UC"},R:{260:"VC"},S:{644:"fB"}},B:4,C:"CSS clip-path property (for HTML)"}},664:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",33:"Y LB M N S T U V"},C:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"0 1 2 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB"},D:{16:"G Z I D F E A B C O H P J K L",33:"0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z eB XB gB",33:"I D F E A B C O H hB iB jB YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{16:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{16:"bB G M FC GC HC IC aB JC KC"},J:{16:"D A"},K:{2:"A B C EB W ZB Q"},L:{16:"V"},M:{1:"N"},N:{16:"A B"},O:{16:"LC"},P:{16:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{16:"VC"},S:{1:"fB"}},B:5,C:"CSS color-adjust"}},7794:e=>{e.exports={A:{A:{2:"I mB",2340:"D F E A B"},B:{2:"C O H P J K L",1025:"Y LB M N S T U V"},C:{2:"lB bB tB",513:"KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",545:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB wB"},D:{2:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v",1025:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"A B C O H YB W Q nB oB",2:"G Z eB XB gB",164:"I",4644:"D F E hB iB jB"},F:{2:"E B P J K L a b c d e f g h i pB qB rB sB W ZB",545:"C uB Q",1025:"0 1 2 3 4 5 6 7 8 9 j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB",4260:"xB WC",4644:"F zB 0B 1B 2B"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB JC KC",1025:"M"},J:{2:"D",4260:"A"},K:{2:"A B W ZB",545:"C Q",1025:"EB"},L:{1025:"V"},M:{545:"N"},N:{2340:"A B"},O:{1:"LC"},P:{1025:"G MC NC OC PC QC YB RC SC TC"},Q:{1025:"UC"},R:{1025:"VC"},S:{4097:"fB"}},B:7,C:"Crisp edges/pixelated images"}},3323:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",33:"Y LB M N S T U V"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"G Z I D F E A B C O H P J",33:"0 1 2 3 4 5 6 7 8 9 K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"A B C O H YB W Q nB oB",2:"G Z eB XB",33:"I D F E gB hB iB jB"},F:{2:"E B C pB qB rB sB W ZB uB Q",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB",33:"F xB WC zB 0B 1B 2B"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",33:"M JC KC"},J:{2:"D A"},K:{2:"A B C W ZB Q",33:"EB"},L:{33:"V"},M:{2:"N"},N:{2:"A B"},O:{33:"LC"},P:{33:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{33:"VC"},S:{2:"fB"}},B:4,C:"CSS Cross-Fade Function"}},1779:e=>{e.exports={A:{A:{2:"I D F E mB",164:"A B"},B:{66:"Y LB M N S T U V",164:"C O H P J K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"G Z I D F E A B C O H P J K L a b c d e f g h i j",66:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{2:"E B C P J K L a b c d e f g h i j k l m n o p q r s t u pB qB rB sB W ZB uB Q",66:"0 1 2 3 4 5 6 7 8 9 v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{292:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A EB",292:"B C W ZB Q"},L:{2:"V"},M:{2:"N"},N:{164:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{66:"UC"},R:{2:"VC"},S:{2:"fB"}},B:5,C:"CSS Device Adaptation"}},9666:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L Y LB M N S T U V"},C:{33:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",164:"lB bB tB wB"},D:{2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{2:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{2:"V"},M:{33:"N"},N:{2:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{33:"fB"}},B:5,C:"CSS element() function"}},6192:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L Y LB M N S T U V"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"A B C O H jB YB W Q nB oB",2:"G Z I D F eB XB gB hB iB",33:"E"},F:{2:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"F XB vB aB xB WC zB 0B",33:"1B 2B"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{2:"V"},M:{2:"N"},N:{2:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:5,C:"CSS filter() function"}},9237:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",1028:"O H P J K L",1346:"C"},C:{1:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB",196:"p",516:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o wB"},D:{1:"8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K",33:"0 1 2 3 4 5 6 7 L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{1:"A B C O H jB YB W Q nB oB",2:"G Z eB XB gB",33:"I D F E hB iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d e f g h i j k l m n o p q r s t u"},G:{1:"2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB",33:"F WC zB 0B 1B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB",33:"JC KC"},J:{2:"D",33:"A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"OC PC QC YB RC SC TC",33:"G MC NC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS Filter Effects"}},1407:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB",260:"J K L a b c d e f g h i j k l m n o p q",292:"G Z I D F E A B C O H P wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"A B C O H P J K L a b c d e f g",548:"G Z I D F E"},E:{2:"eB XB",260:"D F E A B C O H hB iB jB YB W Q nB oB",292:"I gB",804:"G Z"},F:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E B pB qB rB sB",33:"C uB",164:"W ZB"},G:{260:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",292:"xB WC",804:"XB vB aB"},H:{2:"EC"},I:{1:"M JC KC",33:"G IC aB",548:"bB FC GC HC"},J:{1:"A",548:"D"},K:{1:"EB Q",2:"A B",33:"C",164:"W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS Gradients"}},7776:e=>{e.exports={A:{A:{2:"I D F mB",8:"E",292:"A B"},B:{1:"J K L Y LB M N S T U V",292:"C O H P"},C:{1:"9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L tB wB",8:"a b c d e f g h i j k l m n o p q r s t u",584:"0 1 2 3 4 5 6 v w x y z",1025:"7 8"},D:{1:"DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f",8:"g h i j",200:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB",1025:"CB"},E:{1:"B C O H YB W Q nB oB",2:"G Z eB XB gB",8:"I D F E A hB iB jB"},F:{1:"0 1 2 3 4 5 6 7 8 9 z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e f g h i pB qB rB sB W ZB uB Q",200:"j k l m n o p q r s t u v w x y"},G:{1:"4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB",8:"F WC zB 0B 1B 2B 3B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC",8:"aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{292:"A B"},O:{1:"LC"},P:{1:"NC OC PC QC YB RC SC TC",2:"MC",8:"G"},Q:{1:"UC"},R:{2:"VC"},S:{1:"fB"}},B:4,C:"CSS Grid Layout (level 1)"}},9747:e=>{e.exports={A:{A:{2:"I D F E mB",33:"A B"},B:{33:"C O H P J K L",132:"Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z tB wB",33:"I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x"},D:{1:"yB cB dB",2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",132:"AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V"},E:{2:"G Z eB XB",33:"I D F E A B C O H gB hB iB jB YB W Q nB oB"},F:{2:"E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w pB qB rB sB W ZB uB Q",132:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB",33:"F aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{4:"LC"},P:{1:"NC OC PC QC YB RC SC TC",2:"G",132:"MC"},Q:{2:"UC"},R:{132:"VC"},S:{1:"fB"}},B:5,C:"CSS Hyphenation"}},4197:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",33:"Y LB M N S T U V"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"G Z I D F E A B C O H P J K L a b",33:"0 1 2 3 4 5 6 7 8 9 c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z eB XB gB",33:"I D F E hB iB jB",129:"A B C O H YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB aB xB",33:"F WC zB 0B 1B 2B",129:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",33:"M JC KC"},J:{2:"D",33:"A"},K:{2:"A B C W ZB Q",33:"EB"},L:{33:"V"},M:{2:"N"},N:{2:"A B"},O:{33:"LC"},P:{33:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{33:"VC"},S:{2:"fB"}},B:5,C:"CSS image-set"}},471:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",3588:"Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB",164:"bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v tB wB"},D:{292:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB",2052:"V yB cB dB",3588:"OB PB GB X WB SB TB UB VB QB Y LB M N S T U"},E:{292:"G Z I D F E A B C eB XB gB hB iB jB YB W",2052:"oB",3588:"O H Q nB"},F:{2:"E B C pB qB rB sB W ZB uB Q",292:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB",3588:"BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{292:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B",3588:"8B 9B AC BC CC DC"},H:{2:"EC"},I:{292:"bB G FC GC HC IC aB JC KC",2052:"M"},J:{292:"D A"},K:{2:"A B C W ZB Q",3588:"EB"},L:{2052:"V"},M:{1:"N"},N:{2:"A B"},O:{292:"LC"},P:{292:"G MC NC OC PC QC",3588:"YB RC SC TC"},Q:{3588:"UC"},R:{3588:"VC"},S:{3588:"fB"}},B:5,C:"CSS Logical Properties"}},4613:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J",164:"Y LB M N S T U V",3138:"K",12292:"L"},C:{1:"8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",260:"0 1 2 3 4 5 6 7 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB"},D:{164:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"eB XB",164:"G Z I D F E A B C O H gB hB iB jB YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",164:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{164:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{164:"M JC KC",676:"bB G FC GC HC IC aB"},J:{164:"D A"},K:{2:"A B C W ZB Q",164:"EB"},L:{164:"V"},M:{1:"N"},N:{2:"A B"},O:{164:"LC"},P:{164:"G MC NC OC PC QC YB RC SC TC"},Q:{164:"UC"},R:{164:"VC"},S:{260:"fB"}},B:4,C:"CSS Masks"}},3588:e=>{e.exports={A:{A:{2:"I D F mB",132:"E A B"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",260:"G Z I D F E A B C O H P tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",548:"G Z I D F E A B C O H P J K L a b c d e f g h i j"},E:{2:"eB XB",548:"G Z I D F E A B C O H gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E",548:"B C pB qB rB sB W ZB uB"},G:{16:"XB",548:"F vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{132:"EC"},I:{1:"M JC KC",16:"FC GC",548:"bB G HC IC aB"},J:{548:"D A"},K:{1:"EB Q",548:"A B C W ZB"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:2,C:"Media Queries: resolution feature"}},3043:e=>{e.exports={A:{A:{2:"I D F E mB",132:"A B"},B:{1:"Y LB M N S T U V",132:"C O H P J K",516:"L"},C:{1:"EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB tB wB"},D:{1:"KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB",260:"IB JB"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"7 8 9 AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"0 1 2 3 4 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z pB qB rB sB W ZB uB Q",260:"5 6"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{2:"LC"},P:{1:"PC QC YB RC SC TC",2:"G MC NC OC"},Q:{1:"UC"},R:{2:"VC"},S:{2:"fB"}},B:7,C:"CSS overscroll-behavior"}},5117:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",36:"C O H P J K L"},C:{1:"6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L tB wB",33:"0 1 2 3 4 5 a b c d e f g h i j k l m n o p q r s t u v w x y z"},D:{1:"CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",36:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB"},E:{1:"B C O H YB W Q nB oB",2:"G eB XB",36:"Z I D F E A gB hB iB jB"},F:{1:"0 1 2 3 4 5 6 7 8 9 z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",36:"P J K L a b c d e f g h i j k l m n o p q r s t u v w x y"},G:{1:"4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB",36:"F aB xB WC zB 0B 1B 2B 3B"},H:{2:"EC"},I:{1:"M",36:"bB G FC GC HC IC aB JC KC"},J:{36:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{36:"A B"},O:{1:"LC"},P:{1:"OC PC QC YB RC SC TC",36:"G MC NC"},Q:{1:"UC"},R:{1:"VC"},S:{33:"fB"}},B:5,C:"::placeholder CSS pseudo-element"}},3502:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"O H P J K L Y LB M N S T U V",2:"C"},C:{1:"QB Y LB M kB N S T U",16:"lB",33:"0 1 2 3 4 5 6 7 8 9 bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",16:"G Z I D F E A B C O H",132:"P J K L a b c d e f g h i j k l m n o p q"},E:{1:"E A B C O H jB YB W Q nB oB",16:"eB XB",132:"G Z I D F gB hB iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",16:"E B pB qB rB sB W",132:"C P J K L a b c d ZB uB Q"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",16:"XB vB",132:"F aB xB WC zB 0B"},H:{2:"EC"},I:{1:"M",16:"FC GC",132:"bB G HC IC aB JC KC"},J:{1:"A",132:"D"},K:{1:"EB",2:"A B W",132:"C ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{33:"fB"}},B:1,C:"CSS :read-only and :read-write selectors"}},5969:e=>{e.exports={A:{A:{2:"I D F E mB",420:"A B"},B:{2:"Y LB M N S T U V",420:"C O H P J K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",36:"P J K L",66:"a b c d e f g h i j k l m n o p"},E:{2:"G Z I C O H eB XB gB W Q nB oB",33:"D F E A B hB iB jB YB"},F:{2:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{2:"XB vB aB xB WC 6B 7B 8B 9B AC BC CC DC",33:"F zB 0B 1B 2B 3B 4B 5B"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{2:"V"},M:{2:"N"},N:{420:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:5,C:"CSS Regions"}},3347:e=>{e.exports={A:{A:{1:"E A B",2:"I D F mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q",2:"E"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M JC KC",2:"bB G FC GC HC IC aB"},J:{1:"A",2:"D"},K:{1:"C EB ZB Q",16:"A B W"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{33:"fB"}},B:5,C:"::selection CSS pseudo-element"}},4298:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{1:"HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"0 1 2 3 4 5 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",322:"6 7 8 9 AB BB CB DB EB FB RB"},D:{1:"0 1 2 3 4 5 6 7 8 9 s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o",194:"p q r"},E:{1:"B C O H YB W Q nB oB",2:"G Z I D eB XB gB hB",33:"F E A iB jB"},F:{1:"0 1 2 3 4 5 6 7 8 9 f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e pB qB rB sB W ZB uB Q"},G:{1:"4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB WC zB",33:"F 0B 1B 2B 3B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{2:"fB"}},B:4,C:"CSS Shapes Level 1"}},87:e=>{e.exports={A:{A:{2:"I D F E mB",6308:"A",6436:"B"},B:{1:"Y LB M N S T U V",6436:"C O H P J K L"},C:{1:"NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t tB wB",2052:"0 1 2 3 4 5 6 7 8 9 u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB"},D:{1:"OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB",8258:"R MB NB"},E:{1:"B C O H W Q nB oB",2:"G Z I D F eB XB gB hB iB",3108:"E A jB YB"},F:{1:"JB KB R MB NB OB PB GB X",2:"0 1 2 3 4 5 6 7 8 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z pB qB rB sB W ZB uB Q",8258:"9 AB BB CB DB FB HB IB"},G:{1:"5B 6B 7B 8B 9B AC BC CC DC",2:"F XB vB aB xB WC zB 0B",3108:"1B 2B 3B 4B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{2:"LC"},P:{1:"YB RC SC TC",2:"G MC NC OC PC QC"},Q:{2:"UC"},R:{2:"VC"},S:{2052:"fB"}},B:4,C:"CSS Scroll Snap"}},3727:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P",1028:"Y LB M N S T U V",4100:"J K L"},C:{1:"EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g tB wB",194:"h i j k l m",516:"0 1 2 3 4 5 6 7 8 9 n o p q r s t u v w x y z AB BB CB DB"},D:{2:"0 1 2 3 4 5 6 G Z I D F E A B C O H P J K L a b c d s t u v w x y z",322:"7 8 9 e f g h i j k l m n o p q r AB",1028:"BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"O H nB oB",2:"G Z I eB XB gB",33:"F E A B C iB jB YB W Q",2084:"D hB"},F:{2:"E B C P J K L a b c d e f g h i j k l m n o p q r s t pB qB rB sB W ZB uB Q",322:"u v w",1028:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"9B AC BC CC DC",2:"XB vB aB xB",33:"F 0B 1B 2B 3B 4B 5B 6B 7B 8B",2084:"WC zB"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB JC KC",1028:"M"},J:{2:"D A"},K:{2:"A B C W ZB Q",1028:"EB"},L:{1028:"V"},M:{1:"N"},N:{2:"A B"},O:{1028:"LC"},P:{1:"NC OC PC QC YB RC SC TC",2:"G MC"},Q:{1028:"UC"},R:{2:"VC"},S:{516:"fB"}},B:5,C:"CSS position:sticky"}},9533:e=>{e.exports={A:{A:{132:"I D F E A B mB"},B:{1:"Y LB M N S T U V",4:"C O H P J K L"},C:{1:"4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B tB wB",33:"0 1 2 3 C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},D:{1:"2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p",322:"0 1 q r s t u v w x y z"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c pB qB rB sB W ZB uB Q",578:"d e f g h i j k l m n o"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",2:"G"},Q:{2:"UC"},R:{1:"VC"},S:{33:"fB"}},B:5,C:"CSS3 text-align-last"}},3100:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{1:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s tB wB",194:"t u v"},D:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 2 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{2:"G Z I D F E eB XB gB hB iB jB",16:"A",33:"B C O H YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e f g h i j k l m n o p pB qB rB sB W ZB uB Q"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"F XB vB aB xB WC zB 0B 1B 2B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",2:"G"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS text-orientation"}},8422:e=>{e.exports={A:{A:{2:"I D mB",161:"F E A B"},B:{2:"Y LB M N S T U V",161:"C O H P J K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{2:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{2:"V"},M:{2:"N"},N:{16:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:5,C:"CSS Text 4 text-spacing"}},5056:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB wB",33:"Z I D F E A B C O H P",164:"G"},D:{1:"0 1 2 3 4 5 6 7 8 9 h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E A B C O H P J K L a b c d e f g"},E:{1:"D F E A B C O H hB iB jB YB W Q nB oB",33:"I gB",164:"G Z eB XB"},F:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E pB qB",33:"C",164:"B rB sB W ZB uB"},G:{1:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"WC",164:"XB vB aB xB"},H:{2:"EC"},I:{1:"M JC KC",33:"bB G FC GC HC IC aB"},J:{1:"A",33:"D"},K:{1:"EB Q",33:"C",164:"A B W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS3 Transitions"}},1456:e=>{e.exports={A:{A:{132:"I D F E A B mB"},B:{1:"Y LB M N S T U V",132:"C O H P J K L"},C:{1:"5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"0 1 2 3 4 K L a b c d e f g h i j k l m n o p q r s t u v w x y z",132:"lB bB G Z I D F E tB wB",292:"A B C O H P J"},D:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",132:"G Z I D F E A B C O H P J",548:"0 1 2 K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{132:"G Z I D F eB XB gB hB iB",548:"E A B C O H jB YB W Q nB oB"},F:{132:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{132:"F XB vB aB xB WC zB 0B",548:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{16:"EC"},I:{1:"M",16:"bB G FC GC HC IC aB JC KC"},J:{16:"D A"},K:{16:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{16:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",16:"G"},Q:{16:"UC"},R:{16:"VC"},S:{33:"fB"}},B:4,C:"CSS unicode-bidi property"}},8307:e=>{e.exports={A:{A:{132:"I D F E A B mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q tB wB",322:"r s t u v"},D:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I",16:"D",33:"0 1 2 F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{1:"B C O H W Q nB oB",2:"G eB XB",16:"Z",33:"I D F E A gB hB iB jB YB"},F:{1:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d e f g h i j k l m n o p"},G:{1:"5B 6B 7B 8B 9B AC BC CC DC",16:"XB vB aB",33:"F xB WC zB 0B 1B 2B 3B 4B"},H:{2:"EC"},I:{1:"M",2:"FC GC HC",33:"bB G IC aB JC KC"},J:{33:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{36:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",33:"G"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS writing-mode property"}},7759:e=>{e.exports={A:{A:{1:"F E A B",8:"I D mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E"},E:{1:"I D F E A B C O H gB hB iB jB YB W Q nB oB",33:"G Z eB XB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q",2:"E"},G:{1:"F xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"XB vB aB"},H:{1:"EC"},I:{1:"G M IC aB JC KC",33:"bB FC GC HC"},J:{1:"A",33:"D"},K:{1:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS3 Box-sizing"}},4528:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"P J K L Y LB M N S T U V",2:"C O H"},C:{1:"0 1 2 3 4 5 6 7 8 9 i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h tB wB"},D:{1:"NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB"},E:{1:"B C O H W Q nB oB",33:"G Z I D F E A eB XB gB hB iB jB YB"},F:{1:"C AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X uB Q",2:"E B pB qB rB sB W ZB",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{33:"D A"},K:{2:"A B C W ZB Q",33:"EB"},L:{1:"V"},M:{2:"N"},N:{2:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{2:"VC"},S:{2:"fB"}},B:3,C:"CSS grab & grabbing cursors"}},8546:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"lB bB G Z I D F E A B C O H P J K L a b c d e tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r"},E:{1:"E A B C O H jB YB W Q nB oB",33:"G Z I D F eB XB gB hB iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 C f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X uB Q",2:"E B pB qB rB sB W ZB",33:"P J K L a b c d e"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{33:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{2:"N"},N:{2:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:4,C:"CSS3 Cursors: zoom-in & zoom-out"}},9807:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{2:"lB bB tB wB",33:"8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",164:"0 1 2 3 4 5 6 7 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},D:{1:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b",132:"c d e f g h i j k l m n o p q r s t u v w"},E:{1:"H nB oB",2:"G Z I eB XB gB",132:"D F E A B C O hB iB jB YB W Q"},F:{1:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E pB qB rB",132:"P J K L a b c d e f g h i j",164:"B C sB W ZB uB Q"},G:{1:"CC DC",2:"XB vB aB xB WC",132:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC"},H:{164:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB",132:"JC KC"},J:{132:"D A"},K:{1:"EB",2:"A",164:"B C W ZB Q"},L:{1:"V"},M:{33:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{164:"fB"}},B:5,C:"CSS3 tab-size"}},3714:e=>{e.exports={A:{A:{2:"I D F E mB",1028:"B",1316:"A"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",164:"lB bB G Z I D F E A B C O H P J K L a b c tB wB",516:"d e f g h i"},D:{1:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"c d e f g h i j",164:"G Z I D F E A B C O H P J K L a b"},E:{1:"E A B C O H jB YB W Q nB oB",33:"D F hB iB",164:"G Z I eB XB gB"},F:{1:"0 1 2 3 4 5 6 7 8 9 K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E B C pB qB rB sB W ZB uB",33:"P J"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"F zB 0B",164:"XB vB aB xB WC"},H:{1:"EC"},I:{1:"M JC KC",164:"bB G FC GC HC IC aB"},J:{1:"A",164:"D"},K:{1:"EB Q",2:"A B C W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"B",292:"A"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS Flexible Box Layout Module"}},7011:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB wB",33:"P J K L a b c d e f g h i j k l m n o",164:"G Z I D F E A B C O H"},D:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P",33:"0 1 2 c d e f g h i j k l m n o p q r s t u v w x y z",292:"J K L a b"},E:{1:"A B C O H jB YB W Q nB oB",2:"D F E eB XB hB iB",4:"G Z I gB"},F:{1:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d e f g h i j k l m n o p"},G:{1:"2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"F zB 0B 1B",4:"XB vB aB xB WC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB",33:"JC KC"},J:{2:"D",33:"A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",33:"G"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS font-feature-settings"}},9195:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{1:"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e tB wB",194:"f g h i j k l m n o"},D:{1:"0 1 2 3 4 5 6 7 8 9 o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f g h i j",33:"k l m n"},E:{1:"A B C O H jB YB W Q nB oB",2:"G Z I eB XB gB hB",33:"D F E iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P pB qB rB sB W ZB uB Q",33:"J K L a"},G:{2:"XB vB aB xB WC zB",33:"F 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M KC",2:"bB G FC GC HC IC aB",33:"JC"},J:{2:"D",33:"A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 font-kerning"}},5833:e=>{e.exports={A:{A:{2:"I D F E A mB",548:"B"},B:{1:"Y LB M N S T U V",516:"C O H P J K L"},C:{1:"JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E tB wB",676:"0 1 A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",1700:"2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB"},D:{1:"GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H",676:"P J K L a",804:"0 1 2 3 4 5 6 7 8 9 b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB"},E:{2:"G Z eB XB",676:"gB",804:"I D F E A B C O H hB iB jB YB W Q nB oB"},F:{1:"JB KB R MB NB OB PB GB X Q",2:"E B C pB qB rB sB W ZB uB",804:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B",2052:"7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D",292:"A"},K:{2:"A B C W ZB Q",804:"EB"},L:{804:"V"},M:{1:"N"},N:{2:"A",548:"B"},O:{804:"LC"},P:{1:"YB RC SC TC",804:"G MC NC OC PC QC"},Q:{804:"UC"},R:{804:"VC"},S:{1:"fB"}},B:1,C:"Full Screen API"}},3794:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",1537:"Y LB M N S T U V"},C:{2:"lB",932:"0 1 2 3 4 5 6 7 8 9 bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB tB wB",2308:"R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U"},D:{2:"G Z I D F E A B C O H P J K L a b c",545:"0 d e f g h i j k l m n o p q r s t u v w x y z",1537:"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I eB XB gB",516:"B C O H W Q nB oB",548:"E A jB YB",676:"D F hB iB"},F:{2:"E B C pB qB rB sB W ZB uB Q",513:"p",545:"P J K L a b c d e f g h i j k l m n",1537:"0 1 2 3 4 5 6 7 8 9 o q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB aB xB WC",548:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",676:"F zB 0B"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",545:"JC KC",1537:"M"},J:{2:"D",545:"A"},K:{2:"A B C W ZB Q",1537:"EB"},L:{1537:"V"},M:{2340:"N"},N:{2:"A B"},O:{1:"LC"},P:{545:"G",1537:"MC NC OC PC QC YB RC SC TC"},Q:{545:"UC"},R:{1537:"VC"},S:{932:"fB"}},B:5,C:"Intrinsic & Extrinsic Sizing"}},1448:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L",516:"Y LB M N S T U V"},C:{132:"7 8 9 AB BB CB DB EB FB RB HB IB JB",164:"0 1 2 3 4 5 6 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",516:"KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U"},D:{420:"0 1 2 3 4 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",516:"5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"A B C O H YB W Q nB oB",132:"E jB",164:"D F iB",420:"G Z I eB XB gB hB"},F:{1:"C W ZB uB Q",2:"E B pB qB rB sB",420:"P J K L a b c d e f g h i j k l m n o p q r",516:"0 1 2 3 4 5 6 7 8 9 s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",132:"1B 2B",164:"F zB 0B",420:"XB vB aB xB WC"},H:{1:"EC"},I:{420:"bB G FC GC HC IC aB JC KC",516:"M"},J:{420:"D A"},K:{1:"C W ZB Q",2:"A B",516:"EB"},L:{516:"V"},M:{132:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",420:"G"},Q:{132:"UC"},R:{132:"VC"},S:{164:"fB"}},B:4,C:"CSS3 Multiple column layout"}},5147:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P",260:"J K L"},C:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l"},E:{1:"A B C O H YB W Q nB oB",2:"G Z I D eB XB gB hB",132:"F E iB jB"},F:{1:"0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E P J K L pB qB rB",33:"B C sB W ZB uB Q"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB WC zB",132:"F 0B 1B 2B"},H:{33:"EC"},I:{1:"M KC",2:"bB G FC GC HC IC aB JC"},J:{2:"D A"},K:{1:"EB",2:"A",33:"B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 object-fit/object-position"}},6714:e=>{e.exports={A:{A:{1:"B",2:"I D F E mB",164:"A"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z tB wB",8:"I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v",328:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB"},D:{1:"AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c",8:"0 1 2 3 4 5 6 d e f g h i j k l m n o p q r s t u v w x y z",584:"7 8 9"},E:{1:"O H nB oB",2:"G Z I eB XB gB",8:"D F E A B C hB iB jB YB W",1096:"Q"},F:{1:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",8:"P J K L a b c d e f g h i j k l m n o p q r s t",584:"u v w"},G:{1:"AC BC CC DC",8:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B",6148:"9B"},H:{2:"EC"},I:{1:"M",8:"bB G FC GC HC IC aB JC KC"},J:{8:"D A"},K:{1:"EB",2:"A",8:"B C W ZB Q"},L:{1:"V"},M:{328:"N"},N:{1:"B",36:"A"},O:{8:"LC"},P:{1:"NC OC PC QC YB RC SC TC",2:"MC",8:"G"},Q:{1:"UC"},R:{2:"VC"},S:{328:"fB"}},B:2,C:"Pointer events"}},6848:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",2052:"Y LB M N S T U V"},C:{2:"lB bB G Z tB wB",1028:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",1060:"I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q"},D:{2:"G Z I D F E A B C O H P J K L a b c d e f g",226:"0 1 2 3 4 5 6 7 8 9 h i j k l m n o p q r s t u v w x y z AB BB",2052:"CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I D eB XB gB hB",772:"O H Q nB oB",804:"F E A B C jB YB W",1316:"iB"},F:{2:"E B C P J K L a b c d e f g h i j k l m n o p pB qB rB sB W ZB uB Q",226:"q r s t u v w x y",2052:"0 1 2 3 4 5 6 7 8 9 z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB aB xB WC zB",292:"F 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C W ZB Q",2052:"EB"},L:{2052:"V"},M:{1:"N"},N:{2:"A B"},O:{2052:"LC"},P:{2:"G MC NC",2052:"OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{1:"VC"},S:{1028:"fB"}},B:4,C:"text-decoration styling"}},5802:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",164:"Y LB M N S T U V"},C:{1:"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",322:"0"},D:{2:"G Z I D F E A B C O H P J K L a b c d e f",164:"0 1 2 3 4 5 6 7 8 9 g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"F E A B C O H iB jB YB W Q nB oB",2:"G Z I eB XB gB",164:"D hB"},F:{2:"E B C pB qB rB sB W ZB uB Q",164:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB WC"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",164:"M JC KC"},J:{2:"D",164:"A"},K:{2:"A B C W ZB Q",164:"EB"},L:{164:"V"},M:{1:"N"},N:{2:"A B"},O:{164:"LC"},P:{164:"G MC NC OC PC QC YB RC SC TC"},Q:{164:"UC"},R:{164:"VC"},S:{1:"fB"}},B:4,C:"text-emphasis styling"}},123:e=>{e.exports={A:{A:{1:"I D F E A B",2:"mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",8:"lB bB G Z I tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X W ZB uB Q",33:"E pB qB rB sB"},G:{1:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{1:"EC"},I:{1:"bB G M FC GC HC IC aB JC KC"},J:{1:"D A"},K:{1:"EB Q",33:"A B C W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 Text-overflow"}},6421:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",33:"C O H P J K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{1:"9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 2 3 4 5 6 7 8 G Z I D F E A B C O H P J K L a b c d e f g i j k l m n o p q r s t u v w x y z",258:"h"},E:{2:"G Z I D F E A B C O H eB XB hB iB jB YB W Q nB oB",258:"gB"},F:{1:"0 1 2 3 4 5 6 7 8 9 y AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x z pB qB rB sB W ZB uB Q"},G:{2:"XB vB aB",33:"F xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{33:"N"},N:{161:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",2:"G"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:7,C:"CSS text-size-adjust"}},762:e=>{e.exports={A:{A:{2:"mB",8:"I D F",129:"A B",161:"E"},B:{1:"K L Y LB M N S T U V",129:"C O H P J"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",33:"G Z I D F E A B C O H P tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q"},E:{1:"E A B C O H jB YB W Q nB oB",33:"G Z I D F eB XB gB hB iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E pB qB",33:"B C P J K L a b c d rB sB W ZB uB"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"F XB vB aB xB WC zB 0B"},H:{2:"EC"},I:{1:"M",33:"bB G FC GC HC IC aB JC KC"},J:{33:"D A"},K:{1:"B C EB W ZB Q",2:"A"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS3 2D Transforms"}},58:e=>{e.exports={A:{A:{2:"I D F E mB",132:"A B"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E tB wB",33:"A B C O H P"},D:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B",33:"C O H P J K L a b c d e f g h i j k l m n o p q"},E:{2:"eB XB",33:"G Z I D F gB hB iB",257:"E A B C O H jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d"},G:{33:"F XB vB aB xB WC zB 0B",257:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"FC GC HC",33:"bB G IC aB JC KC"},J:{33:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS3 3D Transforms"}},7511:e=>{e.exports={A:{A:{2:"I D F E mB",33:"A B"},B:{1:"Y LB M N S T U V",33:"C O H P J K L"},C:{1:"OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB tB wB"},D:{1:"9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"0 1 2 3 4 5 6 7 8 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{33:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d e f g h i j k l m n o p q r s t u v"},G:{33:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",33:"bB G FC GC HC IC aB JC KC"},J:{33:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{33:"A B"},O:{2:"LC"},P:{1:"NC OC PC QC YB RC SC TC",33:"G MC"},Q:{1:"UC"},R:{2:"VC"},S:{33:"fB"}},B:5,C:"CSS user-select: none"}},9883:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/:blank([^\w-]|$)/gi;var o=n.plugin("css-blank-pseudo",e=>{const r=String(Object(e).replaceWith||"[blank]");const t=Boolean("preserve"in Object(e)?e.preserve:true);return e=>{e.walkRules(i,e=>{const n=e.selector.replace(i,(e,t)=>{return`${r}${t}`});const o=e.clone({selector:n});if(t){e.before(o)}else{e.replaceWith(o)}})}});e.exports=o},8410:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(653);var i=_interopRequireDefault(n);var o=t(6231);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},8168:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(8168);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},48:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},3570:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},6941:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},9283:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(48);var i=_interopRequireDefault(n);var o=t(3570);var s=_interopRequireDefault(o);var a=t(1187);var u=_interopRequireDefault(a);var f=t(6941);var c=_interopRequireDefault(f);var l=t(9511);var p=_interopRequireDefault(l);var h=t(3529);var B=_interopRequireDefault(h);var v=t(6867);var d=_interopRequireDefault(v);var b=t(9073);var y=_interopRequireDefault(b);var g=t(4020);var m=_interopRequireDefault(g);var C=t(1848);var w=_interopRequireDefault(C);var S=t(7415);var O=_interopRequireDefault(S);var T=t(8013);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},1559:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(2261);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},9511:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},6231:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(2261);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(9283);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(7472);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},5288:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},3877:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(1559);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},9073:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(1559);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},1848:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},7415:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5288);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},2261:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},8013:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5288);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},627:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},6417:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},2771:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(6417);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},6358:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},2194:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},1044:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(2322);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(2194);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(6358);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(7706);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},7706:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},2322:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},9555:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(7712));var i=_interopDefault(t(4633));const o=/:has/;var s=i.plugin("css-has-pseudo",e=>{const r=Boolean("preserve"in Object(e)?e.preserve:true);return e=>{e.walkRules(o,e=>{const t=n(e=>{e.walkPseudos(e=>{if(e.value===":has"&&e.nodes){const r=checkIfParentIsNot(e);e.value=r?":not-has":":has";const t=n.attribute({attribute:encodeURIComponent(String(e)).replace(/%3A/g,":").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%2C/g,",").replace(/[():%\[\],]/g,"\\$&")});if(r){e.parent.parent.replaceWith(t)}else{e.replaceWith(t)}}})}).processSync(e.selector);const i=e.clone({selector:t});if(r){e.before(i)}else{e.replaceWith(i)}})}});function checkIfParentIsNot(e){return Object(Object(e.parent).parent).type==="pseudo"&&e.parent.parent.value===":not"}e.exports=s},2207:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/^media$/i;const o=/\(\s*prefers-color-scheme\s*:\s*(dark|light|no-preference)\s*\)/i;const s={dark:48,light:70,"no-preference":22};const a=(e,r)=>`(color-index: ${s[r.toLowerCase()]})`;var u=n.plugin("postcss-prefers-color-scheme",e=>{const r="preserve"in Object(e)?e.preserve:true;return e=>{e.walkAtRules(i,e=>{const t=e.params;const n=t.replace(o,a);if(t!==n){if(r){e.cloneBefore({params:n})}else{e.params=n}}})}});e.exports=u},5202:e=>{e.exports=function flatten(e,r){r=typeof r=="number"?r:Infinity;if(!r){if(Array.isArray(e)){return e.map(function(e){return e})}return e}return _flatten(e,1);function _flatten(e,t){return e.reduce(function(e,n){if(Array.isArray(n)&&t{"use strict";e.exports=((e,r)=>{r=r||process.argv;const t=e.startsWith("-")?"":e.length===1?"-":"--";const n=r.indexOf(t+e);const i=r.indexOf("--");return n!==-1&&(i===-1?true:n{e.exports=function(e,r){var t=-1,n=[];while((t=e.indexOf(r,t+1))!==-1)n.push(t);return n}},7478:e=>{var r=/<%=([\s\S]+?)%>/g;e.exports=r},8589:(e,r,t)=>{e=t.nmd(e);var n=t(7478),i=t(1623);var o=800,s=16;var a=1/0,u=9007199254740991;var f="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",p="[object Boolean]",h="[object Date]",B="[object DOMException]",v="[object Error]",d="[object Function]",b="[object GeneratorFunction]",y="[object Map]",g="[object Number]",m="[object Null]",C="[object Object]",w="[object Proxy]",S="[object RegExp]",O="[object Set]",T="[object String]",E="[object Symbol]",k="[object Undefined]",P="[object WeakMap]";var D="[object ArrayBuffer]",A="[object DataView]",R="[object Float32Array]",F="[object Float64Array]",x="[object Int8Array]",j="[object Int16Array]",I="[object Int32Array]",M="[object Uint8Array]",_="[object Uint8ClampedArray]",N="[object Uint16Array]",L="[object Uint32Array]";var q=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var J=/[\\^$.*+?()[\]{}|]/g;var W=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var Q=/^\[object .+?Constructor\]$/;var H=/^(?:0|[1-9]\d*)$/;var K=/($^)/;var Y=/['\n\r\u2028\u2029\\]/g;var z={};z[R]=z[F]=z[x]=z[j]=z[I]=z[M]=z[_]=z[N]=z[L]=true;z[f]=z[c]=z[D]=z[p]=z[A]=z[h]=z[v]=z[d]=z[y]=z[g]=z[C]=z[S]=z[O]=z[T]=z[P]=false;var $={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var X=typeof global=="object"&&global&&global.Object===Object&&global;var Z=typeof self=="object"&&self&&self.Object===Object&&self;var V=X||Z||Function("return this")();var ee=true&&r&&!r.nodeType&&r;var re=ee&&"object"=="object"&&e&&!e.nodeType&&e;var te=re&&re.exports===ee;var ne=te&&X.process;var ie=function(){try{var e=re&&re.require&&re.require("util").types;if(e){return e}return ne&&ne.binding&&ne.binding("util")}catch(e){}}();var oe=ie&&ie.isTypedArray;function apply(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}function arrayMap(e,r){var t=-1,n=e==null?0:e.length,i=Array(n);while(++t1?t[i-1]:undefined,s=i>2?t[2]:undefined;o=e.length>3&&typeof o=="function"?(i--,o):undefined;if(s&&isIterateeCall(t[0],t[1],s)){o=i<3?undefined:o;i=1}r=Object(r);while(++n-1&&e%1==0&&e0){if(++r>=o){return arguments[0]}}else{r=0}return e.apply(undefined,arguments)}}function toSource(e){if(e!=null){try{return fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eq(e,r){return e===r||e!==e&&r!==r}var De=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&ce.call(e,"callee")&&!ye.call(e,"callee")};var Ae=Array.isArray;function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}var Re=Ce||stubFalse;function isError(e){if(!isObjectLike(e)){return false}var r=baseGetTag(e);return r==v||r==B||typeof e.message=="string"&&typeof e.name=="string"&&!isPlainObject(e)}function isFunction(e){if(!isObject(e)){return false}var r=baseGetTag(e);return r==d||r==b||r==l||r==w}function isLength(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=u}function isObject(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function isObjectLike(e){return e!=null&&typeof e=="object"}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=C){return false}var r=be(e);if(r===null){return true}var t=ce.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&fe.call(t)==he}function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==E}var Fe=oe?baseUnary(oe):baseIsTypedArray;function toString(e){return e==null?"":baseToString(e)}var xe=createAssigner(function(e,r,t,n){copyObject(r,keysIn(r),e,n)});function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,true):baseKeysIn(e)}function template(e,r,t){var o=i.imports._.templateSettings||i;if(t&&isIterateeCall(e,r,t)){r=undefined}e=toString(e);r=xe({},r,o,customDefaultsAssignIn);var s=xe({},r.imports,o.imports,customDefaultsAssignIn),a=keys(s),u=baseValues(s,a);var f,c,l=0,p=r.interpolate||K,h="__p += '";var B=RegExp((r.escape||K).source+"|"+p.source+"|"+(p===n?W:K).source+"|"+(r.evaluate||K).source+"|$","g");var v=ce.call(r,"sourceURL")?"//# sourceURL="+(r.sourceURL+"").replace(/[\r\n]/g," ")+"\n":"";e.replace(B,function(r,t,n,i,o,s){n||(n=i);h+=e.slice(l,s).replace(Y,escapeStringChar);if(t){f=true;h+="' +\n__e("+t+") +\n'"}if(o){c=true;h+="';\n"+o+";\n__p += '"}if(n){h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"}l=s+r.length;return r});h+="';\n";var d=ce.call(r,"variable")&&r.variable;if(!d){h="with (obj) {\n"+h+"\n}\n"}h=(c?h.replace(q,""):h).replace(G,"$1").replace(U,"$1;");h="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(f?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var b=je(function(){return Function(a,v+"return "+h).apply(undefined,u)});b.source=h;if(isError(b)){throw b}return b}var je=baseRest(function(e,r){try{return apply(e,undefined,r)}catch(e){return isError(e)?e:new Error(e)}});function constant(e){return function(){return e}}function identity(e){return e}function stubFalse(){return false}e.exports=template},1623:(e,r,t)=>{var n=t(7478);var i=1/0;var o="[object Null]",s="[object Symbol]",a="[object Undefined]";var u=/[&<>"']/g,f=RegExp(u.source);var c=/<%-([\s\S]+?)%>/g,l=/<%([\s\S]+?)%>/g;var p={"&":"&","<":"<",">":">",'"':""","'":"'"};var h=typeof global=="object"&&global&&global.Object===Object&&global;var B=typeof self=="object"&&self&&self.Object===Object&&self;var v=h||B||Function("return this")();function arrayMap(e,r){var t=-1,n=e==null?0:e.length,i=Array(n);while(++t{"use strict";e.exports={wrap:wrapRange,limit:limitRange,validate:validateRange,test:testRange,curry:curry,name:name};function wrapRange(e,r,t){var n=r-e;return((t-e)%n+n)%n+e}function limitRange(e,r,t){return Math.max(e,Math.min(r,t))}function validateRange(e,r,t,n,i){if(!testRange(e,r,t,n,i)){throw new Error(t+" is outside of range ["+e+","+r+")")}return t}function testRange(e,r,t,n,i){return!(tr||i&&t===r||n&&t===e)}function name(e,r,t,n){return(t?"(":"[")+e+","+r+(n?")":"]")}function curry(e,r,t,n){var i=name.bind(null,e,r,t,n);return{wrap:wrapRange.bind(null,e,r),limit:limitRange.bind(null,e,r),validate:function(i){return validateRange(e,r,i,t,n)},test:function(i){return testRange(e,r,i,t,n)},toString:i,name:i}}},9108:e=>{"use strict";var r=Math.abs;var t=Math.round;function almostEq(e,t){return r(e-t)<=9.5367432e-7}function GCD(e,r){if(almostEq(r,0))return e;return GCD(r,e%r)}function findPrecision(e){var r=1;while(!almostEq(t(e*r)/r,e)){r*=10}return r}function num2fraction(e){if(e===0||e==="0")return"0";if(typeof e==="string"){e=parseFloat(e)}var n=findPrecision(e);var i=e*n;var o=r(GCD(i,n));var s=i/o;var a=n/o;return t(s)+"/"+t(a)}e.exports=num2fraction},2347:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var n=t(4633);var i=_interopRequireDefault(n);var o=t(3507);var s=_interopRequireDefault(o);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function nodeIsInsensitiveAttribute(e){return e.type==="attribute"&&e.insensitive}function selectorHasInsensitiveAttribute(e){return e.some(nodeIsInsensitiveAttribute)}function transformString(e,r,t){var n=t.charAt(r);if(n===""){return e}var i=e.map(function(e){return e+n});var o=n.toLocaleUpperCase();if(o!==n){i=i.concat(e.map(function(e){return e+o}))}return transformString(i,r+1,t)}function createSensitiveAtributes(e){var r=transformString([""],0,e.value);return r.map(function(r){var t=e.clone({spaces:{after:e.spaces.after,before:e.spaces.before},insensitive:false});t.setValue(r);return t})}function createNewSelectors(e){var r=[s.default.selector()];e.walk(function(e){if(!nodeIsInsensitiveAttribute(e)){r.forEach(function(r){r.append(e.clone())});return}var t=createSensitiveAtributes(e);var n=[];t.forEach(function(e){r.forEach(function(r){var t=r.clone();t.append(e);n.push(t)})});r=n});return r}function transform(e){var r=[];e.each(function(e){if(selectorHasInsensitiveAttribute(e)){r=r.concat(createNewSelectors(e));e.remove()}});if(r.length){r.forEach(function(r){return e.append(r)})}}var a=/i(\s*\/\*[\W\w]*?\*\/)*\s*\]/;r.default=i.default.plugin("postcss-attribute-case-insensitive",function(){return function(e){e.walkRules(a,function(e){e.selector=(0,s.default)(transform).processSync(e.selector)})}});e.exports=r.default},6608:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(5160);var i=_interopRequireDefault(n);var o=t(3966);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},3373:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(3373);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},8448:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},3556:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},3522:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},6001:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(8448);var i=_interopRequireDefault(n);var o=t(3556);var s=_interopRequireDefault(o);var a=t(4310);var u=_interopRequireDefault(a);var f=t(3522);var c=_interopRequireDefault(f);var l=t(6545);var p=_interopRequireDefault(l);var h=t(2704);var B=_interopRequireDefault(h);var v=t(9173);var d=_interopRequireDefault(v);var b=t(7792);var y=_interopRequireDefault(b);var g=t(5396);var m=_interopRequireDefault(g);var C=t(6776);var w=_interopRequireDefault(C);var S=t(2066);var O=_interopRequireDefault(S);var T=t(707);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},7507:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(4436);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},6545:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},3966:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(4436);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(6001);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(5771);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},8807:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},3366:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(7507);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},7792:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(7507);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},6776:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},2066:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(8807);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},4436:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},707:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(8807);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},4772:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},1406:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},2258:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(1406);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},8039:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},9501:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},6266:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(1010);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(9501);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(8039);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(6972);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},6972:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},1010:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},7814:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=n.plugin("postcss-color-functional-notation",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):false;return e=>{e.walkDecls(e=>{const t=e.value;if(u.test(t)){const n=i(t).parse();n.walkType("func",e=>{if(f.test(e.value)){const r=e.nodes.slice(1,-1);const t=P(e,r);const n=D(e,r);const i=A(e,r);if(t||n||i){const t=r[3];const n=r[4];if(n){if(g(n)&&!d(n)){n.unit="";n.value=String(n.value/100)}if(C(e)){e.value+="a"}}else if(w(e)){e.value=e.value.slice(0,-1)}if(t&&O(t)){t.replaceWith(R())}if(i){r[0].unit=r[1].unit=r[2].unit="";r[0].value=String(Math.floor(r[0].value*255/100));r[1].value=String(Math.floor(r[1].value*255/100));r[2].value=String(Math.floor(r[2].value*255/100))}e.nodes.splice(3,0,[R()]);e.nodes.splice(2,0,[R()])}}});const o=String(n);if(o!==t){if(r){e.cloneBefore({value:o})}else{e.value=o}}}})}});const s=/^%?$/i;const a=/^calc$/i;const u=/(^|[^\w-])(hsla?|rgba?)\(/i;const f=/^(hsla?|rgba?)$/i;const c=/^hsla?$/i;const l=/^(hsl|rgb)$/i;const p=/^(hsla|rgba)$/i;const h=/^(deg|grad|rad|turn)?$/i;const B=/^rgba?$/i;const v=e=>d(e)||e.type==="number"&&s.test(e.unit);const d=e=>e.type==="func"&&a.test(e.value);const b=e=>d(e)||e.type==="number"&&h.test(e.unit);const y=e=>d(e)||e.type==="number"&&e.unit==="";const g=e=>d(e)||e.type==="number"&&(e.unit==="%"||e.unit===""&&e.value==="0");const m=e=>e.type==="func"&&c.test(e.value);const C=e=>e.type==="func"&&l.test(e.value);const w=e=>e.type==="func"&&p.test(e.value);const S=e=>e.type==="func"&&B.test(e.value);const O=e=>e.type==="operator"&&e.value==="/";const T=[b,g,g,O,v];const E=[y,y,y,O,v];const k=[g,g,g,O,v];const P=(e,r)=>m(e)&&r.every((e,r)=>typeof T[r]==="function"&&T[r](e));const D=(e,r)=>S(e)&&r.every((e,r)=>typeof E[r]==="function"&&E[r](e));const A=(e,r)=>S(e)&&r.every((e,r)=>typeof k[r]==="function"&&k[r](e));const R=()=>i.comma({value:","});e.exports=o},489:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=t(4567);function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"]!=null)s["return"]()}finally{if(i)throw o}}return t}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var s=n.plugin("postcss-color-gray",e=>r=>{r.walkDecls(r=>{if(u(r)){const t=r.value;const n=i(t).parse();n.walk(e=>{const r=S(e),t=_slicedToArray(r,2),n=t[0],s=t[1];if(n!==undefined){e.value="rgb";const r=o.lab2rgb(n,0,0).map(e=>Math.max(Math.min(Math.round(e*2.55),255),0)),t=_slicedToArray(r,3),a=t[0],u=t[1],f=t[2];const c=e.first;const l=e.last;e.removeAll().append(c).append(i.number({value:a})).append(i.comma({value:","})).append(i.number({value:u})).append(i.comma({value:","})).append(i.number({value:f}));if(s<1){e.value+="a";e.append(i.comma({value:","})).append(i.number({value:s}))}e.append(l)}});const s=n.toString();if(t!==s){if(Object(e).preserve){r.cloneBefore({value:s})}else{r.value=s}}}})});const a=/(^|[^\w-])gray\(/i;const u=e=>a.test(Object(e).value);const f=e=>Object(e).type==="number";const c=e=>Object(e).type==="operator";const l=e=>Object(e).type==="func";const p=/^calc$/i;const h=e=>l(e)&&p.test(e.value);const B=/^gray$/i;const v=e=>l(e)&&B.test(e.value)&&e.nodes&&e.nodes.length;const d=e=>f(e)&&e.unit==="%";const b=e=>f(e)&&e.unit==="";const y=e=>c(e)&&e.value==="/";const g=e=>b(e)?Number(e.value):undefined;const m=e=>y(e)?null:undefined;const C=e=>h(e)?String(e):b(e)?Number(e.value):d(e)?Number(e.value)/100:undefined;const w=[g,m,C];const S=e=>{const r=[];if(v(e)){const t=e.nodes.slice(1,-1);for(const e in t){const n=typeof w[e]==="function"?w[e](t[e]):undefined;if(n!==undefined){if(n!==null){r.push(n)}}else{return[]}}return r}else{return[]}};e.exports=s},8157:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=n.plugin("postcss-color-hex-alpha",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):false;return e=>{e.walkDecls(e=>{if(a(e)){const t=i(e.value).parse();f(t,e=>{if(l(e)){e.replaceWith(p(e))}});const n=String(t);if(e.value!==n){if(r){e.cloneBefore({value:n})}else{e.value=n}}}})}});const s=/#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)\b/;const a=e=>s.test(e.value);const u=/^#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)$/;const f=(e,r)=>{if(Object(e.nodes).length){e.nodes.slice().forEach(e=>{r(e);f(e,r)})}};const c=1e5;const l=e=>e.type==="word"&&u.test(e.value);const p=e=>{const r=e.value;const t=`0x${r.length===5?r.slice(1).replace(/[0-9A-f]/g,"$&$&"):r.slice(1)}`;const n=[parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),parseInt(t.slice(6,8),16),Math.round(parseInt(t.slice(8,10),16)/255*c)/c],o=n[0],s=n[1],a=n[2],u=n[3];const f=i.func({value:"rgba",raws:Object.assign({},e.raws)});f.append(i.paren({value:"("}));f.append(i.number({value:o}));f.append(i.comma({value:","}));f.append(i.number({value:s}));f.append(i.comma({value:","}));f.append(i.number({value:a}));f.append(i.comma({value:","}));f.append(i.number({value:u}));f.append(i.paren({value:")"}));return f};e.exports=o},8881:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(9448));var i=_interopDefault(t(5747));var o=_interopDefault(t(5622));var s=_interopDefault(t(4633));var a=t(4567);function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function _defineProperty(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function _objectSpread(e){for(var r=1;r{const o=l(e)?t:p(e)?i:null;if(o){e.nodes.slice().forEach(e=>{if(h(e)){const t=e.prop;o[t]=n(e.value).parse();if(!r.preserve){e.remove()}}});if(!r.preserve&&B(e)){e.remove()}}});return _objectSpread({},t,i)}const u=/^html$/i;const f=/^:root$/i;const c=/^--[A-z][\w-]*$/;const l=e=>e.type==="rule"&&u.test(e.selector)&&Object(e.nodes).length;const p=e=>e.type==="rule"&&f.test(e.selector)&&Object(e.nodes).length;const h=e=>e.type==="decl"&&c.test(e.prop);const B=e=>Object(e.nodes).length===0;function importCustomPropertiesFromCSSAST(e){return getCustomProperties(e,{preserve:true})}function importCustomPropertiesFromCSSFile(e){return _importCustomPropertiesFromCSSFile.apply(this,arguments)}function _importCustomPropertiesFromCSSFile(){_importCustomPropertiesFromCSSFile=_asyncToGenerator(function*(e){const r=yield v(e);const t=s.parse(r,{from:e});return importCustomPropertiesFromCSSAST(t)});return _importCustomPropertiesFromCSSFile.apply(this,arguments)}function importCustomPropertiesFromObject(e){const r=Object.assign({},Object(e).customProperties||Object(e)["custom-properties"]);for(const e in r){r[e]=n(r[e]).parse()}return r}function importCustomPropertiesFromJSONFile(e){return _importCustomPropertiesFromJSONFile.apply(this,arguments)}function _importCustomPropertiesFromJSONFile(){_importCustomPropertiesFromJSONFile=_asyncToGenerator(function*(e){const r=yield d(e);return importCustomPropertiesFromObject(r)});return _importCustomPropertiesFromJSONFile.apply(this,arguments)}function importCustomPropertiesFromJSFile(e){return _importCustomPropertiesFromJSFile.apply(this,arguments)}function _importCustomPropertiesFromJSFile(){_importCustomPropertiesFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(e));return importCustomPropertiesFromObject(r)});return _importCustomPropertiesFromJSFile.apply(this,arguments)}function importCustomPropertiesFromSources(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(r.customProperties||r["custom-properties"]){return r}const t=o.resolve(String(r.from||""));const n=(r.type||o.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="ast"){return Object.assign(yield e,importCustomPropertiesFromCSSAST(i))}if(n==="css"){return Object.assign(yield e,yield importCustomPropertiesFromCSSFile(i))}if(n==="js"){return Object.assign(yield e,yield importCustomPropertiesFromJSFile(i))}if(n==="json"){return Object.assign(yield e,yield importCustomPropertiesFromJSONFile(i))}return Object.assign(yield e,yield importCustomPropertiesFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const v=e=>new Promise((r,t)=>{i.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const d=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield v(e))});return function readJSON(r){return e.apply(this,arguments)}}();function convertDtoD(e){return e%360}function convertGtoD(e){return e*.9%360}function convertRtoD(e){return e*180/Math.PI%360}function convertTtoD(e){return e*360%360}function convertNtoRGB(e){const r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],transparent:[0,0,0],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};return r[e]&&r[e].map(e=>e/2.55)}function convertHtoRGB(e){const r=(e.match(b)||[]).slice(1),t=_slicedToArray(r,8),n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],f=t[6],c=t[7];if(a!==undefined||n!==undefined){const e=a!==undefined?parseInt(a,16):n!==undefined?parseInt(n+n,16):0;const r=u!==undefined?parseInt(u,16):i!==undefined?parseInt(i+i,16):0;const t=f!==undefined?parseInt(f,16):o!==undefined?parseInt(o+o,16):0;const l=c!==undefined?parseInt(c,16):s!==undefined?parseInt(s+s,16):255;return[e,r,t,l].map(e=>e/2.55)}return undefined}const b=/^#(?:([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?)$/i;class Color{constructor(e){this.color=Object(Object(e).color||e);this.color.colorspace=this.color.colorspace?this.color.colorspace:"red"in e&&"green"in e&&"blue"in e?"rgb":"hue"in e&&"saturation"in e&&"lightness"in e?"hsl":"hue"in e&&"whiteness"in e&&"blackness"in e?"hwb":"unknown";if(e.colorspace==="rgb"){this.color.hue=a.rgb2hue(e.red,e.green,e.blue,e.hue||0)}}alpha(e){const r=this.color;return e===undefined?r.alpha:new Color(assign(r,{alpha:e}))}blackness(e){const r=color2hwb(this.color);return e===undefined?r.blackness:new Color(assign(r,{blackness:e}))}blend(e,r,t="rgb"){const n=this.color;return new Color(blend(n,e,r,t))}blenda(e,r,t="rgb"){const n=this.color;return new Color(blend(n,e,r,t,true))}blue(e){const r=color2rgb(this.color);return e===undefined?r.blue:new Color(assign(r,{blue:e}))}contrast(e){const r=this.color;return new Color(contrast(r,e))}green(e){const r=color2rgb(this.color);return e===undefined?r.green:new Color(assign(r,{green:e}))}hue(e){const r=color2hsl(this.color);return e===undefined?r.hue:new Color(assign(r,{hue:e}))}lightness(e){const r=color2hsl(this.color);return e===undefined?r.lightness:new Color(assign(r,{lightness:e}))}red(e){const r=color2rgb(this.color);return e===undefined?r.red:new Color(assign(r,{red:e}))}rgb(e,r,t){const n=color2rgb(this.color);return new Color(assign(n,{red:e,green:r,blue:t}))}saturation(e){const r=color2hsl(this.color);return e===undefined?r.saturation:new Color(assign(r,{saturation:e}))}shade(e){const r=color2hwb(this.color);const t={hue:0,whiteness:0,blackness:100,colorspace:"hwb"};const n="rgb";return e===undefined?r.blackness:new Color(blend(r,t,e,n))}tint(e){const r=color2hwb(this.color);const t={hue:0,whiteness:100,blackness:0,colorspace:"hwb"};const n="rgb";return e===undefined?r.blackness:new Color(blend(r,t,e,n))}whiteness(e){const r=color2hwb(this.color);return e===undefined?r.whiteness:new Color(assign(r,{whiteness:e}))}toHSL(){return color2hslString(this.color)}toHWB(){return color2hwbString(this.color)}toLegacy(){return color2legacyString(this.color)}toRGB(){return color2rgbString(this.color)}toRGBLegacy(){return color2rgbLegacyString(this.color)}toString(){return color2string(this.color)}}function blend(e,r,t,n,i){const o=t/100;const s=1-o;if(n==="hsl"){const t=color2hsl(e),n=t.hue,a=t.saturation,u=t.lightness,f=t.alpha;const c=color2hsl(r),l=c.hue,p=c.saturation,h=c.lightness,B=c.alpha;const v=n*s+l*o,d=a*s+p*o,b=u*s+h*o,y=i?f*s+B*o:f;return{hue:v,saturation:d,lightness:b,alpha:y,colorspace:"hsl"}}else if(n==="hwb"){const t=color2hwb(e),n=t.hue,a=t.whiteness,u=t.blackness,f=t.alpha;const c=color2hwb(r),l=c.hue,p=c.whiteness,h=c.blackness,B=c.alpha;const v=n*s+l*o,d=a*s+p*o,b=u*s+h*o,y=i?f*s+B*o:f;return{hue:v,whiteness:d,blackness:b,alpha:y,colorspace:"hwb"}}else{const t=color2rgb(e),n=t.red,a=t.green,u=t.blue,f=t.alpha;const c=color2rgb(r),l=c.red,p=c.green,h=c.blue,B=c.alpha;const v=n*s+l*o,d=a*s+p*o,b=u*s+h*o,y=i?f*s+B*o:f;return{red:v,green:d,blue:b,alpha:y,colorspace:"rgb"}}}function assign(e,r){const t=Object.assign({},e);Object.keys(r).forEach(n=>{const i=n==="hue";const o=!i&&y.test(n);const s=normalize(r[n],n);t[n]=s;if(o){t.hue=a.rgb2hue(t.red,t.green,t.blue,e.hue||0)}});return t}function normalize(e,r){const t=r==="hue";const n=0;const i=t?360:100;const o=Math.min(Math.max(t?e%360:e,n),i);return o}function color2rgb(e){const r=e.colorspace==="hsl"?a.hsl2rgb(e.hue,e.saturation,e.lightness):e.colorspace==="hwb"?a.hwb2rgb(e.hue,e.whiteness,e.blackness):[e.red,e.green,e.blue],t=_slicedToArray(r,3),n=t[0],i=t[1],o=t[2];return{red:n,green:i,blue:o,hue:e.hue,alpha:e.alpha,colorspace:"rgb"}}function color2hsl(e){const r=e.colorspace==="rgb"?a.rgb2hsl(e.red,e.green,e.blue,e.hue):e.colorspace==="hwb"?a.hwb2hsl(e.hue,e.whiteness,e.blackness):[e.hue,e.saturation,e.lightness],t=_slicedToArray(r,3),n=t[0],i=t[1],o=t[2];return{hue:n,saturation:i,lightness:o,alpha:e.alpha,colorspace:"hsl"}}function color2hwb(e){const r=e.colorspace==="rgb"?a.rgb2hwb(e.red,e.green,e.blue,e.hue):e.colorspace==="hsl"?a.hsl2hwb(e.hue,e.saturation,e.lightness):[e.hue,e.whiteness,e.blackness],t=_slicedToArray(r,3),n=t[0],i=t[1],o=t[2];return{hue:n,whiteness:i,blackness:o,alpha:e.alpha,colorspace:"hwb"}}function contrast(e,r){const t=color2hwb(e);const n=color2rgb(e);const i=rgb2luminance(n.red,n.green,n.blue);const o=i<.5?{hue:t.hue,whiteness:100,blackness:0,alpha:t.alpha,colorspace:"hwb"}:{hue:t.hue,whiteness:0,blackness:100,alpha:t.alpha,colorspace:"hwb"};const s=colors2contrast(e,o);const a=s>4.5?colors2contrastRatioColor(t,o):o;return blend(o,a,r,"hwb",false)}function colors2contrast(e,r){const t=color2rgb(e);const n=color2rgb(r);const i=rgb2luminance(t.red,t.green,t.blue);const o=rgb2luminance(n.red,n.green,n.blue);return i>o?(i+.05)/(o+.05):(o+.05)/(i+.05)}function rgb2luminance(e,r,t){const n=[channel2luminance(e),channel2luminance(r),channel2luminance(t)],i=n[0],o=n[1],s=n[2];const a=.2126*i+.7152*o+.0722*s;return a}function channel2luminance(e){const r=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return r}function colors2contrastRatioColor(e,r){const t=Object.assign({},e);let n=e.whiteness;let i=e.blackness;let o=r.whiteness;let s=r.blackness;while(Math.abs(n-o)>100||Math.abs(i-s)>100){const r=Math.round((o+n)/2);const a=Math.round((s+i)/2);t.whiteness=r;t.blackness=a;if(colors2contrast(t,e)>4.5){o=r;s=a}else{n=r;i=a}}return t}const y=/^(blue|green|red)$/i;function color2string(e){return e.colorspace==="hsl"?color2hslString(e):e.colorspace==="hwb"?color2hwbString(e):color2rgbString(e)}function color2hslString(e){const r=color2hsl(e);const t=r.alpha===100;const n=r.hue;const i=Math.round(r.saturation*1e10)/1e10;const o=Math.round(r.lightness*1e10)/1e10;const s=Math.round(r.alpha*1e10)/1e10;return`hsl(${n} ${i}% ${o}%${t?"":` / ${s}%`})`}function color2hwbString(e){const r=color2hwb(e);const t=r.alpha===100;const n=r.hue;const i=Math.round(r.whiteness*1e10)/1e10;const o=Math.round(r.blackness*1e10)/1e10;const s=Math.round(r.alpha*1e10)/1e10;return`hwb(${n} ${i}% ${o}%${t?"":` / ${s}%`})`}function color2rgbString(e){const r=color2rgb(e);const t=r.alpha===100;const n=Math.round(r.red*1e10)/1e10;const i=Math.round(r.green*1e10)/1e10;const o=Math.round(r.blue*1e10)/1e10;const s=Math.round(r.alpha*1e10)/1e10;return`rgb(${n}% ${i}% ${o}%${t?"":` / ${s}%`})`}function color2legacyString(e){return e.colorspace==="hsl"?color2hslLegacyString(e):color2rgbLegacyString(e)}function color2rgbLegacyString(e){const r=color2rgb(e);const t=r.alpha===100;const n=t?"rgb":"rgba";const i=Math.round(r.red*255/100);const o=Math.round(r.green*255/100);const s=Math.round(r.blue*255/100);const a=Math.round(r.alpha/100*1e10)/1e10;return`${n}(${i}, ${o}, ${s}${t?"":`, ${a}`})`}function color2hslLegacyString(e){const r=color2hsl(e);const t=r.alpha===100;const n=t?"hsl":"hsla";const i=r.hue;const o=Math.round(r.saturation*1e10)/1e10;const s=Math.round(r.lightness*1e10)/1e10;const a=Math.round(r.alpha/100*1e10)/1e10;return`${n}(${i}, ${o}%, ${s}%${t?"":`, ${a}`})`}function manageUnresolved(e,r,t,n){if("warn"===r.unresolved){r.decl.warn(r.result,n,{word:t})}else if("ignore"!==r.unresolved){throw r.decl.error(n,{word:t})}}function transformAST(e,r){e.nodes.slice(0).forEach(e=>{if(isColorModFunction(e)){if(r.transformVars){transformVariables(e,r)}const t=transformColorModFunction(e,r);if(t){e.replaceWith(n.word({raws:e.raws,value:r.stringifier(t)}))}}else if(e.nodes&&Object(e.nodes).length){transformAST(e,r)}})}function transformVariables(e,r){walk(e,e=>{if(isVariable(e)){const t=transformArgsByParams(e,[[transformWord,isComma,transformNode]]),n=_slicedToArray(t,2),i=n[0],o=n[1];if(i in r.customProperties){let t=r.customProperties[i];if(_.test(t)){const e=t.clone();transformVariables(e,r);t=e}if(t.nodes.length===1&&t.nodes[0].nodes.length){t.nodes[0].nodes.forEach(r=>{e.parent.insertBefore(e,r)})}e.remove()}else if(o&&o.nodes.length===1&&o.nodes[0].nodes.length){transformVariables(o,r);e.replaceWith(...o.nodes[0].nodes[0])}}})}function transformColor(e,r){if(isRGBFunction(e)){return transformRGBFunction(e,r)}else if(isHSLFunction(e)){return transformHSLFunction(e,r)}else if(isHWBFunction(e)){return transformHWBFunction(e,r)}else if(isColorModFunction(e)){return transformColorModFunction(e,r)}else if(isHexColor(e)){return transformHexColor(e,r)}else if(isNamedColor(e)){return transformNamedColor(e,r)}else{return manageUnresolved(e,r,e.value,`Expected a color`)}}function transformRGBFunction(e,r){const t=transformArgsByParams(e,[[transformPercentage,transformPercentage,transformPercentage,isSlash,transformAlpha],[transformRGBNumber,transformRGBNumber,transformRGBNumber,isSlash,transformAlpha],[transformPercentage,isComma,transformPercentage,isComma,transformPercentage,isComma,transformAlpha],[transformRGBNumber,isComma,transformRGBNumber,isComma,transformRGBNumber,isComma,transformAlpha]]),n=_slicedToArray(t,4),i=n[0],o=n[1],s=n[2],a=n[3],u=a===void 0?100:a;if(i!==undefined){const e=new Color({red:i,green:o,blue:s,alpha:u,colorspace:"rgb"});return e}else{return manageUnresolved(e,r,e.value,`Expected a valid rgb() function`)}}function transformHSLFunction(e,r){const t=transformArgsByParams(e,[[transformHue,transformPercentage,transformPercentage,isSlash,transformAlpha],[transformHue,isComma,transformPercentage,isComma,transformPercentage,isComma,transformAlpha]]),n=_slicedToArray(t,4),i=n[0],o=n[1],s=n[2],a=n[3],u=a===void 0?100:a;if(s!==undefined){const e=new Color({hue:i,saturation:o,lightness:s,alpha:u,colorspace:"hsl"});return e}else{return manageUnresolved(e,r,e.value,`Expected a valid hsl() function`)}}function transformHWBFunction(e,r){const t=transformArgsByParams(e,[[transformHue,transformPercentage,transformPercentage,isSlash,transformAlpha]]),n=_slicedToArray(t,4),i=n[0],o=n[1],s=n[2],a=n[3],u=a===void 0?100:a;if(s!==undefined){const e=new Color({hue:i,whiteness:o,blackness:s,alpha:u,colorspace:"hwb"});return e}else{return manageUnresolved(e,r,e.value,`Expected a valid hwb() function`)}}function transformColorModFunction(e,r){const t=(e.nodes||[]).slice(1,-1)||[],n=_toArray(t),i=n[0],o=n.slice(1);if(i!==undefined){const t=isHue(i)?new Color({hue:transformHue(i,r),saturation:100,lightness:50,alpha:100,colorspace:"hsl"}):transformColor(i,r);if(t){const e=transformColorByAdjusters(t,o,r);return e}else{return manageUnresolved(e,r,e.value,`Expected a valid color`)}}else{return manageUnresolved(e,r,e.value,`Expected a valid color-mod() function`)}}function transformHexColor(e,r){if(E.test(e.value)){const r=convertHtoRGB(e.value),t=_slicedToArray(r,4),n=t[0],i=t[1],o=t[2],s=t[3];const a=new Color({red:n,green:i,blue:o,alpha:s});return a}else{return manageUnresolved(e,r,e.value,`Expected a valid hex color`)}}function transformNamedColor(e,r){if(isNamedColor(e)){const r=convertNtoRGB(e.value),t=_slicedToArray(r,3),n=t[0],i=t[1],o=t[2];const s=new Color({red:n,green:i,blue:o,alpha:100,colorspace:"rgb"});return s}else{return manageUnresolved(e,r,e.value,`Expected a valid named-color`)}}function transformColorByAdjusters(e,r,t){const n=r.reduce((e,r)=>{if(isAlphaBlueGreenRedAdjuster(r)){return transformAlphaBlueGreenRedAdjuster(e,r,t)}else if(isRGBAdjuster(r)){return transformRGBAdjuster(e,r,t)}else if(isHueAdjuster(r)){return transformHueAdjuster(e,r,t)}else if(isBlacknessLightnessSaturationWhitenessAdjuster(r)){return transformBlacknessLightnessSaturationWhitenessAdjuster(e,r,t)}else if(isShadeTintAdjuster(r)){return transformShadeTintAdjuster(e,r,t)}else if(isBlendAdjuster(r)){return transformBlendAdjuster(e,r,r.value==="blenda",t)}else if(isContrastAdjuster(r)){return transformContrastAdjuster(e,r,t)}else{manageUnresolved(r,t,r.value,`Expected a valid color adjuster`);return e}},e);return n}function transformAlphaBlueGreenRedAdjuster(e,r,t){const n=transformArgsByParams(r,g.test(r.value)?[[transformMinusPlusOperator,transformAlpha],[transformTimesOperator,transformPercentage],[transformAlpha]]:[[transformMinusPlusOperator,transformPercentage],[transformMinusPlusOperator,transformRGBNumber],[transformTimesOperator,transformPercentage],[transformPercentage],[transformRGBNumber]]),i=_slicedToArray(n,2),o=i[0],s=i[1];if(o!==undefined){const t=r.value.toLowerCase().replace(g,"alpha");const n=e[t]();const i=s!==undefined?o==="+"?n+Number(s):o==="-"?n-Number(s):o==="*"?n*Number(s):Number(s):Number(o);const a=e[t](i);return a}else{return manageUnresolved(r,t,r.value,`Expected a valid modifier()`)}}function transformRGBAdjuster(e,r,t){const n=transformArgsByParams(r,[[transformMinusPlusOperator,transformPercentage,transformPercentage,transformPercentage],[transformMinusPlusOperator,transformRGBNumber,transformRGBNumber,transformRGBNumber],[transformMinusPlusOperator,transformHexColor],[transformTimesOperator,transformPercentage]]),i=_slicedToArray(n,4),o=i[0],s=i[1],a=i[2],u=i[3];if(s!==undefined&&s.color){const r=e.rgb(o==="+"?e.red()+s.red():e.red()-s.red(),o==="+"?e.green()+s.green():e.green()-s.green(),o==="+"?e.blue()+s.blue():e.blue()-s.blue());return r}else if(o!==undefined&&R.test(o)){const r=e.rgb(o==="+"?e.red()+s:e.red()-s,o==="+"?e.green()+a:e.green()-a,o==="+"?e.blue()+u:e.blue()-u);return r}else if(o!==undefined&&s!==undefined){const r=e.rgb(e.red()*s,e.green()*s,e.blue()*s);return r}else{return manageUnresolved(r,t,r.value,`Expected a valid rgb() adjuster`)}}function transformBlendAdjuster(e,r,t,n){const i=transformArgsByParams(r,[[transformColor,transformPercentage,transformColorSpace]]),o=_slicedToArray(i,3),s=o[0],a=o[1],u=o[2],f=u===void 0?"rgb":u;if(a!==undefined){const r=t?e.blenda(s.color,a,f):e.blend(s.color,a,f);return r}else{return manageUnresolved(r,n,r.value,`Expected a valid blend() adjuster)`)}}function transformContrastAdjuster(e,r,t){const n=transformArgsByParams(r,[[transformPercentage]]),i=_slicedToArray(n,1),o=i[0];if(o!==undefined){const r=e.contrast(o);return r}else{return manageUnresolved(r,t,r.value,`Expected a valid contrast() adjuster)`)}}function transformHueAdjuster(e,r,t){const n=transformArgsByParams(r,[[transformMinusPlusTimesOperator,transformHue],[transformHue]]),i=_slicedToArray(n,2),o=i[0],s=i[1];if(o!==undefined){const r=e.hue();const t=s!==undefined?o==="+"?r+Number(s):o==="-"?r-Number(s):o==="*"?r*Number(s):Number(s):Number(o);return e.hue(t)}else{return manageUnresolved(r,t,r.value,`Expected a valid hue() function)`)}}function transformBlacknessLightnessSaturationWhitenessAdjuster(e,r,t){const n=r.value.toLowerCase().replace(/^b$/,"blackness").replace(/^l$/,"lightness").replace(/^s$/,"saturation").replace(/^w$/,"whiteness");const i=transformArgsByParams(r,[[transformMinusPlusTimesOperator,transformPercentage],[transformPercentage]]),o=_slicedToArray(i,2),s=o[0],a=o[1];if(s!==undefined){const r=e[n]();const t=a!==undefined?s==="+"?r+Number(a):s==="-"?r-Number(a):s==="*"?r*Number(a):Number(a):Number(s);return e[n](t)}else{return manageUnresolved(r,t,r.value,`Expected a valid ${n}() function)`)}}function transformShadeTintAdjuster(e,r,t){const n=r.value.toLowerCase();const i=transformArgsByParams(r,[[transformPercentage]]),o=_slicedToArray(i,1),s=o[0];if(s!==undefined){const r=Number(s);return e[n](r)}else{return manageUnresolved(r,t,r.value,`Expected valid ${n}() arguments`)}}function transformColorSpace(e,r){if(isColorSpace(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a valid color space)`)}}function transformAlpha(e,r){if(isNumber(e)){return e.value*100}else if(isPercentage(e)){return transformPercentage(e,r)}else{return manageUnresolved(e,r,e.value,`Expected a valid alpha value)`)}}function transformRGBNumber(e,r){if(isNumber(e)){return e.value/2.55}else{return manageUnresolved(e,r,e.value,`Expected a valid RGB value)`)}}function transformHue(e,r){if(isHue(e)){const r=e.unit.toLowerCase();if(r==="grad"){return convertGtoD(e.value)}else if(r==="rad"){return convertRtoD(e.value)}else if(r==="turn"){return convertTtoD(e.value)}else{return convertDtoD(e.value)}}else{return manageUnresolved(e,r,e.value,`Expected a valid hue`)}}function transformPercentage(e,r){if(isPercentage(e)){return Number(e.value)}else{return manageUnresolved(e,r,e.value,`Expected a valid hue`)}}function transformMinusPlusOperator(e,r){if(isMinusPlusOperator(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a plus or minus operator`)}}function transformTimesOperator(e,r){if(isTimesOperator(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a times operator`)}}function transformMinusPlusTimesOperator(e,r){if(isMinusPlusTimesOperator(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a plus, minus, or times operator`)}}function transformWord(e,r){if(isWord(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a valid word`)}}function transformNode(e){return Object(e)}function transformArgsByParams(e,r){const t=(e.nodes||[]).slice(1,-1);const n={unresolved:"ignore"};return r.map(e=>t.map((r,t)=>typeof e[t]==="function"?e[t](r,n):undefined).filter(e=>typeof e!=="boolean")).filter(e=>e.every(e=>e!==undefined))[0]||[]}function walk(e,r){r(e);if(Object(e.nodes).length){e.nodes.slice().forEach(e=>{walk(e,r)})}}function isVariable(e){return Object(e).type==="func"&&M.test(e.value)}function isAlphaBlueGreenRedAdjuster(e){return Object(e).type==="func"&&m.test(e.value)}function isRGBAdjuster(e){return Object(e).type==="func"&&x.test(e.value)}function isHueAdjuster(e){return Object(e).type==="func"&&D.test(e.value)}function isBlacknessLightnessSaturationWhitenessAdjuster(e){return Object(e).type==="func"&&C.test(e.value)}function isShadeTintAdjuster(e){return Object(e).type==="func"&&I.test(e.value)}function isBlendAdjuster(e){return Object(e).type==="func"&&w.test(e.value)}function isContrastAdjuster(e){return Object(e).type==="func"&&T.test(e.value)}function isRGBFunction(e){return Object(e).type==="func"&&j.test(e.value)}function isHSLFunction(e){return Object(e).type==="func"&&k.test(e.value)}function isHWBFunction(e){return Object(e).type==="func"&&A.test(e.value)}function isColorModFunction(e){return Object(e).type==="func"&&S.test(e.value)}function isNamedColor(e){return Object(e).type==="word"&&Boolean(convertNtoRGB(e.value))}function isHexColor(e){return Object(e).type==="word"&&E.test(e.value)}function isColorSpace(e){return Object(e).type==="word"&&O.test(e.value)}function isHue(e){return Object(e).type==="number"&&P.test(e.unit)}function isComma(e){return Object(e).type==="comma"}function isSlash(e){return Object(e).type==="operator"&&e.value==="/"}function isNumber(e){return Object(e).type==="number"&&e.unit===""}function isMinusPlusOperator(e){return Object(e).type==="operator"&&R.test(e.value)}function isMinusPlusTimesOperator(e){return Object(e).type==="operator"&&F.test(e.value)}function isTimesOperator(e){return Object(e).type==="operator"&&N.test(e.value)}function isPercentage(e){return Object(e).type==="number"&&(e.unit==="%"||e.value==="0")}function isWord(e){return Object(e).type==="word"}const g=/^a(lpha)?$/i;const m=/^(a(lpha)?|blue|green|red)$/i;const C=/^(b(lackness)?|l(ightness)?|s(aturation)?|w(hiteness)?)$/i;const w=/^blenda?$/i;const S=/^color-mod$/i;const O=/^(hsl|hwb|rgb)$/i;const T=/^contrast$/i;const E=/^#(?:([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?)$/i;const k=/^hsla?$/i;const P=/^(deg|grad|rad|turn)?$/i;const D=/^h(ue)?$/i;const A=/^hwb$/i;const R=/^[+-]$/;const F=/^[*+-]$/;const x=/^rgb$/i;const j=/^rgba?$/i;const I=/^(shade|tint)$/i;const M=/^var$/i;const _=/(^|[^\w-])var\(/i;const N=/^[*]$/;var L=s.plugin("postcss-color-mod-function",e=>{const r=String(Object(e).unresolved||"throw").toLowerCase();const t=Object(e).stringifier||(e=>e.toLegacy());const i=[].concat(Object(e).importFrom||[]);const o="transformVars"in Object(e)?e.transformVars:true;const s=importCustomPropertiesFromSources(i);return function(){var e=_asyncToGenerator(function*(e,i){const a=Object.assign(yield s,getCustomProperties(e,{preserve:true}));e.walkDecls(e=>{const s=e.value;if(q.test(s)){const u=n(s,{loose:true}).parse();transformAST(u,{unresolved:r,stringifier:t,transformVars:o,decl:e,result:i,customProperties:a});const f=u.toString();if(s!==f){e.value=f}}})});return function(r,t){return e.apply(this,arguments)}}()});const q=/(^|[^\w-])color-mod\(/i;e.exports=L},9971:(e,r,t)=>{const n=t(4633);const i=t(9448);const o="#639";const s=/(^|[^\w-])rebeccapurple([^\w-]|$)/;e.exports=n.plugin("postcss-color-rebeccapurple",()=>e=>{e.walkDecls(e=>{const r=e.value;if(r&&s.test(r)){const t=i(r).parse();t.walk(e=>{if(e.type==="word"&&e.value==="rebeccapurple"){e.value=o}});e.value=t.toString()}})})},4731:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(5747));var o=_interopDefault(t(5622));function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function _defineProperty(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function _objectSpread(e){for(var r=1;r0){o-=1}}else if(o===0){if(r&&h.test(n+a)){i=true}else if(!r&&a===","){i=true}}if(i){t.push(r?new MediaExpression(n+a):new MediaQuery(n));n="";i=false}else{n+=a}}if(n!==""){t.push(r?new MediaExpression(n):new MediaQuery(n))}return t}class MediaQueryList{constructor(e){this.nodes=parse(e)}invert(){this.nodes.forEach(e=>{e.invert()});return this}clone(){return new MediaQueryList(String(this))}toString(){return this.nodes.join(",")}}class MediaQuery{constructor(e){const r=e.match(B),t=_slicedToArray(r,4),n=t[1],i=t[2],o=t[3];const s=i.match(v)||[],a=_slicedToArray(s,9),u=a[1],f=u===void 0?"":u,c=a[2],l=c===void 0?" ":c,p=a[3],h=p===void 0?"":p,d=a[4],b=d===void 0?"":d,y=a[5],g=y===void 0?"":y,m=a[6],C=m===void 0?"":m,w=a[7],S=w===void 0?"":w,O=a[8],T=O===void 0?"":O;const E={before:n,after:o,afterModifier:l,originalModifier:f||"",beforeAnd:b,and:g,beforeExpression:C};const k=parse(S||T,true);Object.assign(this,{modifier:f,type:h,raws:E,nodes:k})}clone(e){const r=new MediaQuery(String(this));Object.assign(r,e);return r}invert(){this.modifier=this.modifier?"":this.raws.originalModifier;return this}toString(){const e=this.raws;return`${e.before}${this.modifier}${this.modifier?`${e.afterModifier}`:""}${this.type}${e.beforeAnd}${e.and}${e.beforeExpression}${this.nodes.join("")}${this.raws.after}`}}class MediaExpression{constructor(e){const r=e.match(h)||[null,e],t=_slicedToArray(r,5),n=t[1],i=t[2],o=i===void 0?"":i,s=t[3],a=s===void 0?"":s,u=t[4],f=u===void 0?"":u;const c={after:o,and:a,afterAnd:f};Object.assign(this,{value:n,raws:c})}clone(e){const r=new MediaExpression(String(this));Object.assign(r,e);return r}toString(){const e=this.raws;return`${this.value}${e.after}${e.and}${e.afterAnd}`}}const s="(not|only)";const a="(all|print|screen|speech)";const u="([\\W\\w]*)";const f="([\\W\\w]+)";const c="(\\s*)";const l="(\\s+)";const p="(?:(\\s+)(and))";const h=new RegExp(`^${f}(?:${p}${l})$`,"i");const B=new RegExp(`^${c}${u}${c}$`);const v=new RegExp(`^(?:${s}${l})?(?:${a}(?:${p}${l}${f})?|${f})$`,"i");var d=e=>new MediaQueryList(e);var b=(e,r)=>{const t={};e.nodes.slice().forEach(e=>{if(m(e)){const n=e.params.match(g),i=_slicedToArray(n,3),o=i[1],s=i[2];t[o]=d(s);if(!Object(r).preserve){e.remove()}}});return t};const y=/^custom-media$/i;const g=/^(--[A-z][\w-]*)\s+([\W\w]+)\s*$/;const m=e=>e.type==="atrule"&&y.test(e.name)&&g.test(e.params);function getCustomMediaFromCSSFile(e){return _getCustomMediaFromCSSFile.apply(this,arguments)}function _getCustomMediaFromCSSFile(){_getCustomMediaFromCSSFile=_asyncToGenerator(function*(e){const r=yield C(e);const t=n.parse(r,{from:e});return b(t,{preserve:true})});return _getCustomMediaFromCSSFile.apply(this,arguments)}function getCustomMediaFromObject(e){const r=Object.assign({},Object(e).customMedia,Object(e)["custom-media"]);for(const e in r){r[e]=d(r[e])}return r}function getCustomMediaFromJSONFile(e){return _getCustomMediaFromJSONFile.apply(this,arguments)}function _getCustomMediaFromJSONFile(){_getCustomMediaFromJSONFile=_asyncToGenerator(function*(e){const r=yield w(e);return getCustomMediaFromObject(r)});return _getCustomMediaFromJSONFile.apply(this,arguments)}function getCustomMediaFromJSFile(e){return _getCustomMediaFromJSFile.apply(this,arguments)}function _getCustomMediaFromJSFile(){_getCustomMediaFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(e));return getCustomMediaFromObject(r)});return _getCustomMediaFromJSFile.apply(this,arguments)}function getCustomMediaFromSources(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(Object(r).customMedia||Object(r)["custom-media"]){return r}const t=o.resolve(String(r.from||""));const n=(r.type||o.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="css"||n==="pcss"){return Object.assign(yield e,yield getCustomMediaFromCSSFile(i))}if(n==="js"){return Object.assign(yield e,yield getCustomMediaFromJSFile(i))}if(n==="json"){return Object.assign(yield e,yield getCustomMediaFromJSONFile(i))}return Object.assign(yield e,getCustomMediaFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const C=e=>new Promise((r,t)=>{i.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const w=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield C(e))});return function readJSON(r){return e.apply(this,arguments)}}();function transformMediaList(e,r){let t=e.nodes.length-1;while(t>=0){const n=transformMedia(e.nodes[t],r);if(n.length){e.nodes.splice(t,1,...n)}--t}return e}function transformMedia(e,r){const t=[];for(const u in e.nodes){const f=e.nodes[u],c=f.value,l=f.nodes;const p=c.replace(S,"$1");if(p in r){var n=true;var i=false;var o=undefined;try{for(var s=r[p].nodes[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){const n=a.value;const i=e.modifier!==n.modifier?e.modifier||n.modifier:"";const o=e.clone({modifier:i,raws:!i||e.modifier?_objectSpread({},e.raws):_objectSpread({},n.raws),type:e.type||n.type});if(o.type===n.type){Object.assign(o.raws,{and:n.raws.and,beforeAnd:n.raws.beforeAnd,beforeExpression:n.raws.beforeExpression})}o.nodes.splice(u,1,...n.clone().nodes.map(r=>{if(e.nodes[u].raws.and){r.raws=_objectSpread({},e.nodes[u].raws)}r.spaces=_objectSpread({},e.nodes[u].spaces);return r}));const s=O(r,p);const f=transformMedia(o,s);if(f.length){t.push(...f)}else{t.push(o)}}}catch(e){i=true;o=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(i){throw o}}}return t}else if(l&&l.length){transformMediaList(e.nodes[u],r)}}return t}const S=/\((--[A-z][\w-]*)\)/;const O=(e,r)=>{const t=Object.assign({},e);delete t[r];return t};var T=(e,r,t)=>{e.walkAtRules(E,e=>{if(k.test(e.params)){const n=d(e.params);const i=String(transformMediaList(n,r));if(t.preserve){e.cloneBefore({params:i})}else{e.params=i}}})};const E=/^media$/i;const k=/\(--[A-z][\w-]*\)/;function writeCustomMediaToCssFile(e,r){return _writeCustomMediaToCssFile.apply(this,arguments)}function _writeCustomMediaToCssFile(){_writeCustomMediaToCssFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`@custom-media ${t} ${r[t]};`);return e},[]).join("\n");const n=`${t}\n`;yield D(e,n)});return _writeCustomMediaToCssFile.apply(this,arguments)}function writeCustomMediaToJsonFile(e,r){return _writeCustomMediaToJsonFile.apply(this,arguments)}function _writeCustomMediaToJsonFile(){_writeCustomMediaToJsonFile=_asyncToGenerator(function*(e,r){const t=JSON.stringify({"custom-media":r},null," ");const n=`${t}\n`;yield D(e,n)});return _writeCustomMediaToJsonFile.apply(this,arguments)}function writeCustomMediaToCjsFile(e,r){return _writeCustomMediaToCjsFile.apply(this,arguments)}function _writeCustomMediaToCjsFile(){_writeCustomMediaToCjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t\t'${A(t)}': '${A(r[t])}'`);return e},[]).join(",\n");const n=`module.exports = {\n\tcustomMedia: {\n${t}\n\t}\n};\n`;yield D(e,n)});return _writeCustomMediaToCjsFile.apply(this,arguments)}function writeCustomMediaToMjsFile(e,r){return _writeCustomMediaToMjsFile.apply(this,arguments)}function _writeCustomMediaToMjsFile(){_writeCustomMediaToMjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t'${A(t)}': '${A(r[t])}'`);return e},[]).join(",\n");const n=`export const customMedia = {\n${t}\n};\n`;yield D(e,n)});return _writeCustomMediaToMjsFile.apply(this,arguments)}function writeCustomMediaToExports(e,r){return Promise.all(r.map(function(){var r=_asyncToGenerator(function*(r){if(r instanceof Function){yield r(P(e))}else{const t=r===Object(r)?r:{to:String(r)};const n=t.toJSON||P;if("customMedia"in t){t.customMedia=n(e)}else if("custom-media"in t){t["custom-media"]=n(e)}else{const r=String(t.to||"");const i=(t.type||o.extname(r).slice(1)).toLowerCase();const s=n(e);if(i==="css"){yield writeCustomMediaToCssFile(r,s)}if(i==="js"){yield writeCustomMediaToCjsFile(r,s)}if(i==="json"){yield writeCustomMediaToJsonFile(r,s)}if(i==="mjs"){yield writeCustomMediaToMjsFile(r,s)}}}});return function(e){return r.apply(this,arguments)}}()))}const P=e=>{return Object.keys(e).reduce((r,t)=>{r[t]=String(e[t]);return r},{})};const D=(e,r)=>new Promise((t,n)=>{i.writeFile(e,r,e=>{if(e){n(e)}else{t()}})});const A=e=>e.replace(/\\([\s\S])|(')/g,"\\$1$2").replace(/\n/g,"\\n").replace(/\r/g,"\\r");var R=n.plugin("postcss-custom-media",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):false;const t=[].concat(Object(e).importFrom||[]);const n=[].concat(Object(e).exportTo||[]);const i=getCustomMediaFromSources(t);return function(){var e=_asyncToGenerator(function*(e){const t=Object.assign(yield i,b(e,{preserve:r}));yield writeCustomMediaToExports(t,n);T(e,t,{preserve:r})});return function(r){return e.apply(this,arguments)}}()});e.exports=R},8713:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=_interopDefault(t(5747));var s=_interopDefault(t(5622));function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function parse(e){return i(e).parse()}function isBlockIgnored(e){var r=e.selector?e:e.parent;return/(!\s*)?postcss-custom-properties:\s*off\b/i.test(r.toString())}function isRuleIgnored(e){var r=e.prev();return Boolean(isBlockIgnored(e)||r&&r.type==="comment"&&/(!\s*)?postcss-custom-properties:\s*ignore\s+next\b/i.test(r.text))}function getCustomPropertiesFromRoot(e,r){const t={};const n={};e.nodes.slice().forEach(e=>{const i=c(e)?t:l(e)?n:null;if(i){e.nodes.slice().forEach(e=>{if(p(e)&&!isBlockIgnored(e)){const t=e.prop;i[t]=parse(e.value).nodes;if(!r.preserve){e.remove()}}});if(!r.preserve&&h(e)&&!isBlockIgnored(e)){e.remove()}}});return Object.assign({},t,n)}const a=/^html$/i;const u=/^:root$/i;const f=/^--[A-z][\w-]*$/;const c=e=>e.type==="rule"&&a.test(e.selector)&&Object(e.nodes).length;const l=e=>e.type==="rule"&&u.test(e.selector)&&Object(e.nodes).length;const p=e=>e.type==="decl"&&f.test(e.prop);const h=e=>Object(e.nodes).length===0;function getCustomPropertiesFromCSSFile(e){return _getCustomPropertiesFromCSSFile.apply(this,arguments)}function _getCustomPropertiesFromCSSFile(){_getCustomPropertiesFromCSSFile=_asyncToGenerator(function*(e){const r=yield B(e);const t=n.parse(r,{from:e});return getCustomPropertiesFromRoot(t,{preserve:true})});return _getCustomPropertiesFromCSSFile.apply(this,arguments)}function getCustomPropertiesFromObject(e){const r=Object.assign({},Object(e).customProperties,Object(e)["custom-properties"]);for(const e in r){r[e]=parse(String(r[e])).nodes}return r}function getCustomPropertiesFromJSONFile(e){return _getCustomPropertiesFromJSONFile.apply(this,arguments)}function _getCustomPropertiesFromJSONFile(){_getCustomPropertiesFromJSONFile=_asyncToGenerator(function*(e){const r=yield v(e);return getCustomPropertiesFromObject(r)});return _getCustomPropertiesFromJSONFile.apply(this,arguments)}function getCustomPropertiesFromJSFile(e){return _getCustomPropertiesFromJSFile.apply(this,arguments)}function _getCustomPropertiesFromJSFile(){_getCustomPropertiesFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(e));return getCustomPropertiesFromObject(r)});return _getCustomPropertiesFromJSFile.apply(this,arguments)}function getCustomPropertiesFromImports(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(r.customProperties||r["custom-properties"]){return r}const t=s.resolve(String(r.from||""));const n=(r.type||s.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="css"){return Object.assign(yield e,yield getCustomPropertiesFromCSSFile(i))}if(n==="js"){return Object.assign(yield e,yield getCustomPropertiesFromJSFile(i))}if(n==="json"){return Object.assign(yield e,yield getCustomPropertiesFromJSONFile(i))}return Object.assign(yield e,yield getCustomPropertiesFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const B=e=>new Promise((r,t)=>{o.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const v=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield B(e))});return function readJSON(r){return e.apply(this,arguments)}}();function transformValueAST(e,r){if(e.nodes&&e.nodes.length){e.nodes.slice().forEach(t=>{if(b(t)){const n=t.nodes.slice(1,-1),i=n[0],o=n[1],s=n.slice(2);const a=i.value;if(a in Object(r)){const e=y(r[a],t.raws.before);t.replaceWith(...e);retransformValueAST({nodes:e},r,a)}else if(s.length){const n=e.nodes.indexOf(t);if(n!==-1){e.nodes.splice(n,1,...y(s,t.raws.before))}transformValueAST(e,r)}}else{transformValueAST(t,r)}})}return e}function retransformValueAST(e,r,t){const n=Object.assign({},r);delete n[t];return transformValueAST(e,n)}const d=/^var$/i;const b=e=>e.type==="func"&&d.test(e.value)&&Object(e.nodes).length>0;const y=(e,r)=>{const t=g(e,null);if(t[0]){t[0].raws.before=r}return t};const g=(e,r)=>e.map(e=>m(e,r));const m=(e,r)=>{const t=new e.constructor(e);for(const n in e){if(n==="parent"){t.parent=r}else if(Object(e[n]).constructor===Array){t[n]=g(e.nodes,t)}else if(Object(e[n]).constructor===Object){t[n]=Object.assign({},e[n])}}return t};var C=(e,r,t)=>{e.walkDecls(e=>{if(O(e)&&!isRuleIgnored(e)){const n=e.value;const i=parse(n);const o=String(transformValueAST(i,r));if(o!==n){if(t.preserve){e.cloneBefore({value:o})}else{e.value=o}}}})};const w=/^--[A-z][\w-]*$/;const S=/(^|[^\w-])var\([\W\w]+\)/;const O=e=>!w.test(e.prop)&&S.test(e.value);function writeCustomPropertiesToCssFile(e,r){return _writeCustomPropertiesToCssFile.apply(this,arguments)}function _writeCustomPropertiesToCssFile(){_writeCustomPropertiesToCssFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t${t}: ${r[t]};`);return e},[]).join("\n");const n=`:root {\n${t}\n}\n`;yield E(e,n)});return _writeCustomPropertiesToCssFile.apply(this,arguments)}function writeCustomPropertiesToJsonFile(e,r){return _writeCustomPropertiesToJsonFile.apply(this,arguments)}function _writeCustomPropertiesToJsonFile(){_writeCustomPropertiesToJsonFile=_asyncToGenerator(function*(e,r){const t=JSON.stringify({"custom-properties":r},null," ");const n=`${t}\n`;yield E(e,n)});return _writeCustomPropertiesToJsonFile.apply(this,arguments)}function writeCustomPropertiesToCjsFile(e,r){return _writeCustomPropertiesToCjsFile.apply(this,arguments)}function _writeCustomPropertiesToCjsFile(){_writeCustomPropertiesToCjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t\t'${k(t)}': '${k(r[t])}'`);return e},[]).join(",\n");const n=`module.exports = {\n\tcustomProperties: {\n${t}\n\t}\n};\n`;yield E(e,n)});return _writeCustomPropertiesToCjsFile.apply(this,arguments)}function writeCustomPropertiesToMjsFile(e,r){return _writeCustomPropertiesToMjsFile.apply(this,arguments)}function _writeCustomPropertiesToMjsFile(){_writeCustomPropertiesToMjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t'${k(t)}': '${k(r[t])}'`);return e},[]).join(",\n");const n=`export const customProperties = {\n${t}\n};\n`;yield E(e,n)});return _writeCustomPropertiesToMjsFile.apply(this,arguments)}function writeCustomPropertiesToExports(e,r){return Promise.all(r.map(function(){var r=_asyncToGenerator(function*(r){if(r instanceof Function){yield r(T(e))}else{const t=r===Object(r)?r:{to:String(r)};const n=t.toJSON||T;if("customProperties"in t){t.customProperties=n(e)}else if("custom-properties"in t){t["custom-properties"]=n(e)}else{const r=String(t.to||"");const i=(t.type||s.extname(t.to).slice(1)).toLowerCase();const o=n(e);if(i==="css"){yield writeCustomPropertiesToCssFile(r,o)}if(i==="js"){yield writeCustomPropertiesToCjsFile(r,o)}if(i==="json"){yield writeCustomPropertiesToJsonFile(r,o)}if(i==="mjs"){yield writeCustomPropertiesToMjsFile(r,o)}}}});return function(e){return r.apply(this,arguments)}}()))}const T=e=>{return Object.keys(e).reduce((r,t)=>{r[t]=String(e[t]);return r},{})};const E=(e,r)=>new Promise((t,n)=>{o.writeFile(e,r,e=>{if(e){n(e)}else{t()}})});const k=e=>e.replace(/\\([\s\S])|(')/g,"\\$1$2").replace(/\n/g,"\\n").replace(/\r/g,"\\r");var P=n.plugin("postcss-custom-properties",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;const t=[].concat(Object(e).importFrom||[]);const n=[].concat(Object(e).exportTo||[]);const i=getCustomPropertiesFromImports(t);const o=e=>{const t=getCustomPropertiesFromRoot(e,{preserve:r});C(e,t,{preserve:r})};const s=function(){var e=_asyncToGenerator(function*(e){const t=Object.assign({},yield i,getCustomPropertiesFromRoot(e,{preserve:r}));yield writeCustomPropertiesToExports(t,n);C(e,t,{preserve:r})});return function asyncTransform(r){return e.apply(this,arguments)}}();const a=t.length===0&&n.length===0;return a?o:s});e.exports=P},8758:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(2152));var i=_interopDefault(t(5747));var o=_interopDefault(t(5622));var s=_interopDefault(t(4633));function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function _defineProperty(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function _objectSpread(e){for(var r=1;r{let r;n(e=>{r=e}).processSync(e);return r};var u=(e,r)=>{const t={};e.nodes.slice().forEach(e=>{if(l(e)){const n=e.params.match(c),i=_slicedToArray(n,3),o=i[1],s=i[2];t[o]=a(s);if(!Object(r).preserve){e.remove()}}});return t};const f=/^custom-selector$/i;const c=/^(:--[A-z][\w-]*)\s+([\W\w]+)\s*$/;const l=e=>e.type==="atrule"&&f.test(e.name)&&c.test(e.params);function transformSelectorList(e,r){let t=e.nodes.length-1;while(t>=0){const n=transformSelector(e.nodes[t],r);if(n.length){e.nodes.splice(t,1,...n)}--t}return e}function transformSelector(e,r){const t=[];for(const u in e.nodes){const f=e.nodes[u],c=f.value,l=f.nodes;if(c in r){var n=true;var i=false;var o=undefined;try{for(var s=r[c].nodes[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){const n=a.value;const i=e.clone();i.nodes.splice(u,1,...n.clone().nodes.map(r=>{r.spaces=_objectSpread({},e.nodes[u].spaces);return r}));const o=transformSelector(i,r);d(i.nodes,Number(u));if(o.length){t.push(...o)}else{t.push(i)}}}catch(e){i=true;o=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(i){throw o}}}return t}else if(l&&l.length){transformSelectorList(e.nodes[u],r)}}return t}const p=/^(tag|universal)$/;const h=/^(class|id|pseudo|tag|universal)$/;const B=e=>p.test(Object(e).type);const v=e=>h.test(Object(e).type);const d=(e,r)=>{if(r&&B(e[r])&&v(e[r-1])){let t=r-1;while(t&&v(e[t])){--t}if(t{e.walkRules(y,e=>{const i=n(e=>{transformSelectorList(e,r,t)}).processSync(e.selector);if(t.preserve){e.cloneBefore({selector:i})}else{e.selector=i}})};const y=/:--[A-z][\w-]*/;function importCustomSelectorsFromCSSAST(e){return u(e)}function importCustomSelectorsFromCSSFile(e){return _importCustomSelectorsFromCSSFile.apply(this,arguments)}function _importCustomSelectorsFromCSSFile(){_importCustomSelectorsFromCSSFile=_asyncToGenerator(function*(e){const r=yield g(o.resolve(e));const t=s.parse(r,{from:o.resolve(e)});return importCustomSelectorsFromCSSAST(t)});return _importCustomSelectorsFromCSSFile.apply(this,arguments)}function importCustomSelectorsFromObject(e){const r=Object.assign({},Object(e).customSelectors||Object(e)["custom-selectors"]);for(const e in r){r[e]=a(r[e])}return r}function importCustomSelectorsFromJSONFile(e){return _importCustomSelectorsFromJSONFile.apply(this,arguments)}function _importCustomSelectorsFromJSONFile(){_importCustomSelectorsFromJSONFile=_asyncToGenerator(function*(e){const r=yield m(o.resolve(e));return importCustomSelectorsFromObject(r)});return _importCustomSelectorsFromJSONFile.apply(this,arguments)}function importCustomSelectorsFromJSFile(e){return _importCustomSelectorsFromJSFile.apply(this,arguments)}function _importCustomSelectorsFromJSFile(){_importCustomSelectorsFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(o.resolve(e)));return importCustomSelectorsFromObject(r)});return _importCustomSelectorsFromJSFile.apply(this,arguments)}function importCustomSelectorsFromSources(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(Object(r).customSelectors||Object(r)["custom-selectors"]){return r}const t=String(r.from||"");const n=(r.type||o.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="ast"){return Object.assign(e,importCustomSelectorsFromCSSAST(i))}if(n==="css"){return Object.assign(e,yield importCustomSelectorsFromCSSFile(i))}if(n==="js"){return Object.assign(e,yield importCustomSelectorsFromJSFile(i))}if(n==="json"){return Object.assign(e,yield importCustomSelectorsFromJSONFile(i))}return Object.assign(e,importCustomSelectorsFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const g=e=>new Promise((r,t)=>{i.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const m=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield g(e))});return function readJSON(r){return e.apply(this,arguments)}}();function exportCustomSelectorsToCssFile(e,r){return _exportCustomSelectorsToCssFile.apply(this,arguments)}function _exportCustomSelectorsToCssFile(){_exportCustomSelectorsToCssFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`@custom-selector ${t} ${r[t]};`);return e},[]).join("\n");const n=`${t}\n`;yield w(e,n)});return _exportCustomSelectorsToCssFile.apply(this,arguments)}function exportCustomSelectorsToJsonFile(e,r){return _exportCustomSelectorsToJsonFile.apply(this,arguments)}function _exportCustomSelectorsToJsonFile(){_exportCustomSelectorsToJsonFile=_asyncToGenerator(function*(e,r){const t=JSON.stringify({"custom-selectors":r},null," ");const n=`${t}\n`;yield w(e,n)});return _exportCustomSelectorsToJsonFile.apply(this,arguments)}function exportCustomSelectorsToCjsFile(e,r){return _exportCustomSelectorsToCjsFile.apply(this,arguments)}function _exportCustomSelectorsToCjsFile(){_exportCustomSelectorsToCjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t\t'${S(t)}': '${S(r[t])}'`);return e},[]).join(",\n");const n=`module.exports = {\n\tcustomSelectors: {\n${t}\n\t}\n};\n`;yield w(e,n)});return _exportCustomSelectorsToCjsFile.apply(this,arguments)}function exportCustomSelectorsToMjsFile(e,r){return _exportCustomSelectorsToMjsFile.apply(this,arguments)}function _exportCustomSelectorsToMjsFile(){_exportCustomSelectorsToMjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t'${S(t)}': '${S(r[t])}'`);return e},[]).join(",\n");const n=`export const customSelectors = {\n${t}\n};\n`;yield w(e,n)});return _exportCustomSelectorsToMjsFile.apply(this,arguments)}function exportCustomSelectorsToDestinations(e,r){return Promise.all(r.map(function(){var r=_asyncToGenerator(function*(r){if(r instanceof Function){yield r(C(e))}else{const t=r===Object(r)?r:{to:String(r)};const n=t.toJSON||C;if("customSelectors"in t){t.customSelectors=n(e)}else if("custom-selectors"in t){t["custom-selectors"]=n(e)}else{const r=String(t.to||"");const i=(t.type||o.extname(t.to).slice(1)).toLowerCase();const s=n(e);if(i==="css"){yield exportCustomSelectorsToCssFile(r,s)}if(i==="js"){yield exportCustomSelectorsToCjsFile(r,s)}if(i==="json"){yield exportCustomSelectorsToJsonFile(r,s)}if(i==="mjs"){yield exportCustomSelectorsToMjsFile(r,s)}}}});return function(e){return r.apply(this,arguments)}}()))}const C=e=>{return Object.keys(e).reduce((r,t)=>{r[t]=String(e[t]);return r},{})};const w=(e,r)=>new Promise((t,n)=>{i.writeFile(e,r,e=>{if(e){n(e)}else{t()}})});const S=e=>e.replace(/\\([\s\S])|(')/g,"\\$1$2").replace(/\n/g,"\\n").replace(/\r/g,"\\r");var O=s.plugin("postcss-custom-selectors",e=>{const r=Boolean(Object(e).preserve);const t=[].concat(Object(e).importFrom||[]);const n=[].concat(Object(e).exportTo||[]);const i=importCustomSelectorsFromSources(t);return function(){var e=_asyncToGenerator(function*(e){const t=Object.assign(yield i,u(e,{preserve:r}));yield exportCustomSelectorsToDestinations(t,n);b(e,t,{preserve:r})});return function(r){return e.apply(this,arguments)}}()});e.exports=O},666:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(7291);var i=_interopRequireDefault(n);var o=t(2341);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},1387:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(1387);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},3982:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},3687:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},9211:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},5420:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(3982);var i=_interopRequireDefault(n);var o=t(3687);var s=_interopRequireDefault(o);var a=t(4274);var u=_interopRequireDefault(a);var f=t(9211);var c=_interopRequireDefault(f);var l=t(7732);var p=_interopRequireDefault(l);var h=t(3589);var B=_interopRequireDefault(h);var v=t(1692);var d=_interopRequireDefault(v);var b=t(6522);var y=_interopRequireDefault(b);var g=t(3390);var m=_interopRequireDefault(g);var C=t(1989);var w=_interopRequireDefault(C);var S=t(5535);var O=_interopRequireDefault(S);var T=t(9479);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},8541:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(9151);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},7732:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},2341:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(9151);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(5420);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(8526);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},6512:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},917:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(8541);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},6522:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(8541);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},1989:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},5535:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(6512);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},9151:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},9479:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(6512);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},7813:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},9676:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},7210:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(9676);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},560:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},456:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},2196:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3806);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(456);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(560);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(7012);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},7012:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},3806:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},3650:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9182));var o=n.plugin("postcss-dir-pseudo-class",e=>{const r=Object(e).dir;const t=Boolean(Object(e).preserve);return e=>{e.walkRules(/:dir\([^\)]*\)/,e=>{let n=e;if(t){n=e.cloneBefore()}n.selector=i(e=>{e.nodes.forEach(e=>{e.walk(t=>{if("pseudo"===t.type&&":dir"===t.value){const n=t.prev();const o=t.next();const s=n&&n.type&&"combinator"===n.type&&" "===n.value;const a=o&&o.type&&"combinator"===o.type&&" "===o.value;if(s&&(a||!o)){t.replaceWith(i.universal())}else{t.remove()}const u=e.nodes[0];const f=u&&"combinator"===u.type&&" "===u.value;const c=u&&"tag"===u.type&&"html"===u.value;const l=u&&"pseudo"===u.type&&":root"===u.value;if(u&&!c&&!l&&!f){e.prepend(i.combinator({value:" "}))}const p=t.nodes.toString();const h=r===p;const B=i.attribute({attribute:"dir",operator:"=",quoteMark:'"',value:`"${p}"`});const v=i.pseudo({value:`${c||l?"":"html"}:not`});v.append(i.attribute({attribute:"dir",operator:"=",quoteMark:'"',value:`"${"ltr"===p?"rtl":"ltr"}"`}));if(h){if(c){e.insertAfter(u,v)}else{e.prepend(v)}}else if(c){e.insertAfter(u,B)}else{e.prepend(B)}}})})}).processSync(n.selector)})}});e.exports=o},3730:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(7274);var i=_interopRequireDefault(n);var o=t(3639);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},1927:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(1927);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},8067:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},3198:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},7517:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},9338:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(8067);var i=_interopRequireDefault(n);var o=t(3198);var s=_interopRequireDefault(o);var a=t(6931);var u=_interopRequireDefault(a);var f=t(7517);var c=_interopRequireDefault(f);var l=t(1931);var p=_interopRequireDefault(l);var h=t(4712);var B=_interopRequireDefault(h);var v=t(7614);var d=_interopRequireDefault(v);var b=t(1026);var y=_interopRequireDefault(b);var g=t(5445);var m=_interopRequireDefault(g);var C=t(6959);var w=_interopRequireDefault(C);var S=t(5546);var O=_interopRequireDefault(S);var T=t(4411);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},3130:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(2958);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},1931:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},3639:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(2958);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(9338);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(6924);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},7264:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},4944:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(3130);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},1026:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3130);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},6959:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},5546:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(7264);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},2958:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},4411:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(7264);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},9611:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},5791:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},26:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(5791);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},7315:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},5558:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},4225:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(310);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(5558);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(7315);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(51);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},51:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},310:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},3030:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=n.plugin("postcss-double-position-gradients",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;return e=>{e.walkDecls(e=>{const t=e.value;if(s.test(t)){const n=i(t).parse();n.walkFunctionNodes(e=>{if(a.test(e.value)){const r=e.nodes.slice(1,-1);r.forEach((t,n)=>{const o=Object(r[n-1]);const s=Object(r[n-2]);const a=s.type&&o.type==="number"&&t.type==="number";if(a){const r=s.clone();const n=i.comma({value:",",raws:{after:" "}});e.insertBefore(t,n);e.insertBefore(t,r)}})}});const o=n.toString();if(t!==o){e.cloneBefore({value:o});if(!r){e.remove()}}}})}});const s=/(repeating-)?(conic|linear|radial)-gradient\([\W\w]*\)/i;const a=/^(repeating-)?(conic|linear|radial)-gradient$/i;e.exports=o},5538:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(9448));var i=_interopDefault(t(5747));var o=_interopDefault(t(5622));var s=_interopDefault(t(4633));function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}const a=/^--/;var u=e=>{const r=String(e.nodes.slice(1,-1));return a.test(r)?r:undefined};var f=(e,r)=>{const t=u(e);if(typeof t==="string"&&t in r){e.replaceWith(...c(r[t],e.raws.before))}};const c=(e,r)=>{const t=l(e,null);if(t[0]){t[0].raws.before=r}return t};const l=(e,r)=>e.map(e=>p(e,r));const p=(e,r)=>{const t=new e.constructor(e);for(const n in e){if(n==="parent"){t.parent=r}else if(Object(e[n]).constructor===Array){t[n]=l(e.nodes,t)}else if(Object(e[n]).constructor===Object){t[n]=Object.assign({},e[n])}}return t};var h=e=>e&&e.type==="func"&&e.value==="env";function walk(e,r){e.nodes.slice(0).forEach(e=>{if(e.nodes){walk(e,r)}if(h(e)){r(e)}})}var B=(e,r)=>{const t=n(e).parse();walk(t,e=>{f(e,r)});return String(t)};var v=e=>e&&e.type==="atrule";var d=e=>e&&e.type==="decl";var b=e=>v(e)&&e.params||d(e)&&e.value;function setSupportedValue(e,r){if(v(e)){e.params=r}if(d(e)){e.value=r}}function importEnvironmentVariablesFromObject(e){const r=Object.assign({},Object(e).environmentVariables||Object(e)["environment-variables"]);for(const e in r){r[e]=n(r[e]).parse().nodes}return r}function importEnvironmentVariablesFromJSONFile(e){return _importEnvironmentVariablesFromJSONFile.apply(this,arguments)}function _importEnvironmentVariablesFromJSONFile(){_importEnvironmentVariablesFromJSONFile=_asyncToGenerator(function*(e){const r=yield g(o.resolve(e));return importEnvironmentVariablesFromObject(r)});return _importEnvironmentVariablesFromJSONFile.apply(this,arguments)}function importEnvironmentVariablesFromJSFile(e){return _importEnvironmentVariablesFromJSFile.apply(this,arguments)}function _importEnvironmentVariablesFromJSFile(){_importEnvironmentVariablesFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(o.resolve(e)));return importEnvironmentVariablesFromObject(r)});return _importEnvironmentVariablesFromJSFile.apply(this,arguments)}function importEnvironmentVariablesFromSources(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(r.environmentVariables||r["environment-variables"]){return r}const t=String(r.from||"");const n=(r.type||o.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="js"){return Object.assign(e,yield importEnvironmentVariablesFromJSFile(i))}if(n==="json"){return Object.assign(e,yield importEnvironmentVariablesFromJSONFile(i))}return Object.assign(e,importEnvironmentVariablesFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const y=e=>new Promise((r,t)=>{i.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const g=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield y(e))});return function readJSON(r){return e.apply(this,arguments)}}();var m=s.plugin("postcss-env-fn",e=>{const r=[].concat(Object(e).importFrom||[]);const t=importEnvironmentVariablesFromSources(r);return function(){var e=_asyncToGenerator(function*(e){const r=yield t;e.walk(e=>{const t=b(e);if(t){const n=B(t,r);if(n!==t){setSupportedValue(e,n)}}})});return function(r){return e.apply(this,arguments)}}()});e.exports=m},9642:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/:focus-visible([^\w-]|$)/gi;var o=n.plugin("postcss-focus-visible",e=>{const r=String(Object(e).replaceWith||".focus-visible");const t=Boolean("preserve"in Object(e)?e.preserve:true);return e=>{e.walkRules(i,e=>{const n=e.selector.replace(i,(e,t)=>{return`${r}${t}`});const o=e.clone({selector:n});if(t){e.before(o)}else{e.replaceWith(o)}})}});e.exports=o},8059:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/:focus-within([^\w-]|$)/gi;var o=n.plugin("postcss-focus-within",e=>{const r=String(Object(e).replaceWith||"[focus-within]");const t=Boolean("preserve"in Object(e)?e.preserve:true);return e=>{e.walkRules(i,e=>{const n=e.selector.replace(i,(e,t)=>{return`${r}${t}`});const o=e.clone({selector:n});if(t){e.before(o)}else{e.replaceWith(o)}})}});e.exports=o},3203:(e,r,t)=>{var n=t(4633);var i={"font-variant-ligatures":{"common-ligatures":'"liga", "clig"',"no-common-ligatures":'"liga", "clig off"',"discretionary-ligatures":'"dlig"',"no-discretionary-ligatures":'"dlig" off',"historical-ligatures":'"hlig"',"no-historical-ligatures":'"hlig" off',contextual:'"calt"',"no-contextual":'"calt" off'},"font-variant-position":{sub:'"subs"',super:'"sups"',normal:'"subs" off, "sups" off'},"font-variant-caps":{"small-caps":'"c2sc"',"all-small-caps":'"smcp", "c2sc"',"petite-caps":'"pcap"',"all-petite-caps":'"pcap", "c2pc"',unicase:'"unic"',"titling-caps":'"titl"'},"font-variant-numeric":{"lining-nums":'"lnum"',"oldstyle-nums":'"onum"',"proportional-nums":'"pnum"',"tabular-nums":'"tnum"',"diagonal-fractions":'"frac"',"stacked-fractions":'"afrc"',ordinal:'"ordn"',"slashed-zero":'"zero"'},"font-kerning":{normal:'"kern"',none:'"kern" off'},"font-variant":{normal:"normal",inherit:"inherit"}};for(var o in i){var s=i[o];for(var a in s){if(!(a in i["font-variant"])){i["font-variant"][a]=s[a]}}}function getFontFeatureSettingsPrevTo(e){var r=null;e.parent.walkDecls(function(e){if(e.prop==="font-feature-settings"){r=e}});if(r===null){r=e.clone();r.prop="font-feature-settings";r.value="";e.parent.insertBefore(e,r)}return r}e.exports=n.plugin("postcss-font-variant",function(){return function(e){e.walkRules(function(e){var r=null;e.walkDecls(function(e){if(!i[e.prop]){return null}var t=e.value;if(e.prop==="font-variant"){t=e.value.split(/\s+/g).map(function(e){return i["font-variant"][e]}).join(", ")}else if(i[e.prop][e.value]){t=i[e.prop][e.value]}if(r===null){r=getFontFeatureSettingsPrevTo(e)}if(r.value&&r.value!==t){r.value+=", "+t}else{r.value=t}})})}})},9547:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/^(column-gap|gap|row-gap)$/i;var o=n.plugin("postcss-gap-properties",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;return e=>{e.walkDecls(i,e=>{e.cloneBefore({prop:`grid-${e.prop}`});if(!r){e.remove()}})}});e.exports=o},4287:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=e=>Object(e).type==="comma";const s=/^(-webkit-)?image-set$/i;var a=e=>Object(e).type==="func"&&/^(cross-fade|image|(repeating-)?(conic|linear|radial)-gradient|url)$/i.test(e.value)&&!(e.parent.parent&&e.parent.parent.type==="func"&&s.test(e.parent.parent.value))?String(e):Object(e).type==="string"?e.value:false;const u={dpcm:2.54,dpi:1,dppx:96,x:96};var f=(e,r)=>{if(Object(e).type==="number"&&e.unit in u){const t=Number(e.value)*u[e.unit.toLowerCase()];const i=Math.floor(t/u.x*100)/100;if(t in r){return false}else{const e=r[t]=n.atRule({name:"media",params:`(-webkit-min-device-pixel-ratio: ${i}), (min-resolution: ${t}dpi)`});return e}}else{return false}};var c=(e,r,t)=>{if(e.oninvalid==="warn"){e.decl.warn(e.result,r,{word:String(t)})}else if(e.oninvalid==="throw"){throw e.decl.error(r,{word:String(t)})}};var l=(e,r,t)=>{const n=r.parent;const i={};let s=e.length;let u=-1;while(ue-r).map(e=>i[e]);if(l.length){const e=l[0].nodes[0].nodes[0];if(l.length===1){r.value=e.value}else{const i=n.nodes;const o=i.slice(0,i.indexOf(r)).concat(e);if(o.length){const e=n.cloneBefore().removeAll();e.append(o)}n.before(l.slice(1));if(!t.preserve){r.remove();if(!n.nodes.length){n.remove()}}}}};const p=/(^|[^\w-])(-webkit-)?image-set\(/;const h=/^(-webkit-)?image-set$/i;var B=n.plugin("postcss-image-set-function",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;const t="oninvalid"in Object(e)?e.oninvalid:"ignore";return(e,n)=>{e.walkDecls(e=>{const o=e.value;if(p.test(o)){const s=i(o).parse();s.walkType("func",i=>{if(h.test(i.value)){l(i.nodes.slice(1,-1),e,{decl:e,oninvalid:t,preserve:r,result:n})}})}})}});e.exports=B},7501:(e,r,t)=>{var n=t(4633);var i=t(7552);e.exports=n.plugin("postcss-initial",function(e){e=e||{};e.reset=e.reset||"all";e.replace=e.replace||false;var r=i(e.reset==="inherited");var t=function(e,r){var t=false;r.parent.walkDecls(function(e){if(e.prop===r.prop&&e.value!==r.value){t=true}});return t};return function(n){n.walkDecls(function(n){if(n.value.indexOf("initial")<0){return}var i=r(n.prop,n.value);if(i.length===0)return;i.forEach(function(e){if(!t(n.prop,n)){n.cloneBefore(e)}});if(e.replace===true){n.remove()}})}})},7552:(e,r,t)=>{var n=t(8589);var i=t(9614);function _getRulesMap(e){return e.filter(function(e){return!e.combined}).reduce(function(e,r){e[r.prop.replace(/\-/g,"")]=r.initial;return e},{})}function _compileDecls(e){var r=_getRulesMap(e);return e.map(function(e){if(e.combined&&e.initial){var t=n(e.initial.replace(/\-/g,""));e.initial=t(r)}return e})}function _getRequirements(e){return e.reduce(function(e,r){if(!r.contains)return e;return r.contains.reduce(function(e,t){e[t]=r;return e},e)},{})}function _expandContainments(e){var r=_getRequirements(e);return e.filter(function(e){return!e.contains}).map(function(e){var t=r[e.prop];if(t){e.requiredBy=t.prop;e.basic=e.basic||t.basic;e.inherited=e.inherited||t.inherited}return e})}var o=_expandContainments(_compileDecls(i));function _clearDecls(e,r){return e.map(function(e){return{prop:e.prop,value:r.replace(/initial/g,e.initial)}})}function _allDecls(e){return o.filter(function(r){var t=r.combined||r.basic;if(e)return t&&r.inherited;return t})}function _concreteDecl(e){return o.filter(function(r){return e===r.prop||e===r.requiredBy})}function makeFallbackFunction(e){return function(r,t){var n;if(r==="all"){n=_allDecls(e)}else{n=_concreteDecl(r)}return _clearDecls(n,t)}}e.exports=makeFallbackFunction},7972:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=t(4567);var i=_interopDefault(t(4633));var o=_interopDefault(t(9448));var s=i.plugin("postcss-lab-function",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):false;return e=>{e.walkDecls(e=>{const t=e.value;if(a.test(t)){const i=o(t).parse();i.walkType("func",e=>{if(u.test(e.value)){const r=e.nodes.slice(1,-1);const t=f.test(e.value);const i=c.test(e.value);const o=!i&&S(r);const s=!i&&O(r);const a=i&&T(r);if(o||s){e.value="rgb";const i=r[3];const o=r[4];if(o){if(y(o)&&!v(o)){o.unit="";o.value=String(o.value/100)}if(o.value==="1"){i.remove();o.remove()}else{e.value+="a"}}if(i&&g(i)){i.replaceWith(E())}const s=t?n.lab2rgb:n.lch2rgb;const a=s(...[r[0].value,r[1].value,r[2].value].map(e=>parseFloat(e))).map(e=>Math.max(Math.min(parseInt(e*2.55),255),0));r[0].value=String(a[0]);r[1].value=String(a[1]);r[2].value=String(a[2]);e.nodes.splice(3,0,[E()]);e.nodes.splice(2,0,[E()])}else if(a){e.value="rgb";const t=r[2];const i=n.lab2rgb(...[r[0].value,0,0].map(e=>parseFloat(e))).map(e=>Math.max(Math.min(parseInt(e*2.55),255),0));e.removeAll().append(P("(")).append(k(i[0])).append(E()).append(k(i[1])).append(E()).append(k(i[2])).append(P(")"));if(t){if(y(t)&&!v(t)){t.unit="";t.value=String(t.value/100)}if(t.value!=="1"){e.value+="a";e.insertBefore(e.last,E()).insertBefore(e.last,t)}}}}});const s=String(i);if(r){e.cloneBefore({value:s})}else{e.value=s}}})}});const a=/(^|[^\w-])(lab|lch|gray)\(/i;const u=/^(lab|lch|gray)$/i;const f=/^lab$/i;const c=/^gray$/i;const l=/^%?$/i;const p=/^calc$/i;const h=/^(deg|grad|rad|turn)?$/i;const B=e=>v(e)||e.type==="number"&&l.test(e.unit);const v=e=>e.type==="func"&&p.test(e.value);const d=e=>v(e)||e.type==="number"&&h.test(e.unit);const b=e=>v(e)||e.type==="number"&&e.unit==="";const y=e=>v(e)||e.type==="number"&&e.unit==="%";const g=e=>e.type==="operator"&&e.value==="/";const m=[b,b,b,g,B];const C=[b,b,d,g,B];const w=[b,g,B];const S=e=>e.every((e,r)=>typeof m[r]==="function"&&m[r](e));const O=e=>e.every((e,r)=>typeof C[r]==="function"&&C[r](e));const T=e=>e.every((e,r)=>typeof w[r]==="function"&&w[r](e));const E=()=>o.comma({value:","});const k=e=>o.number({value:e});const P=e=>o.paren({value:e});e.exports=s},562:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=(e,r)=>{const t=Object(e.parent).type==="rule"?e.parent.clone({raws:{}}).removeAll():n.rule({selector:"&"});t.selectors=t.selectors.map(e=>`${e}:dir(${r})`);return t};const o=/^\s*logical\s+/i;const s=/^border(-width|-style|-color)?$/i;const a=/^border-(block|block-start|block-end|inline|inline-start|inline-end|start|end)(-(width|style|color))?$/i;var u={border:(e,r,t)=>{const n=o.test(r[0]);if(n){r[0]=r[0].replace(o,"")}const a=[e.clone({prop:`border-top${e.prop.replace(s,"$1")}`,value:r[0]}),e.clone({prop:`border-left${e.prop.replace(s,"$1")}`,value:r[1]||r[0]}),e.clone({prop:`border-bottom${e.prop.replace(s,"$1")}`,value:r[2]||r[0]}),e.clone({prop:`border-right${e.prop.replace(s,"$1")}`,value:r[3]||r[1]||r[0]})];const u=[e.clone({prop:`border-top${e.prop.replace(s,"$1")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(s,"$1")}`,value:r[1]||r[0]}),e.clone({prop:`border-bottom${e.prop.replace(s,"$1")}`,value:r[2]||r[0]}),e.clone({prop:`border-left${e.prop.replace(s,"$1")}`,value:r[3]||r[1]||r[0]})];return n?1===r.length?e.clone({value:e.value.replace(o,"")}):!r[3]||r[3]===r[1]?[e.clone({prop:`border-top${e.prop.replace(s,"$1")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(s,"$1")}`,value:r[3]||r[1]||r[0]}),e.clone({prop:`border-bottom${e.prop.replace(s,"$1")}`,value:r[2]||r[0]}),e.clone({prop:`border-left${e.prop.replace(s,"$1")}`,value:r[1]||r[0]})]:"ltr"===t?a:"rtl"===t?u:[i(e,"ltr").append(a),i(e,"rtl").append(u)]:null},"border-block":(e,r)=>[e.clone({prop:`border-top${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-bottom${e.prop.replace(a,"$2")}`,value:r[0]})],"border-block-start":e=>{e.prop="border-top"},"border-block-end":e=>{e.prop="border-bottom"},"border-inline":(e,r,t)=>{const n=[e.clone({prop:`border-left${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];const o=[e.clone({prop:`border-right${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-left${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];const s=1===r.length||2===r.length&&r[0]===r[1];return s?n:"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"border-inline-start":(e,r,t)=>{const n=e.clone({prop:`border-left${e.prop.replace(a,"$2")}`});const o=e.clone({prop:`border-right${e.prop.replace(a,"$2")}`});return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"border-inline-end":(e,r,t)=>{const n=e.clone({prop:`border-right${e.prop.replace(a,"$2")}`});const o=e.clone({prop:`border-left${e.prop.replace(a,"$2")}`});return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"border-start":(e,r,t)=>{const n=[e.clone({prop:`border-top${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-left${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];const o=[e.clone({prop:`border-top${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"border-end":(e,r,t)=>{const n=[e.clone({prop:`border-bottom${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];const o=[e.clone({prop:`border-bottom${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-left${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]}};var f=(e,r,t)=>{const n=e.clone({value:"left"});const o=e.clone({value:"right"});return/^inline-start$/i.test(e.value)?"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]:/^inline-end$/i.test(e.value)?"ltr"===t?o:"rtl"===t?n:[i(e,"ltr").append(o),i(e,"rtl").append(n)]:null};var c=(e,r,t)=>{if("logical"!==r[0]){return[e.clone({prop:"top",value:r[0]}),e.clone({prop:"right",value:r[1]||r[0]}),e.clone({prop:"bottom",value:r[2]||r[0]}),e.clone({prop:"left",value:r[3]||r[1]||r[0]})]}const n=!r[4]||r[4]===r[2];const o=[e.clone({prop:"top",value:r[1]}),e.clone({prop:"left",value:r[2]||r[1]}),e.clone({prop:"bottom",value:r[3]||r[1]}),e.clone({prop:"right",value:r[4]||r[2]||r[1]})];const s=[e.clone({prop:"top",value:r[1]}),e.clone({prop:"right",value:r[2]||r[1]}),e.clone({prop:"bottom",value:r[3]||r[1]}),e.clone({prop:"left",value:r[4]||r[2]||r[1]})];return n||"ltr"===t?o:"rtl"===t?s:[i(e,"ltr").append(o),i(e,"rtl").append(s)]};var l=e=>/^block$/i.test(e.value)?e.clone({value:"vertical"}):/^inline$/i.test(e.value)?e.clone({value:"horizontal"}):null;var p=/^(inset|margin|padding)(?:-(block|block-start|block-end|inline|inline-start|inline-end|start|end))$/i;var h=/^inset-/i;var B=(e,r,t)=>e.clone({prop:`${e.prop.replace(p,"$1")}${r}`.replace(h,""),value:t});var v={block:(e,r)=>[B(e,"-top",r[0]),B(e,"-bottom",r[1]||r[0])],"block-start":e=>{e.prop=e.prop.replace(p,"$1-top").replace(h,"")},"block-end":e=>{e.prop=e.prop.replace(p,"$1-bottom").replace(h,"")},inline:(e,r,t)=>{const n=[B(e,"-left",r[0]),B(e,"-right",r[1]||r[0])];const o=[B(e,"-right",r[0]),B(e,"-left",r[1]||r[0])];const s=1===r.length||2===r.length&&r[0]===r[1];return s?n:"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"inline-start":(e,r,t)=>{const n=B(e,"-left",e.value);const o=B(e,"-right",e.value);return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"inline-end":(e,r,t)=>{const n=B(e,"-right",e.value);const o=B(e,"-left",e.value);return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},start:(e,r,t)=>{const n=[B(e,"-top",r[0]),B(e,"-left",r[1]||r[0])];const o=[B(e,"-top",r[0]),B(e,"-right",r[1]||r[0])];return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},end:(e,r,t)=>{const n=[B(e,"-bottom",r[0]),B(e,"-right",r[1]||r[0])];const o=[B(e,"-bottom",r[0]),B(e,"-left",r[1]||r[0])];return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]}};var d=/^(min-|max-)?(block|inline)-(size)$/i;var b=e=>{e.prop=e.prop.replace(d,(e,r,t)=>`${r||""}${"block"===t?"height":"width"}`)};var y=(e,r,t)=>{if("logical"!==r[0]){return null}const n=!r[4]||r[4]===r[2];const o=e.clone({value:[r[1],r[4]||r[2]||r[1],r[3]||r[1],r[2]||r[1]].join(" ")});const s=e.clone({value:[r[1],r[2]||r[1],r[3]||r[1],r[4]||r[2]||r[1]].join(" ")});return n?e.clone({value:e.value.replace(/^\s*logical\s+/i,"")}):"ltr"===t?o:"rtl"===t?s:[i(e,"ltr").append(o),i(e,"rtl").append(s)]};var g=(e,r,t)=>{const n=e.clone({value:"left"});const o=e.clone({value:"right"});return/^start$/i.test(e.value)?"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]:/^end$/i.test(e.value)?"ltr"===t?o:"rtl"===t?n:[i(e,"ltr").append(o),i(e,"rtl").append(n)]:null};function splitByComma(e,r){return splitByRegExp(e,/^,$/,r)}function splitBySpace(e,r){return splitByRegExp(e,/^\s$/,r)}function splitBySlash(e,r){return splitByRegExp(e,/^\/$/,r)}function splitByRegExp(e,r,t){const n=[];let i="";let o=false;let s=0;let a=-1;while(++a0){s-=1}}else if(s===0){if(r.test(u)){o=true}}if(o){if(!t||i.trim()){n.push(t?i.trim():i)}if(!t){n.push(u)}i="";o=false}else{i+=u}}if(i!==""){n.push(t?i.trim():i)}return n}var m=(e,r,t)=>{const n=[];const o=[];splitByComma(e.value).forEach(e=>{let r=false;splitBySpace(e).forEach((e,t,i)=>{if(e in C){r=true;C[e].ltr.forEach(e=>{const r=i.slice();r.splice(t,1,e);if(n.length&&!/^,$/.test(n[n.length-1])){n.push(",")}n.push(r.join(""))});C[e].rtl.forEach(e=>{const r=i.slice();r.splice(t,1,e);if(o.length&&!/^,$/.test(o[o.length-1])){o.push(",")}o.push(r.join(""))})}});if(!r){n.push(e);o.push(e)}});const s=e.clone({value:n.join("")});const a=e.clone({value:o.join("")});return n.length&&"ltr"===t?s:o.length&&"rtl"===t?a:s.value!==a.value?[i(e,"ltr").append(s),i(e,"rtl").append(a)]:null};const C={"border-block":{ltr:["border-top","border-bottom"],rtl:["border-top","border-bottom"]},"border-block-color":{ltr:["border-top-color","border-bottom-color"],rtl:["border-top-color","border-bottom-color"]},"border-block-end":{ltr:["border-bottom"],rtl:["border-bottom"]},"border-block-end-color":{ltr:["border-bottom-color"],rtl:["border-bottom-color"]},"border-block-end-style":{ltr:["border-bottom-style"],rtl:["border-bottom-style"]},"border-block-end-width":{ltr:["border-bottom-width"],rtl:["border-bottom-width"]},"border-block-start":{ltr:["border-top"],rtl:["border-top"]},"border-block-start-color":{ltr:["border-top-color"],rtl:["border-top-color"]},"border-block-start-style":{ltr:["border-top-style"],rtl:["border-top-style"]},"border-block-start-width":{ltr:["border-top-width"],rtl:["border-top-width"]},"border-block-style":{ltr:["border-top-style","border-bottom-style"],rtl:["border-top-style","border-bottom-style"]},"border-block-width":{ltr:["border-top-width","border-bottom-width"],rtl:["border-top-width","border-bottom-width"]},"border-end":{ltr:["border-bottom","border-right"],rtl:["border-bottom","border-left"]},"border-end-color":{ltr:["border-bottom-color","border-right-color"],rtl:["border-bottom-color","border-left-color"]},"border-end-style":{ltr:["border-bottom-style","border-right-style"],rtl:["border-bottom-style","border-left-style"]},"border-end-width":{ltr:["border-bottom-width","border-right-width"],rtl:["border-bottom-width","border-left-width"]},"border-inline":{ltr:["border-left","border-right"],rtl:["border-left","border-right"]},"border-inline-color":{ltr:["border-left-color","border-right-color"],rtl:["border-left-color","border-right-color"]},"border-inline-end":{ltr:["border-right"],rtl:["border-left"]},"border-inline-end-color":{ltr:["border-right-color"],rtl:["border-left-color"]},"border-inline-end-style":{ltr:["border-right-style"],rtl:["border-left-style"]},"border-inline-end-width":{ltr:["border-right-width"],rtl:["border-left-width"]},"border-inline-start":{ltr:["border-left"],rtl:["border-right"]},"border-inline-start-color":{ltr:["border-left-color"],rtl:["border-right-color"]},"border-inline-start-style":{ltr:["border-left-style"],rtl:["border-right-style"]},"border-inline-start-width":{ltr:["border-left-width"],rtl:["border-right-width"]},"border-inline-style":{ltr:["border-left-style","border-right-style"],rtl:["border-left-style","border-right-style"]},"border-inline-width":{ltr:["border-left-width","border-right-width"],rtl:["border-left-width","border-right-width"]},"border-start":{ltr:["border-top","border-left"],rtl:["border-top","border-right"]},"border-start-color":{ltr:["border-top-color","border-left-color"],rtl:["border-top-color","border-right-color"]},"border-start-style":{ltr:["border-top-style","border-left-style"],rtl:["border-top-style","border-right-style"]},"border-start-width":{ltr:["border-top-width","border-left-width"],rtl:["border-top-width","border-right-width"]},"block-size":{ltr:["height"],rtl:["height"]},"inline-size":{ltr:["width"],rtl:["width"]},inset:{ltr:["top","right","bottom","left"],rtl:["top","right","bottom","left"]},"inset-block":{ltr:["top","bottom"],rtl:["top","bottom"]},"inset-block-start":{ltr:["top"],rtl:["top"]},"inset-block-end":{ltr:["bottom"],rtl:["bottom"]},"inset-end":{ltr:["bottom","right"],rtl:["bottom","left"]},"inset-inline":{ltr:["left","right"],rtl:["left","right"]},"inset-inline-start":{ltr:["left"],rtl:["right"]},"inset-inline-end":{ltr:["right"],rtl:["left"]},"inset-start":{ltr:["top","left"],rtl:["top","right"]},"margin-block":{ltr:["margin-top","margin-bottom"],rtl:["margin-top","margin-bottom"]},"margin-block-start":{ltr:["margin-top"],rtl:["margin-top"]},"margin-block-end":{ltr:["margin-bottom"],rtl:["margin-bottom"]},"margin-end":{ltr:["margin-bottom","margin-right"],rtl:["margin-bottom","margin-left"]},"margin-inline":{ltr:["margin-left","margin-right"],rtl:["margin-left","margin-right"]},"margin-inline-start":{ltr:["margin-left"],rtl:["margin-right"]},"margin-inline-end":{ltr:["margin-right"],rtl:["margin-left"]},"margin-start":{ltr:["margin-top","margin-left"],rtl:["margin-top","margin-right"]},"padding-block":{ltr:["padding-top","padding-bottom"],rtl:["padding-top","padding-bottom"]},"padding-block-start":{ltr:["padding-top"],rtl:["padding-top"]},"padding-block-end":{ltr:["padding-bottom"],rtl:["padding-bottom"]},"padding-end":{ltr:["padding-bottom","padding-right"],rtl:["padding-bottom","padding-left"]},"padding-inline":{ltr:["padding-left","padding-right"],rtl:["padding-left","padding-right"]},"padding-inline-start":{ltr:["padding-left"],rtl:["padding-right"]},"padding-inline-end":{ltr:["padding-right"],rtl:["padding-left"]},"padding-start":{ltr:["padding-top","padding-left"],rtl:["padding-top","padding-right"]}};var w=/^(?:(inset|margin|padding)(?:-(block|block-start|block-end|inline|inline-start|inline-end|start|end))|(min-|max-)?(block|inline)-(size))$/i;const S={border:u["border"],"border-width":u["border"],"border-style":u["border"],"border-color":u["border"],"border-block":u["border-block"],"border-block-width":u["border-block"],"border-block-style":u["border-block"],"border-block-color":u["border-block"],"border-block-start":u["border-block-start"],"border-block-start-width":u["border-block-start"],"border-block-start-style":u["border-block-start"],"border-block-start-color":u["border-block-start"],"border-block-end":u["border-block-end"],"border-block-end-width":u["border-block-end"],"border-block-end-style":u["border-block-end"],"border-block-end-color":u["border-block-end"],"border-inline":u["border-inline"],"border-inline-width":u["border-inline"],"border-inline-style":u["border-inline"],"border-inline-color":u["border-inline"],"border-inline-start":u["border-inline-start"],"border-inline-start-width":u["border-inline-start"],"border-inline-start-style":u["border-inline-start"],"border-inline-start-color":u["border-inline-start"],"border-inline-end":u["border-inline-end"],"border-inline-end-width":u["border-inline-end"],"border-inline-end-style":u["border-inline-end"],"border-inline-end-color":u["border-inline-end"],"border-start":u["border-start"],"border-start-width":u["border-start"],"border-start-style":u["border-start"],"border-start-color":u["border-start"],"border-end":u["border-end"],"border-end-width":u["border-end"],"border-end-style":u["border-end"],"border-end-color":u["border-end"],clear:f,inset:c,margin:y,padding:y,block:v["block"],"block-start":v["block-start"],"block-end":v["block-end"],inline:v["inline"],"inline-start":v["inline-start"],"inline-end":v["inline-end"],start:v["start"],end:v["end"],float:f,resize:l,size:b,"text-align":g,transition:m,"transition-property":m};const O=/^border(-block|-inline|-start|-end)?(-width|-style|-color)?$/i;var T=n.plugin("postcss-logical-properties",e=>{const r=Boolean(Object(e).preserve);const t=!r&&typeof Object(e).dir==="string"?/^rtl$/i.test(e.dir)?"rtl":"ltr":false;return e=>{e.walkDecls(e=>{const n=e.parent;const i=O.test(e.prop)?splitBySlash(e.value,true):splitBySpace(e.value,true);const o=e.prop.replace(w,"$2$5").toLowerCase();if(o in S){const s=S[o](e,i,t);if(s){[].concat(s).forEach(r=>{if(r.type==="rule"){n.before(r)}else{e.before(r)}});if(!r){e.remove();if(!n.nodes.length){n.remove()}}}}})}});e.exports=T},601:(e,r,t)=>{var n=t(4633);e.exports=n.plugin("postcss-media-minmax",function(){return function(e){var r={width:"px",height:"px","device-width":"px","device-height":"px","aspect-ratio":"","device-aspect-ratio":"",color:"","color-index":"",monochrome:"",resolution:"dpi"};var t=Object.keys(r);var n=.001;var i={">":1,"<":-1};var o={">":"min","<":"max"};function create_query(e,t,s,a,u){return a.replace(/([-\d\.]+)(.*)/,function(a,u,f){var c=parseFloat(u);if(parseFloat(u)||s){if(!s){if(f==="px"&&c===parseInt(u,10)){u=c+i[t]}else{u=Number(Math.round(parseFloat(u)+n*i[t]+"e6")+"e-6")}}}else{u=i[t]+r[e]}return"("+o[t]+"-"+e+": "+u+f+")"})}e.walkAtRules(function(e,r){if(e.name!=="media"&&e.name!=="custom-media"){return}e.params=e.params.replace(/\(\s*([a-z-]+?)\s*([<>])(=?)\s*((?:-?\d*\.?(?:\s*\/?\s*)?\d+[a-z]*)?)\s*\)/gi,function(r,n,i,o,s){var a="";if(t.indexOf(n)>-1){return create_query(n,i,o,s,e.params)}return r});e.params=e.params.replace(/\(\s*((?:-?\d*\.?(?:\s*\/?\s*)?\d+[a-z]*)?)\s*(<|>)(=?)\s*([a-z-]+)\s*(<|>)(=?)\s*((?:-?\d*\.?(?:\s*\/?\s*)?\d+[a-z]*)?)\s*\)/gi,function(e,r,n,i,o,s,a,u){if(t.indexOf(o)>-1){if(n==="<"&&s==="<"||n===">"&&s===">"){var f=n==="<"?r:u;var c=n==="<"?u:r;var l=i;var p=a;if(n===">"){l=a;p=i}return create_query(o,">",l,f)+" and "+create_query(o,"<",p,c)}}return e})})}})},9717:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=t(4633);var i=_interopDefault(n);function shiftNodesBeforeParent(e){const r=e.parent;const t=r.index(e);if(t){r.cloneBefore().removeAll().append(r.nodes.slice(0,t))}r.before(e);return r}function cleanupParent(e){if(!e.nodes.length){e.remove()}}var o=/&(?:[^\w-|]|$)/;const s=/&/g;function mergeSelectors(e,r){return e.reduce((e,t)=>e.concat(r.map(e=>e.replace(s,t))),[])}function transformRuleWithinRule(e){const r=shiftNodesBeforeParent(e);e.selectors=mergeSelectors(r.selectors,e.selectors);const t=e.type==="rule"&&r.type==="rule"&&e.selector===r.selector||e.type==="atrule"&&r.type==="atrule"&&e.params===r.params;if(t){e.append(...r.nodes)}cleanupParent(r)}const a=e=>e.type==="rule"&&Object(e.parent).type==="rule"&&e.selectors.every(e=>e.trim().lastIndexOf("&")===0&&o.test(e));const u=n.list.comma;function transformNestRuleWithinRule(e){const r=shiftNodesBeforeParent(e);const t=r.clone().removeAll().append(e.nodes);e.replaceWith(t);t.selectors=mergeSelectors(r.selectors,u(e.params));cleanupParent(r);walk(t)}const f=e=>e.type==="atrule"&&e.name==="nest"&&Object(e.parent).type==="rule"&&u(e.params).every(e=>e.split("&").length===2&&o.test(e));var c=["document","media","supports"];function atruleWithinRule(e){const r=shiftNodesBeforeParent(e);const t=r.clone().removeAll().append(e.nodes);e.append(t);cleanupParent(r);walk(t)}const l=e=>e.type==="atrule"&&c.indexOf(e.name)!==-1&&Object(e.parent).type==="rule";const p=n.list.comma;function mergeParams(e,r){return p(e).map(e=>p(r).map(r=>`${e} and ${r}`).join(", ")).join(", ")}function transformAtruleWithinAtrule(e){const r=shiftNodesBeforeParent(e);e.params=mergeParams(r.params,e.params);cleanupParent(r)}const h=e=>e.type==="atrule"&&c.indexOf(e.name)!==-1&&Object(e.parent).type==="atrule"&&e.name===e.parent.name;function walk(e){e.nodes.slice(0).forEach(r=>{if(r.parent===e){if(a(r)){transformRuleWithinRule(r)}else if(f(r)){transformNestRuleWithinRule(r)}else if(l(r)){atruleWithinRule(r)}else if(h(r)){transformAtruleWithinAtrule(r)}if(Object(r.nodes).length){walk(r)}}})}var B=i.plugin("postcss-nesting",()=>walk);e.exports=B},498:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}const i=n.list.space;const o=/^overflow$/i;var s=n.plugin("postcss-overflow-shorthand",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;return e=>{e.walkDecls(o,e=>{const t=i(e.value),n=_toArray(t),o=n[0],s=n[1],a=n.slice(2);if(s&&!a.length){e.cloneBefore({prop:`${e.prop}-x`,value:o});e.cloneBefore({prop:`${e.prop}-y`,value:s});if(!r){e.remove()}}})}});e.exports=s},2841:(e,r,t)=>{var n=t(4633);e.exports=n.plugin("postcss-page-break",function(){return function(e){e.walkDecls(/^break-(inside|before|after)/,function(e){if(e.value.search(/column|region/)>=0){return}var r;switch(e.value){case"page":r="always";break;case"avoid-page":r="avoid";break;default:r=e.value}e.cloneBefore({prop:"page-"+e.prop,value:r})})}})},1431:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));const o=/^place-(content|items|self)/;var s=n.plugin("postcss-place",e=>{const r="preserve"in Object(e)?Boolean(e.prefix):true;return e=>{e.walkDecls(o,e=>{const t=e.prop.match(o)[1];const n=i(e.value).parse();const s=n.nodes[0].nodes;const a=s.length===1?e.value:String(s.slice(0,1)).trim();const u=s.length===1?e.value:String(s.slice(1)).trim();e.cloneBefore({prop:`align-${t}`,value:a});e.cloneBefore({prop:`justify-${t}`,value:u});if(!r){e.remove()}})}});e.exports=s},7435:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(3501));var i=_interopDefault(t(3561));var o=_interopDefault(t(3094));var s=_interopDefault(t(4633));var a=_interopDefault(t(2347));var u=_interopDefault(t(9883));var f=_interopDefault(t(7814));var c=_interopDefault(t(489));var l=_interopDefault(t(8157));var p=_interopDefault(t(8881));var h=_interopDefault(t(9971));var B=_interopDefault(t(4731));var v=_interopDefault(t(8713));var d=_interopDefault(t(8758));var b=_interopDefault(t(3650));var y=_interopDefault(t(3030));var g=_interopDefault(t(5538));var m=_interopDefault(t(9642));var C=_interopDefault(t(8059));var w=_interopDefault(t(3203));var S=_interopDefault(t(9547));var O=_interopDefault(t(9555));var T=_interopDefault(t(4287));var E=_interopDefault(t(7501));var k=_interopDefault(t(7972));var P=_interopDefault(t(562));var D=_interopDefault(t(601));var A=_interopDefault(t(9717));var R=_interopDefault(t(498));var F=_interopDefault(t(2841));var x=_interopDefault(t(1431));var j=_interopDefault(t(2207));var I=_interopDefault(t(1832));var M=_interopDefault(t(9020));var _=_interopDefault(t(40));var N=_interopDefault(t(8158));var L=t(4338);var q=_interopDefault(t(5747));var G=_interopDefault(t(5622));var U=s.plugin("postcss-system-ui-font",()=>e=>{e.walkDecls(J,e=>{e.value=e.value.replace(H,K)})});const J=/(?:^(?:-|\\002d){2})|(?:^font(?:-family)?$)/i;const W="[\\f\\n\\r\\x09\\x20]";const Q=["system-ui","-apple-system","Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans","sans-serif"];const H=new RegExp(`(^|,|${W}+)(?:system-ui${W}*)(?:,${W}*(?:${Q.join("|")})${W}*)?(,|$)`,"i");const K=`$1${Q.join(", ")}$2`;var Y={"all-property":E,"any-link-pseudo-class":I,"blank-pseudo-class":u,"break-properties":F,"case-insensitive-attributes":a,"color-functional-notation":f,"color-mod-function":p,"custom-media-queries":B,"custom-properties":v,"custom-selectors":d,"dir-pseudo-class":b,"double-position-gradients":y,"environment-variables":g,"focus-visible-pseudo-class":m,"focus-within-pseudo-class":C,"font-variant-property":w,"gap-properties":S,"gray-function":c,"has-pseudo-class":O,"hexadecimal-alpha-notation":l,"image-set-function":T,"lab-function":k,"logical-properties-and-values":P,"matches-pseudo-class":_,"media-query-ranges":D,"nesting-rules":A,"not-pseudo-class":N,"overflow-property":R,"overflow-wrap-property":M,"place-properties":x,"prefers-color-scheme-query":j,"rebeccapurple-color":h,"system-ui-font-family":U};function getTransformedInsertions(e,r){return Object.keys(e).map(t=>[].concat(e[t]).map(e=>({[r]:true,plugin:e,id:t}))).reduce((e,r)=>e.concat(r),[])}function getUnsupportedBrowsersByFeature(e){const r=L.features[e];if(r){const e=L.feature(r).stats;const t=Object.keys(e).reduce((r,t)=>r.concat(Object.keys(e[t]).filter(r=>e[t][r].indexOf("y")!==0).map(e=>`${t} ${e}`)),[]);return t}else{return["> 0%"]}}var z=["custom-media-queries","custom-properties","environment-variables","image-set-function","media-query-ranges","prefers-color-scheme-query","nesting-rules","custom-selectors","any-link-pseudo-class","case-insensitive-attributes","focus-visible-pseudo-class","focus-within-pseudo-class","matches-pseudo-class","not-pseudo-class","logical-properties-and-values","dir-pseudo-class","all-property","color-functional-notation","double-position-gradients","gray-function","hexadecimal-alpha-notation","lab-function","rebeccapurple-color","color-mod-function","blank-pseudo-class","break-properties","font-variant-property","has-pseudo-class","gap-properties","overflow-property","overflow-wrap-property","place-properties","system-ui-font-family"];function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function getCustomMediaAsCss(e){const r=Object.keys(e).reduce((r,t)=>{r.push(`@custom-media ${t} ${e[t]};`);return r},[]).join("\n");const t=`${r}\n`;return t}function getCustomPropertiesAsCss(e){const r=Object.keys(e).reduce((r,t)=>{r.push(`\t${t}: ${e[t]};`);return r},[]).join("\n");const t=`:root {\n${r}\n}\n`;return t}function getCustomSelectorsAsCss(e){const r=Object.keys(e).reduce((r,t)=>{r.push(`@custom-selector ${t} ${e[t]};`);return r},[]).join("\n");const t=`${r}\n`;return t}function writeExportsToCssFile(e,r,t,n){return _writeExportsToCssFile.apply(this,arguments)}function _writeExportsToCssFile(){_writeExportsToCssFile=_asyncToGenerator(function*(e,r,t,n){const i=getCustomPropertiesAsCss(t);const o=getCustomMediaAsCss(r);const s=getCustomSelectorsAsCss(n);const a=`${o}\n${s}\n${i}`;yield writeFile(e,a)});return _writeExportsToCssFile.apply(this,arguments)}function writeExportsToJsonFile(e,r,t,n){return _writeExportsToJsonFile.apply(this,arguments)}function _writeExportsToJsonFile(){_writeExportsToJsonFile=_asyncToGenerator(function*(e,r,t,n){const i=JSON.stringify({"custom-media":r,"custom-properties":t,"custom-selectors":n},null," ");const o=`${i}\n`;yield writeFile(e,o)});return _writeExportsToJsonFile.apply(this,arguments)}function getObjectWithKeyAsCjs(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t\t'${escapeForJS(t)}': '${escapeForJS(r[t])}'`);return e},[]).join(",\n");const n=`\n\t${e}: {\n${t}\n\t}`;return n}function writeExportsToCjsFile(e,r,t,n){return _writeExportsToCjsFile.apply(this,arguments)}function _writeExportsToCjsFile(){_writeExportsToCjsFile=_asyncToGenerator(function*(e,r,t,n){const i=getObjectWithKeyAsCjs("customMedia",r);const o=getObjectWithKeyAsCjs("customProperties",t);const s=getObjectWithKeyAsCjs("customSelectors",n);const a=`module.exports = {${i},${o},${s}\n};\n`;yield writeFile(e,a)});return _writeExportsToCjsFile.apply(this,arguments)}function getObjectWithKeyAsMjs(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t'${escapeForJS(t)}': '${escapeForJS(r[t])}'`);return e},[]).join(",\n");const n=`export const ${e} = {\n${t}\n};\n`;return n}function writeExportsToMjsFile(e,r,t,n){return _writeExportsToMjsFile.apply(this,arguments)}function _writeExportsToMjsFile(){_writeExportsToMjsFile=_asyncToGenerator(function*(e,r,t,n){const i=getObjectWithKeyAsMjs("customMedia",r);const o=getObjectWithKeyAsMjs("customProperties",t);const s=getObjectWithKeyAsMjs("customSelectors",n);const a=`${i}\n${o}\n${s}`;yield writeFile(e,a)});return _writeExportsToMjsFile.apply(this,arguments)}function writeToExports(e,r){return Promise.all([].concat(r).map(function(){var r=_asyncToGenerator(function*(r){if(r instanceof Function){yield r({customMedia:getObjectWithStringifiedKeys(e.customMedia),customProperties:getObjectWithStringifiedKeys(e.customProperties),customSelectors:getObjectWithStringifiedKeys(e.customSelectors)})}else{const t=r===Object(r)?r:{to:String(r)};const n=t.toJSON||getObjectWithStringifiedKeys;if("customMedia"in t||"customProperties"in t||"customSelectors"in t){t.customMedia=n(e.customMedia);t.customProperties=n(e.customProperties);t.customSelectors=n(e.customSelectors)}else if("custom-media"in t||"custom-properties"in t||"custom-selectors"in t){t["custom-media"]=n(e.customMedia);t["custom-properties"]=n(e.customProperties);t["custom-selectors"]=n(e.customSelectors)}else{const r=String(t.to||"");const i=(t.type||G.extname(t.to).slice(1)).toLowerCase();const o=n(e.customMedia);const s=n(e.customProperties);const a=n(e.customSelectors);if(i==="css"){yield writeExportsToCssFile(r,o,s,a)}if(i==="js"){yield writeExportsToCjsFile(r,o,s,a)}if(i==="json"){yield writeExportsToJsonFile(r,o,s,a)}if(i==="mjs"){yield writeExportsToMjsFile(r,o,s,a)}}}});return function(e){return r.apply(this,arguments)}}()))}function getObjectWithStringifiedKeys(e){return Object.keys(e).reduce((r,t)=>{r[t]=String(e[t]);return r},{})}function writeFile(e,r){return new Promise((t,n)=>{q.writeFile(e,r,e=>{if(e){n(e)}else{t()}})})}function escapeForJS(e){return e.replace(/\\([\s\S])|(')/g,"\\$1$2").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var $=s.plugin("postcss-preset-env",e=>{const r=Object(Object(e).features);const t=Object(Object(e).insertBefore);const s=Object(Object(e).insertAfter);const a=Object(e).browsers;const u="stage"in Object(e)?e.stage===false?5:parseInt(e.stage)||0:2;const f=Object(e).autoprefixer;const c=X(Object(e));const l=f===false?()=>{}:n(Object.assign({overrideBrowserslist:a},f));const p=o.concat(getTransformedInsertions(t,"insertBefore"),getTransformedInsertions(s,"insertAfter")).filter(e=>e.insertBefore||e.id in Y).sort((e,r)=>z.indexOf(e.id)-z.indexOf(r.id)||(e.insertBefore?-1:r.insertBefore?1:0)||(e.insertAfter?1:r.insertAfter?-1:0)).map(e=>{const r=getUnsupportedBrowsersByFeature(e.caniuse);return e.insertBefore||e.insertAfter?{browsers:r,plugin:e.plugin,id:`${e.insertBefore?"before":"after"}-${e.id}`,stage:6}:{browsers:r,plugin:Y[e.id],id:e.id,stage:e.stage}});const h=p.filter(e=>e.id in r?r[e.id]:e.stage>=u).map(e=>({browsers:e.browsers,plugin:typeof e.plugin.process==="function"?r[e.id]===true?c?e.plugin(Object.assign({},c)):e.plugin():c?e.plugin(Object.assign({},c,r[e.id])):e.plugin(Object.assign({},r[e.id])):e.plugin,id:e.id}));const B=i(a,{ignoreUnknownVersions:true});const v=h.filter(e=>B.some(r=>i(e.browsers,{ignoreUnknownVersions:true}).some(e=>e===r)));return(r,t)=>{const n=v.reduce((e,r)=>e.then(()=>r.plugin(t.root,t)),Promise.resolve()).then(()=>l(t.root,t)).then(()=>{if(Object(e).exportTo){writeToExports(c.exportTo,e.exportTo)}});return n}});const X=e=>{if("importFrom"in e||"exportTo"in e||"preserve"in e){const r={};if("importFrom"in e){r.importFrom=e.importFrom}if("exportTo"in e){r.exportTo={customMedia:{},customProperties:{},customSelectors:{}}}if("preserve"in e){r.preserve=e.preserve}return r}return false};e.exports=$},1832:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(741));const o=/:any-link/;var s=n.plugin("postcss-pseudo-class-any-link",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;return e=>{e.walkRules(o,e=>{const t=e.raws.selector&&e.raws.selector.raw||e.selector;if(t[t.length-1]!==":"){const n=i(e=>{let r;let t;let n;let i;let o;let s=-1;while(n=e.nodes[++s]){t=-1;while(r=n.nodes[++t]){if(r.value===":any-link"){i=n.clone();o=n.clone();i.nodes[t].value=":link";o.nodes[t].value=":visited";e.nodes.splice(s--,1,i,o);break}}}}).processSync(t);if(n!==t){if(r){e.cloneBefore({selector:n})}else{e.selector=n}}}})}});e.exports=s},9018:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(268);var i=_interopRequireDefault(n);var o=t(5848);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},4682:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(4682);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},7239:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},2961:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},2622:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},4649:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(7239);var i=_interopRequireDefault(n);var o=t(2961);var s=_interopRequireDefault(o);var a=t(415);var u=_interopRequireDefault(a);var f=t(2622);var c=_interopRequireDefault(f);var l=t(6856);var p=_interopRequireDefault(l);var h=t(7939);var B=_interopRequireDefault(h);var v=t(9189);var d=_interopRequireDefault(v);var b=t(7156);var y=_interopRequireDefault(b);var g=t(8727);var m=_interopRequireDefault(g);var C=t(1572);var w=_interopRequireDefault(C);var S=t(2252);var O=_interopRequireDefault(S);var T=t(3447);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},8837:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(9);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},6856:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},5848:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(9);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(4649);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(7910);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},7937:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},5387:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(8837);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},7156:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(8837);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},1572:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},2252:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(7937);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},9:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},3447:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(7937);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},1949:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},7620:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},6317:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(7620);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},2058:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},4600:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},6913:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(6474);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(4600);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(2058);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(6817);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},6817:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},6474:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},9020:(e,r,t)=>{var n=t(4633);e.exports=n.plugin("postcss-replace-overflow-wrap",function(e){e=e||{};var r=e.method||"replace";return function(e){e.walkDecls("overflow-wrap",function(e){e.cloneBefore({prop:"word-wrap"});if(r==="replace"){e.remove()}})}})},40:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var n=t(4633);var i=_interopRequireDefault(n);var o=t(8746);var s=_interopRequireDefault(o);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function explodeSelectors(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(r){r.walkRules(function(r){if(r.selector&&r.selector.indexOf(":matches")>-1){r.selector=(0,s.default)(r,e)}})}}r.default=i.default.plugin("postcss-selector-matches",explodeSelectors);e.exports=r.default},8746:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.default=replaceRuleSelector;var n=t(7009);var i=_interopRequireDefault(n);var o=t(587);var s=_interopRequireDefault(o);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _toConsumableArray(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r-1){var t=[];var n=e.match(/^\s+/);var o=n?n[0]:"";var u=i.default.comma(e);u.forEach(function(e){var n=e.indexOf(a);var u=e.slice(0,n);var f=e.slice(n);var c=(0,s.default)("(",")",f);var l=c&&c.body?i.default.comma(c.body).reduce(function(e,t){return[].concat(_toConsumableArray(e),_toConsumableArray(explodeSelector(t,r)))},[]):[f];var p=c&&c.post?explodeSelector(c.post,r):[];var h=void 0;if(p.length===0){if(n===-1||u.indexOf(" ")>-1){h=l.map(function(e){return o+u+e})}else{h=l.map(function(e){return normalizeSelector(e,o,u)})}}else{h=[];p.forEach(function(e){l.forEach(function(r){h.push(o+u+r+e)})})}t=[].concat(_toConsumableArray(t),_toConsumableArray(h))});return t}return[e]}function replaceRuleSelector(e,r){var t=e.raws&&e.raws.before?e.raws.before.split("\n").pop():"";return explodeSelector(e.selector,r).join(","+(r.lineBreak?"\n"+t:" "))}e.exports=r.default},8158:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var n=t(4633);var i=_interopRequireDefault(n);var o=t(7009);var s=_interopRequireDefault(o);var a=t(587);var u=_interopRequireDefault(a);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function explodeSelector(e,r){var t=locatePseudoClass(r,e);if(r&&t>-1){var n=r.slice(0,t);var i=(0,u.default)("(",")",r.slice(t));var o=i.body?s.default.comma(i.body).map(function(r){return explodeSelector(e,r)}).join(`)${e}(`):"";var a=i.post?explodeSelector(e,i.post):"";return`${n}${e}(${o})${a}`}return r}var f={};function locatePseudoClass(e,r){f[r]=f[r]||new RegExp(`([^\\\\]|^)${r}`);var t=f[r];var n=e.search(t);if(n===-1){return-1}return n+e.slice(n).indexOf(r)}function explodeSelectors(e){return function(){return function(r){r.walkRules(function(r){if(r.selector&&r.selector.indexOf(e)>-1){r.selector=explodeSelector(e,r.selector)}})}}}r.default=i.default.plugin("postcss-selector-not",explodeSelectors(":not"));e.exports=r.default},2334:(e,r,t)=>{"use strict";const n=t(9745);class AtWord extends n{constructor(e){super(e);this.type="atword"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,"@",String.prototype.toString.call(this.value),this.raws.after].join("")}}n.registerWalker(AtWord);e.exports=AtWord},1776:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Colon extends i{constructor(e){super(e);this.type="colon"}}n.registerWalker(Colon);e.exports=Colon},6429:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Comma extends i{constructor(e){super(e);this.type="comma"}}n.registerWalker(Comma);e.exports=Comma},8688:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Comment extends i{constructor(e){super(e);this.type="comment";this.inline=Object(e).inline||false}toString(){return[this.raws.before,this.inline?"//":"/*",String(this.value),this.inline?"":"*/",this.raws.after].join("")}}n.registerWalker(Comment);e.exports=Comment},9745:(e,r,t)=>{"use strict";const n=t(7203);class Container extends n{constructor(e){super(e);if(!this.nodes){this.nodes=[]}}push(e){e.parent=this;this.nodes.push(e);return this}each(e){if(!this.lastEach)this.lastEach=0;if(!this.indexes)this.indexes={};this.lastEach+=1;let r=this.lastEach,t,n;this.indexes[r]=0;if(!this.nodes)return undefined;while(this.indexes[r]{let n=e(r,t);if(n!==false&&r.walk){n=r.walk(e)}return n})}walkType(e,r){if(!e||!r){throw new Error("Parameters {type} and {callback} are required.")}const t=typeof e==="function";return this.walk((n,i)=>{if(t&&n instanceof e||!t&&n.type===e){return r.call(this,n,i)}})}append(e){e.parent=this;this.nodes.push(e);return this}prepend(e){e.parent=this;this.nodes.unshift(e);return this}cleanRaws(e){super.cleanRaws(e);if(this.nodes){for(let r of this.nodes)r.cleanRaws(e)}}insertAfter(e,r){let t=this.index(e),n;this.nodes.splice(t+1,0,r);for(let e in this.indexes){n=this.indexes[e];if(t<=n){this.indexes[e]=n+this.nodes.length}}return this}insertBefore(e,r){let t=this.index(e),n;this.nodes.splice(t,0,r);for(let e in this.indexes){n=this.indexes[e];if(t<=n){this.indexes[e]=n+this.nodes.length}}return this}removeChild(e){e=this.index(e);this.nodes[e].parent=undefined;this.nodes.splice(e,1);let r;for(let t in this.indexes){r=this.indexes[t];if(r>=e){this.indexes[t]=r-1}}return this}removeAll(){for(let e of this.nodes)e.parent=undefined;this.nodes=[];return this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){if(typeof e==="number"){return e}else{return this.nodes.indexOf(e)}}get first(){if(!this.nodes)return undefined;return this.nodes[0]}get last(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}toString(){let e=this.nodes.map(String).join("");if(this.value){e=this.value+e}if(this.raws.before){e=this.raws.before+e}if(this.raws.after){e+=this.raws.after}return e}}Container.registerWalker=(e=>{let r="walk"+e.name;if(r.lastIndexOf("s")!==r.length-1){r+="s"}if(Container.prototype[r]){return}Container.prototype[r]=function(r){return this.walkType(e,r)}});e.exports=Container},7016:e=>{"use strict";class ParserError extends Error{constructor(e){super(e);this.name=this.constructor.name;this.message=e||"An error ocurred while parsing.";if(typeof Error.captureStackTrace==="function"){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error(e).stack}}}e.exports=ParserError},4828:e=>{"use strict";class TokenizeError extends Error{constructor(e){super(e);this.name=this.constructor.name;this.message=e||"An error ocurred while tokzenizing.";if(typeof Error.captureStackTrace==="function"){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error(e).stack}}}e.exports=TokenizeError},7615:(e,r,t)=>{"use strict";const n=t(9745);class FunctionNode extends n{constructor(e){super(e);this.type="func";this.unbalanced=-1}}n.registerWalker(FunctionNode);e.exports=FunctionNode},9448:(e,r,t)=>{"use strict";const n=t(3663);const i=t(2334);const o=t(1776);const s=t(6429);const a=t(8688);const u=t(7615);const f=t(2541);const c=t(6005);const l=t(6827);const p=t(3300);const h=t(2897);const B=t(2964);const v=t(2945);let d=function(e,r){return new n(e,r)};d.atword=function(e){return new i(e)};d.colon=function(e){return new o(Object.assign({value:":"},e))};d.comma=function(e){return new s(Object.assign({value:","},e))};d.comment=function(e){return new a(e)};d.func=function(e){return new u(e)};d.number=function(e){return new f(e)};d.operator=function(e){return new c(e)};d.paren=function(e){return new l(Object.assign({value:"("},e))};d.string=function(e){return new p(Object.assign({quote:"'"},e))};d.value=function(e){return new B(e)};d.word=function(e){return new v(e)};d.unicodeRange=function(e){return new h(e)};e.exports=d},7203:e=>{"use strict";let r=function(e,t){let n=new e.constructor;for(let i in e){if(!e.hasOwnProperty(i))continue;let o=e[i],s=typeof o;if(i==="parent"&&s==="object"){if(t)n[i]=t}else if(i==="source"){n[i]=o}else if(o instanceof Array){n[i]=o.map(e=>r(e,n))}else if(i!=="before"&&i!=="after"&&i!=="between"&&i!=="semicolon"){if(s==="object"&&o!==null)o=r(o);n[i]=o}}return n};e.exports=class Node{constructor(e){e=e||{};this.raws={before:"",after:""};for(let r in e){this[r]=e[r]}}remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this}toString(){return[this.raws.before,String(this.value),this.raws.after].join("")}clone(e){e=e||{};let t=r(this);for(let r in e){t[r]=e[r]}return t}cloneBefore(e){e=e||{};let r=this.clone(e);this.parent.insertBefore(this,r);return r}cloneAfter(e){e=e||{};let r=this.clone(e);this.parent.insertAfter(this,r);return r}replaceWith(){let e=Array.prototype.slice.call(arguments);if(this.parent){for(let r of e){this.parent.insertBefore(this,r)}this.remove()}return this}moveTo(e){this.cleanRaws(this.root()===e.root());this.remove();e.append(this);return this}moveBefore(e){this.cleanRaws(this.root()===e.root());this.remove();e.parent.insertBefore(e,this);return this}moveAfter(e){this.cleanRaws(this.root()===e.root());this.remove();e.parent.insertAfter(e,this);return this}next(){let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){let e=this.parent.index(this);return this.parent.nodes[e-1]}toJSON(){let e={};for(let r in this){if(!this.hasOwnProperty(r))continue;if(r==="parent")continue;let t=this[r];if(t instanceof Array){e[r]=t.map(e=>{if(typeof e==="object"&&e.toJSON){return e.toJSON()}else{return e}})}else if(typeof t==="object"&&t.toJSON){e[r]=t.toJSON()}else{e[r]=t}}return e}root(){let e=this;while(e.parent)e=e.parent;return e}cleanRaws(e){delete this.raws.before;delete this.raws.after;if(!e)delete this.raws.between}positionInside(e){let r=this.toString(),t=this.source.start.column,n=this.source.start.line;for(let i=0;i{"use strict";const n=t(9745);const i=t(7203);class NumberNode extends i{constructor(e){super(e);this.type="number";this.unit=Object(e).unit||""}toString(){return[this.raws.before,String(this.value),this.unit,this.raws.after].join("")}}n.registerWalker(NumberNode);e.exports=NumberNode},6005:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Operator extends i{constructor(e){super(e);this.type="operator"}}n.registerWalker(Operator);e.exports=Operator},6827:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Parenthesis extends i{constructor(e){super(e);this.type="paren";this.parenType=""}}n.registerWalker(Parenthesis);e.exports=Parenthesis},3663:(e,r,t)=>{"use strict";const n=t(2413);const i=t(2964);const o=t(2334);const s=t(1776);const a=t(6429);const u=t(8688);const f=t(7615);const c=t(2541);const l=t(6005);const p=t(6827);const h=t(3300);const B=t(2945);const v=t(2897);const d=t(868);const b=t(5202);const y=t(4751);const g=t(5632);const m=t(7016);function sortAscending(e){return e.sort((e,r)=>e-r)}e.exports=class Parser{constructor(e,r){const t={loose:false};this.cache=[];this.input=e;this.options=Object.assign({},t,r);this.position=0;this.unbalanced=0;this.root=new n;let o=new i;this.root.append(o);this.current=o;this.tokens=d(e,this.options)}parse(){return this.loop()}colon(){let e=this.currToken;this.newNode(new s({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]}));this.position++}comma(){let e=this.currToken;this.newNode(new a({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]}));this.position++}comment(){let e=false,r=this.currToken[1].replace(/\/\*|\*\//g,""),t;if(this.options.loose&&r.startsWith("//")){r=r.substring(2);e=true}t=new u({value:r,inline:e,source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]});this.newNode(t);this.position++}error(e,r){throw new m(e+` at line: ${r[2]}, column ${r[3]}`)}loop(){while(this.position0){if(this.current.type==="func"&&this.current.value==="calc"){if(this.prevToken[0]!=="space"&&this.prevToken[0]!=="("){this.error("Syntax Error",this.currToken)}else if(this.nextToken[0]!=="space"&&this.nextToken[0]!=="word"){this.error("Syntax Error",this.currToken)}else if(this.nextToken[0]==="word"&&this.current.last.type!=="operator"&&this.current.last.value!=="("){this.error("Syntax Error",this.currToken)}}else if(this.nextToken[0]==="space"||this.nextToken[0]==="operator"||this.prevToken[0]==="operator"){this.error("Syntax Error",this.currToken)}}}if(!this.options.loose){if(this.nextToken[0]==="word"){return this.word()}}else{if((!this.current.nodes.length||this.current.last&&this.current.last.type==="operator")&&this.nextToken[0]==="word"){return this.word()}}}r=new l({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]});this.position++;return this.newNode(r)}parseTokens(){switch(this.currToken[0]){case"space":this.space();break;case"colon":this.colon();break;case"comma":this.comma();break;case"comment":this.comment();break;case"(":this.parenOpen();break;case")":this.parenClose();break;case"atword":case"word":this.word();break;case"operator":this.operator();break;case"string":this.string();break;case"unicoderange":this.unicodeRange();break;default:this.word();break}}parenOpen(){let e=1,r=this.position+1,t=this.currToken,n;while(r=this.tokens.length-1&&!this.current.unbalanced){return}this.current.unbalanced--;if(this.current.unbalanced<0){this.error("Expected opening parenthesis",e)}if(!this.current.unbalanced&&this.cache.length){this.current=this.cache.pop()}}space(){let e=this.currToken;if(this.position===this.tokens.length-1||this.nextToken[0]===","||this.nextToken[0]===")"){this.current.last.raws.after+=e[1];this.position++}else{this.spaces=e[1];this.position++}}unicodeRange(){let e=this.currToken;this.newNode(new v({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]}));this.position++}splitWord(){let e=this.nextToken,r=this.currToken[1],t=/^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/,n=/^(?!\#([a-z0-9]+))[\#\{\}]/gi,i,s;if(!n.test(r)){while(e&&e[0]==="word"){this.position++;let t=this.currToken[1];r+=t;e=this.nextToken}}i=y(r,"@");s=sortAscending(g(b([[0],i])));s.forEach((n,a)=>{let u=s[a+1]||r.length,l=r.slice(n,u),p;if(~i.indexOf(n)){p=new o({value:l.slice(1),source:{start:{line:this.currToken[2],column:this.currToken[3]+n},end:{line:this.currToken[4],column:this.currToken[3]+(u-1)}},sourceIndex:this.currToken[6]+s[a]})}else if(t.test(this.currToken[1])){let e=l.replace(t,"");p=new c({value:l.replace(e,""),source:{start:{line:this.currToken[2],column:this.currToken[3]+n},end:{line:this.currToken[4],column:this.currToken[3]+(u-1)}},sourceIndex:this.currToken[6]+s[a],unit:e})}else{p=new(e&&e[0]==="("?f:B)({value:l,source:{start:{line:this.currToken[2],column:this.currToken[3]+n},end:{line:this.currToken[4],column:this.currToken[3]+(u-1)}},sourceIndex:this.currToken[6]+s[a]});if(p.constructor.name==="Word"){p.isHex=/^#(.+)/.test(l);p.isColor=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(l)}else{this.cache.push(this.current)}}this.newNode(p)});this.position++}string(){let e=this.currToken,r=this.currToken[1],t=/^(\"|\')/,n=t.test(r),i="",o;if(n){i=r.match(t)[0];r=r.slice(1,r.length-1)}o=new h({value:r,source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6],quoted:n});o.raws.quote=i;this.newNode(o);this.position++}word(){return this.splitWord()}newNode(e){if(this.spaces){e.raws.before+=this.spaces;this.spaces=""}return this.current.append(e)}get currToken(){return this.tokens[this.position]}get nextToken(){return this.tokens[this.position+1]}get prevToken(){return this.tokens[this.position-1]}}},2413:(e,r,t)=>{"use strict";const n=t(9745);e.exports=class Root extends n{constructor(e){super(e);this.type="root"}}},3300:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class StringNode extends i{constructor(e){super(e);this.type="string"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,e,this.value+"",e,this.raws.after].join("")}}n.registerWalker(StringNode);e.exports=StringNode},868:(e,r,t)=>{"use strict";const n="{".charCodeAt(0);const i="}".charCodeAt(0);const o="(".charCodeAt(0);const s=")".charCodeAt(0);const a="'".charCodeAt(0);const u='"'.charCodeAt(0);const f="\\".charCodeAt(0);const c="/".charCodeAt(0);const l=".".charCodeAt(0);const p=",".charCodeAt(0);const h=":".charCodeAt(0);const B="*".charCodeAt(0);const v="-".charCodeAt(0);const d="+".charCodeAt(0);const b="#".charCodeAt(0);const y="\n".charCodeAt(0);const g=" ".charCodeAt(0);const m="\f".charCodeAt(0);const C="\t".charCodeAt(0);const w="\r".charCodeAt(0);const S="@".charCodeAt(0);const O="e".charCodeAt(0);const T="E".charCodeAt(0);const E="0".charCodeAt(0);const k="9".charCodeAt(0);const P="u".charCodeAt(0);const D="U".charCodeAt(0);const A=/[ \n\t\r\{\(\)'"\\;,/]/g;const R=/[ \n\t\r\(\)\{\}\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;const F=/[ \n\t\r\(\)\{\}\*:;@!&'"\-\+\|~>,\[\]\\]|\//g;const x=/^[a-z0-9]/i;const j=/^[a-f0-9?\-]/i;const I=t(1669);const M=t(4828);e.exports=function tokenize(e,r){r=r||{};let t=[],_=e.valueOf(),N=_.length,L=-1,q=1,G=0,U=0,J=null,W,Q,H,K,Y,z,$,X,Z,V,ee,re;function unclosed(e){let r=I.format("Unclosed %s at line: %d, column: %d, token: %d",e,q,G-L,G);throw new M(r)}function tokenizeError(){let e=I.format("Syntax error at line: %d, column: %d, token: %d",q,G-L,G);throw new M(e)}while(G0&&t[t.length-1][0]==="word"&&t[t.length-1][1]==="url";t.push(["(","(",q,G-L,q,Q-L,G]);break;case s:U--;J=J&&U>0;t.push([")",")",q,G-L,q,Q-L,G]);break;case a:case u:H=W===a?"'":'"';Q=G;do{V=false;Q=_.indexOf(H,Q+1);if(Q===-1){unclosed("quote",H)}ee=Q;while(_.charCodeAt(ee-1)===f){ee-=1;V=!V}}while(V);t.push(["string",_.slice(G,Q+1),q,G-L,q,Q-L,G]);G=Q;break;case S:A.lastIndex=G+1;A.test(_);if(A.lastIndex===0){Q=_.length-1}else{Q=A.lastIndex-2}t.push(["atword",_.slice(G,Q+1),q,G-L,q,Q-L,G]);G=Q;break;case f:Q=G;W=_.charCodeAt(Q+1);if($&&(W!==c&&W!==g&&W!==y&&W!==C&&W!==w&&W!==m)){Q+=1}t.push(["word",_.slice(G,Q+1),q,G-L,q,Q-L,G]);G=Q;break;case d:case v:case B:Q=G+1;re=_.slice(G+1,Q+1);let e=_.slice(G-1,G);if(W===v&&re.charCodeAt(0)===v){Q++;t.push(["word",_.slice(G,Q),q,G-L,q,Q-L,G]);G=Q-1;break}t.push(["operator",_.slice(G,Q),q,G-L,q,Q-L,G]);G=Q-1;break;default:if(W===c&&(_.charCodeAt(G+1)===B||r.loose&&!J&&_.charCodeAt(G+1)===c)){const e=_.charCodeAt(G+1)===B;if(e){Q=_.indexOf("*/",G+2)+1;if(Q===0){unclosed("comment","*/")}}else{const e=_.indexOf("\n",G+2);Q=e!==-1?e-1:N}z=_.slice(G,Q+1);K=z.split("\n");Y=K.length-1;if(Y>0){X=q+Y;Z=Q-K[Y].length}else{X=q;Z=L}t.push(["comment",z,q,G-L,X,Q-Z,G]);L=Z;q=X;G=Q}else if(W===b&&!x.test(_.slice(G+1,G+2))){Q=G+1;t.push(["#",_.slice(G,Q),q,G-L,q,Q-L,G]);G=Q-1}else if((W===P||W===D)&&_.charCodeAt(G+1)===d){Q=G+2;do{Q+=1;W=_.charCodeAt(Q)}while(Q=E&&W<=k){e=F}e.lastIndex=G+1;e.test(_);if(e.lastIndex===0){Q=_.length-1}else{Q=e.lastIndex-2}if(e===F||W===l){let e=_.charCodeAt(Q),r=_.charCodeAt(Q+1),t=_.charCodeAt(Q+2);if((e===O||e===T)&&(r===v||r===d)&&(t>=E&&t<=k)){F.lastIndex=Q+2;F.test(_);if(F.lastIndex===0){Q=_.length-1}else{Q=F.lastIndex-2}}}t.push(["word",_.slice(G,Q+1),q,G-L,q,Q-L,G]);G=Q}break}G++}return t}},2897:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class UnicodeRange extends i{constructor(e){super(e);this.type="unicode-range"}}n.registerWalker(UnicodeRange);e.exports=UnicodeRange},2964:(e,r,t)=>{"use strict";const n=t(9745);e.exports=class Value extends n{constructor(e){super(e);this.type="value";this.unbalanced=0}}},2945:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Word extends i{constructor(e){super(e);this.type="word"}}n.registerWalker(Word);e.exports=Word},4217:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(5878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(r){var t;t=e.call(this,r)||this;t.type="atrule";return t}var r=AtRule.prototype;r.append=function append(){var r;if(!this.nodes)this.nodes=[];for(var t=arguments.length,n=new Array(t),i=0;i{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(1497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}var i=function(e){_inheritsLoose(Comment,e);function Comment(r){var t;t=e.call(this,r)||this;t.type="comment";return t}return Comment}(n.default);var o=i;r.default=o;e.exports=r.default},5878:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3605));var i=_interopRequireDefault(t(8259));var o=_interopRequireDefault(t(1497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;t=a.length)break;c=a[f++]}else{f=a.next();if(f.done)break;c=f.value}var l=c;this.nodes.push(l)}}return this};r.prepend=function prepend(){for(var e=arguments.length,r=new Array(e),t=0;t=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;var u=this.normalize(a,this.first,"prepend").reverse();for(var f=u,c=Array.isArray(f),l=0,f=c?f:f[Symbol.iterator]();;){var p;if(c){if(l>=f.length)break;p=f[l++]}else{l=f.next();if(l.done)break;p=l.value}var h=p;this.nodes.unshift(h)}for(var B in this.indexes){this.indexes[B]=this.indexes[B]+u.length}}return this};r.cleanRaws=function cleanRaws(r){e.prototype.cleanRaws.call(this,r);if(this.nodes){for(var t=this.nodes,n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(i>=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;s.cleanRaws(r)}}};r.insertBefore=function insertBefore(e,r){e=this.index(e);var t=e===0?"prepend":false;var n=this.normalize(r,this.nodes[e],t).reverse();for(var i=n,o=Array.isArray(i),s=0,i=o?i:i[Symbol.iterator]();;){var a;if(o){if(s>=i.length)break;a=i[s++]}else{s=i.next();if(s.done)break;a=s.value}var u=a;this.nodes.splice(e,0,u)}var f;for(var c in this.indexes){f=this.indexes[c];if(e<=f){this.indexes[c]=f+n.length}}return this};r.insertAfter=function insertAfter(e,r){e=this.index(e);var t=this.normalize(r,this.nodes[e]).reverse();for(var n=t,i=Array.isArray(n),o=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(o>=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;this.nodes.splice(e+1,0,a)}var u;for(var f in this.indexes){u=this.indexes[f];if(e=e){this.indexes[t]=r-1}}return this};r.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};r.replaceValues=function replaceValues(e,r,t){if(!t){t=r;r={}}this.walkDecls(function(n){if(r.props&&r.props.indexOf(n.prop)===-1)return;if(r.fast&&n.value.indexOf(r.fast)===-1)return;n.value=n.value.replace(e,t)});return this};r.every=function every(e){return this.nodes.every(e)};r.some=function some(e){return this.nodes.some(e)};r.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};r.normalize=function normalize(e,r){var o=this;if(typeof e==="string"){var s=t(3749);e=cleanSource(s(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var a=e,u=Array.isArray(a),f=0,a=u?a:a[Symbol.iterator]();;){var c;if(u){if(f>=a.length)break;c=a[f++]}else{f=a.next();if(f.done)break;c=f.value}var l=c;if(l.parent)l.parent.removeChild(l,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var p=e,h=Array.isArray(p),B=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(B>=p.length)break;v=p[B++]}else{B=p.next();if(B.done)break;v=B.value}var d=v;if(d.parent)d.parent.removeChild(d,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var b=t(7797);e=[new b(e)]}else if(e.name){var y=t(4217);e=[new y(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var g=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(r&&typeof r.raws.before!=="undefined"){e.raws.before=r.raws.before.replace(/[^\s]/g,"")}}e.parent=o;return e});return g};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(o.default);var a=s;r.default=a;e.exports=r.default},9535:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(8327));var i=_interopRequireDefault(t(2242));var o=_interopRequireDefault(t(8300));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}function _wrapNativeSuper(e){var r=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof r!=="undefined"){if(r.has(e))return r.get(e);r.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,r,t){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,r,t){var n=[null];n.push.apply(n,r);var i=Function.bind.apply(e,n);var o=new i;if(t)_setPrototypeOf(o,t.prototype);return o}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,r){e.__proto__=r;return e};return _setPrototypeOf(e,r)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var s=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(r,t,n,i,o,s){var a;a=e.call(this,r)||this;a.name="CssSyntaxError";a.reason=r;if(o){a.file=o}if(i){a.source=i}if(s){a.plugin=s}if(typeof t!=="undefined"&&typeof n!=="undefined"){a.line=t;a.column=n}a.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(a),CssSyntaxError)}return a}var r=CssSyntaxError.prototype;r.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};r.showSourceCode=function showSourceCode(e){var r=this;if(!this.source)return"";var t=this.source;if(o.default){if(typeof e==="undefined")e=n.default.stdout;if(e)t=(0,o.default)(t)}var s=t.split(/\r?\n/);var a=Math.max(this.line-3,0);var u=Math.min(this.line+2,s.length);var f=String(u).length;function mark(r){if(e&&i.default.red){return i.default.red.bold(r)}return r}function aside(r){if(e&&i.default.gray){return i.default.gray(r)}return r}return s.slice(a,u).map(function(e,t){var n=a+1+t;var i=" "+(" "+n).slice(-f)+" | ";if(n===r.line){var o=aside(i.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+o+mark("^")}return" "+aside(i)+e}).join("\n")};r.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var a=s;r.default=a;e.exports=r.default},3605:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(1497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(r){var t;t=e.call(this,r)||this;t.type="decl";return t}return Declaration}(n.default);var o=i;r.default=o;e.exports=r.default},4905:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(5622));var i=_interopRequireDefault(t(9535));var o=_interopRequireDefault(t(2713));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;t"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,r,t,n){if(n===void 0){n={}}var o;var s=this.origin(r,t);if(s){o=new i.default(e,s.line,s.column,s.source,s.file,n.plugin)}else{o=new i.default(e,r,t,this.css,this.file,n.plugin)}o.input={line:r,column:t,source:this.css};if(this.file)o.input.file=this.file;return o};e.origin=function origin(e,r){if(!this.map)return false;var t=this.map.consumer();var n=t.originalPositionFor({line:e,column:r});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var o=t.sourceContentFor(n.source);if(o)i.source=o;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var u=a;r.default=u;e.exports=r.default},1169:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3595));var i=_interopRequireDefault(t(7549));var o=_interopRequireDefault(t(3831));var s=_interopRequireDefault(t(7613));var a=_interopRequireDefault(t(3749));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;tparseInt(s[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+t+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,r){var t=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){t.asyncTick(e,r)}).catch(function(e){t.handleError(e,n);t.processed=true;r(e)})}else{this.asyncTick(e,r)}}catch(e){this.processed=true;r(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(r,t){if(e.error){t(e.error)}else{r(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(r,t){if(e.error)return t(e.error);e.plugin=0;e.asyncTick(r,t)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;var o=this.run(i);if(isPromise(o)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(r){this.handleError(r,e);throw r}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var r=i.default;if(e.syntax)r=e.syntax.stringify;if(e.stringifier)r=e.stringifier;if(r.stringify)r=r.stringify;var t=new n.default(r,this.result.root,this.result.opts);var o=t.generate();this.result.css=o[0];this.result.map=o[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=u;r.default=f;e.exports=r.default},7009:(e,r)=>{"use strict";r.__esModule=true;r.default=void 0;var t={split:function split(e,r,t){var n=[];var i="";var split=false;var o=0;var s=false;var a=false;for(var u=0;u0)o-=1}else if(o===0){if(r.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(t||i!=="")n.push(i.trim());return n},space:function space(e){var r=[" ","\n","\t"];return t.split(e,r)},comma:function comma(e){return t.split(e,[","],true)}};var n=t;r.default=n;e.exports=r.default},3595:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(6241));var i=_interopRequireDefault(t(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o=function(){function MapGenerator(e,r,t){this.stringify=e;this.mapOpts=t.map||{};this.root=r;this.opts=t}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(r){if(r.source&&r.source.input.map){var t=r.source.input.map;if(e.previousMaps.indexOf(t)===-1){e.previousMaps.push(t)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var r=this.root.nodes.length-1;r>=0;r--){e=this.root.nodes[r];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(r)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var r={};this.root.walk(function(t){if(t.source){var n=t.source.input.from;if(n&&!r[n]){r[n]=true;var i=e.relative(n);e.map.setSourceContent(i,t.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var o;if(r){if(t>=e.length)break;o=e[t++]}else{t=e.next();if(t.done)break;o=t.value}var s=o;var a=this.relative(s.file);var u=s.root||i.default.dirname(s.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(s.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=s.consumer()}this.map.applySourceMap(f,a,this.relative(u))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var r="\n";if(this.css.indexOf("\r\n")!==-1)r="\r\n";this.css+=r+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var r=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){r=i.default.dirname(i.default.resolve(r,this.mapOpts.annotation))}e=i.default.relative(r,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var r=1;var t=1;var i,o;this.stringify(this.root,function(n,s,a){e.css+=n;if(s&&a!=="end"){if(s.source&&s.source.start){e.map.addMapping({source:e.sourcePath(s),generated:{line:r,column:t-1},original:{line:s.source.start.line,column:s.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:r,column:t-1}})}}i=n.match(/\n/g);if(i){r+=i.length;o=n.lastIndexOf("\n");t=n.length-o}else{t+=n.length}if(s&&a!=="start"){var u=s.parent||{raws:{}};if(s.type!=="decl"||s!==u.last||u.raws.semicolon){if(s.source&&s.source.end){e.map.addMapping({source:e.sourcePath(s),generated:{line:r,column:t-2},original:{line:s.source.end.line,column:s.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:r,column:t-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(r){e+=r});return[e]};return MapGenerator}();var s=o;r.default=s;e.exports=r.default},1497:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(9535));var i=_interopRequireDefault(t(3935));var o=_interopRequireDefault(t(7549));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,r){var t=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var o=typeof i;if(n==="parent"&&o==="object"){if(r)t[n]=r}else if(n==="source"){t[n]=i}else if(i instanceof Array){t[n]=i.map(function(e){return cloneNode(e,t)})}else{if(o==="object"&&i!==null)i=cloneNode(i);t[n]=i}}return t}var s=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var r in e){this[r]=e[r]}}var e=Node.prototype;e.error=function error(e,r){if(r===void 0){r={}}if(this.source){var t=this.positionBy(r);return this.source.input.error(e,t.line,t.column,r)}return new n.default(e)};e.warn=function warn(e,r,t){var n={node:this};for(var i in t){n[i]=t[i]}return e.warn(r,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=o.default}if(e.stringify)e=e.stringify;var r="";e(this,function(e){r+=e});return r};e.clone=function clone(e){if(e===void 0){e={}}var r=cloneNode(this);for(var t in e){r[t]=e[t]}return r};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var r=this.clone(e);this.parent.insertBefore(this,r);return r};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var r=this.clone(e);this.parent.insertAfter(this,r);return r};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,r=new Array(e),t=0;t{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(9570));var i=_interopRequireDefault(t(4905));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e,r){var t=new i.default(e,r);var o=new n.default(t);try{o.parse()}catch(e){if(process.env.NODE_ENV!=="production"){if(e.name==="CssSyntaxError"&&r&&r.from){if(/\.scss$/i.test(r.from)){e.message+="\nYou tried to parse SCSS with "+"the standard CSS parser; "+"try again with the postcss-scss parser"}else if(/\.sass/i.test(r.from)){e.message+="\nYou tried to parse Sass with "+"the standard CSS parser; "+"try again with the postcss-sass parser"}else if(/\.less$/i.test(r.from)){e.message+="\nYou tried to parse Less with "+"the standard CSS parser; "+"try again with the postcss-less parser"}}}throw e}return o.root}var o=parse;r.default=o;e.exports=r.default},9570:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3605));var i=_interopRequireDefault(t(1926));var o=_interopRequireDefault(t(8259));var s=_interopRequireDefault(t(4217));var a=_interopRequireDefault(t(5907));var u=_interopRequireDefault(t(7797));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f=function(){function Parser(e){this.input=e;this.root=new a.default;this.current=this.root;this.spaces="";this.semicolon=false;this.createTokenizer();this.root.source={input:e,start:{line:1,column:1}}}var e=Parser.prototype;e.createTokenizer=function createTokenizer(){this.tokenizer=(0,i.default)(this.input)};e.parse=function parse(){var e;while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();switch(e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}}this.endFile()};e.comment=function comment(e){var r=new o.default;this.init(r,e[2],e[3]);r.source.end={line:e[4],column:e[5]};var t=e[1].slice(2,-2);if(/^\s*$/.test(t)){r.text="";r.raws.left=t;r.raws.right=""}else{var n=t.match(/^(\s*)([^]*[^\s])(\s*)$/);r.text=n[2];r.raws.left=n[1];r.raws.right=n[3]}};e.emptyRule=function emptyRule(e){var r=new u.default;this.init(r,e[2],e[3]);r.selector="";r.raws.between="";this.current=r};e.other=function other(e){var r=false;var t=null;var n=false;var i=null;var o=[];var s=[];var a=e;while(a){t=a[0];s.push(a);if(t==="("||t==="["){if(!i)i=a;o.push(t==="("?")":"]")}else if(o.length===0){if(t===";"){if(n){this.decl(s);return}else{break}}else if(t==="{"){this.rule(s);return}else if(t==="}"){this.tokenizer.back(s.pop());r=true;break}else if(t===":"){n=true}}else if(t===o[o.length-1]){o.pop();if(o.length===0)i=null}a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())r=true;if(o.length>0)this.unclosedBracket(i);if(r&&n){while(s.length){a=s[s.length-1][0];if(a!=="space"&&a!=="comment")break;this.tokenizer.back(s.pop())}this.decl(s)}else{this.unknownWord(s)}};e.rule=function rule(e){e.pop();var r=new u.default;this.init(r,e[0][2],e[0][3]);r.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(r,"selector",e);this.current=r};e.decl=function decl(e){var r=new n.default;this.init(r);var t=e[e.length-1];if(t[0]===";"){this.semicolon=true;e.pop()}if(t[4]){r.source.end={line:t[4],column:t[5]}}else{r.source.end={line:t[2],column:t[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);r.raws.before+=e.shift()[1]}r.source.start={line:e[0][2],column:e[0][3]};r.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}r.prop+=e.shift()[1]}r.raws.between="";var o;while(e.length){o=e.shift();if(o[0]===":"){r.raws.between+=o[1];break}else{if(o[0]==="word"&&/\w/.test(o[1])){this.unknownWord([o])}r.raws.between+=o[1]}}if(r.prop[0]==="_"||r.prop[0]==="*"){r.raws.before+=r.prop[0];r.prop=r.prop.slice(1)}r.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var s=e.length-1;s>0;s--){o=e[s];if(o[1].toLowerCase()==="!important"){r.important=true;var a=this.stringFrom(e,s);a=this.spacesFromEnd(e)+a;if(a!==" !important")r.raws.important=a;break}else if(o[1].toLowerCase()==="important"){var u=e.slice(0);var f="";for(var c=s;c>0;c--){var l=u[c][0];if(f.trim().indexOf("!")===0&&l!=="space"){break}f=u.pop()[1]+f}if(f.trim().indexOf("!")===0){r.important=true;r.raws.important=f;e=u}}if(o[0]!=="space"&&o[0]!=="comment"){break}}this.raw(r,"value",e);if(r.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var r=new s.default;r.name=e[1].slice(1);if(r.name===""){this.unnamedAtrule(r,e)}this.init(r,e[2],e[3]);var t;var n;var i=false;var o=false;var a=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){r.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){o=true;break}else if(e[0]==="}"){if(a.length>0){n=a.length-1;t=a[n];while(t&&t[0]==="space"){t=a[--n]}if(t){r.source.end={line:t[4],column:t[5]}}}this.end(e);break}else{a.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}r.raws.between=this.spacesAndCommentsFromEnd(a);if(a.length){r.raws.afterName=this.spacesAndCommentsFromStart(a);this.raw(r,"params",a);if(i){e=a[a.length-1];r.source.end={line:e[4],column:e[5]};this.spaces=r.raws.between;r.raws.between=""}}else{r.raws.afterName="";r.params=""}if(o){r.nodes=[];this.current=r}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var r=this.current.nodes[this.current.nodes.length-1];if(r&&r.type==="rule"&&!r.raws.ownSemicolon){r.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,r,t){this.current.push(e);e.source={start:{line:r,column:t},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,r,t){var n,i;var o=t.length;var s="";var a=true;var u,f;var c=/^([.|#])?([\w])+/i;for(var l=0;l=0;i--){n=e[i];if(n[0]!=="space"){t+=1;if(t===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();r.default=f;e.exports=r.default},4633:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3605));var i=_interopRequireDefault(t(8074));var o=_interopRequireDefault(t(7549));var s=_interopRequireDefault(t(8259));var a=_interopRequireDefault(t(4217));var u=_interopRequireDefault(t(216));var f=_interopRequireDefault(t(3749));var c=_interopRequireDefault(t(7009));var l=_interopRequireDefault(t(7797));var p=_interopRequireDefault(t(5907));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,r=new Array(e),t=0;t{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(6241));var i=_interopRequireDefault(t(5622));var o=_interopRequireDefault(t(5747));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function fromBase64(e){if(Buffer){return Buffer.from(e,"base64").toString()}else{return window.atob(e)}}var s=function(){function PreviousMap(e,r){this.loadAnnotation(e);this.inline=this.startWith(this.annotation,"data:");var t=r.map?r.map.prev:undefined;var n=this.loadMap(r.from,t);if(n)this.text=n}var e=PreviousMap.prototype;e.consumer=function consumer(){if(!this.consumerCache){this.consumerCache=new n.default.SourceMapConsumer(this.text)}return this.consumerCache};e.withContent=function withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)};e.startWith=function startWith(e,r){if(!e)return false;return e.substr(0,r.length)===r};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var r=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(r&&r.length>0){var t=r[r.length-1];if(t){this.annotation=this.getAnnotationURL(t)}}};e.decodeInline=function decodeInline(e){var r=/^data:application\/json;charset=utf-?8;base64,/;var t=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(r.test(e)||t.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,r){if(r===false)return false;if(r){if(typeof r==="string"){return r}else if(typeof r==="function"){var t=r(e);if(t&&o.default.existsSync&&o.default.existsSync(t)){return o.default.readFileSync(t,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+t.toString())}}else if(r instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(r).toString()}else if(r instanceof n.default.SourceMapGenerator){return r.toString()}else if(this.isMap(r)){return JSON.stringify(r)}else{throw new Error("Unsupported previous source map format: "+r.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var s=this.annotation;if(e)s=i.default.join(i.default.dirname(e),s);this.root=i.default.dirname(s);if(o.default.existsSync&&o.default.existsSync(s)){return o.default.readFileSync(s,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var a=s;r.default=a;e.exports=r.default},8074:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(1169));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(r){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,r){if(r===void 0){r={}}if(this.plugins.length===0&&r.parser===r.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,r)});e.normalize=function normalize(e){var r=[];for(var t=e,n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(i>=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;if(s.postcss)s=s.postcss;if(typeof s==="object"&&Array.isArray(s.plugins)){r=r.concat(s.plugins)}else if(typeof s==="function"){r.push(s)}else if(typeof s==="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(s+" is not a PostCSS plugin")}}return r};return Processor}();var o=i;r.default=o;e.exports=r.default},7613:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(7338));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(5878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}var i=function(e){_inheritsLoose(Root,e);function Root(r){var t;t=e.call(this,r)||this;t.type="root";if(!t.nodes)t.nodes=[];return t}var r=Root.prototype;r.removeChild=function removeChild(r,t){var n=this.index(r);if(!t&&n===0&&this.nodes.length>1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,r)};r.normalize=function normalize(r,t,n){var i=e.prototype.normalize.call(this,r);if(t){if(n==="prepend"){if(this.nodes.length>1){t.raws.before=this.nodes[1].raws.before}else{delete t.raws.before}}else if(this.first!==t){for(var o=i,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;f.raws.before=t.raws.before}}}return i};r.toResult=function toResult(e){if(e===void 0){e={}}var r=t(1169);var n=t(8074);var i=new r(new n,this,e);return i.stringify()};return Root}(n.default);var o=i;r.default=o;e.exports=r.default},7797:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(5878));var i=_interopRequireDefault(t(7009));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;r.default=void 0;var t={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:false};function capitalize(e){return e[0].toUpperCase()+e.slice(1)}var n=function(){function Stringifier(e){this.builder=e}var e=Stringifier.prototype;e.stringify=function stringify(e,r){this[e.type](e,r)};e.root=function root(e){this.body(e);if(e.raws.after)this.builder(e.raws.after)};e.comment=function comment(e){var r=this.raw(e,"left","commentLeft");var t=this.raw(e,"right","commentRight");this.builder("/*"+r+e.text+t+"*/",e)};e.decl=function decl(e,r){var t=this.raw(e,"between","colon");var n=e.prop+t+this.rawValue(e,"value");if(e.important){n+=e.raws.important||" !important"}if(r)n+=";";this.builder(n,e)};e.rule=function rule(e){this.block(e,this.rawValue(e,"selector"));if(e.raws.ownSemicolon){this.builder(e.raws.ownSemicolon,e,"end")}};e.atrule=function atrule(e,r){var t="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!=="undefined"){t+=e.raws.afterName}else if(n){t+=" "}if(e.nodes){this.block(e,t+n)}else{var i=(e.raws.between||"")+(r?";":"");this.builder(t+n+i,e)}};e.body=function body(e){var r=e.nodes.length-1;while(r>0){if(e.nodes[r].type!=="comment")break;r-=1}var t=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){r=e.raws.after;if(r.indexOf("\n")!==-1){r=r.replace(/[^\n]+$/,"")}return false}}});if(r)r=r.replace(/[^\s]/g,"");return r};e.rawBeforeOpen=function rawBeforeOpen(e){var r;e.walk(function(e){if(e.type!=="decl"){r=e.raws.between;if(typeof r!=="undefined")return false}});return r};e.rawColon=function rawColon(e){var r;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){r=e.raws.between.replace(/[^\s:]/g,"");return false}});return r};e.beforeAfter=function beforeAfter(e,r){var t;if(e.type==="decl"){t=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){t=this.raw(e,null,"beforeComment")}else if(r==="before"){t=this.raw(e,null,"beforeRule")}else{t=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(t.indexOf("\n")!==-1){var o=this.raw(e,null,"indent");if(o.length){for(var s=0;s{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3935));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringify(e,r){var t=new n.default(r);t.stringify(e)}var i=stringify;r.default=i;e.exports=r.default},8300:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(2242));var i=_interopRequireDefault(t(1926));var o=_interopRequireDefault(t(4905));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s={brackets:n.default.cyan,"at-word":n.default.cyan,comment:n.default.gray,string:n.default.green,class:n.default.yellow,call:n.default.cyan,hash:n.default.magenta,"(":n.default.cyan,")":n.default.cyan,"{":n.default.yellow,"}":n.default.yellow,"[":n.default.yellow,"]":n.default.yellow,":":n.default.yellow,";":n.default.yellow};function getTokenType(e,r){var t=e[0],n=e[1];if(t==="word"){if(n[0]==="."){return"class"}if(n[0]==="#"){return"hash"}}if(!r.endOfFile()){var i=r.nextToken();r.back(i);if(i[0]==="brackets"||i[0]==="(")return"call"}return t}function terminalHighlight(e){var r=(0,i.default)(new o.default(e),{ignoreErrors:true});var t="";var n=function _loop(){var e=r.nextToken();var n=s[getTokenType(e,r)];if(n){t+=e[1].split(/\r?\n/).map(function(e){return n(e)}).join("\n")}else{t+=e[1]}};while(!r.endOfFile()){n()}return t}var a=terminalHighlight;r.default=a;e.exports=r.default},1926:(e,r)=>{"use strict";r.__esModule=true;r.default=tokenizer;var t="'".charCodeAt(0);var n='"'.charCodeAt(0);var i="\\".charCodeAt(0);var o="/".charCodeAt(0);var s="\n".charCodeAt(0);var a=" ".charCodeAt(0);var u="\f".charCodeAt(0);var f="\t".charCodeAt(0);var c="\r".charCodeAt(0);var l="[".charCodeAt(0);var p="]".charCodeAt(0);var h="(".charCodeAt(0);var B=")".charCodeAt(0);var v="{".charCodeAt(0);var d="}".charCodeAt(0);var b=";".charCodeAt(0);var y="*".charCodeAt(0);var g=":".charCodeAt(0);var m="@".charCodeAt(0);var C=/[ \n\t\r\f{}()'"\\;/[\]#]/g;var w=/[ \n\t\r\f(){}:;@!'"\\\][#]|\/(?=\*)/g;var S=/.[\\/("'\n]/;var O=/[a-f0-9]/i;function tokenizer(e,r){if(r===void 0){r={}}var T=e.css.valueOf();var E=r.ignoreErrors;var k,P,D,A,R,F,x;var j,I,M,_,N,L,q;var G=T.length;var U=-1;var J=1;var W=0;var Q=[];var H=[];function position(){return W}function unclosed(r){throw e.error("Unclosed "+r,J,W-U)}function endOfFile(){return H.length===0&&W>=G}function nextToken(e){if(H.length)return H.pop();if(W>=G)return;var r=e?e.ignoreUnclosed:false;k=T.charCodeAt(W);if(k===s||k===u||k===c&&T.charCodeAt(W+1)!==s){U=W;J+=1}switch(k){case s:case a:case f:case c:case u:P=W;do{P+=1;k=T.charCodeAt(P);if(k===s){U=P;J+=1}}while(k===a||k===s||k===f||k===c||k===u);q=["space",T.slice(W,P)];W=P-1;break;case l:case p:case v:case d:case g:case b:case B:var K=String.fromCharCode(k);q=[K,K,J,W-U];break;case h:N=Q.length?Q.pop()[1]:"";L=T.charCodeAt(W+1);if(N==="url"&&L!==t&&L!==n&&L!==a&&L!==s&&L!==f&&L!==u&&L!==c){P=W;do{M=false;P=T.indexOf(")",P+1);if(P===-1){if(E||r){P=W;break}else{unclosed("bracket")}}_=P;while(T.charCodeAt(_-1)===i){_-=1;M=!M}}while(M);q=["brackets",T.slice(W,P+1),J,W-U,J,P-U];W=P}else{P=T.indexOf(")",W+1);F=T.slice(W,P+1);if(P===-1||S.test(F)){q=["(","(",J,W-U]}else{q=["brackets",F,J,W-U,J,P-U];W=P}}break;case t:case n:D=k===t?"'":'"';P=W;do{M=false;P=T.indexOf(D,P+1);if(P===-1){if(E||r){P=W+1;break}else{unclosed("string")}}_=P;while(T.charCodeAt(_-1)===i){_-=1;M=!M}}while(M);F=T.slice(W,P+1);A=F.split("\n");R=A.length-1;if(R>0){j=J+R;I=P-A[R].length}else{j=J;I=U}q=["string",T.slice(W,P+1),J,W-U,j,P-I];U=I;J=j;W=P;break;case m:C.lastIndex=W+1;C.test(T);if(C.lastIndex===0){P=T.length-1}else{P=C.lastIndex-2}q=["at-word",T.slice(W,P+1),J,W-U,J,P-U];W=P;break;case i:P=W;x=true;while(T.charCodeAt(P+1)===i){P+=1;x=!x}k=T.charCodeAt(P+1);if(x&&k!==o&&k!==a&&k!==s&&k!==f&&k!==c&&k!==u){P+=1;if(O.test(T.charAt(P))){while(O.test(T.charAt(P+1))){P+=1}if(T.charCodeAt(P+1)===a){P+=1}}}q=["word",T.slice(W,P+1),J,W-U,J,P-U];W=P;break;default:if(k===o&&T.charCodeAt(W+1)===y){P=T.indexOf("*/",W+2)+1;if(P===0){if(E||r){P=T.length}else{unclosed("comment")}}F=T.slice(W,P+1);A=F.split("\n");R=A.length-1;if(R>0){j=J+R;I=P-A[R].length}else{j=J;I=U}q=["comment",F,J,W-U,j,P-I];U=I;J=j;W=P}else{w.lastIndex=W+1;w.test(T);if(w.lastIndex===0){P=T.length-1}else{P=w.lastIndex-2}q=["word",T.slice(W,P+1),J,W-U,J,P-U];Q.push(q);W=P}break}W++;return q}function back(e){H.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=r.default},216:(e,r)=>{"use strict";r.__esModule=true;r.default=void 0;var t={prefix:function prefix(e){var r=e.match(/^(-\w+-)/);if(r){return r[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=t;r.default=n;e.exports=r.default},3831:(e,r)=>{"use strict";r.__esModule=true;r.default=warnOnce;var t={};function warnOnce(e){if(t[e])return;t[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=r.default},7338:(e,r)=>{"use strict";r.__esModule=true;r.default=void 0;var t=function(){function Warning(e,r){if(r===void 0){r={}}this.type="warning";this.text=e;if(r.node&&r.node.source){var t=r.node.positionBy(r);this.line=t.line;this.column=t.column}for(var n in r){this[n]=r[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=t;r.default=n;e.exports=r.default},8327:(e,r,t)=>{"use strict";const n=t(2087);const i=t(8379);const{env:o}=process;let s;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){s=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){s=1}if("FORCE_COLOR"in o){if(o.FORCE_COLOR===true||o.FORCE_COLOR==="true"){s=1}else if(o.FORCE_COLOR===false||o.FORCE_COLOR==="false"){s=0}else{s=o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(s===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&s===undefined){return 0}const r=s||0;if(o.TERM==="dumb"){return r}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in o)||o.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}return r}function getSupportLevel(e){const r=supportsColor(e);return translateLevel(r)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},5632:e=>{"use strict";function unique_pred(e,r){var t=1,n=e.length,i=e[0],o=e[0];for(var s=1;s{"use strict";e.exports=require("browserslist")},4338:e=>{"use strict";e.exports=require("caniuse-lite")},5543:e=>{"use strict";e.exports=require("caniuse-lite/data/features/border-radius")},6944:e=>{"use strict";e.exports=require("caniuse-lite/data/features/css-featurequeries")},2242:e=>{"use strict";e.exports=require("chalk")},5747:e=>{"use strict";e.exports=require("fs")},6241:e=>{"use strict";e.exports=require("next/dist/compiled/source-map")},2087:e=>{"use strict";e.exports=require("os")},5622:e=>{"use strict";e.exports=require("path")},1669:e=>{"use strict";e.exports=require("util")}};var r={};function __nccwpck_require__(t){if(r[t]){return r[t].exports}var n=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t](n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}n.loaded=true;return n.exports}(()=>{__nccwpck_require__.nmd=(e=>{e.paths=[];if(!e.children)e.children=[];return e})})();__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(7435)})(); \ No newline at end of file +module.exports=(()=>{var e={3094:e=>{"use strict";e.exports=JSON.parse('[{"id":"all-property","title":"`all` Property","description":"A property for defining the reset of all properties of an element","specification":"https://www.w3.org/TR/css-cascade-3/#all-shorthand","stage":3,"caniuse":"css-all","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/all"},"example":"a {\\n all: initial;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/maximkoretskiy/postcss-initial"}]},{"id":"any-link-pseudo-class","title":"`:any-link` Hyperlink Pseudo-Class","description":"A pseudo-class for matching anchor elements independent of whether they have been visited","specification":"https://www.w3.org/TR/selectors-4/#any-link-pseudo","stage":2,"caniuse":"css-any-link","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:any-link"},"example":"nav :any-link > span {\\n background-color: yellow;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-pseudo-class-any-link"}]},{"id":"blank-pseudo-class","title":"`:blank` Empty-Value Pseudo-Class","description":"A pseudo-class for matching form elements when they are empty","specification":"https://drafts.csswg.org/selectors-4/#blank","stage":1,"example":"input:blank {\\n background-color: yellow;\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/csstools/css-blank-pseudo"},{"type":"PostCSS Plugin","link":"https://github.com/csstools/css-blank-pseudo"}]},{"id":"break-properties","title":"Break Properties","description":"Properties for defining the break behavior between and within boxes","specification":"https://www.w3.org/TR/css-break-3/#breaking-controls","stage":3,"caniuse":"multicolumn","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/break-after"},"example":"a {\\n break-inside: avoid;\\n break-before: avoid-column;\\n break-after: always;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/shrpne/postcss-page-break"}]},{"id":"case-insensitive-attributes","title":"Case-Insensitive Attributes","description":"An attribute selector matching attribute values case-insensitively","specification":"https://www.w3.org/TR/selectors-4/#attribute-case","stage":2,"caniuse":"css-case-insensitive","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors"},"example":"[frame=hsides i] {\\n border-style: solid none;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/Semigradsky/postcss-attribute-case-insensitive"}]},{"id":"color-adjust","title":"`color-adjust` Property","description":"The color-adjust property is a non-standard CSS extension that can be used to force printing of background colors and images","specification":"https://www.w3.org/TR/css-color-4/#color-adjust","stage":2,"caniuse":"css-color-adjust","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/color-adjust"},"example":".background {\\n background-color:#ccc;\\n}\\n.background.color-adjust {\\n color-adjust: economy;\\n}\\n.background.color-adjust-exact {\\n color-adjust: exact;\\n}"},{"id":"color-functional-notation","title":"Color Functional Notation","description":"A space and slash separated notation for specifying colors","specification":"https://drafts.csswg.org/css-color/#ref-for-funcdef-rgb%E2%91%A1%E2%91%A0","stage":1,"example":"em {\\n background-color: hsl(120deg 100% 25%);\\n box-shadow: 0 0 0 10px hwb(120deg 100% 25% / 80%);\\n color: rgb(0 255 0);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-color-functional-notation"}]},{"id":"color-mod-function","title":"`color-mod()` Function","description":"A function for modifying colors","specification":"https://www.w3.org/TR/css-color-4/#funcdef-color-mod","stage":-1,"example":"p {\\n color: color-mod(black alpha(50%));\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-color-mod-function"}]},{"id":"custom-media-queries","title":"Custom Media Queries","description":"An at-rule for defining aliases that represent media queries","specification":"https://drafts.csswg.org/mediaqueries-5/#at-ruledef-custom-media","stage":1,"example":"@custom-media --narrow-window (max-width: 30em);\\n\\n@media (--narrow-window) {}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-custom-media"}]},{"id":"custom-properties","title":"Custom Properties","description":"A syntax for defining custom values accepted by all CSS properties","specification":"https://www.w3.org/TR/css-variables-1/","stage":3,"caniuse":"css-variables","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/var"},"example":"img {\\n --some-length: 32px;\\n\\n height: var(--some-length);\\n width: var(--some-length);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-custom-properties"}]},{"id":"custom-property-sets","title":"Custom Property Sets","description":"A syntax for storing properties in named variables, referenceable in other style rules","specification":"https://tabatkins.github.io/specs/css-apply-rule/","stage":-1,"caniuse":"css-apply-rule","example":"img {\\n --some-length-styles: {\\n height: 32px;\\n width: 32px;\\n };\\n\\n @apply --some-length-styles;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/pascalduez/postcss-apply"}]},{"id":"custom-selectors","title":"Custom Selectors","description":"An at-rule for defining aliases that represent selectors","specification":"https://drafts.csswg.org/css-extensions/#custom-selectors","stage":1,"example":"@custom-selector :--heading h1, h2, h3, h4, h5, h6;\\n\\narticle :--heading + p {}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-custom-selectors"}]},{"id":"dir-pseudo-class","title":"`:dir` Directionality Pseudo-Class","description":"A pseudo-class for matching elements based on their directionality","specification":"https://www.w3.org/TR/selectors-4/#dir-pseudo","stage":2,"caniuse":"css-dir-pseudo","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:dir"},"example":"blockquote:dir(rtl) {\\n margin-right: 10px;\\n}\\n\\nblockquote:dir(ltr) {\\n margin-left: 10px;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-dir-pseudo-class"}]},{"id":"double-position-gradients","title":"Double Position Gradients","description":"A syntax for using two positions in a gradient.","specification":"https://www.w3.org/TR/css-images-4/#color-stop-syntax","stage":2,"caniuse-compat":{"and_chr":{"71":"y"},"chrome":{"71":"y"}},"example":".pie_chart {\\n background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-double-position-gradients"}]},{"id":"environment-variables","title":"Custom Environment Variables","description":"A syntax for using custom values accepted by CSS globally","specification":"https://drafts.csswg.org/css-env-1/","stage":0,"caniuse-compat":{"and_chr":{"69":"y"},"chrome":{"69":"y"},"ios_saf":{"11.2":"y"},"safari":{"11.2":"y"}},"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/env"},"example":"@media (max-width: env(--brand-small)) {\\n body {\\n padding: env(--brand-spacing);\\n }\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-env-function"}]},{"id":"focus-visible-pseudo-class","title":"`:focus-visible` Focus-Indicated Pseudo-Class","description":"A pseudo-class for matching focused elements that indicate that focus to a user","specification":"https://www.w3.org/TR/selectors-4/#focus-visible-pseudo","stage":2,"caniuse":"css-focus-visible","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible"},"example":":focus:not(:focus-visible) {\\n outline: 0;\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/WICG/focus-visible"},{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-focus-visible"}]},{"id":"focus-within-pseudo-class","title":"`:focus-within` Focus Container Pseudo-Class","description":"A pseudo-class for matching elements that are either focused or that have focused descendants","specification":"https://www.w3.org/TR/selectors-4/#focus-within-pseudo","stage":2,"caniuse":"css-focus-within","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-within"},"example":"form:focus-within {\\n background: rgba(0, 0, 0, 0.3);\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/jonathantneal/focus-within"},{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-focus-within"}]},{"id":"font-variant-property","title":"`font-variant` Property","description":"A property for defining the usage of alternate glyphs in a font","specification":"https://www.w3.org/TR/css-fonts-3/#propdef-font-variant","stage":3,"caniuse":"font-variant-alternates","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant"},"example":"h2 {\\n font-variant: small-caps;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-font-variant"}]},{"id":"gap-properties","title":"Gap Properties","description":"Properties for defining gutters within a layout","specification":"https://www.w3.org/TR/css-grid-1/#gutters","stage":3,"caniuse-compat":{"chrome":{"66":"y"},"edge":{"16":"y"},"firefox":{"61":"y"},"safari":{"11.2":"y","TP":"y"}},"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/gap"},"example":".grid-1 {\\n gap: 20px;\\n}\\n\\n.grid-2 {\\n column-gap: 40px;\\n row-gap: 20px;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-gap-properties"}]},{"id":"gray-function","title":"`gray()` Function","description":"A function for specifying fully desaturated colors","specification":"https://www.w3.org/TR/css-color-4/#funcdef-gray","stage":2,"example":"p {\\n color: gray(50);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-color-gray"}]},{"id":"grid-layout","title":"Grid Layout","description":"A syntax for using a grid concept to lay out content","specification":"https://www.w3.org/TR/css-grid-1/","stage":3,"caniuse":"css-grid","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/grid"},"example":"section {\\n display: grid;\\n grid-template-columns: 100px 100px 100px;\\n grid-gap: 10px;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/autoprefixer"}]},{"id":"has-pseudo-class","title":"`:has()` Relational Pseudo-Class","description":"A pseudo-class for matching ancestor and sibling elements","specification":"https://www.w3.org/TR/selectors-4/#has-pseudo","stage":2,"caniuse":"css-has","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:has"},"example":"a:has(> img) {\\n display: block;\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/csstools/css-has-pseudo"},{"type":"PostCSS Plugin","link":"https://github.com/csstools/css-has-pseudo"}]},{"id":"hexadecimal-alpha-notation","title":"Hexadecimal Alpha Notation","description":"A 4 & 8 character hex color notation for specifying the opacity level","specification":"https://www.w3.org/TR/css-color-4/#hex-notation","stage":2,"caniuse":"css-rrggbbaa","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Syntax_2"},"example":"section {\\n background-color: #f3f3f3f3;\\n color: #0003;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-color-hex-alpha"}]},{"id":"hwb-function","title":"`hwb()` Function","description":"A function for specifying colors by hue and then a degree of whiteness and blackness to mix into it","specification":"https://www.w3.org/TR/css-color-4/#funcdef-hwb","stage":2,"example":"p {\\n color: hwb(120 44% 50%);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-color-hwb"}]},{"id":"image-set-function","title":"`image-set()` Function","description":"A function for specifying image sources based on the user’s resolution","specification":"https://www.w3.org/TR/css-images-4/#image-set-notation","stage":2,"caniuse":"css-image-set","example":"p {\\n background-image: image-set(\\n \\"foo.png\\" 1x,\\n \\"foo-2x.png\\" 2x,\\n \\"foo-print.png\\" 600dpi\\n );\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-image-set-function"}]},{"id":"in-out-of-range-pseudo-class","title":"`:in-range` and `:out-of-range` Pseudo-Classes","description":"A pseudo-class for matching elements that have range limitations","specification":"https://www.w3.org/TR/selectors-4/#range-pseudos","stage":2,"caniuse":"css-in-out-of-range","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:in-range"},"example":"input:in-range {\\n background-color: rgba(0, 255, 0, 0.25);\\n}\\ninput:out-of-range {\\n background-color: rgba(255, 0, 0, 0.25);\\n border: 2px solid red;\\n}"},{"id":"lab-function","title":"`lab()` Function","description":"A function for specifying colors expressed in the CIE Lab color space","specification":"https://www.w3.org/TR/css-color-4/#funcdef-lab","stage":2,"example":"body {\\n color: lab(240 50 20);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-lab-function"}]},{"id":"lch-function","title":"`lch()` Function","description":"A function for specifying colors expressed in the CIE Lab color space with chroma and hue","specification":"https://www.w3.org/TR/css-color-4/#funcdef-lch","stage":2,"example":"body {\\n color: lch(53 105 40);\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-lab-function"}]},{"id":"logical-properties-and-values","title":"Logical Properties and Values","description":"Flow-relative (left-to-right or right-to-left) properties and values","specification":"https://www.w3.org/TR/css-logical-1/","stage":2,"caniuse":"css-logical-props","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties"},"example":"span:first-child {\\n float: inline-start;\\n margin-inline-start: 10px;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-logical-properties"}]},{"id":"matches-pseudo-class","title":"`:matches()` Matches-Any Pseudo-Class","description":"A pseudo-class for matching elements in a selector list","specification":"https://www.w3.org/TR/selectors-4/#matches-pseudo","stage":2,"caniuse":"css-matches-pseudo","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:matches"},"example":"p:matches(:first-child, .special) {\\n margin-top: 1em;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-selector-matches"}]},{"id":"media-query-ranges","title":"Media Query Ranges","description":"A syntax for defining media query ranges using ordinary comparison operators","specification":"https://www.w3.org/TR/mediaqueries-4/#range-context","stage":3,"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#Syntax_improvements_in_Level_4"},"example":"@media (width < 480px) {}\\n\\n@media (480px <= width < 768px) {}\\n\\n@media (width >= 768px) {}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-media-minmax"}]},{"id":"nesting-rules","title":"Nesting Rules","description":"A syntax for nesting relative rules within rules","specification":"https://drafts.csswg.org/css-nesting-1/","stage":1,"example":"article {\\n & p {\\n color: #333;\\n }\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-nesting"}]},{"id":"not-pseudo-class","title":"`:not()` Negation List Pseudo-Class","description":"A pseudo-class for ignoring elements in a selector list","specification":"https://www.w3.org/TR/selectors-4/#negation-pseudo","stage":2,"caniuse":"css-not-sel-list","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:not"},"example":"p:not(:first-child, .special) {\\n margin-top: 1em;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-selector-not"}]},{"id":"overflow-property","title":"`overflow` Shorthand Property","description":"A property for defining `overflow-x` and `overflow-y`","specification":"https://www.w3.org/TR/css-overflow-3/#propdef-overflow","stage":2,"caniuse":"css-overflow","caniuse-compat":{"and_chr":{"68":"y"},"and_ff":{"61":"y"},"chrome":{"68":"y"},"firefox":{"61":"y"}},"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/overflow"},"example":"html {\\n overflow: hidden auto;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-overflow-shorthand"}]},{"id":"overflow-wrap-property","title":"`overflow-wrap` Property","description":"A property for defining whether to insert line breaks within words to prevent overflowing","specification":"https://www.w3.org/TR/css-text-3/#overflow-wrap-property","stage":2,"caniuse":"wordwrap","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap"},"example":"p {\\n overflow-wrap: break-word;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/mattdimu/postcss-replace-overflow-wrap"}]},{"id":"overscroll-behavior-property","title":"`overscroll-behavior` Property","description":"Properties for controlling when the scroll position of a scroll container reaches the edge of a scrollport","specification":"https://drafts.csswg.org/css-overscroll-behavior","stage":1,"caniuse":"css-overscroll-behavior","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior"},"example":".messages {\\n height: 220px;\\n overflow: auto;\\n overscroll-behavior-y: contain;\\n}\\n\\nbody {\\n margin: 0;\\n overscroll-behavior: none;\\n}"},{"id":"place-properties","title":"Place Properties","description":"Properties for defining alignment within a layout","specification":"https://www.w3.org/TR/css-align-3/#place-items-property","stage":2,"caniuse-compat":{"chrome":{"59":"y"},"firefox":{"45":"y"}},"docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/place-content"},"example":".example {\\n place-content: flex-end;\\n place-items: center / space-between;\\n place-self: flex-start / center;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/jonathantneal/postcss-place"}]},{"id":"prefers-color-scheme-query","title":"`prefers-color-scheme` Media Query","description":"A media query to detect if the user has requested the system use a light or dark color theme","specification":"https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme","stage":1,"caniuse":"prefers-color-scheme","caniuse-compat":{"ios_saf":{"12.1":"y"},"safari":{"12.1":"y"}},"example":"body {\\n background-color: white;\\n color: black;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n body {\\n background-color: black;\\n color: white;\\n }\\n}","polyfills":[{"type":"JavaScript Library","link":"https://github.com/csstools/css-prefers-color-scheme"},{"type":"PostCSS Plugin","link":"https://github.com/csstools/css-prefers-color-scheme"}]},{"id":"prefers-reduced-motion-query","title":"`prefers-reduced-motion` Media Query","description":"A media query to detect if the user has requested less animation and general motion on the page","specification":"https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion","stage":1,"caniuse":"prefers-reduced-motion","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion"},"example":".animation {\\n animation: vibrate 0.3s linear infinite both; \\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n .animation {\\n animation: none;\\n }\\n}"},{"id":"read-only-write-pseudo-class","title":"`:read-only` and `:read-write` selectors","description":"Pseudo-classes to match elements which are considered user-alterable","specification":"https://www.w3.org/TR/selectors-4/#rw-pseudos","stage":2,"caniuse":"css-read-only-write","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/:read-only"},"example":"input:read-only {\\n background-color: #ccc;\\n}"},{"id":"rebeccapurple-color","title":"`rebeccapurple` Color","description":"A particularly lovely shade of purple in memory of Rebecca Alison Meyer","specification":"https://www.w3.org/TR/css-color-4/#valdef-color-rebeccapurple","stage":2,"caniuse":"css-rebeccapurple","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/color_value"},"example":"html {\\n color: rebeccapurple;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/postcss/postcss-color-rebeccapurple"}]},{"id":"system-ui-font-family","title":"`system-ui` Font Family","description":"A generic font used to match the user’s interface","specification":"https://www.w3.org/TR/css-fonts-4/#system-ui-def","stage":2,"caniuse":"font-family-system-ui","docs":{"mdn":"https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#Syntax"},"example":"body {\\n font-family: system-ui;\\n}","polyfills":[{"type":"PostCSS Plugin","link":"https://github.com/JLHwung/postcss-font-family-system-ui"}]},{"id":"when-else-rules","title":"When/Else Rules","description":"At-rules for specifying media queries and support queries in a single grammar","specification":"https://tabatkins.github.io/specs/css-when-else/","stage":0,"example":"@when media(width >= 640px) and (supports(display: flex) or supports(display: grid)) {\\n /* A */\\n} @else media(pointer: coarse) {\\n /* B */\\n} @else {\\n /* C */\\n}"},{"id":"where-pseudo-class","title":"`:where()` Zero-Specificity Pseudo-Class","description":"A pseudo-class for matching elements in a selector list without contributing specificity","specification":"https://drafts.csswg.org/selectors-4/#where-pseudo","stage":1,"example":"a:where(:not(:hover)) {\\n text-decoration: none;\\n}"}]')},9614:e=>{"use strict";e.exports=JSON.parse('[{"prop":"animation","initial":"${animation-name} ${animation-duration} ${animation-timing-function} ${animation-delay} ${animation-iteration-count} ${animation-direction} ${animation-fill-mode} ${animation-play-state}","combined":true},{"prop":"animation-delay","initial":"0s"},{"prop":"animation-direction","initial":"normal"},{"prop":"animation-duration","initial":"0s"},{"prop":"animation-fill-mode","initial":"none"},{"prop":"animation-iteration-count","initial":"1"},{"prop":"animation-name","initial":"none"},{"prop":"animation-play-state","initial":"running"},{"prop":"animation-timing-function","initial":"ease"},{"prop":"backface-visibility","initial":"visible","basic":true},{"prop":"background","initial":"${background-color} ${background-image} ${background-repeat} ${background-position} / ${background-size} ${background-origin} ${background-clip} ${background-attachment}","combined":true},{"prop":"background-attachment","initial":"scroll"},{"prop":"background-clip","initial":"border-box"},{"prop":"background-color","initial":"transparent"},{"prop":"background-image","initial":"none"},{"prop":"background-origin","initial":"padding-box"},{"prop":"background-position","initial":"0 0"},{"prop":"background-position-x","initial":"0"},{"prop":"background-position-y","initial":"0"},{"prop":"background-repeat","initial":"repeat"},{"prop":"background-size","initial":"auto auto"},{"prop":"border","initial":"${border-width} ${border-style} ${border-color}","combined":true},{"prop":"border-style","initial":"none"},{"prop":"border-width","initial":"medium"},{"prop":"border-color","initial":"currentColor"},{"prop":"border-bottom","initial":"0"},{"prop":"border-bottom-color","initial":"currentColor"},{"prop":"border-bottom-left-radius","initial":"0"},{"prop":"border-bottom-right-radius","initial":"0"},{"prop":"border-bottom-style","initial":"none"},{"prop":"border-bottom-width","initial":"medium"},{"prop":"border-collapse","initial":"separate","basic":true,"inherited":true},{"prop":"border-image","initial":"none","basic":true},{"prop":"border-left","initial":"0"},{"prop":"border-left-color","initial":"currentColor"},{"prop":"border-left-style","initial":"none"},{"prop":"border-left-width","initial":"medium"},{"prop":"border-radius","initial":"0","basic":true},{"prop":"border-right","initial":"0"},{"prop":"border-right-color","initial":"currentColor"},{"prop":"border-right-style","initial":"none"},{"prop":"border-right-width","initial":"medium"},{"prop":"border-spacing","initial":"0","basic":true,"inherited":true},{"prop":"border-top","initial":"0"},{"prop":"border-top-color","initial":"currentColor"},{"prop":"border-top-left-radius","initial":"0"},{"prop":"border-top-right-radius","initial":"0"},{"prop":"border-top-style","initial":"none"},{"prop":"border-top-width","initial":"medium"},{"prop":"bottom","initial":"auto","basic":true},{"prop":"box-shadow","initial":"none","basic":true},{"prop":"box-sizing","initial":"content-box","basic":true},{"prop":"caption-side","initial":"top","basic":true,"inherited":true},{"prop":"clear","initial":"none","basic":true},{"prop":"clip","initial":"auto","basic":true},{"prop":"color","initial":"#000","basic":true},{"prop":"columns","initial":"auto","basic":true},{"prop":"column-count","initial":"auto","basic":true},{"prop":"column-fill","initial":"balance","basic":true},{"prop":"column-gap","initial":"normal","basic":true},{"prop":"column-rule","initial":"${column-rule-width} ${column-rule-style} ${column-rule-color}","combined":true},{"prop":"column-rule-color","initial":"currentColor"},{"prop":"column-rule-style","initial":"none"},{"prop":"column-rule-width","initial":"medium"},{"prop":"column-span","initial":"1","basic":true},{"prop":"column-width","initial":"auto","basic":true},{"prop":"content","initial":"normal","basic":true},{"prop":"counter-increment","initial":"none","basic":true},{"prop":"counter-reset","initial":"none","basic":true},{"prop":"cursor","initial":"auto","basic":true,"inherited":true},{"prop":"direction","initial":"ltr","basic":true,"inherited":true},{"prop":"display","initial":"inline","basic":true},{"prop":"empty-cells","initial":"show","basic":true,"inherited":true},{"prop":"float","initial":"none","basic":true},{"prop":"font","contains":["font-style","font-variant","font-weight","font-stretch","font-size","line-height","font-family"],"basic":true,"inherited":true},{"prop":"font-family","initial":"serif"},{"prop":"font-size","initial":"medium"},{"prop":"font-style","initial":"normal"},{"prop":"font-variant","initial":"normal"},{"prop":"font-weight","initial":"normal"},{"prop":"font-stretch","initial":"normal"},{"prop":"line-height","initial":"normal","inherited":true},{"prop":"height","initial":"auto","basic":true},{"prop":"hyphens","initial":"none","basic":true,"inherited":true},{"prop":"left","initial":"auto","basic":true},{"prop":"letter-spacing","initial":"normal","basic":true,"inherited":true},{"prop":"list-style","initial":"${list-style-type} ${list-style-position} ${list-style-image}","combined":true,"inherited":true},{"prop":"list-style-image","initial":"none"},{"prop":"list-style-position","initial":"outside"},{"prop":"list-style-type","initial":"disc"},{"prop":"margin","initial":"0","basic":true},{"prop":"margin-bottom","initial":"0"},{"prop":"margin-left","initial":"0"},{"prop":"margin-right","initial":"0"},{"prop":"margin-top","initial":"0"},{"prop":"max-height","initial":"none","basic":true},{"prop":"max-width","initial":"none","basic":true},{"prop":"min-height","initial":"0","basic":true},{"prop":"min-width","initial":"0","basic":true},{"prop":"opacity","initial":"1","basic":true},{"prop":"orphans","initial":"2","basic":true},{"prop":"outline","initial":"${outline-width} ${outline-style} ${outline-color}","combined":true},{"prop":"outline-color","initial":"invert"},{"prop":"outline-style","initial":"none"},{"prop":"outline-width","initial":"medium"},{"prop":"overflow","initial":"visible","basic":true},{"prop":"overflow-x","initial":"visible","basic":true},{"prop":"overflow-y","initial":"visible","basic":true},{"prop":"padding","initial":"0","basic":true},{"prop":"padding-bottom","initial":"0"},{"prop":"padding-left","initial":"0"},{"prop":"padding-right","initial":"0"},{"prop":"padding-top","initial":"0"},{"prop":"page-break-after","initial":"auto","basic":true},{"prop":"page-break-before","initial":"auto","basic":true},{"prop":"page-break-inside","initial":"auto","basic":true},{"prop":"perspective","initial":"none","basic":true},{"prop":"perspective-origin","initial":"50% 50%","basic":true},{"prop":"position","initial":"static","basic":true},{"prop":"quotes","initial":"“ ” ‘ ’"},{"prop":"right","initial":"auto","basic":true},{"prop":"tab-size","initial":"8","basic":true,"inherited":true},{"prop":"table-layout","initial":"auto","basic":true},{"prop":"text-align","initial":"left","basic":true,"inherited":true},{"prop":"text-align-last","initial":"auto","basic":true,"inherited":true},{"prop":"text-decoration","initial":"${text-decoration-line}","combined":true},{"prop":"text-decoration-color","initial":"inherited"},{"prop":"text-decoration-color","initial":"currentColor"},{"prop":"text-decoration-line","initial":"none"},{"prop":"text-decoration-style","initial":"solid"},{"prop":"text-indent","initial":"0","basic":true,"inherited":true},{"prop":"text-shadow","initial":"none","basic":true,"inherited":true},{"prop":"text-transform","initial":"none","basic":true,"inherited":true},{"prop":"top","initial":"auto","basic":true},{"prop":"transform","initial":"none","basic":true},{"prop":"transform-origin","initial":"50% 50% 0","basic":true},{"prop":"transform-style","initial":"flat","basic":true},{"prop":"transition","initial":"${transition-property} ${transition-duration} ${transition-timing-function} ${transition-delay}","combined":true},{"prop":"transition-delay","initial":"0s"},{"prop":"transition-duration","initial":"0s"},{"prop":"transition-property","initial":"none"},{"prop":"transition-timing-function","initial":"ease"},{"prop":"unicode-bidi","initial":"normal","basic":true},{"prop":"vertical-align","initial":"baseline","basic":true},{"prop":"visibility","initial":"visible","basic":true,"inherited":true},{"prop":"white-space","initial":"normal","basic":true,"inherited":true},{"prop":"widows","initial":"2","basic":true,"inherited":true},{"prop":"width","initial":"auto","basic":true},{"prop":"word-spacing","initial":"normal","basic":true,"inherited":true},{"prop":"z-index","initial":"auto","basic":true}]')},4567:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function rgb2hue(e,r,t){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var i=rgb2value(e,r,t);var o=rgb2whiteness(e,r,t);var s=i-o;if(s){var a=i===e?(r-t)/s:i===r?(t-e)/s:(e-r)/s;var u=i===e?a<0?360/60:0/60:i===r?120/60:240/60;var f=(a+u)*60;return f}else{return n}}function hue2rgb(e,r,t){var n=t<0?t+360:t>360?t-360:t;var i=n*6<360?e+(r-e)*n/60:n*2<360?r:n*3<720?e+(r-e)*(240-n)/60:e;return i}function rgb2value(e,r,t){var n=Math.max(e,r,t);return n}function rgb2whiteness(e,r,t){var n=Math.min(e,r,t);return n}function matrix(e,r){return r.map(function(r){return r.reduce(function(r,t,n){return r+e[n]*t},0)})}var t=96.42;var n=100;var i=82.49;var o=Math.pow(6,3)/Math.pow(29,3);var s=Math.pow(29,3)/Math.pow(3,3);function rgb2hsl(e,r,t,n){var i=rgb2hue(e,r,t,n);var o=rgb2value(e,r,t);var s=rgb2whiteness(e,r,t);var a=o-s;var u=(o+s)/2;var f=a===0?0:a/(100-Math.abs(2*u-100))*100;return[i,f,u]}function hsl2rgb(e,r,t){var n=t<=50?t*(r+100)/100:t+r-t*r/100;var i=t*2-n;var o=[hue2rgb(i,n,e+120),hue2rgb(i,n,e),hue2rgb(i,n,e-120)],s=o[0],a=o[1],u=o[2];return[s,a,u]}var a=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function rgb2hwb(e,r,t,n){var i=rgb2hue(e,r,t,n);var o=rgb2whiteness(e,r,t);var s=rgb2value(e,r,t);var a=100-s;return[i,o,a]}function hwb2rgb(e,r,t,n){var i=hsl2rgb(e,100,50,n).map(function(e){return e*(100-r-t)/100+r}),o=a(i,3),s=o[0],u=o[1],f=o[2];return[s,u,f]}var u=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function rgb2hsv(e,r,t,n){var i=rgb2value(e,r,t);var o=rgb2whiteness(e,r,t);var s=rgb2hue(e,r,t,n);var a=i===o?0:(i-o)/i*100;return[s,a,i]}function hsv2rgb(e,r,t){var n=Math.floor(e/60);var i=e/60-n&1?e/60-n:1-e/60-n;var o=t*(100-r)/100;var s=t*(100-r*i)/100;var a=n===5?[t,o,s]:n===4?[s,o,t]:n===3?[o,s,t]:n===2?[o,t,s]:n===1?[s,t,o]:[t,s,o],f=u(a,3),c=f[0],l=f[1],p=f[2];return[c,l,p]}var f=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function rgb2xyz(e,r,t){var n=[e,r,t].map(function(e){return e>4.045?Math.pow((e+5.5)/105.5,2.4)*100:e/12.92}),i=f(n,3),o=i[0],s=i[1],a=i[2];var u=matrix([o,s,a],[[.4124564,.3575761,.1804375],[.2126729,.7151522,.072175],[.0193339,.119192,.9503041]]),c=f(u,3),l=c[0],p=c[1],h=c[2];return[l,p,h]}function xyz2rgb(e,r,t){var n=matrix([e,r,t],[[3.2404542,-1.5371385,-.4985314],[-.969266,1.8760108,.041556],[.0556434,-.2040259,1.0572252]]),i=f(n,3),o=i[0],s=i[1],a=i[2];var u=[o,s,a].map(function(e){return e>.31308?1.055*Math.pow(e/100,1/2.4)*100-5.5:12.92*e}),c=f(u,3),l=c[0],p=c[1],h=c[2];return[l,p,h]}function hsl2hsv(e,r,t){var n=r*(t<50?t:100-t)/100;var i=n===0?0:2*n/(t+n)*100;var o=t+n;return[e,i,o]}function hsv2hsl(e,r,t){var n=(200-r)*t/100;var i=n===0||n===200?0:r*t/100/(n<=100?n:200-n)*100,o=n*5/10;return[e,i,o]}function hwb2hsv(e,r,t){var n=e,i=t===100?0:100-r/(100-t)*100,o=100-t;return[n,i,o]}function hsv2hwb(e,r,t){var n=e,i=(100-r)*t/100,o=100-t;return[n,i,o]}var c=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function lab2xyz(e,r,a){var u=(e+16)/116;var f=r/500+u;var l=u-a/200;var p=Math.pow(f,3)>o?Math.pow(f,3):(116*f-16)/s,h=e>s*o?Math.pow((e+16)/116,3):e/s,B=Math.pow(l,3)>o?Math.pow(l,3):(116*l-16)/s;var v=matrix([p*t,h*n,B*i],[[.9555766,-.0230393,.0631636],[-.0282895,1.0099416,.0210077],[.0122982,-.020483,1.3299098]]),d=c(v,3),b=d[0],y=d[1],g=d[2];return[b,y,g]}function xyz2lab(e,r,a){var u=matrix([e,r,a],[[1.0478112,.0228866,-.050127],[.0295424,.9904844,-.0170491],[-.0092345,.0150436,.7521316]]),f=c(u,3),l=f[0],p=f[1],h=f[2];var B=[l/t,p/n,h/i].map(function(e){return e>o?Math.cbrt(e):(s*e+16)/116}),v=c(B,3),d=v[0],b=v[1],y=v[2];var g=116*b-16,m=500*(d-b),C=200*(b-y);return[g,m,C]}function lab2lch(e,r,t){var n=[Math.sqrt(Math.pow(r,2)+Math.pow(t,2)),Math.atan2(t,r)*180/Math.PI],i=n[0],o=n[1];return[e,i,o]}function lch2lab(e,r,t){var n=r*Math.cos(t*Math.PI/180),i=r*Math.sin(t*Math.PI/180);return[e,n,i]}var l=function(){function sliceIterator(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw o}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function rgb2lab(e,r,t){var n=rgb2xyz(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=xyz2lab(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function lab2rgb(e,r,t){var n=lab2xyz(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=xyz2rgb(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function rgb2lch(e,r,t){var n=rgb2xyz(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=xyz2lab(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=lab2lch(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function lch2rgb(e,r,t){var n=lch2lab(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=lab2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2rgb(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function hwb2hsl(e,r,t){var n=hwb2hsv(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=hsv2hsl(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function hsl2hwb(e,r,t){var n=hsl2hsv(e,r,t),i=l(n,3),o=i[1],s=i[2];var a=hsv2hwb(e,o,s),u=l(a,3),f=u[1],c=u[2];return[e,f,c]}function hsl2lab(e,r,t){var n=hsl2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function lab2hsl(e,r,t,n){var i=lab2xyz(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=xyz2rgb(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=rgb2hsl(p,h,B,n),d=l(v,3),b=d[0],y=d[1],g=d[2];return[b,y,g]}function hsl2lch(e,r,t){var n=hsl2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];var g=lab2lch(d,b,y),m=l(g,3),C=m[0],w=m[1],S=m[2];return[C,w,S]}function lch2hsl(e,r,t,n){var i=lch2lab(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=lab2xyz(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=xyz2rgb(p,h,B),d=l(v,3),b=d[0],y=d[1],g=d[2];var m=rgb2hsl(b,y,g,n),C=l(m,3),w=C[0],S=C[1],O=C[2];return[w,S,O]}function hsl2xyz(e,r,t){var n=hsl2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function xyz2hsl(e,r,t,n){var i=xyz2rgb(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=rgb2hsl(s,a,u,n),c=l(f,3),p=c[0],h=c[1],B=c[2];return[p,h,B]}function hwb2lab(e,r,t){var n=hwb2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function lab2hwb(e,r,t,n){var i=lab2xyz(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=xyz2rgb(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=rgb2hwb(p,h,B,n),d=l(v,3),b=d[0],y=d[1],g=d[2];return[b,y,g]}function hwb2lch(e,r,t){var n=hwb2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];var g=lab2lch(d,b,y),m=l(g,3),C=m[0],w=m[1],S=m[2];return[C,w,S]}function lch2hwb(e,r,t,n){var i=lch2lab(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=lab2xyz(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=xyz2rgb(p,h,B),d=l(v,3),b=d[0],y=d[1],g=d[2];var m=rgb2hwb(b,y,g,n),C=l(m,3),w=C[0],S=C[1],O=C[2];return[w,S,O]}function hwb2xyz(e,r,t){var n=hwb2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function xyz2hwb(e,r,t,n){var i=xyz2rgb(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=rgb2hwb(s,a,u,n),c=l(f,3),p=c[0],h=c[1],B=c[2];return[p,h,B]}function hsv2lab(e,r,t){var n=hsv2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];return[d,b,y]}function lab2hsv(e,r,t,n){var i=lab2xyz(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=xyz2rgb(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=rgb2hsv(p,h,B,n),d=l(v,3),b=d[0],y=d[1],g=d[2];return[b,y,g]}function hsv2lch(e,r,t){var n=hsv2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];var B=xyz2lab(c,p,h),v=l(B,3),d=v[0],b=v[1],y=v[2];var g=lab2lch(d,b,y),m=l(g,3),C=m[0],w=m[1],S=m[2];return[C,w,S]}function lch2hsv(e,r,t,n){var i=lch2lab(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=lab2xyz(s,a,u),c=l(f,3),p=c[0],h=c[1],B=c[2];var v=xyz2rgb(p,h,B),d=l(v,3),b=d[0],y=d[1],g=d[2];var m=rgb2hsv(b,y,g,n),C=l(m,3),w=C[0],S=C[1],O=C[2];return[w,S,O]}function hsv2xyz(e,r,t){var n=hsv2rgb(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=rgb2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function xyz2hsv(e,r,t,n){var i=xyz2rgb(e,r,t),o=l(i,3),s=o[0],a=o[1],u=o[2];var f=rgb2hsv(s,a,u,n),c=l(f,3),p=c[0],h=c[1],B=c[2];return[p,h,B]}function xyz2lch(e,r,t){var n=xyz2lab(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=lab2lch(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}function lch2xyz(e,r,t){var n=lch2lab(e,r,t),i=l(n,3),o=i[0],s=i[1],a=i[2];var u=lab2xyz(o,s,a),f=l(u,3),c=f[0],p=f[1],h=f[2];return[c,p,h]}var p={rgb2hsl:rgb2hsl,rgb2hwb:rgb2hwb,rgb2lab:rgb2lab,rgb2lch:rgb2lch,rgb2hsv:rgb2hsv,rgb2xyz:rgb2xyz,hsl2rgb:hsl2rgb,hsl2hwb:hsl2hwb,hsl2lab:hsl2lab,hsl2lch:hsl2lch,hsl2hsv:hsl2hsv,hsl2xyz:hsl2xyz,hwb2rgb:hwb2rgb,hwb2hsl:hwb2hsl,hwb2lab:hwb2lab,hwb2lch:hwb2lch,hwb2hsv:hwb2hsv,hwb2xyz:hwb2xyz,lab2rgb:lab2rgb,lab2hsl:lab2hsl,lab2hwb:lab2hwb,lab2lch:lab2lch,lab2hsv:lab2hsv,lab2xyz:lab2xyz,lch2rgb:lch2rgb,lch2hsl:lch2hsl,lch2hwb:lch2hwb,lch2lab:lch2lab,lch2hsv:lch2hsv,lch2xyz:lch2xyz,hsv2rgb:hsv2rgb,hsv2hsl:hsv2hsl,hsv2hwb:hsv2hwb,hsv2lab:hsv2lab,hsv2lch:hsv2lch,hsv2xyz:hsv2xyz,xyz2rgb:xyz2rgb,xyz2hsl:xyz2hsl,xyz2hwb:xyz2hwb,xyz2lab:xyz2lab,xyz2lch:xyz2lch,xyz2hsv:xyz2hsv,rgb2hue:rgb2hue};r.rgb2hsl=rgb2hsl;r.rgb2hwb=rgb2hwb;r.rgb2lab=rgb2lab;r.rgb2lch=rgb2lch;r.rgb2hsv=rgb2hsv;r.rgb2xyz=rgb2xyz;r.hsl2rgb=hsl2rgb;r.hsl2hwb=hsl2hwb;r.hsl2lab=hsl2lab;r.hsl2lch=hsl2lch;r.hsl2hsv=hsl2hsv;r.hsl2xyz=hsl2xyz;r.hwb2rgb=hwb2rgb;r.hwb2hsl=hwb2hsl;r.hwb2lab=hwb2lab;r.hwb2lch=hwb2lch;r.hwb2hsv=hwb2hsv;r.hwb2xyz=hwb2xyz;r.lab2rgb=lab2rgb;r.lab2hsl=lab2hsl;r.lab2hwb=lab2hwb;r.lab2lch=lab2lch;r.lab2hsv=lab2hsv;r.lab2xyz=lab2xyz;r.lch2rgb=lch2rgb;r.lch2hsl=lch2hsl;r.lch2hwb=lch2hwb;r.lch2lab=lch2lab;r.lch2hsv=lch2hsv;r.lch2xyz=lch2xyz;r.hsv2rgb=hsv2rgb;r.hsv2hsl=hsv2hsl;r.hsv2hwb=hsv2hwb;r.hsv2lab=hsv2lab;r.hsv2lch=hsv2lch;r.hsv2xyz=hsv2xyz;r.xyz2rgb=xyz2rgb;r.xyz2hsl=xyz2hsl;r.xyz2hwb=xyz2hwb;r.xyz2lab=xyz2lab;r.xyz2lch=xyz2lch;r.xyz2hsv=xyz2hsv;r.rgb2hue=rgb2hue;r.default=p},4394:(e,r,t)=>{"use strict";var n=t(4338).feature;function browsersSort(e,r){e=e.split(" ");r=r.split(" ");if(e[0]>r[0]){return 1}else if(e[0]=t.length)break;s=t[o++]}else{o=t.next();if(o.done)break;s=o.value}var a=s;i[a]=Object.assign({},r)}}function add(e,r){for(var t=e,n=Array.isArray(t),o=0,t=n?t:t[Symbol.iterator]();;){var s;if(n){if(o>=t.length)break;s=t[o++]}else{o=t.next();if(o.done)break;s=o.value}var a=s;i[a].browsers=i[a].browsers.concat(r.browsers).sort(browsersSort)}}e.exports=i;f(t(5543),function(e){return prefix(["border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],{mistakes:["-khtml-","-ms-","-o-"],feature:"border-radius",browsers:e})});f(t(5861),function(e){return prefix(["box-shadow"],{mistakes:["-khtml-"],feature:"css-boxshadow",browsers:e})});f(t(8252),function(e){return prefix(["animation","animation-name","animation-duration","animation-delay","animation-direction","animation-fill-mode","animation-iteration-count","animation-play-state","animation-timing-function","@keyframes"],{mistakes:["-khtml-","-ms-"],feature:"css-animation",browsers:e})});f(t(5056),function(e){return prefix(["transition","transition-property","transition-duration","transition-delay","transition-timing-function"],{mistakes:["-khtml-","-ms-"],browsers:e,feature:"css-transitions"})});f(t(762),function(e){return prefix(["transform","transform-origin"],{feature:"transforms2d",browsers:e})});var o=t(58);f(o,function(e){prefix(["perspective","perspective-origin"],{feature:"transforms3d",browsers:e});return prefix(["transform-style"],{mistakes:["-ms-","-o-"],browsers:e,feature:"transforms3d"})});f(o,{match:/y\sx|y\s#2/},function(e){return prefix(["backface-visibility"],{mistakes:["-ms-","-o-"],feature:"transforms3d",browsers:e})});var s=t(1407);f(s,{match:/y\sx/},function(e){return prefix(["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient"],{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],mistakes:["-ms-"],feature:"css-gradients",browsers:e})});f(s,{match:/a\sx/},function(e){e=e.map(function(e){if(/firefox|op/.test(e)){return e}else{return e+" old"}});return add(["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient"],{feature:"css-gradients",browsers:e})});f(t(7759),function(e){return prefix(["box-sizing"],{feature:"css3-boxsizing",browsers:e})});f(t(9237),function(e){return prefix(["filter"],{feature:"css-filters",browsers:e})});f(t(6192),function(e){return prefix(["filter-function"],{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],feature:"css-filter-function",browsers:e})});var a=t(3613);f(a,{match:/y\sx|y\s#2/},function(e){return prefix(["backdrop-filter"],{feature:"css-backdrop-filter",browsers:e})});f(t(9666),function(e){return prefix(["element"],{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],feature:"css-element-function",browsers:e})});f(t(1448),function(e){prefix(["columns","column-width","column-gap","column-rule","column-rule-color","column-rule-width","column-count","column-rule-style","column-span","column-fill"],{feature:"multicolumn",browsers:e});var r=e.filter(function(e){return!/firefox/.test(e)});prefix(["break-before","break-after","break-inside"],{feature:"multicolumn",browsers:r})});f(t(7511),function(e){return prefix(["user-select"],{mistakes:["-khtml-"],feature:"user-select-none",browsers:e})});var u=t(3714);f(u,{match:/a\sx/},function(e){e=e.map(function(e){if(/ie|firefox/.test(e)){return e}else{return e+" 2009"}});prefix(["display-flex","inline-flex"],{props:["display"],feature:"flexbox",browsers:e});prefix(["flex","flex-grow","flex-shrink","flex-basis"],{feature:"flexbox",browsers:e});prefix(["flex-direction","flex-wrap","flex-flow","justify-content","order","align-items","align-self","align-content"],{feature:"flexbox",browsers:e})});f(u,{match:/y\sx/},function(e){add(["display-flex","inline-flex"],{feature:"flexbox",browsers:e});add(["flex","flex-grow","flex-shrink","flex-basis"],{feature:"flexbox",browsers:e});add(["flex-direction","flex-wrap","flex-flow","justify-content","order","align-items","align-self","align-content"],{feature:"flexbox",browsers:e})});f(t(3807),function(e){return prefix(["calc"],{props:["*"],feature:"calc",browsers:e})});f(t(2259),function(e){return prefix(["background-origin","background-size"],{feature:"background-img-opts",browsers:e})});f(t(1302),function(e){return prefix(["background-clip"],{feature:"background-clip-text",browsers:e})});f(t(7011),function(e){return prefix(["font-feature-settings","font-variant-ligatures","font-language-override"],{feature:"font-feature",browsers:e})});f(t(9195),function(e){return prefix(["font-kerning"],{feature:"font-kerning",browsers:e})});f(t(9847),function(e){return prefix(["border-image"],{feature:"border-image",browsers:e})});f(t(3347),function(e){return prefix(["::selection"],{selector:true,feature:"css-selection",browsers:e})});f(t(5117),function(e){prefix(["::placeholder"],{selector:true,feature:"css-placeholder",browsers:e.concat(["ie 10 old","ie 11 old","firefox 18 old"])})});f(t(9747),function(e){return prefix(["hyphens"],{feature:"css-hyphens",browsers:e})});var c=t(5833);f(c,function(e){return prefix([":fullscreen"],{selector:true,feature:"fullscreen",browsers:e})});f(c,{match:/x(\s#2|$)/},function(e){return prefix(["::backdrop"],{selector:true,feature:"fullscreen",browsers:e})});f(t(9807),function(e){return prefix(["tab-size"],{feature:"css3-tabsize",browsers:e})});var l=t(3794);var p=["width","min-width","max-width","height","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size","grid","grid-template","grid-template-rows","grid-template-columns","grid-auto-columns","grid-auto-rows"];f(l,function(e){return prefix(["max-content","min-content"],{props:p,feature:"intrinsic-width",browsers:e})});f(l,{match:/x|\s#4/},function(e){return prefix(["fill","fill-available","stretch"],{props:p,feature:"intrinsic-width",browsers:e})});f(l,{match:/x|\s#5/},function(e){return prefix(["fit-content"],{props:p,feature:"intrinsic-width",browsers:e})});f(t(8546),function(e){return prefix(["zoom-in","zoom-out"],{props:["cursor"],feature:"css3-cursors-newer",browsers:e})});f(t(4528),function(e){return prefix(["grab","grabbing"],{props:["cursor"],feature:"css3-cursors-grab",browsers:e})});f(t(3727),function(e){return prefix(["sticky"],{props:["position"],feature:"css-sticky",browsers:e})});f(t(6714),function(e){return prefix(["touch-action"],{feature:"pointer",browsers:e})});var h=t(6848);f(h,function(e){return prefix(["text-decoration-style","text-decoration-color","text-decoration-line","text-decoration"],{feature:"text-decoration",browsers:e})});f(h,{match:/x.*#[235]/},function(e){return prefix(["text-decoration-skip","text-decoration-skip-ink"],{feature:"text-decoration",browsers:e})});f(t(6421),function(e){return prefix(["text-size-adjust"],{feature:"text-size-adjust",browsers:e})});f(t(4613),function(e){prefix(["mask-clip","mask-composite","mask-image","mask-origin","mask-repeat","mask-border-repeat","mask-border-source"],{feature:"css-masks",browsers:e});prefix(["mask","mask-position","mask-size","mask-border","mask-border-outset","mask-border-width","mask-border-slice"],{feature:"css-masks",browsers:e})});f(t(147),function(e){return prefix(["clip-path"],{feature:"css-clip-path",browsers:e})});f(t(4016),function(e){return prefix(["box-decoration-break"],{feature:"css-boxdecorationbreak",browsers:e})});f(t(5147),function(e){return prefix(["object-fit","object-position"],{feature:"object-fit",browsers:e})});f(t(4298),function(e){return prefix(["shape-margin","shape-outside","shape-image-threshold"],{feature:"css-shapes",browsers:e})});f(t(123),function(e){return prefix(["text-overflow"],{feature:"text-overflow",browsers:e})});f(t(1779),function(e){return prefix(["@viewport"],{feature:"css-deviceadaptation",browsers:e})});var B=t(3588);f(B,{match:/( x($| )|a #2)/},function(e){return prefix(["@resolution"],{feature:"css-media-resolution",browsers:e})});f(t(9533),function(e){return prefix(["text-align-last"],{feature:"css-text-align-last",browsers:e})});var v=t(7794);f(v,{match:/y x|a x #1/},function(e){return prefix(["pixelated"],{props:["image-rendering"],feature:"css-crisp-edges",browsers:e})});f(v,{match:/a x #2/},function(e){return prefix(["image-rendering"],{feature:"css-crisp-edges",browsers:e})});var d=t(471);f(d,function(e){return prefix(["border-inline-start","border-inline-end","margin-inline-start","margin-inline-end","padding-inline-start","padding-inline-end"],{feature:"css-logical-props",browsers:e})});f(d,{match:/x\s#2/},function(e){return prefix(["border-block-start","border-block-end","margin-block-start","margin-block-end","padding-block-start","padding-block-end"],{feature:"css-logical-props",browsers:e})});var b=t(8672);f(b,{match:/#2|x/},function(e){return prefix(["appearance"],{feature:"css-appearance",browsers:e})});f(t(87),function(e){return prefix(["scroll-snap-type","scroll-snap-coordinate","scroll-snap-destination","scroll-snap-points-x","scroll-snap-points-y"],{feature:"css-snappoints",browsers:e})});f(t(5969),function(e){return prefix(["flow-into","flow-from","region-fragment"],{feature:"css-regions",browsers:e})});f(t(4197),function(e){return prefix(["image-set"],{props:["background","background-image","border-image","cursor","mask","mask-image","list-style","list-style-image","content"],feature:"css-image-set",browsers:e})});var y=t(8307);f(y,{match:/a|x/},function(e){return prefix(["writing-mode"],{feature:"css-writing-mode",browsers:e})});f(t(3323),function(e){return prefix(["cross-fade"],{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],feature:"css-cross-fade",browsers:e})});f(t(3502),function(e){return prefix([":read-only",":read-write"],{selector:true,feature:"css-read-only-write",browsers:e})});f(t(5802),function(e){return prefix(["text-emphasis","text-emphasis-position","text-emphasis-style","text-emphasis-color"],{feature:"text-emphasis",browsers:e})});var g=t(7776);f(g,function(e){prefix(["display-grid","inline-grid"],{props:["display"],feature:"css-grid",browsers:e});prefix(["grid-template-columns","grid-template-rows","grid-row-start","grid-column-start","grid-row-end","grid-column-end","grid-row","grid-column","grid-area","grid-template","grid-template-areas","place-self"],{feature:"css-grid",browsers:e})});f(g,{match:/a x/},function(e){return prefix(["grid-column-align","grid-row-align"],{feature:"css-grid",browsers:e})});f(t(8422),function(e){return prefix(["text-spacing"],{feature:"css-text-spacing",browsers:e})});f(t(1977),function(e){return prefix([":any-link"],{selector:true,feature:"css-any-link",browsers:e})});var m=t(1456);f(m,function(e){return prefix(["isolate"],{props:["unicode-bidi"],feature:"css-unicode-bidi",browsers:e})});f(m,{match:/y x|a x #2/},function(e){return prefix(["plaintext"],{props:["unicode-bidi"],feature:"css-unicode-bidi",browsers:e})});f(m,{match:/y x/},function(e){return prefix(["isolate-override"],{props:["unicode-bidi"],feature:"css-unicode-bidi",browsers:e})});var C=t(3043);f(C,{match:/a #1/},function(e){return prefix(["overscroll-behavior"],{feature:"css-overscroll-behavior",browsers:e})});f(t(664),function(e){return prefix(["color-adjust"],{feature:"css-color-adjust",browsers:e})});f(t(3100),function(e){return prefix(["text-orientation"],{feature:"css-text-orientation",browsers:e})})},7997:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;if(!r||r===s){this.add(e,s)}}};return AtRule}(n);e.exports=i},3501:(e,r,t)=>{"use strict";var n=t(3561);var i=t(4633);var o=t(4338).agents;var s=t(2242);var a=t(2319);var u=t(811);var f=t(4394);var c=t(6741);var l="\n"+" Replace Autoprefixer `browsers` option to Browserslist config.\n"+" Use `browserslist` key in `package.json` or `.browserslistrc` file.\n"+"\n"+" Using `browsers` option can cause errors. Browserslist config \n"+" can be used for Babel, Autoprefixer, postcss-normalize and other tools.\n"+"\n"+" If you really need to use option, rename it to `overrideBrowserslist`.\n"+"\n"+" Learn more at:\n"+" https://github.com/browserslist/browserslist#readme\n"+" https://twitter.com/browserslist\n"+"\n";function isPlainObject(e){return Object.prototype.toString.apply(e)==="[object Object]"}var p={};function timeCapsule(e,r){if(r.browsers.selected.length===0){return}if(r.add.selectors.length>0){return}if(Object.keys(r.add).length>2){return}e.warn("Greetings, time traveller. "+"We are in the golden age of prefix-less CSS, "+"where Autoprefixer is no longer needed for your stylesheet.")}e.exports=i.plugin("autoprefixer",function(){for(var r=arguments.length,t=new Array(r),n=0;n{"use strict";function last(e){return e[e.length-1]}var r={parse:function parse(e){var r=[""];var t=[r];for(var n=e,i=Array.isArray(n),o=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(o>=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;if(a==="("){r=[""];last(t).push(r);t.push(r);continue}if(a===")"){t.pop();r=last(t);r.push("");continue}r[r.length-1]+=a}return t[0]},stringify:function stringify(e){var t="";for(var n=e,i=Array.isArray(n),o=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(o>=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;if(typeof a==="object"){t+="("+r.stringify(a)+")";continue}t+=a}return t}};e.exports=r},2319:(e,r,t)=>{"use strict";var n=t(3561);var i=t(4338).agents;var o=t(772);var s=function(){Browsers.prefixes=function prefixes(){if(this.prefixesCache){return this.prefixesCache}this.prefixesCache=[];for(var e in i){this.prefixesCache.push("-"+i[e].prefix+"-")}this.prefixesCache=o.uniq(this.prefixesCache).sort(function(e,r){return r.length-e.length});return this.prefixesCache};Browsers.withPrefix=function withPrefix(e){if(!this.prefixesRegexp){this.prefixesRegexp=new RegExp(this.prefixes().join("|"))}return this.prefixesRegexp.test(e)};function Browsers(e,r,t,n){this.data=e;this.options=t||{};this.browserslistOpts=n||{};this.selected=this.parse(r)}var e=Browsers.prototype;e.parse=function parse(e){var r={};for(var t in this.browserslistOpts){r[t]=this.browserslistOpts[t]}r.path=this.options.from;r.env=this.options.env;return n(e,r)};e.prefix=function prefix(e){var r=e.split(" "),t=r[0],n=r[1];var i=this.data[t];var prefix=i.prefix_exceptions&&i.prefix_exceptions[n];if(!prefix){prefix=i.prefix}return"-"+prefix+"-"};e.isSelected=function isSelected(e){return this.selected.includes(e)};return Browsers}();e.exports=s},5753:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=t.length)break;s=t[o++]}else{o=t.next();if(o.done)break;s=o.value}var a=s;if(a===r){continue}if(e.includes(a)){return true}}return false};r.set=function set(e,r){e.prop=this.prefixed(e.prop,r);return e};r.needCascade=function needCascade(e){if(!e._autoprefixerCascade){e._autoprefixerCascade=this.all.options.cascade!==false&&e.raw("before").includes("\n")}return e._autoprefixerCascade};r.maxPrefixed=function maxPrefixed(e,r){if(r._autoprefixerMax){return r._autoprefixerMax}var t=0;for(var n=e,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{s=n.next();if(s.done)break;a=s.value}var u=a;u=o.removeNote(u);if(u.length>t){t=u.length}}r._autoprefixerMax=t;return r._autoprefixerMax};r.calcBefore=function calcBefore(e,r,t){if(t===void 0){t=""}var n=this.maxPrefixed(e,r);var i=n-o.removeNote(t).length;var s=r.raw("before");if(i>0){s+=Array(i).fill(" ").join("")}return s};r.restoreBefore=function restoreBefore(e){var r=e.raw("before").split("\n");var t=r[r.length-1];this.all.group(e).up(function(e){var r=e.raw("before").split("\n");var n=r[r.length-1];if(n.length{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";e.exports=function(e){var r;if(e==="-webkit- 2009"||e==="-moz-"){r=2009}else if(e==="-ms-"){r=2012}else if(e==="-webkit-"){r="final"}if(e==="-webkit- 2009"){e="-webkit-"}return[r,e]}},9315:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=i.length)break;a=i[s++]}else{s=i.next();if(s.done)break;a=s.value}var u=a;if(u.type==="function"&&u.value===this.name){u.nodes=this.newDirection(u.nodes);u.nodes=this.normalize(u.nodes);if(r==="-webkit- old"){var f=this.oldWebkit(u);if(!f){return false}}else{u.nodes=this.convertDirection(u.nodes);u.value=r+u.value}}}return t.toString()};r.replaceFirst=function replaceFirst(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;if(r==="before"&&s.type==="space"){r="at"}else if(r==="at"&&s.value==="at"){r="after"}else if(r==="after"&&s.type==="space"){return true}else if(s.type==="div"){break}else{r="before"}}return false};r.convertDirection=function convertDirection(e){if(e.length>0){if(e[0].value==="to"){this.fixDirection(e)}else if(e[0].value.includes("deg")){this.fixAngle(e)}else if(this.isRadial(e)){this.fixRadial(e)}}return e};r.fixDirection=function fixDirection(e){e.splice(0,2);for(var r=e,t=Array.isArray(r),n=0,r=t?r:r[Symbol.iterator]();;){var i;if(t){if(n>=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;if(o.type==="div"){break}if(o.type==="word"){o.value=this.revertDirection(o.value)}}};r.fixAngle=function fixAngle(e){var r=e[0].value;r=parseFloat(r);r=Math.abs(450-r)%360;r=this.roundFloat(r,3);e[0].value=r+"deg"};r.fixRadial=function fixRadial(e){var r=[];var t=[];var n,i,o,s,a;for(s=0;s=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;i[i.length-1].push(f);if(f.type==="div"&&f.value===","){i.push([])}}this.oldDirection(i);this.colorStops(i);e.nodes=[];for(var c=0,l=i;c=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;if(a.type==="word"){t.push(a.value.toLowerCase())}}t=t.join(" ");var u=this.oldDirections[t]||t;e[0]=[{type:"word",value:u},r];return e[0]}};r.cloneDiv=function cloneDiv(e){for(var r=e,t=Array.isArray(r),n=0,r=t?r:r[Symbol.iterator]();;){var i;if(t){if(n>=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;if(o.type==="div"&&o.value===","){return o}}return{type:"div",value:",",after:" "}};r.colorStops=function colorStops(e){var r=[];for(var t=0;t{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n1){r.cloneBefore({prop:"-ms-grid-rows",value:u({value:"repeat("+d.length+", auto)",gap:v.row}),raws:{}})}c({gap:v,hasColumns:p,decl:r,result:i});var b=o({rows:d,gap:v});s(b,r,i);return r};return GridTemplateAreas}(n);_defineProperty(p,"names",["grid-template-areas"]);e.exports=p},5193:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n0;var b=Boolean(h);var y=Boolean(B);u({gap:c,hasColumns:y,decl:r,result:i});s(v,r,i);if(b&&y||d){r.cloneBefore({prop:"-ms-grid-rows",value:h,raws:{}})}if(y){r.cloneBefore({prop:"-ms-grid-columns",value:B,raws:{}})}return r};return GridTemplate}(n);_defineProperty(c,"names",["grid-template"]);e.exports=c},5224:(e,r,t)=>{"use strict";var n=t(23);var i=t(4633).list;var o=t(772).uniq;var s=t(772).escapeRegexp;var a=t(772).splitSelector;function convert(e){if(e&&e.length===2&&e[0]==="span"&&parseInt(e[1],10)>0){return[false,parseInt(e[1],10)]}if(e&&e.length===1&&parseInt(e[0],10)>0){return[parseInt(e[0],10),false]}return[false,false]}function translate(e,r,t){var n=e[r];var i=e[t];if(!n){return[false,false]}var o=convert(n),s=o[0],a=o[1];var u=convert(i),f=u[0],c=u[1];if(s&&!i){return[s,false]}if(a&&f){return[f-a,a]}if(s&&c){return[s,c]}if(s&&f){return[s,f-s]}return[false,false]}function parse(e){var r=n(e.value);var t=[];var i=0;t[i]=[];for(var o=r.nodes,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;if(f.type==="div"){i+=1;t[i]=[]}else if(f.type==="word"){t[i].push(f.value)}}return t}function insertDecl(e,r,t){if(t&&!e.parent.some(function(e){return e.prop==="-ms-"+r})){e.cloneBefore({prop:"-ms-"+r,value:t.toString()})}}function prefixTrackProp(e){var r=e.prop,t=e.prefix;return t+r.replace("template-","")}function transformRepeat(e,r){var t=e.nodes;var i=r.gap;var o=t.reduce(function(e,r){if(r.type==="div"&&r.value===","){e.key="size"}else{e[e.key].push(n.stringify(r))}return e},{key:"count",size:[],count:[]}),s=o.count,a=o.size;if(i){var u=function(){a=a.filter(function(e){return e.trim()});var e=[];var r=function _loop(r){a.forEach(function(t,n){if(n>0||r>1){e.push(i)}e.push(t)})};for(var t=1;t<=s;t++){r(t)}return{v:e.join(" ")}}();if(typeof u==="object")return u.v}return"("+a.join("")+")["+s.join("")+"]"}function prefixTrackValue(e){var r=e.value,t=e.gap;var i=n(r).nodes.reduce(function(e,r){if(r.type==="function"&&r.value==="repeat"){return e.concat({type:"word",value:transformRepeat(r,{gap:t})})}if(t&&r.type==="space"){return e.concat({type:"space",value:" "},{type:"word",value:t},r)}return e.concat(r)},[]);return n.stringify(i)}var u=/^\.+$/;function track(e,r){return{start:e,end:r,span:r-e}}function getColumns(e){return e.trim().split(/\s+/g)}function parseGridAreas(e){var r=e.rows,t=e.gap;return r.reduce(function(e,r,n){if(t.row)n*=2;if(r.trim()==="")return e;getColumns(r).forEach(function(r,i){if(u.test(r))return;if(t.column)i*=2;if(typeof e[r]==="undefined"){e[r]={column:track(i+1,i+2),row:track(n+1,n+2)}}else{var o=e[r],s=o.column,a=o.row;s.start=Math.min(s.start,i+1);s.end=Math.max(s.end,i+2);s.span=s.end-s.start;a.start=Math.min(a.start,n+1);a.end=Math.max(a.end,n+2);a.span=a.end-a.start}});return e},{})}function testTrack(e){return e.type==="word"&&/^\[.+]$/.test(e.value)}function verifyRowSize(e){if(e.areas.length>e.rows.length){e.rows.push("auto")}return e}function parseTemplate(e){var r=e.decl,t=e.gap;var i=n(r.value).nodes.reduce(function(e,r){var t=r.type,i=r.value;if(testTrack(r)||t==="space")return e;if(t==="string"){e=verifyRowSize(e);e.areas.push(i)}if(t==="word"||t==="function"){e[e.key].push(n.stringify(r))}if(t==="div"&&i==="/"){e.key="columns";e=verifyRowSize(e)}return e},{key:"rows",columns:[],rows:[],areas:[]});return{areas:parseGridAreas({rows:i.areas,gap:t}),columns:prefixTrackValue({value:i.columns.join(" "),gap:t.column}),rows:prefixTrackValue({value:i.rows.join(" "),gap:t.row})}}function getMSDecls(e,r,t){if(r===void 0){r=false}if(t===void 0){t=false}return[].concat({prop:"-ms-grid-row",value:String(e.row.start)},e.row.span>1||r?{prop:"-ms-grid-row-span",value:String(e.row.span)}:[],{prop:"-ms-grid-column",value:String(e.column.start)},e.column.span>1||t?{prop:"-ms-grid-column-span",value:String(e.column.span)}:[])}function getParentMedia(e){if(e.type==="atrule"&&e.name==="media"){return e}if(!e.parent){return false}return getParentMedia(e.parent)}function changeDuplicateAreaSelectors(e,r){e=e.map(function(e){var r=i.space(e);var t=i.comma(e);if(r.length>t.length){e=r.slice(-1).join("")}return e});return e.map(function(e){var t=r.map(function(r,t){var n=t===0?"":" ";return""+n+r+" > "+e});return t})}function selectorsEqual(e,r){return e.selectors.some(function(e){return r.selectors.some(function(r){return r===e})})}function parseGridTemplatesData(e){var r=[];e.walkDecls(/grid-template(-areas)?$/,function(e){var t=e.parent;var n=getParentMedia(t);var i=getGridGap(e);var s=inheritGridGap(e,i);var a=parseTemplate({decl:e,gap:s||i}),u=a.areas;var f=Object.keys(u);if(f.length===0){return true}var c=r.reduce(function(e,r,t){var n=r.allAreas;var i=n&&f.some(function(e){return n.includes(e)});return i?t:e},null);if(c!==null){var l=r[c],p=l.allAreas,h=l.rules;var B=h.some(function(e){return e.hasDuplicates===false&&selectorsEqual(e,t)});var v=false;var d=h.reduce(function(e,r){if(!r.params&&selectorsEqual(r,t)){v=true;return r.duplicateAreaNames}if(!v){f.forEach(function(t){if(r.areas[t]){e.push(t)}})}return o(e)},[]);h.forEach(function(e){f.forEach(function(r){var t=e.areas[r];if(t&&t.row.span!==u[r].row.span){u[r].row.updateSpan=true}if(t&&t.column.span!==u[r].column.span){u[r].column.updateSpan=true}})});r[c].allAreas=o([].concat(p,f));r[c].rules.push({hasDuplicates:!B,params:n.params,selectors:t.selectors,node:t,duplicateAreaNames:d,areas:u})}else{r.push({allAreas:f,areasCount:0,rules:[{hasDuplicates:false,duplicateRules:[],params:n.params,selectors:t.selectors,node:t,duplicateAreaNames:[],areas:u}]})}return undefined});return r}function insertAreas(e,r){var t=parseGridTemplatesData(e);if(t.length===0){return undefined}var n={};e.walkDecls("grid-area",function(o){var s=o.parent;var a=s.first.prop==="-ms-grid-row";var u=getParentMedia(s);if(r(o)){return undefined}var f=u?e.index(u):e.index(s);var c=o.value;var l=t.filter(function(e){return e.allAreas.includes(c)})[0];if(!l){return true}var p=l.allAreas[l.allAreas.length-1];var h=i.space(s.selector);var B=i.comma(s.selector);var v=h.length>1&&h.length>B.length;if(a){return false}if(!n[p]){n[p]={}}var d=false;for(var b=l.rules,y=Array.isArray(b),g=0,b=y?b:b[Symbol.iterator]();;){var m;if(y){if(g>=b.length)break;m=b[g++]}else{g=b.next();if(g.done)break;m=g.value}var C=m;var w=C.areas[c];var S=C.duplicateAreaNames.includes(c);if(!w){var O=e.index(n[p].lastRule);if(f>O){n[p].lastRule=u||s}continue}if(C.params&&!n[p][C.params]){n[p][C.params]=[]}if((!C.hasDuplicates||!S)&&!C.params){getMSDecls(w,false,false).reverse().forEach(function(e){return s.prepend(Object.assign(e,{raws:{between:o.raws.between}}))});n[p].lastRule=s;d=true}else if(C.hasDuplicates&&!C.params&&!v){(function(){var e=s.clone();e.removeAll();getMSDecls(w,w.row.updateSpan,w.column.updateSpan).reverse().forEach(function(r){return e.prepend(Object.assign(r,{raws:{between:o.raws.between}}))});e.selectors=changeDuplicateAreaSelectors(e.selectors,C.selectors);if(n[p].lastRule){n[p].lastRule.after(e)}n[p].lastRule=e;d=true})()}else if(C.hasDuplicates&&!C.params&&v&&s.selector.includes(C.selectors[0])){s.walkDecls(/-ms-grid-(row|column)/,function(e){return e.remove()});getMSDecls(w,w.row.updateSpan,w.column.updateSpan).reverse().forEach(function(e){return s.prepend(Object.assign(e,{raws:{between:o.raws.between}}))})}else if(C.params){(function(){var r=s.clone();r.removeAll();getMSDecls(w,w.row.updateSpan,w.column.updateSpan).reverse().forEach(function(e){return r.prepend(Object.assign(e,{raws:{between:o.raws.between}}))});if(C.hasDuplicates&&S){r.selectors=changeDuplicateAreaSelectors(r.selectors,C.selectors)}r.raws=C.node.raws;if(e.index(C.node.parent)>f){C.node.parent.append(r)}else{n[p][C.params].push(r)}if(!d){n[p].lastRule=u||s}})()}}return undefined});Object.keys(n).forEach(function(e){var r=n[e];var t=r.lastRule;Object.keys(r).reverse().filter(function(e){return e!=="lastRule"}).forEach(function(e){if(r[e].length>0&&t){t.after({name:"media",params:e});t.next().append(r[e])}})});return undefined}function warnMissedAreas(e,r,t){var n=Object.keys(e);r.root().walkDecls("grid-area",function(e){n=n.filter(function(r){return r!==e.value})});if(n.length>0){r.warn(t,"Can not find grid areas: "+n.join(", "))}return undefined}function warnTemplateSelectorNotFound(e,r){var t=e.parent;var n=e.root();var o=false;var s=i.space(t.selector).filter(function(e){return e!==">"}).slice(0,-1);if(s.length>0){var a=false;var u=null;n.walkDecls(/grid-template(-areas)?$/,function(r){var t=r.parent;var n=t.selectors;var f=parseTemplate({decl:r,gap:getGridGap(r)}),c=f.areas;var l=c[e.value];for(var p=n,h=Array.isArray(p),B=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(B>=p.length)break;v=p[B++]}else{B=p.next();if(B.done)break;v=B.value}var d=v;if(a){break}var b=i.space(d).filter(function(e){return e!==">"});a=b.every(function(e,r){return e===s[r]})}if(a||!l){return true}if(!u){u=t.selector}if(u&&u!==t.selector){o=true}return undefined});if(!a&&o){e.warn(r,"Autoprefixer cannot find a grid-template "+('containing the duplicate grid-area "'+e.value+'" ')+("with full selector matching: "+s.join(" ")))}}}function warnIfGridRowColumnExists(e,r){var t=e.parent;var n=[];t.walkDecls(/^grid-(row|column)/,function(e){if(!e.prop.endsWith("-end")&&!e.value.startsWith("span")){n.push(e)}});if(n.length>0){n.forEach(function(e){e.warn(r,"You already have a grid-area declaration present in the rule. "+("You should use either grid-area or "+e.prop+", not both"))})}return undefined}function getGridGap(e){var r={};var t=/^(grid-)?((row|column)-)?gap$/;e.parent.walkDecls(t,function(e){var t=e.prop,i=e.value;if(/^(grid-)?gap$/.test(t)){var o=n(i).nodes,s=o[0],a=o[2];r.row=s&&n.stringify(s);r.column=a?n.stringify(a):r.row}if(/^(grid-)?row-gap$/.test(t))r.row=i;if(/^(grid-)?column-gap$/.test(t))r.column=i});return r}function parseMediaParams(e){if(!e){return false}var r=n(e);var t;var i;r.walk(function(e){if(e.type==="word"&&/min|max/g.test(e.value)){t=e.value}else if(e.value.includes("px")){i=parseInt(e.value.replace(/\D/g,""))}});return[t,i]}function shouldInheritGap(e,r){var t;var n=a(e);var i=a(r);if(n[0].lengthi[0].length){var o=n[0].reduce(function(e,r,t){var n=r[0];var o=i[0][0][0];if(n===o){return t}return false},false);if(o){t=i[0].every(function(e,r){return e.every(function(e,t){return n[0].slice(o)[r][t]===e})})}}else{t=i.some(function(e){return e.every(function(e,r){return e.every(function(e,t){return n[0][r][t]===e})})})}return t}function inheritGridGap(e,r){var t=e.parent;var n=getParentMedia(t);var i=t.root();var o=a(t.selector);if(Object.keys(r).length>0){return false}var u=parseMediaParams(n.params),f=u[0];var c=o[0];var l=s(c[c.length-1][0]);var p=new RegExp("("+l+"$)|("+l+"[,.])");var h;i.walkRules(p,function(e){var r;if(t.toString()===e.toString()){return false}e.walkDecls("grid-gap",function(e){return r=getGridGap(e)});if(!r||Object.keys(r).length===0){return true}if(!shouldInheritGap(t.selector,e.selector)){return true}var n=getParentMedia(e);if(n){var i=parseMediaParams(n.params)[0];if(i===f){h=r;return true}}else{h=r;return true}return undefined});if(h&&Object.keys(h).length>0){return h}return false}function warnGridGap(e){var r=e.gap,t=e.hasColumns,n=e.decl,i=e.result;var o=r.row&&r.column;if(!t&&(o||r.column&&!r.row)){delete r.column;n.warn(i,"Can not implement grid-gap without grid-template-columns")}}function normalizeRowColumn(e){var r=n(e).nodes.reduce(function(e,r){if(r.type==="function"&&r.value==="repeat"){var t="count";var i=r.nodes.reduce(function(e,r){if(r.type==="word"&&t==="count"){e[0]=Math.abs(parseInt(r.value));return e}if(r.type==="div"&&r.value===","){t="value";return e}if(t==="value"){e[1]+=n.stringify(r)}return e},[0,""]),o=i[0],s=i[1];if(o){for(var a=0;a *:nth-child("+(c.length-r)+")")}).join(", ");var s=i.clone().removeAll();s.selector=o;s.append({prop:"-ms-grid-row",value:n.start});s.append({prop:"-ms-grid-column",value:t.start});i.after(s)});return undefined}e.exports={parse:parse,translate:translate,parseTemplate:parseTemplate,parseGridAreas:parseGridAreas,warnMissedAreas:warnMissedAreas,insertAreas:insertAreas,insertDecl:insertDecl,prefixTrackProp:prefixTrackProp,prefixTrackValue:prefixTrackValue,getGridGap:getGridGap,warnGridGap:warnGridGap,warnTemplateSelectorNotFound:warnTemplateSelectorNotFound,warnIfGridRowColumnExists:warnIfGridRowColumnExists,inheritGridGap:inheritGridGap,autoplaceGridItems:autoplaceGridItems}},3463:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;if(e.value.includes(o+"(")){return true}}return false};r.set=function set(r,t){r=e.prototype.set.call(this,r,t);if(t==="-ms-"){r.value=r.value.replace(/rotatez/gi,"rotate")}return r};r.insert=function insert(r,t,n){if(t==="-ms-"){if(!this.contain3d(r)&&!this.keyframeParents(r)){return e.prototype.insert.call(this,r,t,n)}}else if(t==="-o-"){if(!this.contain3d(r)){return e.prototype.insert.call(this,r,t,n)}}else{return e.prototype.insert.call(this,r,t,n)}return undefined};return TransformDecl}(n);_defineProperty(i,"names",["transform","transform-origin"]);_defineProperty(i,"functions3d",["matrix3d","translate3d","translateZ","scale3d","scaleZ","rotate3d","rotateX","rotateY","perspective"]);e.exports=i},3251:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{"use strict";var n=t(3561);function capitalize(e){return e.slice(0,1).toUpperCase()+e.slice(1)}var i={ie:"IE",ie_mob:"IE Mobile",ios_saf:"iOS",op_mini:"Opera Mini",op_mob:"Opera Mobile",and_chr:"Chrome for Android",and_ff:"Firefox for Android",and_uc:"UC for Android"};function prefix(e,r,t){var n=" "+e;if(t)n+=" *";n+=": ";n+=r.map(function(e){return e.replace(/^-(.*)-$/g,"$1")}).join(", ");n+="\n";return n}e.exports=function(e){if(e.browsers.selected.length===0){return"No browsers selected"}var r={};for(var t=e.browsers.selected,o=Array.isArray(t),s=0,t=o?t:t[Symbol.iterator]();;){var a;if(o){if(s>=t.length)break;a=t[s++]}else{s=t.next();if(s.done)break;a=s.value}var u=a;var f=u.split(" ");var c=f[0];var l=f[1];c=i[c]||capitalize(c);if(r[c]){r[c].push(l)}else{r[c]=[l]}}var p="Browsers:\n";for(var h in r){var B=r[h];B=B.sort(function(e,r){return parseFloat(r)-parseFloat(e)});p+=" "+h+": "+B.join(", ")+"\n"}var v=n.coverage(e.browsers.selected);var d=Math.round(v*100)/100;p+="\nThese browsers account for "+d+"% of all users globally\n";var b=[];for(var y in e.add){var g=e.add[y];if(y[0]==="@"&&g.prefixes){b.push(prefix(y,g.prefixes))}}if(b.length>0){p+="\nAt-Rules:\n"+b.sort().join("")}var m=[];for(var C=e.add.selectors,w=Array.isArray(C),S=0,C=w?C:C[Symbol.iterator]();;){var O;if(w){if(S>=C.length)break;O=C[S++]}else{S=C.next();if(S.done)break;O=S.value}var T=O;if(T.prefixes){m.push(prefix(T.name,T.prefixes))}}if(m.length>0){p+="\nSelectors:\n"+m.sort().join("")}var E=[];var k=[];var P=false;for(var D in e.add){var A=e.add[D];if(D[0]!=="@"&&A.prefixes){var R=D.indexOf("grid-")===0;if(R)P=true;k.push(prefix(D,A.prefixes,R))}if(!Array.isArray(A.values)){continue}for(var F=A.values,x=Array.isArray(F),j=0,F=x?F:F[Symbol.iterator]();;){var I;if(x){if(j>=F.length)break;I=F[j++]}else{j=F.next();if(j.done)break;I=j.value}var M=I;var _=M.name.includes("grid");if(_)P=true;var N=prefix(M.name,M.prefixes,_);if(!E.includes(N)){E.push(N)}}}if(k.length>0){p+="\nProperties:\n"+k.sort().join("")}if(E.length>0){p+="\nValues:\n"+E.sort().join("")}if(P){p+="\n* - Prefixes will be added only on grid: true option.\n"}if(!b.length&&!m.length&&!k.length&&!E.length){p+="\nAwesome! Your browsers don't require any vendor prefixes."+"\nNow you can remove Autoprefixer from build steps."}return p}},7471:e=>{"use strict";var r=function(){function OldSelector(e,r){this.prefix=r;this.prefixed=e.prefixed(this.prefix);this.regexp=e.regexp(this.prefix);this.prefixeds=e.possible().map(function(r){return[e.prefixed(r),e.regexp(r)]});this.unprefixed=e.name;this.nameRegexp=e.regexp()}var e=OldSelector.prototype;e.isHack=function isHack(e){var r=e.parent.index(e)+1;var t=e.parent.nodes;while(r=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u,c=f[0],l=f[1];if(n.includes(c)&&n.match(l)){i=true;break}}if(!i){return true}r+=1}return true};e.check=function check(e){if(!e.selector.includes(this.prefixed)){return false}if(!e.selector.match(this.regexp)){return false}if(this.isHack(e)){return false}return true};return OldSelector}();e.exports=r},6661:(e,r,t)=>{"use strict";var n=t(772);var i=function(){function OldValue(e,r,t,i){this.unprefixed=e;this.prefixed=r;this.string=t||r;this.regexp=i||n.regexp(r)}var e=OldValue.prototype;e.check=function check(e){if(e.includes(this.string)){return!!e.match(this.regexp)}return false};return OldValue}();e.exports=i},8428:(e,r,t)=>{"use strict";var n=t(4633).vendor;var i=t(2319);var o=t(772);function _clone(e,r){var t=new e.constructor;for(var n=0,i=Object.keys(e||{});n=s.length)break;f=s[u++]}else{u=s.next();if(u.done)break;f=u.value}var c=f;if(this.add(e,c,i.concat([c]),r)){i.push(c)}}return i};e.clone=function clone(e,r){return Prefixer.clone(e,r)};return Prefixer}();e.exports=s},811:(e,r,t)=>{"use strict";var n=t(4633).vendor;var i=t(5753);var o=t(9514);var s=t(7080);var a=t(8120);var u=t(3817);var f=t(2319);var c=t(4806);var l=t(7997);var p=t(1882);var h=t(772);c.hack(t(9231));c.hack(t(9478));i.hack(t(3629));i.hack(t(7017));i.hack(t(972));i.hack(t(1763));i.hack(t(3331));i.hack(t(7106));i.hack(t(3392));i.hack(t(9315));i.hack(t(6658));i.hack(t(1036));i.hack(t(7912));i.hack(t(7335));i.hack(t(3686));i.hack(t(5041));i.hack(t(7447));i.hack(t(9116));i.hack(t(180));i.hack(t(3251));i.hack(t(5035));i.hack(t(517));i.hack(t(5836));i.hack(t(1041));i.hack(t(3305));i.hack(t(4802));i.hack(t(657));i.hack(t(9423));i.hack(t(5193));i.hack(t(8322));i.hack(t(4689));i.hack(t(9801));i.hack(t(2112));i.hack(t(3463));i.hack(t(1262));i.hack(t(7509));i.hack(t(9936));i.hack(t(5230));i.hack(t(1150));i.hack(t(8360));i.hack(t(2456));i.hack(t(5422));i.hack(t(2681));i.hack(t(1719));i.hack(t(487));i.hack(t(9228));p.hack(t(2433));p.hack(t(1138));p.hack(t(4581));p.hack(t(291));p.hack(t(8485));p.hack(t(3692));p.hack(t(1665));p.hack(t(133));var B={};var v=function(){function Prefixes(e,r,t){if(t===void 0){t={}}this.data=e;this.browsers=r;this.options=t;var n=this.preprocess(this.select(this.data));this.add=n[0];this.remove=n[1];this.transition=new s(this);this.processor=new a(this)}var e=Prefixes.prototype;e.cleaner=function cleaner(){if(this.cleanerCache){return this.cleanerCache}if(this.browsers.selected.length){var e=new f(this.browsers.data,[]);this.cleanerCache=new Prefixes(this.data,e,this.options)}else{return this}return this.cleanerCache};e.select=function select(e){var r=this;var t={add:{},remove:{}};var n=function _loop(n){var i=e[n];var o=i.browsers.map(function(e){var r=e.split(" ");return{browser:r[0]+" "+r[1],note:r[2]}});var s=o.filter(function(e){return e.note}).map(function(e){return r.browsers.prefix(e.browser)+" "+e.note});s=h.uniq(s);o=o.filter(function(e){return r.browsers.isSelected(e.browser)}).map(function(e){var t=r.browsers.prefix(e.browser);if(e.note){return t+" "+e.note}else{return t}});o=r.sort(h.uniq(o));if(r.options.flexbox==="no-2009"){o=o.filter(function(e){return!e.includes("2009")})}var a=i.browsers.map(function(e){return r.browsers.prefix(e)});if(i.mistakes){a=a.concat(i.mistakes)}a=a.concat(s);a=h.uniq(a);if(o.length){t.add[n]=o;if(o.length=f.length)break;v=f[B++]}else{B=f.next();if(B.done)break;v=B.value}var d=v;if(!r[d]){r[d]={values:[]}}r[d].values.push(a)}}else{var b=r[t]&&r[t].values||[];r[t]=i.load(t,n,this);r[t].values=b}}}var y={selectors:[]};for(var g in e.remove){var m=e.remove[g];if(this.data[g].selector){var C=c.load(g,m);for(var w=m,S=Array.isArray(w),O=0,w=S?w:w[Symbol.iterator]();;){var T;if(S){if(O>=w.length)break;T=w[O++]}else{O=w.next();if(O.done)break;T=O.value}var E=T;y.selectors.push(C.old(E))}}else if(g==="@keyframes"||g==="@viewport"){for(var k=m,P=Array.isArray(k),D=0,k=P?k:k[Symbol.iterator]();;){var A;if(P){if(D>=k.length)break;A=k[D++]}else{D=k.next();if(D.done)break;A=D.value}var R=A;var F="@"+R+g.slice(1);y[F]={remove:true}}}else if(g==="@resolution"){y[g]=new o(g,m,this)}else{var x=this.data[g].props;if(x){var j=p.load(g,[],this);for(var I=m,M=Array.isArray(I),_=0,I=M?I:I[Symbol.iterator]();;){var N;if(M){if(_>=I.length)break;N=I[_++]}else{_=I.next();if(_.done)break;N=_.value}var L=N;var q=j.old(L);if(q){for(var G=x,U=Array.isArray(G),J=0,G=U?G:G[Symbol.iterator]();;){var W;if(U){if(J>=G.length)break;W=G[J++]}else{J=G.next();if(J.done)break;W=J.value}var Q=W;if(!y[Q]){y[Q]={}}if(!y[Q].values){y[Q].values=[]}y[Q].values.push(q)}}}}else{for(var H=m,K=Array.isArray(H),Y=0,H=K?H:H[Symbol.iterator]();;){var z;if(K){if(Y>=H.length)break;z=H[Y++]}else{Y=H.next();if(Y.done)break;z=Y.value}var $=z;var X=this.decl(g).old(g,$);if(g==="align-self"){var Z=r[g]&&r[g].prefixes;if(Z){if($==="-webkit- 2009"&&Z.includes("-webkit-")){continue}else if($==="-webkit-"&&Z.includes("-webkit- 2009")){continue}}}for(var V=X,ee=Array.isArray(V),re=0,V=ee?V:V[Symbol.iterator]();;){var te;if(ee){if(re>=V.length)break;te=V[re++]}else{re=V.next();if(re.done)break;te=re.value}var ne=te;if(!y[ne]){y[ne]={}}y[ne].remove=true}}}}}return[r,y]};e.decl=function decl(e){var decl=B[e];if(decl){return decl}else{B[e]=i.load(e);return B[e]}};e.unprefixed=function unprefixed(e){var r=this.normalize(n.unprefixed(e));if(r==="flex-direction"){r="flex-flow"}return r};e.normalize=function normalize(e){return this.decl(e).normalize(e)};e.prefixed=function prefixed(e,r){e=n.unprefixed(e);return this.decl(e).prefixed(e,r)};e.values=function values(e,r){var t=this[e];var n=t["*"]&&t["*"].values;var values=t[r]&&t[r].values;if(n&&values){return h.uniq(n.concat(values))}else{return n||values||[]}};e.group=function group(e){var r=this;var t=e.parent;var n=t.index(e);var i=t.nodes.length;var o=this.unprefixed(e.prop);var s=function checker(e,s){n+=e;while(n>=0&&n{"use strict";var n=t(23);var i=t(1882);var o=t(5224).insertAreas;var s=/(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i;var a=/(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i;var u=/(!\s*)?autoprefixer:\s*ignore\s+next/i;var f=/(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i;var c=["width","height","min-width","max-width","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size"];function hasGridTemplate(e){return e.parent.some(function(e){return e.prop==="grid-template"||e.prop==="grid-template-areas"})}function hasRowsAndColumns(e){var r=e.parent.some(function(e){return e.prop==="grid-template-rows"});var t=e.parent.some(function(e){return e.prop==="grid-template-columns"});return r&&t}var l=function(){function Processor(e){this.prefixes=e}var e=Processor.prototype;e.add=function add(e,r){var t=this;var u=this.prefixes.add["@resolution"];var f=this.prefixes.add["@keyframes"];var l=this.prefixes.add["@viewport"];var p=this.prefixes.add["@supports"];e.walkAtRules(function(e){if(e.name==="keyframes"){if(!t.disabled(e,r)){return f&&f.process(e)}}else if(e.name==="viewport"){if(!t.disabled(e,r)){return l&&l.process(e)}}else if(e.name==="supports"){if(t.prefixes.options.supports!==false&&!t.disabled(e,r)){return p.process(e)}}else if(e.name==="media"&&e.params.includes("-resolution")){if(!t.disabled(e,r)){return u&&u.process(e)}}return undefined});e.walkRules(function(e){if(t.disabled(e,r))return undefined;return t.prefixes.add.selectors.map(function(t){return t.process(e,r)})});function insideGrid(e){return e.parent.nodes.some(function(e){if(e.type!=="decl")return false;var r=e.prop==="display"&&/(inline-)?grid/.test(e.value);var t=e.prop.startsWith("grid-template");var n=/^grid-([A-z]+-)?gap/.test(e.prop);return r||t||n})}function insideFlex(e){return e.parent.some(function(e){return e.prop==="display"&&/(inline-)?flex/.test(e.value)})}var h=this.gridStatus(e,r)&&this.prefixes.add["grid-area"]&&this.prefixes.add["grid-area"].prefixes;e.walkDecls(function(e){if(t.disabledDecl(e,r))return undefined;var i=e.parent;var o=e.prop;var u=e.value;if(o==="grid-row-span"){r.warn("grid-row-span is not part of final Grid Layout. Use grid-row.",{node:e});return undefined}else if(o==="grid-column-span"){r.warn("grid-column-span is not part of final Grid Layout. Use grid-column.",{node:e});return undefined}else if(o==="display"&&u==="box"){r.warn("You should write display: flex by final spec "+"instead of display: box",{node:e});return undefined}else if(o==="text-emphasis-position"){if(u==="under"||u==="over"){r.warn("You should use 2 values for text-emphasis-position "+"For example, `under left` instead of just `under`.",{node:e})}}else if(/^(align|justify|place)-(items|content)$/.test(o)&&insideFlex(e)){if(u==="start"||u==="end"){r.warn(u+" value has mixed support, consider using "+("flex-"+u+" instead"),{node:e})}}else if(o==="text-decoration-skip"&&u==="ink"){r.warn("Replace text-decoration-skip: ink to "+"text-decoration-skip-ink: auto, because spec had been changed",{node:e})}else{if(h){if(/^(align|justify|place)-items$/.test(o)&&insideGrid(e)){var f=o.replace("-items","-self");r.warn("IE does not support "+o+" on grid containers. "+("Try using "+f+" on child elements instead: ")+(e.parent.selector+" > * { "+f+": "+e.value+" }"),{node:e})}else if(/^(align|justify|place)-content$/.test(o)&&insideGrid(e)){r.warn("IE does not support "+e.prop+" on grid containers",{node:e})}else if(o==="display"&&e.value==="contents"){r.warn("Please do not use display: contents; "+"if you have grid setting enabled",{node:e});return undefined}else if(e.prop==="grid-gap"){var l=t.gridStatus(e,r);if(l==="autoplace"&&!hasRowsAndColumns(e)&&!hasGridTemplate(e)){r.warn("grid-gap only works if grid-template(-areas) is being "+"used or both rows and columns have been declared "+"and cells have not been manually "+"placed inside the explicit grid",{node:e})}else if((l===true||l==="no-autoplace")&&!hasGridTemplate(e)){r.warn("grid-gap only works if grid-template(-areas) is being used",{node:e})}}else if(o==="grid-auto-columns"){r.warn("grid-auto-columns is not supported by IE",{node:e});return undefined}else if(o==="grid-auto-rows"){r.warn("grid-auto-rows is not supported by IE",{node:e});return undefined}else if(o==="grid-auto-flow"){var p=i.some(function(e){return e.prop==="grid-template-rows"});var B=i.some(function(e){return e.prop==="grid-template-columns"});if(hasGridTemplate(e)){r.warn("grid-auto-flow is not supported by IE",{node:e})}else if(u.includes("dense")){r.warn("grid-auto-flow: dense is not supported by IE",{node:e})}else if(!p&&!B){r.warn("grid-auto-flow works only if grid-template-rows and "+"grid-template-columns are present in the same rule",{node:e})}return undefined}else if(u.includes("auto-fit")){r.warn("auto-fit value is not supported by IE",{node:e,word:"auto-fit"});return undefined}else if(u.includes("auto-fill")){r.warn("auto-fill value is not supported by IE",{node:e,word:"auto-fill"});return undefined}else if(o.startsWith("grid-template")&&u.includes("[")){r.warn("Autoprefixer currently does not support line names. "+"Try using grid-template-areas instead.",{node:e,word:"["})}}if(u.includes("radial-gradient")){if(a.test(e.value)){r.warn("Gradient has outdated direction syntax. "+"New syntax is like `closest-side at 0 0` "+"instead of `0 0, closest-side`.",{node:e})}else{var v=n(u);for(var d=v.nodes,b=Array.isArray(d),y=0,d=b?d:d[Symbol.iterator]();;){var g;if(b){if(y>=d.length)break;g=d[y++]}else{y=d.next();if(y.done)break;g=y.value}var m=g;if(m.type==="function"&&m.value==="radial-gradient"){for(var C=m.nodes,w=Array.isArray(C),S=0,C=w?C:C[Symbol.iterator]();;){var O;if(w){if(S>=C.length)break;O=C[S++]}else{S=C.next();if(S.done)break;O=S.value}var T=O;if(T.type==="word"){if(T.value==="cover"){r.warn("Gradient has outdated direction syntax. "+"Replace `cover` to `farthest-corner`.",{node:e})}else if(T.value==="contain"){r.warn("Gradient has outdated direction syntax. "+"Replace `contain` to `closest-side`.",{node:e})}}}}}}}if(u.includes("linear-gradient")){if(s.test(u)){r.warn("Gradient has outdated direction syntax. "+"New syntax is like `to left` instead of `right`.",{node:e})}}}if(c.includes(e.prop)){if(!e.value.includes("-fill-available")){if(e.value.includes("fill-available")){r.warn("Replace fill-available to stretch, "+"because spec had been changed",{node:e})}else if(e.value.includes("fill")){var E=n(u);if(E.nodes.some(function(e){return e.type==="word"&&e.value==="fill"})){r.warn("Replace fill to stretch, because spec had been changed",{node:e})}}}}var k;if(e.prop==="transition"||e.prop==="transition-property"){return t.prefixes.transition.add(e,r)}else if(e.prop==="align-self"){var P=t.displayType(e);if(P!=="grid"&&t.prefixes.options.flexbox!==false){k=t.prefixes.add["align-self"];if(k&&k.prefixes){k.process(e)}}if(P!=="flex"&&t.gridStatus(e,r)!==false){k=t.prefixes.add["grid-row-align"];if(k&&k.prefixes){return k.process(e,r)}}}else if(e.prop==="justify-self"){var D=t.displayType(e);if(D!=="flex"&&t.gridStatus(e,r)!==false){k=t.prefixes.add["grid-column-align"];if(k&&k.prefixes){return k.process(e,r)}}}else if(e.prop==="place-self"){k=t.prefixes.add["place-self"];if(k&&k.prefixes&&t.gridStatus(e,r)!==false){return k.process(e,r)}}else{k=t.prefixes.add[e.prop];if(k&&k.prefixes){return k.process(e,r)}}return undefined});if(this.gridStatus(e,r)){o(e,this.disabled)}return e.walkDecls(function(e){if(t.disabledValue(e,r))return;var n=t.prefixes.unprefixed(e.prop);var o=t.prefixes.values("add",n);if(Array.isArray(o)){for(var s=o,a=Array.isArray(s),u=0,s=a?s:s[Symbol.iterator]();;){var f;if(a){if(u>=s.length)break;f=s[u++]}else{u=s.next();if(u.done)break;f=u.value}var c=f;if(c.process)c.process(e,r)}}i.save(t.prefixes,e)})};e.remove=function remove(e,r){var t=this;var n=this.prefixes.remove["@resolution"];e.walkAtRules(function(e,i){if(t.prefixes.remove["@"+e.name]){if(!t.disabled(e,r)){e.parent.removeChild(i)}}else if(e.name==="media"&&e.params.includes("-resolution")&&n){n.clean(e)}});var i=function _loop(){if(s){if(a>=o.length)return"break";u=o[a++]}else{a=o.next();if(a.done)return"break";u=a.value}var n=u;e.walkRules(function(e,i){if(n.check(e)){if(!t.disabled(e,r)){e.parent.removeChild(i)}}})};for(var o=this.prefixes.remove.selectors,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;var f=i();if(f==="break")break}return e.walkDecls(function(e,n){if(t.disabled(e,r))return;var i=e.parent;var o=t.prefixes.unprefixed(e.prop);if(e.prop==="transition"||e.prop==="transition-property"){t.prefixes.transition.remove(e)}if(t.prefixes.remove[e.prop]&&t.prefixes.remove[e.prop].remove){var s=t.prefixes.group(e).down(function(e){return t.prefixes.normalize(e.prop)===o});if(o==="flex-flow"){s=true}if(e.prop==="-webkit-box-orient"){var a={"flex-direction":true,"flex-flow":true};if(!e.parent.some(function(e){return a[e.prop]}))return}if(s&&!t.withHackValue(e)){if(e.raw("before").includes("\n")){t.reduceSpaces(e)}i.removeChild(n);return}}for(var u=t.prefixes.values("remove",o),f=Array.isArray(u),c=0,u=f?u:u[Symbol.iterator]();;){var l;if(f){if(c>=u.length)break;l=u[c++]}else{c=u.next();if(c.done)break;l=c.value}var p=l;if(!p.check)continue;if(!p.check(e.value))continue;o=p.unprefixed;var h=t.prefixes.group(e).down(function(e){return e.value.includes(o)});if(h){i.removeChild(n);return}}})};e.withHackValue=function withHackValue(e){return e.prop==="-webkit-background-clip"&&e.value==="text"};e.disabledValue=function disabledValue(e,r){if(this.gridStatus(e,r)===false&&e.type==="decl"){if(e.prop==="display"&&e.value.includes("grid")){return true}}if(this.prefixes.options.flexbox===false&&e.type==="decl"){if(e.prop==="display"&&e.value.includes("flex")){return true}}return this.disabled(e,r)};e.disabledDecl=function disabledDecl(e,r){if(this.gridStatus(e,r)===false&&e.type==="decl"){if(e.prop.includes("grid")||e.prop==="justify-items"){return true}}if(this.prefixes.options.flexbox===false&&e.type==="decl"){var t=["order","justify-content","align-items","align-content"];if(e.prop.includes("flex")||t.includes(e.prop)){return true}}return this.disabled(e,r)};e.disabled=function disabled(e,r){if(!e)return false;if(e._autoprefixerDisabled!==undefined){return e._autoprefixerDisabled}if(e.parent){var t=e.prev();if(t&&t.type==="comment"&&u.test(t.text)){e._autoprefixerDisabled=true;e._autoprefixerSelfDisabled=true;return true}}var n=null;if(e.nodes){var i;e.each(function(e){if(e.type!=="comment")return;if(/(!\s*)?autoprefixer:\s*(off|on)/i.test(e.text)){if(typeof i!=="undefined"){r.warn("Second Autoprefixer control comment "+"was ignored. Autoprefixer applies control "+"comment to whole block, not to next rules.",{node:e})}else{i=/on/i.test(e.text)}}});if(i!==undefined){n=!i}}if(!e.nodes||n===null){if(e.parent){var o=this.disabled(e.parent,r);if(e.parent._autoprefixerSelfDisabled===true){n=false}else{n=o}}else{n=false}}e._autoprefixerDisabled=n;return n};e.reduceSpaces=function reduceSpaces(e){var r=false;this.prefixes.group(e).up(function(){r=true;return true});if(r){return}var t=e.raw("before").split("\n");var n=t[t.length-1].length;var i=false;this.prefixes.group(e).down(function(e){t=e.raw("before").split("\n");var r=t.length-1;if(t[r].length>n){if(i===false){i=t[r].length-n}t[r]=t[r].slice(0,-i);e.raws.before=t.join("\n")}})};e.displayType=function displayType(e){for(var r=e.parent.nodes,t=Array.isArray(r),n=0,r=t?r:r[Symbol.iterator]();;){var i;if(t){if(n>=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;if(o.prop!=="display"){continue}if(o.value.includes("flex")){return"flex"}if(o.value.includes("grid")){return"grid"}}return false};e.gridStatus=function gridStatus(e,r){if(!e)return false;if(e._autoprefixerGridStatus!==undefined){return e._autoprefixerGridStatus}var t=null;if(e.nodes){var n;e.each(function(e){if(e.type!=="comment")return;if(f.test(e.text)){var t=/:\s*autoplace/i.test(e.text);var i=/no-autoplace/i.test(e.text);if(typeof n!=="undefined"){r.warn("Second Autoprefixer grid control comment was "+"ignored. Autoprefixer applies control comments to the whole "+"block, not to the next rules.",{node:e})}else if(t){n="autoplace"}else if(i){n=true}else{n=/on/i.test(e.text)}}});if(n!==undefined){t=n}}if(e.type==="atrule"&&e.name==="supports"){var i=e.params;if(i.includes("grid")&&i.includes("auto")){t=false}}if(!e.nodes||t===null){if(e.parent){var o=this.gridStatus(e.parent,r);if(e.parent._autoprefixerSelfDisabled===true){t=false}else{t=o}}else if(typeof this.prefixes.options.grid!=="undefined"){t=this.prefixes.options.grid}else if(typeof process.env.AUTOPREFIXER_GRID!=="undefined"){if(process.env.AUTOPREFIXER_GRID==="autoplace"){t="autoplace"}else{t=true}}else{t=false}}e._autoprefixerGridStatus=t;return t};return Processor}();e.exports=l},9514:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=t.length)break;s=t[i++]}else{i=t.next();if(i.done)break;s=i.value}var a=s;this.bad.push(this.prefixName(a,"min"));this.bad.push(this.prefixName(a,"max"))}}e.params=o.editList(e.params,function(e){return e.filter(function(e){return r.bad.every(function(r){return!e.includes(r)})})})};r.process=function process(e){var r=this;var t=this.parentPrefix(e);var n=t?[t]:this.prefixes;e.params=o.editList(e.params,function(e,t){for(var i=e,u=Array.isArray(i),f=0,i=u?i:i[Symbol.iterator]();;){var c;if(u){if(f>=i.length)break;c=i[f++]}else{f=i.next();if(f.done)break;c=f.value}var l=c;if(!l.includes("min-resolution")&&!l.includes("max-resolution")){t.push(l);continue}var p=function _loop(){if(B){if(v>=h.length)return"break";d=h[v++]}else{v=h.next();if(v.done)return"break";d=v.value}var e=d;var n=l.replace(s,function(t){var n=t.match(a);return r.prefixQuery(e,n[1],n[2],n[3],n[4])});t.push(n)};for(var h=n,B=Array.isArray(h),v=0,h=B?h:h[Symbol.iterator]();;){var d;var b=p();if(b==="break")break}t.push(l)}return o.uniq(t)})};return Resolution}(i);e.exports=u},4806:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n=s.length)return"break";f=s[u++]}else{u=s.next();if(u.done)return"break";f=u.value}var e=f;prefixeds[e]=n.map(function(t){return r.replace(t,e)}).join(", ")};for(var s=this.possible(),a=Array.isArray(s),u=0,s=a?s:s[Symbol.iterator]();;){var f;var c=o();if(c==="break")break}}else{for(var l=this.possible(),p=Array.isArray(l),h=0,l=p?l:l[Symbol.iterator]();;){var B;if(p){if(h>=l.length)break;B=l[h++]}else{h=l.next();if(h.done)break;B=h.value}var v=B;prefixeds[v]=this.replace(e.selector,v)}}e._autoprefixerPrefixeds[this.name]=prefixeds;return e._autoprefixerPrefixeds};r.already=function already(e,r,t){var n=e.parent.index(e)-1;while(n>=0){var i=e.parent.nodes[n];if(i.type!=="rule"){return false}var o=false;for(var s in r[this.name]){var a=r[this.name][s];if(i.selector===a){if(t===s){return true}else{o=true;break}}}if(!o){return false}n-=1}return false};r.replace=function replace(e,r){return e.replace(this.regexp(),"$1"+this.prefixed(r))};r.add=function add(e,r){var t=this.prefixeds(e);if(this.already(e,t,r)){return}var n=this.clone(e,{selector:t[this.name][r]});e.parent.insertBefore(e,n)};r.old=function old(e){return new o(this,e)};return Selector}(s);e.exports=f},3817:(e,r,t)=>{"use strict";var n=t(4633);var i=t(4338).feature(t(6944));var o=t(2319);var s=t(6689);var a=t(1882);var u=t(772);var f=[];for(var c in i.stats){var l=i.stats[c];for(var p in l){var h=l[p];if(/y/.test(h)){f.push(c+" "+p)}}}var B=function(){function Supports(e,r){this.Prefixes=e;this.all=r}var e=Supports.prototype;e.prefixer=function prefixer(){if(this.prefixerCache){return this.prefixerCache}var e=this.all.browsers.selected.filter(function(e){return f.includes(e)});var r=new o(this.all.browsers.data,e,this.all.options);this.prefixerCache=new this.Prefixes(this.all.data,r,this.all.options);return this.prefixerCache};e.parse=function parse(e){var r=e.split(":");var t=r[0];var n=r[1];if(!n)n="";return[t.trim(),n.trim()]};e.virtual=function virtual(e){var r=this.parse(e),t=r[0],i=r[1];var o=n.parse("a{}").first;o.append({prop:t,value:i,raws:{before:""}});return o};e.prefixed=function prefixed(e){var r=this.virtual(e);if(this.disabled(r.first)){return r.nodes}var t={warn:function warn(){return null}};var n=this.prefixer().add[r.first.prop];n&&n.process&&n.process(r.first,t);for(var i=r.nodes,o=Array.isArray(i),s=0,i=o?i:i[Symbol.iterator]();;){var u;if(o){if(s>=i.length)break;u=i[s++]}else{s=i.next();if(s.done)break;u=s.value}var f=u;for(var c=this.prefixer().values("add",r.first.prop),l=Array.isArray(c),p=0,c=l?c:c[Symbol.iterator]();;){var h;if(l){if(p>=c.length)break;h=c[p++]}else{p=c.next();if(p.done)break;h=p.value}var B=h;B.process(f)}a.save(this.all,f)}return r.nodes};e.isNot=function isNot(e){return typeof e==="string"&&/not\s*/i.test(e)};e.isOr=function isOr(e){return typeof e==="string"&&/\s*or\s*/i.test(e)};e.isProp=function isProp(e){return typeof e==="object"&&e.length===1&&typeof e[0]==="string"};e.isHack=function isHack(e,r){var t=new RegExp("(\\(|\\s)"+u.escapeRegexp(r)+":");return!t.test(e)};e.toRemove=function toRemove(e,r){var t=this.parse(e),n=t[0],i=t[1];var o=this.all.unprefixed(n);var s=this.all.cleaner();if(s.remove[n]&&s.remove[n].remove&&!this.isHack(r,o)){return true}for(var a=s.values("remove",o),u=Array.isArray(a),f=0,a=u?a:a[Symbol.iterator]();;){var c;if(u){if(f>=a.length)break;c=a[f++]}else{f=a.next();if(f.done)break;c=f.value}var l=c;if(l.check(i)){return true}}return false};e.remove=function remove(e,r){var t=0;while(t=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;r.push([s.prop+": "+s.value]);r.push(" or ")}r[r.length-1]="";return r};e.normalize=function normalize(e){var r=this;if(typeof e!=="object"){return e}e=e.filter(function(e){return e!==""});if(typeof e[0]==="string"&&e[0].includes(":")){return[s.stringify(e)]}return e.map(function(e){return r.normalize(e)})};e.add=function add(e,r){var t=this;return e.map(function(e){if(t.isProp(e)){var n=t.prefixed(e[0]);if(n.length>1){return t.convert(n)}return e}if(typeof e==="object"){return t.add(e,r)}return e})};e.process=function process(e){var r=s.parse(e.params);r=this.normalize(r);r=this.remove(r,e.params);r=this.add(r,e.params);r=this.cleanBrackets(r);e.params=s.stringify(r)};e.disabled=function disabled(e){if(!this.all.options.grid){if(e.prop==="display"&&e.value.includes("grid")){return true}if(e.prop.includes("grid")||e.prop==="justify-items"){return true}}if(this.all.options.flexbox===false){if(e.prop==="display"&&e.value.includes("flex")){return true}var r=["order","justify-content","align-items","align-content"];if(e.prop.includes("flex")||r.includes(e.prop)){return true}}return false};return Supports}();e.exports=B},7080:(e,r,t)=>{"use strict";function _defineProperty(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}var n=t(23);var i=t(4633).vendor;var o=t(4633).list;var s=t(2319);var a=function(){function Transition(e){_defineProperty(this,"props",["transition","transition-property"]);this.prefixes=e}var e=Transition.prototype;e.add=function add(e,r){var t=this;var n,i;var add=this.prefixes.add[e.prop];var o=this.ruleVendorPrefixes(e);var s=o||add&&add.prefixes||[];var a=this.parse(e.value);var u=a.map(function(e){return t.findProp(e)});var f=[];if(u.some(function(e){return e[0]==="-"})){return}for(var c=a,l=Array.isArray(c),p=0,c=l?c:c[Symbol.iterator]();;){var h;if(l){if(p>=c.length)break;h=c[p++]}else{p=c.next();if(p.done)break;h=p.value}var B=h;i=this.findProp(B);if(i[0]==="-")continue;var v=this.prefixes.add[i];if(!v||!v.prefixes)continue;for(var d=v.prefixes,b=Array.isArray(d),y=0,d=b?d:d[Symbol.iterator]();;){if(b){if(y>=d.length)break;n=d[y++]}else{y=d.next();if(y.done)break;n=y.value}if(o&&!o.some(function(e){return n.includes(e)})){continue}var g=this.prefixes.prefixed(i,n);if(g!=="-ms-transform"&&!u.includes(g)){if(!this.disabled(i,n)){f.push(this.clone(i,g,B))}}}}a=a.concat(f);var m=this.stringify(a);var C=this.stringify(this.cleanFromUnprefixed(a,"-webkit-"));if(s.includes("-webkit-")){this.cloneBefore(e,"-webkit-"+e.prop,C)}this.cloneBefore(e,e.prop,C);if(s.includes("-o-")){var w=this.stringify(this.cleanFromUnprefixed(a,"-o-"));this.cloneBefore(e,"-o-"+e.prop,w)}for(var S=s,O=Array.isArray(S),T=0,S=O?S:S[Symbol.iterator]();;){if(O){if(T>=S.length)break;n=S[T++]}else{T=S.next();if(T.done)break;n=T.value}if(n!=="-webkit-"&&n!=="-o-"){var E=this.stringify(this.cleanOtherPrefixes(a,n));this.cloneBefore(e,n+e.prop,E)}}if(m!==e.value&&!this.already(e,e.prop,m)){this.checkForWarning(r,e);e.cloneBefore();e.value=m}};e.findProp=function findProp(e){var r=e[0].value;if(/^\d/.test(r)){for(var t=e.entries(),n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(i>=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o,a=s[0],u=s[1];if(a!==0&&u.type==="word"){return u.value}}}return r};e.already=function already(e,r,t){return e.parent.some(function(e){return e.prop===r&&e.value===t})};e.cloneBefore=function cloneBefore(e,r,t){if(!this.already(e,r,t)){e.cloneBefore({prop:r,value:t})}};e.checkForWarning=function checkForWarning(e,r){if(r.prop!=="transition-property"){return}r.parent.each(function(t){if(t.type!=="decl"){return undefined}if(t.prop.indexOf("transition-")!==0){return undefined}if(t.prop==="transition-property"){return undefined}if(o.comma(t.value).length>1){r.warn(e,"Replace transition-property to transition, "+"because Autoprefixer could not support "+"any cases of transition-property "+"and other transition-*")}return false})};e.remove=function remove(e){var r=this;var t=this.parse(e.value);t=t.filter(function(e){var t=r.prefixes.remove[r.findProp(e)];return!t||!t.remove});var n=this.stringify(t);if(e.value===n){return}if(t.length===0){e.remove();return}var i=e.parent.some(function(r){return r.prop===e.prop&&r.value===n});var o=e.parent.some(function(r){return r!==e&&r.prop===e.prop&&r.value.length>n.length});if(i||o){e.remove();return}e.value=n};e.parse=function parse(e){var r=n(e);var t=[];var i=[];for(var o=r.nodes,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;i.push(f);if(f.type==="div"&&f.value===","){t.push(i);i=[]}}t.push(i);return t.filter(function(e){return e.length>0})};e.stringify=function stringify(e){if(e.length===0){return""}var r=[];for(var t=e,i=Array.isArray(t),o=0,t=i?t:t[Symbol.iterator]();;){var s;if(i){if(o>=t.length)break;s=t[o++]}else{o=t.next();if(o.done)break;s=o.value}var a=s;if(a[a.length-1].type!=="div"){a.push(this.div(e))}r=r.concat(a)}if(r[0].type==="div"){r=r.slice(1)}if(r[r.length-1].type==="div"){r=r.slice(0,+-2+1||0)}return n.stringify({nodes:r})};e.clone=function clone(e,r,t){var n=[];var i=false;for(var o=t,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;if(!i&&f.type==="word"&&f.value===e){n.push({type:"word",value:r});i=true}else{n.push(f)}}return n};e.div=function div(e){for(var r=e,t=Array.isArray(r),n=0,r=t?r:r[Symbol.iterator]();;){var i;if(t){if(n>=r.length)break;i=r[n++]}else{n=r.next();if(n.done)break;i=n.value}var o=i;for(var s=o,a=Array.isArray(s),u=0,s=a?s:s[Symbol.iterator]();;){var f;if(a){if(u>=s.length)break;f=s[u++]}else{u=s.next();if(u.done)break;f=u.value}var c=f;if(c.type==="div"&&c.value===","){return c}}}return{type:"div",value:",",after:" "}};e.cleanOtherPrefixes=function cleanOtherPrefixes(e,r){var t=this;return e.filter(function(e){var n=i.prefix(t.findProp(e));return n===""||n===r})};e.cleanFromUnprefixed=function cleanFromUnprefixed(e,r){var t=this;var n=e.map(function(e){return t.findProp(e)}).filter(function(e){return e.slice(0,r.length)===r}).map(function(e){return t.prefixes.unprefixed(e)});var o=[];for(var s=e,a=Array.isArray(s),u=0,s=a?s:s[Symbol.iterator]();;){var f;if(a){if(u>=s.length)break;f=s[u++]}else{u=s.next();if(u.done)break;f=u.value}var c=f;var l=this.findProp(c);var p=i.prefix(l);if(!n.includes(l)&&(p===r||p==="")){o.push(c)}}return o};e.disabled=function disabled(e,r){var t=["order","justify-content","align-self","align-content"];if(e.includes("flex")||t.includes(e)){if(this.prefixes.options.flexbox===false){return true}if(this.prefixes.options.flexbox==="no-2009"){return r.includes("2009")}}return undefined};e.ruleVendorPrefixes=function ruleVendorPrefixes(e){var r=e.parent;if(r.type!=="rule"){return false}else if(!r.selector.includes(":-")){return false}var t=s.prefixes().filter(function(e){return r.selector.includes(":"+e)});return t.length>0?t:false};return Transition}();e.exports=a},772:(e,r,t)=>{"use strict";var n=t(4633).list;e.exports={error:function error(e){var r=new Error(e);r.autoprefixer=true;throw r},uniq:function uniq(e){var r=[];for(var t=e,n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(i>=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;if(!r.includes(s)){r.push(s)}}return r},removeNote:function removeNote(e){if(!e.includes(" ")){return e}return e.split(" ")[0]},escapeRegexp:function escapeRegexp(e){return e.replace(/[$()*+-.?[\\\]^{|}]/g,"\\$&")},regexp:function regexp(e,r){if(r===void 0){r=true}if(r){e=this.escapeRegexp(e)}return new RegExp("(^|[\\s,(])("+e+"($|[\\s(,]))","gi")},editList:function editList(e,r){var t=n.comma(e);var i=r(t,[]);if(t===i){return e}var o=e.match(/,\s*/);o=o?o[0]:", ";return i.join(o)},splitSelector:function splitSelector(e){return n.comma(e).map(function(e){return n.space(e).map(function(e){return e.split(/(?=\.|#)/g)})})}}},1882:(e,r,t)=>{"use strict";function _defaults(e,r){var t=Object.getOwnPropertyNames(r);for(var n=0;n{var n=t(2731);var i=t(2355);var o=t(3856);function ValueParser(e){if(this instanceof ValueParser){this.nodes=n(e);return this}return new ValueParser(e)}ValueParser.prototype.toString=function(){return Array.isArray(this.nodes)?o(this.nodes):""};ValueParser.prototype.walk=function(e,r){i(this.nodes,e,r);return this};ValueParser.unit=t(2137);ValueParser.walk=i;ValueParser.stringify=o;e.exports=ValueParser},2731:e=>{var r="(".charCodeAt(0);var t=")".charCodeAt(0);var n="'".charCodeAt(0);var i='"'.charCodeAt(0);var o="\\".charCodeAt(0);var s="/".charCodeAt(0);var a=",".charCodeAt(0);var u=":".charCodeAt(0);var f="*".charCodeAt(0);var c="u".charCodeAt(0);var l="U".charCodeAt(0);var p="+".charCodeAt(0);var h=/^[a-f0-9?-]+$/i;e.exports=function(e){var B=[];var v=e;var d,b,y,g,m,C,w,S;var O=0;var T=v.charCodeAt(O);var E=v.length;var k=[{nodes:B}];var P=0;var D;var A="";var R="";var F="";while(O{function stringifyNode(e,r){var t=e.type;var n=e.value;var i;var o;if(r&&(o=r(e))!==undefined){return o}else if(t==="word"||t==="space"){return n}else if(t==="string"){i=e.quote||"";return i+n+(e.unclosed?"":i)}else if(t==="comment"){return"/*"+n+(e.unclosed?"":"*/")}else if(t==="div"){return(e.before||"")+n+(e.after||"")}else if(Array.isArray(e.nodes)){i=stringify(e.nodes,r);if(t!=="function"){return i}return n+"("+(e.before||"")+i+(e.after||"")+(e.unclosed?"":")")}return n}function stringify(e,r){var t,n;if(Array.isArray(e)){t="";for(n=e.length-1;~n;n-=1){t=stringifyNode(e[n],r)+t}return t}return stringifyNode(e,r)}e.exports=stringify},2137:e=>{var r="-".charCodeAt(0);var t="+".charCodeAt(0);var n=".".charCodeAt(0);var i="e".charCodeAt(0);var o="E".charCodeAt(0);function likeNumber(e){var i=e.charCodeAt(0);var o;if(i===t||i===r){o=e.charCodeAt(1);if(o>=48&&o<=57){return true}var s=e.charCodeAt(2);if(o===n&&s>=48&&s<=57){return true}return false}if(i===n){o=e.charCodeAt(1);if(o>=48&&o<=57){return true}return false}if(i>=48&&i<=57){return true}return false}e.exports=function(e){var s=0;var a=e.length;var u;var f;var c;if(a===0||!likeNumber(e)){return false}u=e.charCodeAt(s);if(u===t||u===r){s++}while(s57){break}s+=1}u=e.charCodeAt(s);f=e.charCodeAt(s+1);if(u===n&&f>=48&&f<=57){s+=2;while(s57){break}s+=1}}u=e.charCodeAt(s);f=e.charCodeAt(s+1);c=e.charCodeAt(s+2);if((u===i||u===o)&&(f>=48&&f<=57||(f===t||f===r)&&c>=48&&c<=57)){s+=f===t||f===r?3:2;while(s57){break}s+=1}}return{number:e.slice(0,s),unit:e.slice(s)}}},2355:e=>{e.exports=function walk(e,r,t){var n,i,o,s;for(n=0,i=e.length;n{"use strict";e.exports=balanced;function balanced(e,r,t){if(e instanceof RegExp)e=maybeMatch(e,t);if(r instanceof RegExp)r=maybeMatch(r,t);var n=range(e,r,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+e.length,n[1]),post:t.slice(n[1]+r.length)}}function maybeMatch(e,r){var t=r.match(e);return t?t[0]:null}balanced.range=range;function range(e,r,t){var n,i,o,s,a;var u=t.indexOf(e);var f=t.indexOf(r,u+1);var c=u;if(u>=0&&f>0){n=[];o=t.length;while(c>=0&&!a){if(c==u){n.push(c);u=t.indexOf(e,c+1)}else if(n.length==1){a=[n.pop(),f]}else{i=n.pop();if(i=0?u:f}if(n.length){a=[o,s]}}return a}},1302:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{36:"Y LB M N S T U V",257:"P J K L",548:"C O H"},C:{1:"4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",16:"0 1 2 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",130:"3"},D:{36:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{16:"eB XB",36:"G Z I D F E A B C O H gB hB iB jB YB W Q nB oB"},F:{16:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{16:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{16:"EC"},I:{16:"bB G M FC GC HC IC aB JC KC"},J:{16:"D A"},K:{16:"A B C EB W ZB Q"},L:{16:"V"},M:{16:"N"},N:{16:"A B"},O:{16:"LC"},P:{16:"G MC NC OC PC QC YB RC SC TC"},Q:{16:"UC"},R:{16:"VC"},S:{130:"fB"}},B:1,C:"CSS3 Background-clip: text"}},2259:e=>{e.exports={A:{A:{1:"E A B",2:"I D F mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB",36:"wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",516:"G Z I D F E A B C O H"},E:{1:"D F E A B C O H iB jB YB W Q nB oB",772:"G Z I eB XB gB hB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X rB sB W ZB uB Q",2:"E pB",36:"qB"},G:{1:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",4:"XB vB aB WC",516:"xB"},H:{132:"EC"},I:{1:"M JC KC",36:"FC",516:"bB G IC aB",548:"GC HC"},J:{1:"D A"},K:{1:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 Background-image options"}},9847:e=>{e.exports={A:{A:{1:"B",2:"I D F E A mB"},B:{1:"H P J K L Y LB M N S T U V",129:"C O"},C:{1:"5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",260:"0 1 2 3 4 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",804:"G Z I D F E A B C O H tB wB"},D:{1:"BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",260:"6 7 8 9 AB",388:"0 1 2 3 4 5 l m n o p q r s t u v w x y z",1412:"P J K L a b c d e f g h i j k",1956:"G Z I D F E A B C O H"},E:{129:"A B C O H jB YB W Q nB oB",1412:"I D F E hB iB",1956:"G Z eB XB gB"},F:{1:"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E pB qB",260:"t u v w x",388:"P J K L a b c d e f g h i j k l m n o p q r s",1796:"rB sB",1828:"B C W ZB uB Q"},G:{129:"2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",1412:"F WC zB 0B 1B",1956:"XB vB aB xB"},H:{1828:"EC"},I:{388:"M JC KC",1956:"bB G FC GC HC IC aB"},J:{1412:"A",1924:"D"},K:{1:"EB",2:"A",1828:"B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{1:"B",2:"A"},O:{388:"LC"},P:{1:"OC PC QC YB RC SC TC",260:"MC NC",388:"G"},Q:{260:"UC"},R:{260:"VC"},S:{260:"fB"}},B:4,C:"CSS3 Border images"}},3807:e=>{e.exports={A:{A:{2:"I D F mB",260:"E",516:"A B"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB wB",33:"G Z I D F E A B C O H P"},D:{1:"0 1 2 3 4 5 6 7 8 9 h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L",33:"a b c d e f g"},E:{1:"D F E A B C O H hB iB jB YB W Q nB oB",2:"G Z eB XB gB",33:"I"},F:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q"},G:{1:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB",33:"WC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB",132:"JC KC"},J:{1:"A",2:"D"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"calc() as CSS unit value"}},8252:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G tB wB",33:"Z I D F E A B C O H P"},D:{1:"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x"},E:{1:"E A B C O H jB YB W Q nB oB",2:"eB XB",33:"I D F gB hB iB",292:"G Z"},F:{1:"0 1 2 3 4 5 6 7 8 9 l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E B pB qB rB sB W ZB uB",33:"C P J K L a b c d e f g h i j k"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"F WC zB 0B",164:"XB vB aB xB"},H:{2:"EC"},I:{1:"M",33:"G IC aB JC KC",164:"bB FC GC HC"},J:{33:"D A"},K:{1:"EB Q",2:"A B C W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS Animation"}},1977:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{1:"5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",16:"lB",33:"0 1 2 3 4 bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB"},D:{1:"KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",16:"G Z I D F E A B C O H",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB"},E:{1:"E A B C O H jB YB W Q nB oB",16:"G Z I eB XB gB",33:"D F hB iB"},F:{1:"7 8 9 AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"0 1 2 3 4 5 6 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",16:"XB vB aB xB",33:"F WC zB 0B"},H:{2:"EC"},I:{1:"M",16:"bB G FC GC HC IC aB",33:"JC KC"},J:{16:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{33:"LC"},P:{1:"QC YB RC SC TC",16:"G",33:"MC NC OC PC"},Q:{1:"UC"},R:{1:"VC"},S:{33:"fB"}},B:5,C:"CSS :any-link selector"}},8672:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"S T U V",33:"N",164:"Y LB M",388:"C O H P J K L"},C:{1:"LB M kB N S T U",164:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y",676:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p tB wB"},D:{1:"S T U V yB cB dB",33:"N",164:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M"},E:{164:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",33:"PB GB X",164:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB"},G:{164:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{164:"bB G M FC GC HC IC aB JC KC"},J:{164:"D A"},K:{2:"A B C W ZB Q",164:"EB"},L:{1:"V"},M:{164:"N"},N:{2:"A",388:"B"},O:{164:"LC"},P:{164:"G MC NC OC PC QC YB RC SC TC"},Q:{164:"UC"},R:{164:"VC"},S:{164:"fB"}},B:5,C:"CSS Appearance"}},3613:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J",257:"K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB tB wB",578:"PB GB X WB SB TB UB VB QB Y LB M kB N S T U"},D:{1:"UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",194:"2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB"},E:{2:"G Z I D F eB XB gB hB iB",33:"E A B C O H jB YB W Q nB oB"},F:{1:"JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e f g h i j k l m n o pB qB rB sB W ZB uB Q",194:"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB BB CB DB FB HB IB"},G:{2:"F XB vB aB xB WC zB 0B",33:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{578:"N"},N:{2:"A B"},O:{2:"LC"},P:{1:"SC TC",2:"G",194:"MC NC OC PC QC YB RC"},Q:{194:"UC"},R:{194:"VC"},S:{2:"fB"}},B:7,C:"CSS Backdrop Filter"}},4016:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",164:"Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m tB wB"},D:{2:"G Z I D F E A B C O H P J K L a b c",164:"0 1 2 3 4 5 6 7 8 9 d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I eB XB gB",164:"D F E A B C O H hB iB jB YB W Q nB oB"},F:{2:"E pB qB rB sB",129:"B C W ZB uB Q",164:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB aB xB WC",164:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{132:"EC"},I:{2:"bB G FC GC HC IC aB",164:"M JC KC"},J:{2:"D",164:"A"},K:{2:"A",129:"B C W ZB Q",164:"EB"},L:{164:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{164:"G MC NC OC PC QC YB RC SC TC"},Q:{164:"UC"},R:{164:"VC"},S:{1:"fB"}},B:5,C:"CSS box-decoration-break"}},5861:e=>{e.exports={A:{A:{1:"E A B",2:"I D F mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",33:"tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E"},E:{1:"I D F E A B C O H gB hB iB jB YB W Q nB oB",33:"Z",164:"G eB XB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X rB sB W ZB uB Q",2:"E pB qB"},G:{1:"F xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"vB aB",164:"XB"},H:{2:"EC"},I:{1:"G M IC aB JC KC",164:"bB FC GC HC"},J:{1:"A",33:"D"},K:{1:"B C EB W ZB Q",2:"A"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 Box-shadow"}},147:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K",260:"Y LB M N S T U V",3138:"L"},C:{1:"9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",132:"0 1 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",644:"2 3 4 5 6 7 8"},D:{2:"G Z I D F E A B C O H P J K L a b c d e",260:"AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",292:"0 1 2 3 4 5 6 7 8 9 f g h i j k l m n o p q r s t u v w x y z"},E:{2:"G Z I eB XB gB hB",292:"D F E A B C O H iB jB YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",260:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",292:"P J K L a b c d e f g h i j k l m n o p q r s t u v w"},G:{2:"XB vB aB xB WC",292:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",260:"M",292:"JC KC"},J:{2:"D A"},K:{2:"A B C W ZB Q",260:"EB"},L:{260:"V"},M:{1:"N"},N:{2:"A B"},O:{292:"LC"},P:{292:"G MC NC OC PC QC YB RC SC TC"},Q:{292:"UC"},R:{260:"VC"},S:{644:"fB"}},B:4,C:"CSS clip-path property (for HTML)"}},664:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",33:"Y LB M N S T U V"},C:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"0 1 2 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB"},D:{16:"G Z I D F E A B C O H P J K L",33:"0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z eB XB gB",33:"I D F E A B C O H hB iB jB YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{16:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{16:"bB G M FC GC HC IC aB JC KC"},J:{16:"D A"},K:{2:"A B C EB W ZB Q"},L:{16:"V"},M:{1:"N"},N:{16:"A B"},O:{16:"LC"},P:{16:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{16:"VC"},S:{1:"fB"}},B:5,C:"CSS color-adjust"}},7794:e=>{e.exports={A:{A:{2:"I mB",2340:"D F E A B"},B:{2:"C O H P J K L",1025:"Y LB M N S T U V"},C:{2:"lB bB tB",513:"KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",545:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB wB"},D:{2:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v",1025:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"A B C O H YB W Q nB oB",2:"G Z eB XB gB",164:"I",4644:"D F E hB iB jB"},F:{2:"E B P J K L a b c d e f g h i pB qB rB sB W ZB",545:"C uB Q",1025:"0 1 2 3 4 5 6 7 8 9 j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB",4260:"xB WC",4644:"F zB 0B 1B 2B"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB JC KC",1025:"M"},J:{2:"D",4260:"A"},K:{2:"A B W ZB",545:"C Q",1025:"EB"},L:{1025:"V"},M:{545:"N"},N:{2340:"A B"},O:{1:"LC"},P:{1025:"G MC NC OC PC QC YB RC SC TC"},Q:{1025:"UC"},R:{1025:"VC"},S:{4097:"fB"}},B:7,C:"Crisp edges/pixelated images"}},3323:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",33:"Y LB M N S T U V"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"G Z I D F E A B C O H P J",33:"0 1 2 3 4 5 6 7 8 9 K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"A B C O H YB W Q nB oB",2:"G Z eB XB",33:"I D F E gB hB iB jB"},F:{2:"E B C pB qB rB sB W ZB uB Q",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB",33:"F xB WC zB 0B 1B 2B"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",33:"M JC KC"},J:{2:"D A"},K:{2:"A B C W ZB Q",33:"EB"},L:{33:"V"},M:{2:"N"},N:{2:"A B"},O:{33:"LC"},P:{33:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{33:"VC"},S:{2:"fB"}},B:4,C:"CSS Cross-Fade Function"}},1779:e=>{e.exports={A:{A:{2:"I D F E mB",164:"A B"},B:{66:"Y LB M N S T U V",164:"C O H P J K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"G Z I D F E A B C O H P J K L a b c d e f g h i j",66:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{2:"E B C P J K L a b c d e f g h i j k l m n o p q r s t u pB qB rB sB W ZB uB Q",66:"0 1 2 3 4 5 6 7 8 9 v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{292:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A EB",292:"B C W ZB Q"},L:{2:"V"},M:{2:"N"},N:{164:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{66:"UC"},R:{2:"VC"},S:{2:"fB"}},B:5,C:"CSS Device Adaptation"}},9666:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L Y LB M N S T U V"},C:{33:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",164:"lB bB tB wB"},D:{2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{2:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{2:"V"},M:{33:"N"},N:{2:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{33:"fB"}},B:5,C:"CSS element() function"}},6192:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L Y LB M N S T U V"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"A B C O H jB YB W Q nB oB",2:"G Z I D F eB XB gB hB iB",33:"E"},F:{2:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"F XB vB aB xB WC zB 0B",33:"1B 2B"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{2:"V"},M:{2:"N"},N:{2:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:5,C:"CSS filter() function"}},9237:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",1028:"O H P J K L",1346:"C"},C:{1:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB",196:"p",516:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o wB"},D:{1:"8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K",33:"0 1 2 3 4 5 6 7 L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{1:"A B C O H jB YB W Q nB oB",2:"G Z eB XB gB",33:"I D F E hB iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d e f g h i j k l m n o p q r s t u"},G:{1:"2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB",33:"F WC zB 0B 1B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB",33:"JC KC"},J:{2:"D",33:"A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"OC PC QC YB RC SC TC",33:"G MC NC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS Filter Effects"}},1407:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB",260:"J K L a b c d e f g h i j k l m n o p q",292:"G Z I D F E A B C O H P wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"A B C O H P J K L a b c d e f g",548:"G Z I D F E"},E:{2:"eB XB",260:"D F E A B C O H hB iB jB YB W Q nB oB",292:"I gB",804:"G Z"},F:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E B pB qB rB sB",33:"C uB",164:"W ZB"},G:{260:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",292:"xB WC",804:"XB vB aB"},H:{2:"EC"},I:{1:"M JC KC",33:"G IC aB",548:"bB FC GC HC"},J:{1:"A",548:"D"},K:{1:"EB Q",2:"A B",33:"C",164:"W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS Gradients"}},7776:e=>{e.exports={A:{A:{2:"I D F mB",8:"E",292:"A B"},B:{1:"J K L Y LB M N S T U V",292:"C O H P"},C:{1:"9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L tB wB",8:"a b c d e f g h i j k l m n o p q r s t u",584:"0 1 2 3 4 5 6 v w x y z",1025:"7 8"},D:{1:"DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f",8:"g h i j",200:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB",1025:"CB"},E:{1:"B C O H YB W Q nB oB",2:"G Z eB XB gB",8:"I D F E A hB iB jB"},F:{1:"0 1 2 3 4 5 6 7 8 9 z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e f g h i pB qB rB sB W ZB uB Q",200:"j k l m n o p q r s t u v w x y"},G:{1:"4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB",8:"F WC zB 0B 1B 2B 3B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC",8:"aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{292:"A B"},O:{1:"LC"},P:{1:"NC OC PC QC YB RC SC TC",2:"MC",8:"G"},Q:{1:"UC"},R:{2:"VC"},S:{1:"fB"}},B:4,C:"CSS Grid Layout (level 1)"}},9747:e=>{e.exports={A:{A:{2:"I D F E mB",33:"A B"},B:{33:"C O H P J K L",132:"Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z tB wB",33:"I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x"},D:{1:"yB cB dB",2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",132:"AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V"},E:{2:"G Z eB XB",33:"I D F E A B C O H gB hB iB jB YB W Q nB oB"},F:{2:"E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w pB qB rB sB W ZB uB Q",132:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB",33:"F aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{4:"LC"},P:{1:"NC OC PC QC YB RC SC TC",2:"G",132:"MC"},Q:{2:"UC"},R:{132:"VC"},S:{1:"fB"}},B:5,C:"CSS Hyphenation"}},4197:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",33:"Y LB M N S T U V"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"G Z I D F E A B C O H P J K L a b",33:"0 1 2 3 4 5 6 7 8 9 c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z eB XB gB",33:"I D F E hB iB jB",129:"A B C O H YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB aB xB",33:"F WC zB 0B 1B 2B",129:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",33:"M JC KC"},J:{2:"D",33:"A"},K:{2:"A B C W ZB Q",33:"EB"},L:{33:"V"},M:{2:"N"},N:{2:"A B"},O:{33:"LC"},P:{33:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{33:"VC"},S:{2:"fB"}},B:5,C:"CSS image-set"}},471:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",3588:"Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB",164:"bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v tB wB"},D:{292:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB",2052:"V yB cB dB",3588:"OB PB GB X WB SB TB UB VB QB Y LB M N S T U"},E:{292:"G Z I D F E A B C eB XB gB hB iB jB YB W",2052:"oB",3588:"O H Q nB"},F:{2:"E B C pB qB rB sB W ZB uB Q",292:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB",3588:"BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{292:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B",3588:"8B 9B AC BC CC DC"},H:{2:"EC"},I:{292:"bB G FC GC HC IC aB JC KC",2052:"M"},J:{292:"D A"},K:{2:"A B C W ZB Q",3588:"EB"},L:{2052:"V"},M:{1:"N"},N:{2:"A B"},O:{292:"LC"},P:{292:"G MC NC OC PC QC",3588:"YB RC SC TC"},Q:{3588:"UC"},R:{3588:"VC"},S:{3588:"fB"}},B:5,C:"CSS Logical Properties"}},4613:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J",164:"Y LB M N S T U V",3138:"K",12292:"L"},C:{1:"8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",260:"0 1 2 3 4 5 6 7 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB"},D:{164:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"eB XB",164:"G Z I D F E A B C O H gB hB iB jB YB W Q nB oB"},F:{2:"E B C pB qB rB sB W ZB uB Q",164:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{164:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{164:"M JC KC",676:"bB G FC GC HC IC aB"},J:{164:"D A"},K:{2:"A B C W ZB Q",164:"EB"},L:{164:"V"},M:{1:"N"},N:{2:"A B"},O:{164:"LC"},P:{164:"G MC NC OC PC QC YB RC SC TC"},Q:{164:"UC"},R:{164:"VC"},S:{260:"fB"}},B:4,C:"CSS Masks"}},3588:e=>{e.exports={A:{A:{2:"I D F mB",132:"E A B"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",260:"G Z I D F E A B C O H P tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",548:"G Z I D F E A B C O H P J K L a b c d e f g h i j"},E:{2:"eB XB",548:"G Z I D F E A B C O H gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E",548:"B C pB qB rB sB W ZB uB"},G:{16:"XB",548:"F vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{132:"EC"},I:{1:"M JC KC",16:"FC GC",548:"bB G HC IC aB"},J:{548:"D A"},K:{1:"EB Q",548:"A B C W ZB"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:2,C:"Media Queries: resolution feature"}},3043:e=>{e.exports={A:{A:{2:"I D F E mB",132:"A B"},B:{1:"Y LB M N S T U V",132:"C O H P J K",516:"L"},C:{1:"EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB tB wB"},D:{1:"KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB",260:"IB JB"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"7 8 9 AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"0 1 2 3 4 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z pB qB rB sB W ZB uB Q",260:"5 6"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{2:"LC"},P:{1:"PC QC YB RC SC TC",2:"G MC NC OC"},Q:{1:"UC"},R:{2:"VC"},S:{2:"fB"}},B:7,C:"CSS overscroll-behavior"}},5117:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",36:"C O H P J K L"},C:{1:"6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L tB wB",33:"0 1 2 3 4 5 a b c d e f g h i j k l m n o p q r s t u v w x y z"},D:{1:"CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",36:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB"},E:{1:"B C O H YB W Q nB oB",2:"G eB XB",36:"Z I D F E A gB hB iB jB"},F:{1:"0 1 2 3 4 5 6 7 8 9 z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",36:"P J K L a b c d e f g h i j k l m n o p q r s t u v w x y"},G:{1:"4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB",36:"F aB xB WC zB 0B 1B 2B 3B"},H:{2:"EC"},I:{1:"M",36:"bB G FC GC HC IC aB JC KC"},J:{36:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{36:"A B"},O:{1:"LC"},P:{1:"OC PC QC YB RC SC TC",36:"G MC NC"},Q:{1:"UC"},R:{1:"VC"},S:{33:"fB"}},B:5,C:"::placeholder CSS pseudo-element"}},3502:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"O H P J K L Y LB M N S T U V",2:"C"},C:{1:"QB Y LB M kB N S T U",16:"lB",33:"0 1 2 3 4 5 6 7 8 9 bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",16:"G Z I D F E A B C O H",132:"P J K L a b c d e f g h i j k l m n o p q"},E:{1:"E A B C O H jB YB W Q nB oB",16:"eB XB",132:"G Z I D F gB hB iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",16:"E B pB qB rB sB W",132:"C P J K L a b c d ZB uB Q"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",16:"XB vB",132:"F aB xB WC zB 0B"},H:{2:"EC"},I:{1:"M",16:"FC GC",132:"bB G HC IC aB JC KC"},J:{1:"A",132:"D"},K:{1:"EB",2:"A B W",132:"C ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{33:"fB"}},B:1,C:"CSS :read-only and :read-write selectors"}},5969:e=>{e.exports={A:{A:{2:"I D F E mB",420:"A B"},B:{2:"Y LB M N S T U V",420:"C O H P J K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",36:"P J K L",66:"a b c d e f g h i j k l m n o p"},E:{2:"G Z I C O H eB XB gB W Q nB oB",33:"D F E A B hB iB jB YB"},F:{2:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{2:"XB vB aB xB WC 6B 7B 8B 9B AC BC CC DC",33:"F zB 0B 1B 2B 3B 4B 5B"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{2:"V"},M:{2:"N"},N:{420:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:5,C:"CSS Regions"}},3347:e=>{e.exports={A:{A:{1:"E A B",2:"I D F mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q",2:"E"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M JC KC",2:"bB G FC GC HC IC aB"},J:{1:"A",2:"D"},K:{1:"C EB ZB Q",16:"A B W"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{33:"fB"}},B:5,C:"::selection CSS pseudo-element"}},4298:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{1:"HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"0 1 2 3 4 5 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",322:"6 7 8 9 AB BB CB DB EB FB RB"},D:{1:"0 1 2 3 4 5 6 7 8 9 s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o",194:"p q r"},E:{1:"B C O H YB W Q nB oB",2:"G Z I D eB XB gB hB",33:"F E A iB jB"},F:{1:"0 1 2 3 4 5 6 7 8 9 f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e pB qB rB sB W ZB uB Q"},G:{1:"4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB WC zB",33:"F 0B 1B 2B 3B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{2:"fB"}},B:4,C:"CSS Shapes Level 1"}},87:e=>{e.exports={A:{A:{2:"I D F E mB",6308:"A",6436:"B"},B:{1:"Y LB M N S T U V",6436:"C O H P J K L"},C:{1:"NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t tB wB",2052:"0 1 2 3 4 5 6 7 8 9 u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB"},D:{1:"OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB",8258:"R MB NB"},E:{1:"B C O H W Q nB oB",2:"G Z I D F eB XB gB hB iB",3108:"E A jB YB"},F:{1:"JB KB R MB NB OB PB GB X",2:"0 1 2 3 4 5 6 7 8 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z pB qB rB sB W ZB uB Q",8258:"9 AB BB CB DB FB HB IB"},G:{1:"5B 6B 7B 8B 9B AC BC CC DC",2:"F XB vB aB xB WC zB 0B",3108:"1B 2B 3B 4B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{2:"LC"},P:{1:"YB RC SC TC",2:"G MC NC OC PC QC"},Q:{2:"UC"},R:{2:"VC"},S:{2052:"fB"}},B:4,C:"CSS Scroll Snap"}},3727:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P",1028:"Y LB M N S T U V",4100:"J K L"},C:{1:"EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g tB wB",194:"h i j k l m",516:"0 1 2 3 4 5 6 7 8 9 n o p q r s t u v w x y z AB BB CB DB"},D:{2:"0 1 2 3 4 5 6 G Z I D F E A B C O H P J K L a b c d s t u v w x y z",322:"7 8 9 e f g h i j k l m n o p q r AB",1028:"BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"O H nB oB",2:"G Z I eB XB gB",33:"F E A B C iB jB YB W Q",2084:"D hB"},F:{2:"E B C P J K L a b c d e f g h i j k l m n o p q r s t pB qB rB sB W ZB uB Q",322:"u v w",1028:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"9B AC BC CC DC",2:"XB vB aB xB",33:"F 0B 1B 2B 3B 4B 5B 6B 7B 8B",2084:"WC zB"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB JC KC",1028:"M"},J:{2:"D A"},K:{2:"A B C W ZB Q",1028:"EB"},L:{1028:"V"},M:{1:"N"},N:{2:"A B"},O:{1028:"LC"},P:{1:"NC OC PC QC YB RC SC TC",2:"G MC"},Q:{1028:"UC"},R:{2:"VC"},S:{516:"fB"}},B:5,C:"CSS position:sticky"}},9533:e=>{e.exports={A:{A:{132:"I D F E A B mB"},B:{1:"Y LB M N S T U V",4:"C O H P J K L"},C:{1:"4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B tB wB",33:"0 1 2 3 C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},D:{1:"2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p",322:"0 1 q r s t u v w x y z"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c pB qB rB sB W ZB uB Q",578:"d e f g h i j k l m n o"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",2:"G"},Q:{2:"UC"},R:{1:"VC"},S:{33:"fB"}},B:5,C:"CSS3 text-align-last"}},3100:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{1:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s tB wB",194:"t u v"},D:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 2 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{2:"G Z I D F E eB XB gB hB iB jB",16:"A",33:"B C O H YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e f g h i j k l m n o p pB qB rB sB W ZB uB Q"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"F XB vB aB xB WC zB 0B 1B 2B"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",2:"G"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS text-orientation"}},8422:e=>{e.exports={A:{A:{2:"I D mB",161:"F E A B"},B:{2:"Y LB M N S T U V",161:"C O H P J K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{2:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{2:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C EB W ZB Q"},L:{2:"V"},M:{2:"N"},N:{16:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:5,C:"CSS Text 4 text-spacing"}},5056:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB wB",33:"Z I D F E A B C O H P",164:"G"},D:{1:"0 1 2 3 4 5 6 7 8 9 h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E A B C O H P J K L a b c d e f g"},E:{1:"D F E A B C O H hB iB jB YB W Q nB oB",33:"I gB",164:"G Z eB XB"},F:{1:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E pB qB",33:"C",164:"B rB sB W ZB uB"},G:{1:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"WC",164:"XB vB aB xB"},H:{2:"EC"},I:{1:"M JC KC",33:"bB G FC GC HC IC aB"},J:{1:"A",33:"D"},K:{1:"EB Q",33:"C",164:"A B W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS3 Transitions"}},1456:e=>{e.exports={A:{A:{132:"I D F E A B mB"},B:{1:"Y LB M N S T U V",132:"C O H P J K L"},C:{1:"5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"0 1 2 3 4 K L a b c d e f g h i j k l m n o p q r s t u v w x y z",132:"lB bB G Z I D F E tB wB",292:"A B C O H P J"},D:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",132:"G Z I D F E A B C O H P J",548:"0 1 2 K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{132:"G Z I D F eB XB gB hB iB",548:"E A B C O H jB YB W Q nB oB"},F:{132:"0 1 2 3 4 5 6 7 8 9 E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q"},G:{132:"F XB vB aB xB WC zB 0B",548:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{16:"EC"},I:{1:"M",16:"bB G FC GC HC IC aB JC KC"},J:{16:"D A"},K:{16:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{16:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",16:"G"},Q:{16:"UC"},R:{16:"VC"},S:{33:"fB"}},B:4,C:"CSS unicode-bidi property"}},8307:e=>{e.exports={A:{A:{132:"I D F E A B mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q tB wB",322:"r s t u v"},D:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I",16:"D",33:"0 1 2 F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{1:"B C O H W Q nB oB",2:"G eB XB",16:"Z",33:"I D F E A gB hB iB jB YB"},F:{1:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d e f g h i j k l m n o p"},G:{1:"5B 6B 7B 8B 9B AC BC CC DC",16:"XB vB aB",33:"F xB WC zB 0B 1B 2B 3B 4B"},H:{2:"EC"},I:{1:"M",2:"FC GC HC",33:"bB G IC aB JC KC"},J:{33:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{36:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",33:"G"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS writing-mode property"}},7759:e=>{e.exports={A:{A:{1:"F E A B",8:"I D mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E"},E:{1:"I D F E A B C O H gB hB iB jB YB W Q nB oB",33:"G Z eB XB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X pB qB rB sB W ZB uB Q",2:"E"},G:{1:"F xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"XB vB aB"},H:{1:"EC"},I:{1:"G M IC aB JC KC",33:"bB FC GC HC"},J:{1:"A",33:"D"},K:{1:"A B C EB W ZB Q"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS3 Box-sizing"}},4528:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"P J K L Y LB M N S T U V",2:"C O H"},C:{1:"0 1 2 3 4 5 6 7 8 9 i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h tB wB"},D:{1:"NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB"},E:{1:"B C O H W Q nB oB",33:"G Z I D F E A eB XB gB hB iB jB YB"},F:{1:"C AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X uB Q",2:"E B pB qB rB sB W ZB",33:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{33:"D A"},K:{2:"A B C W ZB Q",33:"EB"},L:{1:"V"},M:{2:"N"},N:{2:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{33:"UC"},R:{2:"VC"},S:{2:"fB"}},B:3,C:"CSS grab & grabbing cursors"}},8546:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"lB bB G Z I D F E A B C O H P J K L a b c d e tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r"},E:{1:"E A B C O H jB YB W Q nB oB",33:"G Z I D F eB XB gB hB iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 C f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X uB Q",2:"E B pB qB rB sB W ZB",33:"P J K L a b c d e"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{33:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{2:"N"},N:{2:"A B"},O:{2:"LC"},P:{2:"G MC NC OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:4,C:"CSS3 Cursors: zoom-in & zoom-out"}},9807:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{2:"lB bB tB wB",33:"8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",164:"0 1 2 3 4 5 6 7 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},D:{1:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b",132:"c d e f g h i j k l m n o p q r s t u v w"},E:{1:"H nB oB",2:"G Z I eB XB gB",132:"D F E A B C O hB iB jB YB W Q"},F:{1:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E pB qB rB",132:"P J K L a b c d e f g h i j",164:"B C sB W ZB uB Q"},G:{1:"CC DC",2:"XB vB aB xB WC",132:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC"},H:{164:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB",132:"JC KC"},J:{132:"D A"},K:{1:"EB",2:"A",164:"B C W ZB Q"},L:{1:"V"},M:{33:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{164:"fB"}},B:5,C:"CSS3 tab-size"}},3714:e=>{e.exports={A:{A:{2:"I D F E mB",1028:"B",1316:"A"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",164:"lB bB G Z I D F E A B C O H P J K L a b c tB wB",516:"d e f g h i"},D:{1:"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"c d e f g h i j",164:"G Z I D F E A B C O H P J K L a b"},E:{1:"E A B C O H jB YB W Q nB oB",33:"D F hB iB",164:"G Z I eB XB gB"},F:{1:"0 1 2 3 4 5 6 7 8 9 K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E B C pB qB rB sB W ZB uB",33:"P J"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"F zB 0B",164:"XB vB aB xB WC"},H:{1:"EC"},I:{1:"M JC KC",164:"bB G FC GC HC IC aB"},J:{1:"A",164:"D"},K:{1:"EB Q",2:"A B C W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"B",292:"A"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS Flexible Box Layout Module"}},7011:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB tB wB",33:"P J K L a b c d e f g h i j k l m n o",164:"G Z I D F E A B C O H"},D:{1:"3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P",33:"0 1 2 c d e f g h i j k l m n o p q r s t u v w x y z",292:"J K L a b"},E:{1:"A B C O H jB YB W Q nB oB",2:"D F E eB XB hB iB",4:"G Z I gB"},F:{1:"0 1 2 3 4 5 6 7 8 9 q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d e f g h i j k l m n o p"},G:{1:"2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"F zB 0B 1B",4:"XB vB aB xB WC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB",33:"JC KC"},J:{2:"D",33:"A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",33:"G"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS font-feature-settings"}},9195:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P J K L"},C:{1:"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e tB wB",194:"f g h i j k l m n o"},D:{1:"0 1 2 3 4 5 6 7 8 9 o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f g h i j",33:"k l m n"},E:{1:"A B C O H jB YB W Q nB oB",2:"G Z I eB XB gB hB",33:"D F E iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P pB qB rB sB W ZB uB Q",33:"J K L a"},G:{2:"XB vB aB xB WC zB",33:"F 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M KC",2:"bB G FC GC HC IC aB",33:"JC"},J:{2:"D",33:"A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 font-kerning"}},5833:e=>{e.exports={A:{A:{2:"I D F E A mB",548:"B"},B:{1:"Y LB M N S T U V",516:"C O H P J K L"},C:{1:"JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E tB wB",676:"0 1 A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",1700:"2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB"},D:{1:"GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H",676:"P J K L a",804:"0 1 2 3 4 5 6 7 8 9 b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB"},E:{2:"G Z eB XB",676:"gB",804:"I D F E A B C O H hB iB jB YB W Q nB oB"},F:{1:"JB KB R MB NB OB PB GB X Q",2:"E B C pB qB rB sB W ZB uB",804:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB"},G:{2:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B",2052:"7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{2:"bB G M FC GC HC IC aB JC KC"},J:{2:"D",292:"A"},K:{2:"A B C W ZB Q",804:"EB"},L:{804:"V"},M:{1:"N"},N:{2:"A",548:"B"},O:{804:"LC"},P:{1:"YB RC SC TC",804:"G MC NC OC PC QC"},Q:{804:"UC"},R:{804:"VC"},S:{1:"fB"}},B:1,C:"Full Screen API"}},3794:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",1537:"Y LB M N S T U V"},C:{2:"lB",932:"0 1 2 3 4 5 6 7 8 9 bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB tB wB",2308:"R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U"},D:{2:"G Z I D F E A B C O H P J K L a b c",545:"0 d e f g h i j k l m n o p q r s t u v w x y z",1537:"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I eB XB gB",516:"B C O H W Q nB oB",548:"E A jB YB",676:"D F hB iB"},F:{2:"E B C pB qB rB sB W ZB uB Q",513:"p",545:"P J K L a b c d e f g h i j k l m n",1537:"0 1 2 3 4 5 6 7 8 9 o q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB aB xB WC",548:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",676:"F zB 0B"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",545:"JC KC",1537:"M"},J:{2:"D",545:"A"},K:{2:"A B C W ZB Q",1537:"EB"},L:{1537:"V"},M:{2340:"N"},N:{2:"A B"},O:{1:"LC"},P:{545:"G",1537:"MC NC OC PC QC YB RC SC TC"},Q:{545:"UC"},R:{1537:"VC"},S:{932:"fB"}},B:5,C:"Intrinsic & Extrinsic Sizing"}},1448:e=>{e.exports={A:{A:{1:"A B",2:"I D F E mB"},B:{1:"C O H P J K L",516:"Y LB M N S T U V"},C:{132:"7 8 9 AB BB CB DB EB FB RB HB IB JB",164:"0 1 2 3 4 5 6 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",516:"KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U"},D:{420:"0 1 2 3 4 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z",516:"5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"A B C O H YB W Q nB oB",132:"E jB",164:"D F iB",420:"G Z I eB XB gB hB"},F:{1:"C W ZB uB Q",2:"E B pB qB rB sB",420:"P J K L a b c d e f g h i j k l m n o p q r",516:"0 1 2 3 4 5 6 7 8 9 s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",132:"1B 2B",164:"F zB 0B",420:"XB vB aB xB WC"},H:{1:"EC"},I:{420:"bB G FC GC HC IC aB JC KC",516:"M"},J:{420:"D A"},K:{1:"C W ZB Q",2:"A B",516:"EB"},L:{516:"V"},M:{132:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",420:"G"},Q:{132:"UC"},R:{132:"VC"},S:{164:"fB"}},B:4,C:"CSS3 Multiple column layout"}},5147:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",2:"C O H P",260:"J K L"},C:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l"},E:{1:"A B C O H YB W Q nB oB",2:"G Z I D eB XB gB hB",132:"F E iB jB"},F:{1:"0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E P J K L pB qB rB",33:"B C sB W ZB uB Q"},G:{1:"3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB WC zB",132:"F 0B 1B 2B"},H:{33:"EC"},I:{1:"M KC",2:"bB G FC GC HC IC aB JC"},J:{2:"D A"},K:{1:"EB",2:"A",33:"B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{2:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 object-fit/object-position"}},6714:e=>{e.exports={A:{A:{1:"B",2:"I D F E mB",164:"A"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z tB wB",8:"I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v",328:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB"},D:{1:"AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B C O H P J K L a b c",8:"0 1 2 3 4 5 6 d e f g h i j k l m n o p q r s t u v w x y z",584:"7 8 9"},E:{1:"O H nB oB",2:"G Z I eB XB gB",8:"D F E A B C hB iB jB YB W",1096:"Q"},F:{1:"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",8:"P J K L a b c d e f g h i j k l m n o p q r s t",584:"u v w"},G:{1:"AC BC CC DC",8:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B",6148:"9B"},H:{2:"EC"},I:{1:"M",8:"bB G FC GC HC IC aB JC KC"},J:{8:"D A"},K:{1:"EB",2:"A",8:"B C W ZB Q"},L:{1:"V"},M:{328:"N"},N:{1:"B",36:"A"},O:{8:"LC"},P:{1:"NC OC PC QC YB RC SC TC",2:"MC",8:"G"},Q:{1:"UC"},R:{2:"VC"},S:{328:"fB"}},B:2,C:"Pointer events"}},6848:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",2052:"Y LB M N S T U V"},C:{2:"lB bB G Z tB wB",1028:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",1060:"I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q"},D:{2:"G Z I D F E A B C O H P J K L a b c d e f g",226:"0 1 2 3 4 5 6 7 8 9 h i j k l m n o p q r s t u v w x y z AB BB",2052:"CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{2:"G Z I D eB XB gB hB",772:"O H Q nB oB",804:"F E A B C jB YB W",1316:"iB"},F:{2:"E B C P J K L a b c d e f g h i j k l m n o p pB qB rB sB W ZB uB Q",226:"q r s t u v w x y",2052:"0 1 2 3 4 5 6 7 8 9 z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{2:"XB vB aB xB WC zB",292:"F 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{2:"A B C W ZB Q",2052:"EB"},L:{2052:"V"},M:{1:"N"},N:{2:"A B"},O:{2052:"LC"},P:{2:"G MC NC",2052:"OC PC QC YB RC SC TC"},Q:{2:"UC"},R:{1:"VC"},S:{1028:"fB"}},B:4,C:"text-decoration styling"}},5802:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{2:"C O H P J K L",164:"Y LB M N S T U V"},C:{1:"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z tB wB",322:"0"},D:{2:"G Z I D F E A B C O H P J K L a b c d e f",164:"0 1 2 3 4 5 6 7 8 9 g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"F E A B C O H iB jB YB W Q nB oB",2:"G Z I eB XB gB",164:"D hB"},F:{2:"E B C pB qB rB sB W ZB uB Q",164:"0 1 2 3 4 5 6 7 8 9 P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X"},G:{1:"F zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",2:"XB vB aB xB WC"},H:{2:"EC"},I:{2:"bB G FC GC HC IC aB",164:"M JC KC"},J:{2:"D",164:"A"},K:{2:"A B C W ZB Q",164:"EB"},L:{164:"V"},M:{1:"N"},N:{2:"A B"},O:{164:"LC"},P:{164:"G MC NC OC PC QC YB RC SC TC"},Q:{164:"UC"},R:{164:"VC"},S:{1:"fB"}},B:4,C:"text-emphasis styling"}},123:e=>{e.exports={A:{A:{1:"I D F E A B",2:"mB"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",8:"lB bB G Z I tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB"},E:{1:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X W ZB uB Q",33:"E pB qB rB sB"},G:{1:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{1:"EC"},I:{1:"bB G M FC GC HC IC aB JC KC"},J:{1:"D A"},K:{1:"EB Q",33:"A B C W ZB"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:4,C:"CSS3 Text-overflow"}},6421:e=>{e.exports={A:{A:{2:"I D F E A B mB"},B:{1:"Y LB M N S T U V",33:"C O H P J K L"},C:{2:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U tB wB"},D:{1:"9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"0 1 2 3 4 5 6 7 8 G Z I D F E A B C O H P J K L a b c d e f g i j k l m n o p q r s t u v w x y z",258:"h"},E:{2:"G Z I D F E A B C O H eB XB hB iB jB YB W Q nB oB",258:"gB"},F:{1:"0 1 2 3 4 5 6 7 8 9 y AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C P J K L a b c d e f g h i j k l m n o p q r s t u v w x z pB qB rB sB W ZB uB Q"},G:{2:"XB vB aB",33:"F xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"bB G FC GC HC IC aB JC KC"},J:{2:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{33:"N"},N:{161:"A B"},O:{1:"LC"},P:{1:"MC NC OC PC QC YB RC SC TC",2:"G"},Q:{2:"UC"},R:{2:"VC"},S:{2:"fB"}},B:7,C:"CSS text-size-adjust"}},762:e=>{e.exports={A:{A:{2:"mB",8:"I D F",129:"A B",161:"E"},B:{1:"K L Y LB M N S T U V",129:"C O H P J"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB",33:"G Z I D F E A B C O H P tB wB"},D:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q"},E:{1:"E A B C O H jB YB W Q nB oB",33:"G Z I D F eB XB gB hB iB"},F:{1:"0 1 2 3 4 5 6 7 8 9 e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X Q",2:"E pB qB",33:"B C P J K L a b c d rB sB W ZB uB"},G:{1:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC",33:"F XB vB aB xB WC zB 0B"},H:{2:"EC"},I:{1:"M",33:"bB G FC GC HC IC aB JC KC"},J:{33:"D A"},K:{1:"B C EB W ZB Q",2:"A"},L:{1:"V"},M:{1:"N"},N:{1:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS3 2D Transforms"}},58:e=>{e.exports={A:{A:{2:"I D F E mB",132:"A B"},B:{1:"C O H P J K L Y LB M N S T U V"},C:{1:"0 1 2 3 4 5 6 7 8 9 J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",2:"lB bB G Z I D F E tB wB",33:"A B C O H P"},D:{1:"0 1 2 3 4 5 6 7 8 9 r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",2:"G Z I D F E A B",33:"C O H P J K L a b c d e f g h i j k l m n o p q"},E:{2:"eB XB",33:"G Z I D F gB hB iB",257:"E A B C O H jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d"},G:{33:"F XB vB aB xB WC zB 0B",257:"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",2:"FC GC HC",33:"bB G IC aB JC KC"},J:{33:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{132:"A B"},O:{1:"LC"},P:{1:"G MC NC OC PC QC YB RC SC TC"},Q:{1:"UC"},R:{1:"VC"},S:{1:"fB"}},B:5,C:"CSS3 3D Transforms"}},7511:e=>{e.exports={A:{A:{2:"I D F E mB",33:"A B"},B:{1:"Y LB M N S T U V",33:"C O H P J K L"},C:{1:"OB PB GB X WB SB TB UB VB QB Y LB M kB N S T U",33:"0 1 2 3 4 5 6 7 8 9 lB bB G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB RB HB IB JB KB R MB NB tB wB"},D:{1:"9 AB BB CB DB EB FB RB HB IB JB KB R MB NB OB PB GB X WB SB TB UB VB QB Y LB M N S T U V yB cB dB",33:"0 1 2 3 4 5 6 7 8 G Z I D F E A B C O H P J K L a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{33:"G Z I D F E A B C O H eB XB gB hB iB jB YB W Q nB oB"},F:{1:"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB FB HB IB JB KB R MB NB OB PB GB X",2:"E B C pB qB rB sB W ZB uB Q",33:"P J K L a b c d e f g h i j k l m n o p q r s t u v"},G:{33:"F XB vB aB xB WC zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},H:{2:"EC"},I:{1:"M",33:"bB G FC GC HC IC aB JC KC"},J:{33:"D A"},K:{1:"EB",2:"A B C W ZB Q"},L:{1:"V"},M:{1:"N"},N:{33:"A B"},O:{2:"LC"},P:{1:"NC OC PC QC YB RC SC TC",33:"G MC"},Q:{1:"UC"},R:{2:"VC"},S:{33:"fB"}},B:5,C:"CSS user-select: none"}},9883:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/:blank([^\w-]|$)/gi;var o=n.plugin("css-blank-pseudo",e=>{const r=String(Object(e).replaceWith||"[blank]");const t=Boolean("preserve"in Object(e)?e.preserve:true);return e=>{e.walkRules(i,e=>{const n=e.selector.replace(i,(e,t)=>{return`${r}${t}`});const o=e.clone({selector:n});if(t){e.before(o)}else{e.replaceWith(o)}})}});e.exports=o},8410:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(653);var i=_interopRequireDefault(n);var o=t(6231);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},8168:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(8168);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},48:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},3570:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},6941:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},9283:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(48);var i=_interopRequireDefault(n);var o=t(3570);var s=_interopRequireDefault(o);var a=t(1187);var u=_interopRequireDefault(a);var f=t(6941);var c=_interopRequireDefault(f);var l=t(9511);var p=_interopRequireDefault(l);var h=t(3529);var B=_interopRequireDefault(h);var v=t(6867);var d=_interopRequireDefault(v);var b=t(9073);var y=_interopRequireDefault(b);var g=t(4020);var m=_interopRequireDefault(g);var C=t(1848);var w=_interopRequireDefault(C);var S=t(7415);var O=_interopRequireDefault(S);var T=t(8013);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},1559:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(2261);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},9511:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},6231:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(2261);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(9283);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(7472);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},5288:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},3877:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(1559);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},9073:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(1559);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},1848:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3877);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},7415:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5288);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},2261:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},8013:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5288);var i=_interopRequireDefault(n);var o=t(2261);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},627:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},6417:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},2771:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(6417);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},6358:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},2194:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},1044:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(2322);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(2194);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(6358);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(7706);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},7706:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},2322:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},9555:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(7712));var i=_interopDefault(t(4633));const o=/:has/;var s=i.plugin("css-has-pseudo",e=>{const r=Boolean("preserve"in Object(e)?e.preserve:true);return e=>{e.walkRules(o,e=>{const t=n(e=>{e.walkPseudos(e=>{if(e.value===":has"&&e.nodes){const r=checkIfParentIsNot(e);e.value=r?":not-has":":has";const t=n.attribute({attribute:encodeURIComponent(String(e)).replace(/%3A/g,":").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%2C/g,",").replace(/[():%\[\],]/g,"\\$&")});if(r){e.parent.parent.replaceWith(t)}else{e.replaceWith(t)}}})}).processSync(e.selector);const i=e.clone({selector:t});if(r){e.before(i)}else{e.replaceWith(i)}})}});function checkIfParentIsNot(e){return Object(Object(e.parent).parent).type==="pseudo"&&e.parent.parent.value===":not"}e.exports=s},2207:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/^media$/i;const o=/\(\s*prefers-color-scheme\s*:\s*(dark|light|no-preference)\s*\)/i;const s={dark:48,light:70,"no-preference":22};const a=(e,r)=>`(color-index: ${s[r.toLowerCase()]})`;var u=n.plugin("postcss-prefers-color-scheme",e=>{const r="preserve"in Object(e)?e.preserve:true;return e=>{e.walkAtRules(i,e=>{const t=e.params;const n=t.replace(o,a);if(t!==n){if(r){e.cloneBefore({params:n})}else{e.params=n}}})}});e.exports=u},5202:e=>{e.exports=function flatten(e,r){r=typeof r=="number"?r:Infinity;if(!r){if(Array.isArray(e)){return e.map(function(e){return e})}return e}return _flatten(e,1);function _flatten(e,t){return e.reduce(function(e,n){if(Array.isArray(n)&&t{e.exports=function(e,r){var t=-1,n=[];while((t=e.indexOf(r,t+1))!==-1)n.push(t);return n}},7478:e=>{var r=/<%=([\s\S]+?)%>/g;e.exports=r},8589:(e,r,t)=>{e=t.nmd(e);var n=t(7478),i=t(1623);var o=800,s=16;var a=1/0,u=9007199254740991;var f="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",p="[object Boolean]",h="[object Date]",B="[object DOMException]",v="[object Error]",d="[object Function]",b="[object GeneratorFunction]",y="[object Map]",g="[object Number]",m="[object Null]",C="[object Object]",w="[object Proxy]",S="[object RegExp]",O="[object Set]",T="[object String]",E="[object Symbol]",k="[object Undefined]",P="[object WeakMap]";var D="[object ArrayBuffer]",A="[object DataView]",R="[object Float32Array]",F="[object Float64Array]",x="[object Int8Array]",j="[object Int16Array]",I="[object Int32Array]",M="[object Uint8Array]",_="[object Uint8ClampedArray]",N="[object Uint16Array]",L="[object Uint32Array]";var q=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var J=/[\\^$.*+?()[\]{}|]/g;var W=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var Q=/^\[object .+?Constructor\]$/;var H=/^(?:0|[1-9]\d*)$/;var K=/($^)/;var Y=/['\n\r\u2028\u2029\\]/g;var z={};z[R]=z[F]=z[x]=z[j]=z[I]=z[M]=z[_]=z[N]=z[L]=true;z[f]=z[c]=z[D]=z[p]=z[A]=z[h]=z[v]=z[d]=z[y]=z[g]=z[C]=z[S]=z[O]=z[T]=z[P]=false;var $={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var X=typeof global=="object"&&global&&global.Object===Object&&global;var Z=typeof self=="object"&&self&&self.Object===Object&&self;var V=X||Z||Function("return this")();var ee=true&&r&&!r.nodeType&&r;var re=ee&&"object"=="object"&&e&&!e.nodeType&&e;var te=re&&re.exports===ee;var ne=te&&X.process;var ie=function(){try{var e=re&&re.require&&re.require("util").types;if(e){return e}return ne&&ne.binding&&ne.binding("util")}catch(e){}}();var oe=ie&&ie.isTypedArray;function apply(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}function arrayMap(e,r){var t=-1,n=e==null?0:e.length,i=Array(n);while(++t1?t[i-1]:undefined,s=i>2?t[2]:undefined;o=e.length>3&&typeof o=="function"?(i--,o):undefined;if(s&&isIterateeCall(t[0],t[1],s)){o=i<3?undefined:o;i=1}r=Object(r);while(++n-1&&e%1==0&&e0){if(++r>=o){return arguments[0]}}else{r=0}return e.apply(undefined,arguments)}}function toSource(e){if(e!=null){try{return fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eq(e,r){return e===r||e!==e&&r!==r}var De=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&ce.call(e,"callee")&&!ye.call(e,"callee")};var Ae=Array.isArray;function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}var Re=Ce||stubFalse;function isError(e){if(!isObjectLike(e)){return false}var r=baseGetTag(e);return r==v||r==B||typeof e.message=="string"&&typeof e.name=="string"&&!isPlainObject(e)}function isFunction(e){if(!isObject(e)){return false}var r=baseGetTag(e);return r==d||r==b||r==l||r==w}function isLength(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=u}function isObject(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function isObjectLike(e){return e!=null&&typeof e=="object"}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=C){return false}var r=be(e);if(r===null){return true}var t=ce.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&fe.call(t)==he}function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==E}var Fe=oe?baseUnary(oe):baseIsTypedArray;function toString(e){return e==null?"":baseToString(e)}var xe=createAssigner(function(e,r,t,n){copyObject(r,keysIn(r),e,n)});function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,true):baseKeysIn(e)}function template(e,r,t){var o=i.imports._.templateSettings||i;if(t&&isIterateeCall(e,r,t)){r=undefined}e=toString(e);r=xe({},r,o,customDefaultsAssignIn);var s=xe({},r.imports,o.imports,customDefaultsAssignIn),a=keys(s),u=baseValues(s,a);var f,c,l=0,p=r.interpolate||K,h="__p += '";var B=RegExp((r.escape||K).source+"|"+p.source+"|"+(p===n?W:K).source+"|"+(r.evaluate||K).source+"|$","g");var v=ce.call(r,"sourceURL")?"//# sourceURL="+(r.sourceURL+"").replace(/[\r\n]/g," ")+"\n":"";e.replace(B,function(r,t,n,i,o,s){n||(n=i);h+=e.slice(l,s).replace(Y,escapeStringChar);if(t){f=true;h+="' +\n__e("+t+") +\n'"}if(o){c=true;h+="';\n"+o+";\n__p += '"}if(n){h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"}l=s+r.length;return r});h+="';\n";var d=ce.call(r,"variable")&&r.variable;if(!d){h="with (obj) {\n"+h+"\n}\n"}h=(c?h.replace(q,""):h).replace(G,"$1").replace(U,"$1;");h="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(f?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var b=je(function(){return Function(a,v+"return "+h).apply(undefined,u)});b.source=h;if(isError(b)){throw b}return b}var je=baseRest(function(e,r){try{return apply(e,undefined,r)}catch(e){return isError(e)?e:new Error(e)}});function constant(e){return function(){return e}}function identity(e){return e}function stubFalse(){return false}e.exports=template},1623:(e,r,t)=>{var n=t(7478);var i=1/0;var o="[object Null]",s="[object Symbol]",a="[object Undefined]";var u=/[&<>"']/g,f=RegExp(u.source);var c=/<%-([\s\S]+?)%>/g,l=/<%([\s\S]+?)%>/g;var p={"&":"&","<":"<",">":">",'"':""","'":"'"};var h=typeof global=="object"&&global&&global.Object===Object&&global;var B=typeof self=="object"&&self&&self.Object===Object&&self;var v=h||B||Function("return this")();function arrayMap(e,r){var t=-1,n=e==null?0:e.length,i=Array(n);while(++t{"use strict";e.exports={wrap:wrapRange,limit:limitRange,validate:validateRange,test:testRange,curry:curry,name:name};function wrapRange(e,r,t){var n=r-e;return((t-e)%n+n)%n+e}function limitRange(e,r,t){return Math.max(e,Math.min(r,t))}function validateRange(e,r,t,n,i){if(!testRange(e,r,t,n,i)){throw new Error(t+" is outside of range ["+e+","+r+")")}return t}function testRange(e,r,t,n,i){return!(tr||i&&t===r||n&&t===e)}function name(e,r,t,n){return(t?"(":"[")+e+","+r+(n?")":"]")}function curry(e,r,t,n){var i=name.bind(null,e,r,t,n);return{wrap:wrapRange.bind(null,e,r),limit:limitRange.bind(null,e,r),validate:function(i){return validateRange(e,r,i,t,n)},test:function(i){return testRange(e,r,i,t,n)},toString:i,name:i}}},9108:e=>{"use strict";var r=Math.abs;var t=Math.round;function almostEq(e,t){return r(e-t)<=9.5367432e-7}function GCD(e,r){if(almostEq(r,0))return e;return GCD(r,e%r)}function findPrecision(e){var r=1;while(!almostEq(t(e*r)/r,e)){r*=10}return r}function num2fraction(e){if(e===0||e==="0")return"0";if(typeof e==="string"){e=parseFloat(e)}var n=findPrecision(e);var i=e*n;var o=r(GCD(i,n));var s=i/o;var a=n/o;return t(s)+"/"+t(a)}e.exports=num2fraction},2347:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var n=t(4633);var i=_interopRequireDefault(n);var o=t(3507);var s=_interopRequireDefault(o);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function nodeIsInsensitiveAttribute(e){return e.type==="attribute"&&e.insensitive}function selectorHasInsensitiveAttribute(e){return e.some(nodeIsInsensitiveAttribute)}function transformString(e,r,t){var n=t.charAt(r);if(n===""){return e}var i=e.map(function(e){return e+n});var o=n.toLocaleUpperCase();if(o!==n){i=i.concat(e.map(function(e){return e+o}))}return transformString(i,r+1,t)}function createSensitiveAtributes(e){var r=transformString([""],0,e.value);return r.map(function(r){var t=e.clone({spaces:{after:e.spaces.after,before:e.spaces.before},insensitive:false});t.setValue(r);return t})}function createNewSelectors(e){var r=[s.default.selector()];e.walk(function(e){if(!nodeIsInsensitiveAttribute(e)){r.forEach(function(r){r.append(e.clone())});return}var t=createSensitiveAtributes(e);var n=[];t.forEach(function(e){r.forEach(function(r){var t=r.clone();t.append(e);n.push(t)})});r=n});return r}function transform(e){var r=[];e.each(function(e){if(selectorHasInsensitiveAttribute(e)){r=r.concat(createNewSelectors(e));e.remove()}});if(r.length){r.forEach(function(r){return e.append(r)})}}var a=/i(\s*\/\*[\W\w]*?\*\/)*\s*\]/;r.default=i.default.plugin("postcss-attribute-case-insensitive",function(){return function(e){e.walkRules(a,function(e){e.selector=(0,s.default)(transform).processSync(e.selector)})}});e.exports=r.default},6608:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(5160);var i=_interopRequireDefault(n);var o=t(3966);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},3373:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(3373);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},8448:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},3556:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},3522:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},6001:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(8448);var i=_interopRequireDefault(n);var o=t(3556);var s=_interopRequireDefault(o);var a=t(4310);var u=_interopRequireDefault(a);var f=t(3522);var c=_interopRequireDefault(f);var l=t(6545);var p=_interopRequireDefault(l);var h=t(2704);var B=_interopRequireDefault(h);var v=t(9173);var d=_interopRequireDefault(v);var b=t(7792);var y=_interopRequireDefault(b);var g=t(5396);var m=_interopRequireDefault(g);var C=t(6776);var w=_interopRequireDefault(C);var S=t(2066);var O=_interopRequireDefault(S);var T=t(707);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},7507:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(4436);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},6545:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},3966:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(4436);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(6001);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(5771);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},8807:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},3366:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(7507);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},7792:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(7507);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},6776:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3366);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},2066:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(8807);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},4436:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},707:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(8807);var i=_interopRequireDefault(n);var o=t(4436);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},4772:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},1406:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},2258:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(1406);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},8039:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},9501:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},6266:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(1010);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(9501);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(8039);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(6972);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},6972:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},1010:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},7814:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=n.plugin("postcss-color-functional-notation",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):false;return e=>{e.walkDecls(e=>{const t=e.value;if(u.test(t)){const n=i(t).parse();n.walkType("func",e=>{if(f.test(e.value)){const r=e.nodes.slice(1,-1);const t=P(e,r);const n=D(e,r);const i=A(e,r);if(t||n||i){const t=r[3];const n=r[4];if(n){if(g(n)&&!d(n)){n.unit="";n.value=String(n.value/100)}if(C(e)){e.value+="a"}}else if(w(e)){e.value=e.value.slice(0,-1)}if(t&&O(t)){t.replaceWith(R())}if(i){r[0].unit=r[1].unit=r[2].unit="";r[0].value=String(Math.floor(r[0].value*255/100));r[1].value=String(Math.floor(r[1].value*255/100));r[2].value=String(Math.floor(r[2].value*255/100))}e.nodes.splice(3,0,[R()]);e.nodes.splice(2,0,[R()])}}});const o=String(n);if(o!==t){if(r){e.cloneBefore({value:o})}else{e.value=o}}}})}});const s=/^%?$/i;const a=/^calc$/i;const u=/(^|[^\w-])(hsla?|rgba?)\(/i;const f=/^(hsla?|rgba?)$/i;const c=/^hsla?$/i;const l=/^(hsl|rgb)$/i;const p=/^(hsla|rgba)$/i;const h=/^(deg|grad|rad|turn)?$/i;const B=/^rgba?$/i;const v=e=>d(e)||e.type==="number"&&s.test(e.unit);const d=e=>e.type==="func"&&a.test(e.value);const b=e=>d(e)||e.type==="number"&&h.test(e.unit);const y=e=>d(e)||e.type==="number"&&e.unit==="";const g=e=>d(e)||e.type==="number"&&(e.unit==="%"||e.unit===""&&e.value==="0");const m=e=>e.type==="func"&&c.test(e.value);const C=e=>e.type==="func"&&l.test(e.value);const w=e=>e.type==="func"&&p.test(e.value);const S=e=>e.type==="func"&&B.test(e.value);const O=e=>e.type==="operator"&&e.value==="/";const T=[b,g,g,O,v];const E=[y,y,y,O,v];const k=[g,g,g,O,v];const P=(e,r)=>m(e)&&r.every((e,r)=>typeof T[r]==="function"&&T[r](e));const D=(e,r)=>S(e)&&r.every((e,r)=>typeof E[r]==="function"&&E[r](e));const A=(e,r)=>S(e)&&r.every((e,r)=>typeof k[r]==="function"&&k[r](e));const R=()=>i.comma({value:","});e.exports=o},489:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=t(4567);function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,r){var t=[];var n=true;var i=false;var o=undefined;try{for(var s=e[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){t.push(a.value);if(r&&t.length===r)break}}catch(e){i=true;o=e}finally{try{if(!n&&s["return"]!=null)s["return"]()}finally{if(i)throw o}}return t}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var s=n.plugin("postcss-color-gray",e=>r=>{r.walkDecls(r=>{if(u(r)){const t=r.value;const n=i(t).parse();n.walk(e=>{const r=S(e),t=_slicedToArray(r,2),n=t[0],s=t[1];if(n!==undefined){e.value="rgb";const r=o.lab2rgb(n,0,0).map(e=>Math.max(Math.min(Math.round(e*2.55),255),0)),t=_slicedToArray(r,3),a=t[0],u=t[1],f=t[2];const c=e.first;const l=e.last;e.removeAll().append(c).append(i.number({value:a})).append(i.comma({value:","})).append(i.number({value:u})).append(i.comma({value:","})).append(i.number({value:f}));if(s<1){e.value+="a";e.append(i.comma({value:","})).append(i.number({value:s}))}e.append(l)}});const s=n.toString();if(t!==s){if(Object(e).preserve){r.cloneBefore({value:s})}else{r.value=s}}}})});const a=/(^|[^\w-])gray\(/i;const u=e=>a.test(Object(e).value);const f=e=>Object(e).type==="number";const c=e=>Object(e).type==="operator";const l=e=>Object(e).type==="func";const p=/^calc$/i;const h=e=>l(e)&&p.test(e.value);const B=/^gray$/i;const v=e=>l(e)&&B.test(e.value)&&e.nodes&&e.nodes.length;const d=e=>f(e)&&e.unit==="%";const b=e=>f(e)&&e.unit==="";const y=e=>c(e)&&e.value==="/";const g=e=>b(e)?Number(e.value):undefined;const m=e=>y(e)?null:undefined;const C=e=>h(e)?String(e):b(e)?Number(e.value):d(e)?Number(e.value)/100:undefined;const w=[g,m,C];const S=e=>{const r=[];if(v(e)){const t=e.nodes.slice(1,-1);for(const e in t){const n=typeof w[e]==="function"?w[e](t[e]):undefined;if(n!==undefined){if(n!==null){r.push(n)}}else{return[]}}return r}else{return[]}};e.exports=s},8157:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=n.plugin("postcss-color-hex-alpha",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):false;return e=>{e.walkDecls(e=>{if(a(e)){const t=i(e.value).parse();f(t,e=>{if(l(e)){e.replaceWith(p(e))}});const n=String(t);if(e.value!==n){if(r){e.cloneBefore({value:n})}else{e.value=n}}}})}});const s=/#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)\b/;const a=e=>s.test(e.value);const u=/^#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)$/;const f=(e,r)=>{if(Object(e.nodes).length){e.nodes.slice().forEach(e=>{r(e);f(e,r)})}};const c=1e5;const l=e=>e.type==="word"&&u.test(e.value);const p=e=>{const r=e.value;const t=`0x${r.length===5?r.slice(1).replace(/[0-9A-f]/g,"$&$&"):r.slice(1)}`;const n=[parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),parseInt(t.slice(6,8),16),Math.round(parseInt(t.slice(8,10),16)/255*c)/c],o=n[0],s=n[1],a=n[2],u=n[3];const f=i.func({value:"rgba",raws:Object.assign({},e.raws)});f.append(i.paren({value:"("}));f.append(i.number({value:o}));f.append(i.comma({value:","}));f.append(i.number({value:s}));f.append(i.comma({value:","}));f.append(i.number({value:a}));f.append(i.comma({value:","}));f.append(i.number({value:u}));f.append(i.paren({value:")"}));return f};e.exports=o},8881:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(9448));var i=_interopDefault(t(5747));var o=_interopDefault(t(5622));var s=_interopDefault(t(4633));var a=t(4567);function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function _defineProperty(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function _objectSpread(e){for(var r=1;r{const o=l(e)?t:p(e)?i:null;if(o){e.nodes.slice().forEach(e=>{if(h(e)){const t=e.prop;o[t]=n(e.value).parse();if(!r.preserve){e.remove()}}});if(!r.preserve&&B(e)){e.remove()}}});return _objectSpread({},t,i)}const u=/^html$/i;const f=/^:root$/i;const c=/^--[A-z][\w-]*$/;const l=e=>e.type==="rule"&&u.test(e.selector)&&Object(e.nodes).length;const p=e=>e.type==="rule"&&f.test(e.selector)&&Object(e.nodes).length;const h=e=>e.type==="decl"&&c.test(e.prop);const B=e=>Object(e.nodes).length===0;function importCustomPropertiesFromCSSAST(e){return getCustomProperties(e,{preserve:true})}function importCustomPropertiesFromCSSFile(e){return _importCustomPropertiesFromCSSFile.apply(this,arguments)}function _importCustomPropertiesFromCSSFile(){_importCustomPropertiesFromCSSFile=_asyncToGenerator(function*(e){const r=yield v(e);const t=s.parse(r,{from:e});return importCustomPropertiesFromCSSAST(t)});return _importCustomPropertiesFromCSSFile.apply(this,arguments)}function importCustomPropertiesFromObject(e){const r=Object.assign({},Object(e).customProperties||Object(e)["custom-properties"]);for(const e in r){r[e]=n(r[e]).parse()}return r}function importCustomPropertiesFromJSONFile(e){return _importCustomPropertiesFromJSONFile.apply(this,arguments)}function _importCustomPropertiesFromJSONFile(){_importCustomPropertiesFromJSONFile=_asyncToGenerator(function*(e){const r=yield d(e);return importCustomPropertiesFromObject(r)});return _importCustomPropertiesFromJSONFile.apply(this,arguments)}function importCustomPropertiesFromJSFile(e){return _importCustomPropertiesFromJSFile.apply(this,arguments)}function _importCustomPropertiesFromJSFile(){_importCustomPropertiesFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(e));return importCustomPropertiesFromObject(r)});return _importCustomPropertiesFromJSFile.apply(this,arguments)}function importCustomPropertiesFromSources(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(r.customProperties||r["custom-properties"]){return r}const t=o.resolve(String(r.from||""));const n=(r.type||o.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="ast"){return Object.assign(yield e,importCustomPropertiesFromCSSAST(i))}if(n==="css"){return Object.assign(yield e,yield importCustomPropertiesFromCSSFile(i))}if(n==="js"){return Object.assign(yield e,yield importCustomPropertiesFromJSFile(i))}if(n==="json"){return Object.assign(yield e,yield importCustomPropertiesFromJSONFile(i))}return Object.assign(yield e,yield importCustomPropertiesFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const v=e=>new Promise((r,t)=>{i.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const d=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield v(e))});return function readJSON(r){return e.apply(this,arguments)}}();function convertDtoD(e){return e%360}function convertGtoD(e){return e*.9%360}function convertRtoD(e){return e*180/Math.PI%360}function convertTtoD(e){return e*360%360}function convertNtoRGB(e){const r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],transparent:[0,0,0],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};return r[e]&&r[e].map(e=>e/2.55)}function convertHtoRGB(e){const r=(e.match(b)||[]).slice(1),t=_slicedToArray(r,8),n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],f=t[6],c=t[7];if(a!==undefined||n!==undefined){const e=a!==undefined?parseInt(a,16):n!==undefined?parseInt(n+n,16):0;const r=u!==undefined?parseInt(u,16):i!==undefined?parseInt(i+i,16):0;const t=f!==undefined?parseInt(f,16):o!==undefined?parseInt(o+o,16):0;const l=c!==undefined?parseInt(c,16):s!==undefined?parseInt(s+s,16):255;return[e,r,t,l].map(e=>e/2.55)}return undefined}const b=/^#(?:([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?)$/i;class Color{constructor(e){this.color=Object(Object(e).color||e);this.color.colorspace=this.color.colorspace?this.color.colorspace:"red"in e&&"green"in e&&"blue"in e?"rgb":"hue"in e&&"saturation"in e&&"lightness"in e?"hsl":"hue"in e&&"whiteness"in e&&"blackness"in e?"hwb":"unknown";if(e.colorspace==="rgb"){this.color.hue=a.rgb2hue(e.red,e.green,e.blue,e.hue||0)}}alpha(e){const r=this.color;return e===undefined?r.alpha:new Color(assign(r,{alpha:e}))}blackness(e){const r=color2hwb(this.color);return e===undefined?r.blackness:new Color(assign(r,{blackness:e}))}blend(e,r,t="rgb"){const n=this.color;return new Color(blend(n,e,r,t))}blenda(e,r,t="rgb"){const n=this.color;return new Color(blend(n,e,r,t,true))}blue(e){const r=color2rgb(this.color);return e===undefined?r.blue:new Color(assign(r,{blue:e}))}contrast(e){const r=this.color;return new Color(contrast(r,e))}green(e){const r=color2rgb(this.color);return e===undefined?r.green:new Color(assign(r,{green:e}))}hue(e){const r=color2hsl(this.color);return e===undefined?r.hue:new Color(assign(r,{hue:e}))}lightness(e){const r=color2hsl(this.color);return e===undefined?r.lightness:new Color(assign(r,{lightness:e}))}red(e){const r=color2rgb(this.color);return e===undefined?r.red:new Color(assign(r,{red:e}))}rgb(e,r,t){const n=color2rgb(this.color);return new Color(assign(n,{red:e,green:r,blue:t}))}saturation(e){const r=color2hsl(this.color);return e===undefined?r.saturation:new Color(assign(r,{saturation:e}))}shade(e){const r=color2hwb(this.color);const t={hue:0,whiteness:0,blackness:100,colorspace:"hwb"};const n="rgb";return e===undefined?r.blackness:new Color(blend(r,t,e,n))}tint(e){const r=color2hwb(this.color);const t={hue:0,whiteness:100,blackness:0,colorspace:"hwb"};const n="rgb";return e===undefined?r.blackness:new Color(blend(r,t,e,n))}whiteness(e){const r=color2hwb(this.color);return e===undefined?r.whiteness:new Color(assign(r,{whiteness:e}))}toHSL(){return color2hslString(this.color)}toHWB(){return color2hwbString(this.color)}toLegacy(){return color2legacyString(this.color)}toRGB(){return color2rgbString(this.color)}toRGBLegacy(){return color2rgbLegacyString(this.color)}toString(){return color2string(this.color)}}function blend(e,r,t,n,i){const o=t/100;const s=1-o;if(n==="hsl"){const t=color2hsl(e),n=t.hue,a=t.saturation,u=t.lightness,f=t.alpha;const c=color2hsl(r),l=c.hue,p=c.saturation,h=c.lightness,B=c.alpha;const v=n*s+l*o,d=a*s+p*o,b=u*s+h*o,y=i?f*s+B*o:f;return{hue:v,saturation:d,lightness:b,alpha:y,colorspace:"hsl"}}else if(n==="hwb"){const t=color2hwb(e),n=t.hue,a=t.whiteness,u=t.blackness,f=t.alpha;const c=color2hwb(r),l=c.hue,p=c.whiteness,h=c.blackness,B=c.alpha;const v=n*s+l*o,d=a*s+p*o,b=u*s+h*o,y=i?f*s+B*o:f;return{hue:v,whiteness:d,blackness:b,alpha:y,colorspace:"hwb"}}else{const t=color2rgb(e),n=t.red,a=t.green,u=t.blue,f=t.alpha;const c=color2rgb(r),l=c.red,p=c.green,h=c.blue,B=c.alpha;const v=n*s+l*o,d=a*s+p*o,b=u*s+h*o,y=i?f*s+B*o:f;return{red:v,green:d,blue:b,alpha:y,colorspace:"rgb"}}}function assign(e,r){const t=Object.assign({},e);Object.keys(r).forEach(n=>{const i=n==="hue";const o=!i&&y.test(n);const s=normalize(r[n],n);t[n]=s;if(o){t.hue=a.rgb2hue(t.red,t.green,t.blue,e.hue||0)}});return t}function normalize(e,r){const t=r==="hue";const n=0;const i=t?360:100;const o=Math.min(Math.max(t?e%360:e,n),i);return o}function color2rgb(e){const r=e.colorspace==="hsl"?a.hsl2rgb(e.hue,e.saturation,e.lightness):e.colorspace==="hwb"?a.hwb2rgb(e.hue,e.whiteness,e.blackness):[e.red,e.green,e.blue],t=_slicedToArray(r,3),n=t[0],i=t[1],o=t[2];return{red:n,green:i,blue:o,hue:e.hue,alpha:e.alpha,colorspace:"rgb"}}function color2hsl(e){const r=e.colorspace==="rgb"?a.rgb2hsl(e.red,e.green,e.blue,e.hue):e.colorspace==="hwb"?a.hwb2hsl(e.hue,e.whiteness,e.blackness):[e.hue,e.saturation,e.lightness],t=_slicedToArray(r,3),n=t[0],i=t[1],o=t[2];return{hue:n,saturation:i,lightness:o,alpha:e.alpha,colorspace:"hsl"}}function color2hwb(e){const r=e.colorspace==="rgb"?a.rgb2hwb(e.red,e.green,e.blue,e.hue):e.colorspace==="hsl"?a.hsl2hwb(e.hue,e.saturation,e.lightness):[e.hue,e.whiteness,e.blackness],t=_slicedToArray(r,3),n=t[0],i=t[1],o=t[2];return{hue:n,whiteness:i,blackness:o,alpha:e.alpha,colorspace:"hwb"}}function contrast(e,r){const t=color2hwb(e);const n=color2rgb(e);const i=rgb2luminance(n.red,n.green,n.blue);const o=i<.5?{hue:t.hue,whiteness:100,blackness:0,alpha:t.alpha,colorspace:"hwb"}:{hue:t.hue,whiteness:0,blackness:100,alpha:t.alpha,colorspace:"hwb"};const s=colors2contrast(e,o);const a=s>4.5?colors2contrastRatioColor(t,o):o;return blend(o,a,r,"hwb",false)}function colors2contrast(e,r){const t=color2rgb(e);const n=color2rgb(r);const i=rgb2luminance(t.red,t.green,t.blue);const o=rgb2luminance(n.red,n.green,n.blue);return i>o?(i+.05)/(o+.05):(o+.05)/(i+.05)}function rgb2luminance(e,r,t){const n=[channel2luminance(e),channel2luminance(r),channel2luminance(t)],i=n[0],o=n[1],s=n[2];const a=.2126*i+.7152*o+.0722*s;return a}function channel2luminance(e){const r=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return r}function colors2contrastRatioColor(e,r){const t=Object.assign({},e);let n=e.whiteness;let i=e.blackness;let o=r.whiteness;let s=r.blackness;while(Math.abs(n-o)>100||Math.abs(i-s)>100){const r=Math.round((o+n)/2);const a=Math.round((s+i)/2);t.whiteness=r;t.blackness=a;if(colors2contrast(t,e)>4.5){o=r;s=a}else{n=r;i=a}}return t}const y=/^(blue|green|red)$/i;function color2string(e){return e.colorspace==="hsl"?color2hslString(e):e.colorspace==="hwb"?color2hwbString(e):color2rgbString(e)}function color2hslString(e){const r=color2hsl(e);const t=r.alpha===100;const n=r.hue;const i=Math.round(r.saturation*1e10)/1e10;const o=Math.round(r.lightness*1e10)/1e10;const s=Math.round(r.alpha*1e10)/1e10;return`hsl(${n} ${i}% ${o}%${t?"":` / ${s}%`})`}function color2hwbString(e){const r=color2hwb(e);const t=r.alpha===100;const n=r.hue;const i=Math.round(r.whiteness*1e10)/1e10;const o=Math.round(r.blackness*1e10)/1e10;const s=Math.round(r.alpha*1e10)/1e10;return`hwb(${n} ${i}% ${o}%${t?"":` / ${s}%`})`}function color2rgbString(e){const r=color2rgb(e);const t=r.alpha===100;const n=Math.round(r.red*1e10)/1e10;const i=Math.round(r.green*1e10)/1e10;const o=Math.round(r.blue*1e10)/1e10;const s=Math.round(r.alpha*1e10)/1e10;return`rgb(${n}% ${i}% ${o}%${t?"":` / ${s}%`})`}function color2legacyString(e){return e.colorspace==="hsl"?color2hslLegacyString(e):color2rgbLegacyString(e)}function color2rgbLegacyString(e){const r=color2rgb(e);const t=r.alpha===100;const n=t?"rgb":"rgba";const i=Math.round(r.red*255/100);const o=Math.round(r.green*255/100);const s=Math.round(r.blue*255/100);const a=Math.round(r.alpha/100*1e10)/1e10;return`${n}(${i}, ${o}, ${s}${t?"":`, ${a}`})`}function color2hslLegacyString(e){const r=color2hsl(e);const t=r.alpha===100;const n=t?"hsl":"hsla";const i=r.hue;const o=Math.round(r.saturation*1e10)/1e10;const s=Math.round(r.lightness*1e10)/1e10;const a=Math.round(r.alpha/100*1e10)/1e10;return`${n}(${i}, ${o}%, ${s}%${t?"":`, ${a}`})`}function manageUnresolved(e,r,t,n){if("warn"===r.unresolved){r.decl.warn(r.result,n,{word:t})}else if("ignore"!==r.unresolved){throw r.decl.error(n,{word:t})}}function transformAST(e,r){e.nodes.slice(0).forEach(e=>{if(isColorModFunction(e)){if(r.transformVars){transformVariables(e,r)}const t=transformColorModFunction(e,r);if(t){e.replaceWith(n.word({raws:e.raws,value:r.stringifier(t)}))}}else if(e.nodes&&Object(e.nodes).length){transformAST(e,r)}})}function transformVariables(e,r){walk(e,e=>{if(isVariable(e)){const t=transformArgsByParams(e,[[transformWord,isComma,transformNode]]),n=_slicedToArray(t,2),i=n[0],o=n[1];if(i in r.customProperties){let t=r.customProperties[i];if(_.test(t)){const e=t.clone();transformVariables(e,r);t=e}if(t.nodes.length===1&&t.nodes[0].nodes.length){t.nodes[0].nodes.forEach(r=>{e.parent.insertBefore(e,r)})}e.remove()}else if(o&&o.nodes.length===1&&o.nodes[0].nodes.length){transformVariables(o,r);e.replaceWith(...o.nodes[0].nodes[0])}}})}function transformColor(e,r){if(isRGBFunction(e)){return transformRGBFunction(e,r)}else if(isHSLFunction(e)){return transformHSLFunction(e,r)}else if(isHWBFunction(e)){return transformHWBFunction(e,r)}else if(isColorModFunction(e)){return transformColorModFunction(e,r)}else if(isHexColor(e)){return transformHexColor(e,r)}else if(isNamedColor(e)){return transformNamedColor(e,r)}else{return manageUnresolved(e,r,e.value,`Expected a color`)}}function transformRGBFunction(e,r){const t=transformArgsByParams(e,[[transformPercentage,transformPercentage,transformPercentage,isSlash,transformAlpha],[transformRGBNumber,transformRGBNumber,transformRGBNumber,isSlash,transformAlpha],[transformPercentage,isComma,transformPercentage,isComma,transformPercentage,isComma,transformAlpha],[transformRGBNumber,isComma,transformRGBNumber,isComma,transformRGBNumber,isComma,transformAlpha]]),n=_slicedToArray(t,4),i=n[0],o=n[1],s=n[2],a=n[3],u=a===void 0?100:a;if(i!==undefined){const e=new Color({red:i,green:o,blue:s,alpha:u,colorspace:"rgb"});return e}else{return manageUnresolved(e,r,e.value,`Expected a valid rgb() function`)}}function transformHSLFunction(e,r){const t=transformArgsByParams(e,[[transformHue,transformPercentage,transformPercentage,isSlash,transformAlpha],[transformHue,isComma,transformPercentage,isComma,transformPercentage,isComma,transformAlpha]]),n=_slicedToArray(t,4),i=n[0],o=n[1],s=n[2],a=n[3],u=a===void 0?100:a;if(s!==undefined){const e=new Color({hue:i,saturation:o,lightness:s,alpha:u,colorspace:"hsl"});return e}else{return manageUnresolved(e,r,e.value,`Expected a valid hsl() function`)}}function transformHWBFunction(e,r){const t=transformArgsByParams(e,[[transformHue,transformPercentage,transformPercentage,isSlash,transformAlpha]]),n=_slicedToArray(t,4),i=n[0],o=n[1],s=n[2],a=n[3],u=a===void 0?100:a;if(s!==undefined){const e=new Color({hue:i,whiteness:o,blackness:s,alpha:u,colorspace:"hwb"});return e}else{return manageUnresolved(e,r,e.value,`Expected a valid hwb() function`)}}function transformColorModFunction(e,r){const t=(e.nodes||[]).slice(1,-1)||[],n=_toArray(t),i=n[0],o=n.slice(1);if(i!==undefined){const t=isHue(i)?new Color({hue:transformHue(i,r),saturation:100,lightness:50,alpha:100,colorspace:"hsl"}):transformColor(i,r);if(t){const e=transformColorByAdjusters(t,o,r);return e}else{return manageUnresolved(e,r,e.value,`Expected a valid color`)}}else{return manageUnresolved(e,r,e.value,`Expected a valid color-mod() function`)}}function transformHexColor(e,r){if(E.test(e.value)){const r=convertHtoRGB(e.value),t=_slicedToArray(r,4),n=t[0],i=t[1],o=t[2],s=t[3];const a=new Color({red:n,green:i,blue:o,alpha:s});return a}else{return manageUnresolved(e,r,e.value,`Expected a valid hex color`)}}function transformNamedColor(e,r){if(isNamedColor(e)){const r=convertNtoRGB(e.value),t=_slicedToArray(r,3),n=t[0],i=t[1],o=t[2];const s=new Color({red:n,green:i,blue:o,alpha:100,colorspace:"rgb"});return s}else{return manageUnresolved(e,r,e.value,`Expected a valid named-color`)}}function transformColorByAdjusters(e,r,t){const n=r.reduce((e,r)=>{if(isAlphaBlueGreenRedAdjuster(r)){return transformAlphaBlueGreenRedAdjuster(e,r,t)}else if(isRGBAdjuster(r)){return transformRGBAdjuster(e,r,t)}else if(isHueAdjuster(r)){return transformHueAdjuster(e,r,t)}else if(isBlacknessLightnessSaturationWhitenessAdjuster(r)){return transformBlacknessLightnessSaturationWhitenessAdjuster(e,r,t)}else if(isShadeTintAdjuster(r)){return transformShadeTintAdjuster(e,r,t)}else if(isBlendAdjuster(r)){return transformBlendAdjuster(e,r,r.value==="blenda",t)}else if(isContrastAdjuster(r)){return transformContrastAdjuster(e,r,t)}else{manageUnresolved(r,t,r.value,`Expected a valid color adjuster`);return e}},e);return n}function transformAlphaBlueGreenRedAdjuster(e,r,t){const n=transformArgsByParams(r,g.test(r.value)?[[transformMinusPlusOperator,transformAlpha],[transformTimesOperator,transformPercentage],[transformAlpha]]:[[transformMinusPlusOperator,transformPercentage],[transformMinusPlusOperator,transformRGBNumber],[transformTimesOperator,transformPercentage],[transformPercentage],[transformRGBNumber]]),i=_slicedToArray(n,2),o=i[0],s=i[1];if(o!==undefined){const t=r.value.toLowerCase().replace(g,"alpha");const n=e[t]();const i=s!==undefined?o==="+"?n+Number(s):o==="-"?n-Number(s):o==="*"?n*Number(s):Number(s):Number(o);const a=e[t](i);return a}else{return manageUnresolved(r,t,r.value,`Expected a valid modifier()`)}}function transformRGBAdjuster(e,r,t){const n=transformArgsByParams(r,[[transformMinusPlusOperator,transformPercentage,transformPercentage,transformPercentage],[transformMinusPlusOperator,transformRGBNumber,transformRGBNumber,transformRGBNumber],[transformMinusPlusOperator,transformHexColor],[transformTimesOperator,transformPercentage]]),i=_slicedToArray(n,4),o=i[0],s=i[1],a=i[2],u=i[3];if(s!==undefined&&s.color){const r=e.rgb(o==="+"?e.red()+s.red():e.red()-s.red(),o==="+"?e.green()+s.green():e.green()-s.green(),o==="+"?e.blue()+s.blue():e.blue()-s.blue());return r}else if(o!==undefined&&R.test(o)){const r=e.rgb(o==="+"?e.red()+s:e.red()-s,o==="+"?e.green()+a:e.green()-a,o==="+"?e.blue()+u:e.blue()-u);return r}else if(o!==undefined&&s!==undefined){const r=e.rgb(e.red()*s,e.green()*s,e.blue()*s);return r}else{return manageUnresolved(r,t,r.value,`Expected a valid rgb() adjuster`)}}function transformBlendAdjuster(e,r,t,n){const i=transformArgsByParams(r,[[transformColor,transformPercentage,transformColorSpace]]),o=_slicedToArray(i,3),s=o[0],a=o[1],u=o[2],f=u===void 0?"rgb":u;if(a!==undefined){const r=t?e.blenda(s.color,a,f):e.blend(s.color,a,f);return r}else{return manageUnresolved(r,n,r.value,`Expected a valid blend() adjuster)`)}}function transformContrastAdjuster(e,r,t){const n=transformArgsByParams(r,[[transformPercentage]]),i=_slicedToArray(n,1),o=i[0];if(o!==undefined){const r=e.contrast(o);return r}else{return manageUnresolved(r,t,r.value,`Expected a valid contrast() adjuster)`)}}function transformHueAdjuster(e,r,t){const n=transformArgsByParams(r,[[transformMinusPlusTimesOperator,transformHue],[transformHue]]),i=_slicedToArray(n,2),o=i[0],s=i[1];if(o!==undefined){const r=e.hue();const t=s!==undefined?o==="+"?r+Number(s):o==="-"?r-Number(s):o==="*"?r*Number(s):Number(s):Number(o);return e.hue(t)}else{return manageUnresolved(r,t,r.value,`Expected a valid hue() function)`)}}function transformBlacknessLightnessSaturationWhitenessAdjuster(e,r,t){const n=r.value.toLowerCase().replace(/^b$/,"blackness").replace(/^l$/,"lightness").replace(/^s$/,"saturation").replace(/^w$/,"whiteness");const i=transformArgsByParams(r,[[transformMinusPlusTimesOperator,transformPercentage],[transformPercentage]]),o=_slicedToArray(i,2),s=o[0],a=o[1];if(s!==undefined){const r=e[n]();const t=a!==undefined?s==="+"?r+Number(a):s==="-"?r-Number(a):s==="*"?r*Number(a):Number(a):Number(s);return e[n](t)}else{return manageUnresolved(r,t,r.value,`Expected a valid ${n}() function)`)}}function transformShadeTintAdjuster(e,r,t){const n=r.value.toLowerCase();const i=transformArgsByParams(r,[[transformPercentage]]),o=_slicedToArray(i,1),s=o[0];if(s!==undefined){const r=Number(s);return e[n](r)}else{return manageUnresolved(r,t,r.value,`Expected valid ${n}() arguments`)}}function transformColorSpace(e,r){if(isColorSpace(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a valid color space)`)}}function transformAlpha(e,r){if(isNumber(e)){return e.value*100}else if(isPercentage(e)){return transformPercentage(e,r)}else{return manageUnresolved(e,r,e.value,`Expected a valid alpha value)`)}}function transformRGBNumber(e,r){if(isNumber(e)){return e.value/2.55}else{return manageUnresolved(e,r,e.value,`Expected a valid RGB value)`)}}function transformHue(e,r){if(isHue(e)){const r=e.unit.toLowerCase();if(r==="grad"){return convertGtoD(e.value)}else if(r==="rad"){return convertRtoD(e.value)}else if(r==="turn"){return convertTtoD(e.value)}else{return convertDtoD(e.value)}}else{return manageUnresolved(e,r,e.value,`Expected a valid hue`)}}function transformPercentage(e,r){if(isPercentage(e)){return Number(e.value)}else{return manageUnresolved(e,r,e.value,`Expected a valid hue`)}}function transformMinusPlusOperator(e,r){if(isMinusPlusOperator(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a plus or minus operator`)}}function transformTimesOperator(e,r){if(isTimesOperator(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a times operator`)}}function transformMinusPlusTimesOperator(e,r){if(isMinusPlusTimesOperator(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a plus, minus, or times operator`)}}function transformWord(e,r){if(isWord(e)){return e.value}else{return manageUnresolved(e,r,e.value,`Expected a valid word`)}}function transformNode(e){return Object(e)}function transformArgsByParams(e,r){const t=(e.nodes||[]).slice(1,-1);const n={unresolved:"ignore"};return r.map(e=>t.map((r,t)=>typeof e[t]==="function"?e[t](r,n):undefined).filter(e=>typeof e!=="boolean")).filter(e=>e.every(e=>e!==undefined))[0]||[]}function walk(e,r){r(e);if(Object(e.nodes).length){e.nodes.slice().forEach(e=>{walk(e,r)})}}function isVariable(e){return Object(e).type==="func"&&M.test(e.value)}function isAlphaBlueGreenRedAdjuster(e){return Object(e).type==="func"&&m.test(e.value)}function isRGBAdjuster(e){return Object(e).type==="func"&&x.test(e.value)}function isHueAdjuster(e){return Object(e).type==="func"&&D.test(e.value)}function isBlacknessLightnessSaturationWhitenessAdjuster(e){return Object(e).type==="func"&&C.test(e.value)}function isShadeTintAdjuster(e){return Object(e).type==="func"&&I.test(e.value)}function isBlendAdjuster(e){return Object(e).type==="func"&&w.test(e.value)}function isContrastAdjuster(e){return Object(e).type==="func"&&T.test(e.value)}function isRGBFunction(e){return Object(e).type==="func"&&j.test(e.value)}function isHSLFunction(e){return Object(e).type==="func"&&k.test(e.value)}function isHWBFunction(e){return Object(e).type==="func"&&A.test(e.value)}function isColorModFunction(e){return Object(e).type==="func"&&S.test(e.value)}function isNamedColor(e){return Object(e).type==="word"&&Boolean(convertNtoRGB(e.value))}function isHexColor(e){return Object(e).type==="word"&&E.test(e.value)}function isColorSpace(e){return Object(e).type==="word"&&O.test(e.value)}function isHue(e){return Object(e).type==="number"&&P.test(e.unit)}function isComma(e){return Object(e).type==="comma"}function isSlash(e){return Object(e).type==="operator"&&e.value==="/"}function isNumber(e){return Object(e).type==="number"&&e.unit===""}function isMinusPlusOperator(e){return Object(e).type==="operator"&&R.test(e.value)}function isMinusPlusTimesOperator(e){return Object(e).type==="operator"&&F.test(e.value)}function isTimesOperator(e){return Object(e).type==="operator"&&N.test(e.value)}function isPercentage(e){return Object(e).type==="number"&&(e.unit==="%"||e.value==="0")}function isWord(e){return Object(e).type==="word"}const g=/^a(lpha)?$/i;const m=/^(a(lpha)?|blue|green|red)$/i;const C=/^(b(lackness)?|l(ightness)?|s(aturation)?|w(hiteness)?)$/i;const w=/^blenda?$/i;const S=/^color-mod$/i;const O=/^(hsl|hwb|rgb)$/i;const T=/^contrast$/i;const E=/^#(?:([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?)$/i;const k=/^hsla?$/i;const P=/^(deg|grad|rad|turn)?$/i;const D=/^h(ue)?$/i;const A=/^hwb$/i;const R=/^[+-]$/;const F=/^[*+-]$/;const x=/^rgb$/i;const j=/^rgba?$/i;const I=/^(shade|tint)$/i;const M=/^var$/i;const _=/(^|[^\w-])var\(/i;const N=/^[*]$/;var L=s.plugin("postcss-color-mod-function",e=>{const r=String(Object(e).unresolved||"throw").toLowerCase();const t=Object(e).stringifier||(e=>e.toLegacy());const i=[].concat(Object(e).importFrom||[]);const o="transformVars"in Object(e)?e.transformVars:true;const s=importCustomPropertiesFromSources(i);return function(){var e=_asyncToGenerator(function*(e,i){const a=Object.assign(yield s,getCustomProperties(e,{preserve:true}));e.walkDecls(e=>{const s=e.value;if(q.test(s)){const u=n(s,{loose:true}).parse();transformAST(u,{unresolved:r,stringifier:t,transformVars:o,decl:e,result:i,customProperties:a});const f=u.toString();if(s!==f){e.value=f}}})});return function(r,t){return e.apply(this,arguments)}}()});const q=/(^|[^\w-])color-mod\(/i;e.exports=L},9971:(e,r,t)=>{const n=t(4633);const i=t(9448);const o="#639";const s=/(^|[^\w-])rebeccapurple([^\w-]|$)/;e.exports=n.plugin("postcss-color-rebeccapurple",()=>e=>{e.walkDecls(e=>{const r=e.value;if(r&&s.test(r)){const t=i(r).parse();t.walk(e=>{if(e.type==="word"&&e.value==="rebeccapurple"){e.value=o}});e.value=t.toString()}})})},4731:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(5747));var o=_interopDefault(t(5622));function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function _defineProperty(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function _objectSpread(e){for(var r=1;r0){o-=1}}else if(o===0){if(r&&h.test(n+a)){i=true}else if(!r&&a===","){i=true}}if(i){t.push(r?new MediaExpression(n+a):new MediaQuery(n));n="";i=false}else{n+=a}}if(n!==""){t.push(r?new MediaExpression(n):new MediaQuery(n))}return t}class MediaQueryList{constructor(e){this.nodes=parse(e)}invert(){this.nodes.forEach(e=>{e.invert()});return this}clone(){return new MediaQueryList(String(this))}toString(){return this.nodes.join(",")}}class MediaQuery{constructor(e){const r=e.match(B),t=_slicedToArray(r,4),n=t[1],i=t[2],o=t[3];const s=i.match(v)||[],a=_slicedToArray(s,9),u=a[1],f=u===void 0?"":u,c=a[2],l=c===void 0?" ":c,p=a[3],h=p===void 0?"":p,d=a[4],b=d===void 0?"":d,y=a[5],g=y===void 0?"":y,m=a[6],C=m===void 0?"":m,w=a[7],S=w===void 0?"":w,O=a[8],T=O===void 0?"":O;const E={before:n,after:o,afterModifier:l,originalModifier:f||"",beforeAnd:b,and:g,beforeExpression:C};const k=parse(S||T,true);Object.assign(this,{modifier:f,type:h,raws:E,nodes:k})}clone(e){const r=new MediaQuery(String(this));Object.assign(r,e);return r}invert(){this.modifier=this.modifier?"":this.raws.originalModifier;return this}toString(){const e=this.raws;return`${e.before}${this.modifier}${this.modifier?`${e.afterModifier}`:""}${this.type}${e.beforeAnd}${e.and}${e.beforeExpression}${this.nodes.join("")}${this.raws.after}`}}class MediaExpression{constructor(e){const r=e.match(h)||[null,e],t=_slicedToArray(r,5),n=t[1],i=t[2],o=i===void 0?"":i,s=t[3],a=s===void 0?"":s,u=t[4],f=u===void 0?"":u;const c={after:o,and:a,afterAnd:f};Object.assign(this,{value:n,raws:c})}clone(e){const r=new MediaExpression(String(this));Object.assign(r,e);return r}toString(){const e=this.raws;return`${this.value}${e.after}${e.and}${e.afterAnd}`}}const s="(not|only)";const a="(all|print|screen|speech)";const u="([\\W\\w]*)";const f="([\\W\\w]+)";const c="(\\s*)";const l="(\\s+)";const p="(?:(\\s+)(and))";const h=new RegExp(`^${f}(?:${p}${l})$`,"i");const B=new RegExp(`^${c}${u}${c}$`);const v=new RegExp(`^(?:${s}${l})?(?:${a}(?:${p}${l}${f})?|${f})$`,"i");var d=e=>new MediaQueryList(e);var b=(e,r)=>{const t={};e.nodes.slice().forEach(e=>{if(m(e)){const n=e.params.match(g),i=_slicedToArray(n,3),o=i[1],s=i[2];t[o]=d(s);if(!Object(r).preserve){e.remove()}}});return t};const y=/^custom-media$/i;const g=/^(--[A-z][\w-]*)\s+([\W\w]+)\s*$/;const m=e=>e.type==="atrule"&&y.test(e.name)&&g.test(e.params);function getCustomMediaFromCSSFile(e){return _getCustomMediaFromCSSFile.apply(this,arguments)}function _getCustomMediaFromCSSFile(){_getCustomMediaFromCSSFile=_asyncToGenerator(function*(e){const r=yield C(e);const t=n.parse(r,{from:e});return b(t,{preserve:true})});return _getCustomMediaFromCSSFile.apply(this,arguments)}function getCustomMediaFromObject(e){const r=Object.assign({},Object(e).customMedia,Object(e)["custom-media"]);for(const e in r){r[e]=d(r[e])}return r}function getCustomMediaFromJSONFile(e){return _getCustomMediaFromJSONFile.apply(this,arguments)}function _getCustomMediaFromJSONFile(){_getCustomMediaFromJSONFile=_asyncToGenerator(function*(e){const r=yield w(e);return getCustomMediaFromObject(r)});return _getCustomMediaFromJSONFile.apply(this,arguments)}function getCustomMediaFromJSFile(e){return _getCustomMediaFromJSFile.apply(this,arguments)}function _getCustomMediaFromJSFile(){_getCustomMediaFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(e));return getCustomMediaFromObject(r)});return _getCustomMediaFromJSFile.apply(this,arguments)}function getCustomMediaFromSources(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(Object(r).customMedia||Object(r)["custom-media"]){return r}const t=o.resolve(String(r.from||""));const n=(r.type||o.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="css"||n==="pcss"){return Object.assign(yield e,yield getCustomMediaFromCSSFile(i))}if(n==="js"){return Object.assign(yield e,yield getCustomMediaFromJSFile(i))}if(n==="json"){return Object.assign(yield e,yield getCustomMediaFromJSONFile(i))}return Object.assign(yield e,getCustomMediaFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const C=e=>new Promise((r,t)=>{i.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const w=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield C(e))});return function readJSON(r){return e.apply(this,arguments)}}();function transformMediaList(e,r){let t=e.nodes.length-1;while(t>=0){const n=transformMedia(e.nodes[t],r);if(n.length){e.nodes.splice(t,1,...n)}--t}return e}function transformMedia(e,r){const t=[];for(const u in e.nodes){const f=e.nodes[u],c=f.value,l=f.nodes;const p=c.replace(S,"$1");if(p in r){var n=true;var i=false;var o=undefined;try{for(var s=r[p].nodes[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){const n=a.value;const i=e.modifier!==n.modifier?e.modifier||n.modifier:"";const o=e.clone({modifier:i,raws:!i||e.modifier?_objectSpread({},e.raws):_objectSpread({},n.raws),type:e.type||n.type});if(o.type===n.type){Object.assign(o.raws,{and:n.raws.and,beforeAnd:n.raws.beforeAnd,beforeExpression:n.raws.beforeExpression})}o.nodes.splice(u,1,...n.clone().nodes.map(r=>{if(e.nodes[u].raws.and){r.raws=_objectSpread({},e.nodes[u].raws)}r.spaces=_objectSpread({},e.nodes[u].spaces);return r}));const s=O(r,p);const f=transformMedia(o,s);if(f.length){t.push(...f)}else{t.push(o)}}}catch(e){i=true;o=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(i){throw o}}}return t}else if(l&&l.length){transformMediaList(e.nodes[u],r)}}return t}const S=/\((--[A-z][\w-]*)\)/;const O=(e,r)=>{const t=Object.assign({},e);delete t[r];return t};var T=(e,r,t)=>{e.walkAtRules(E,e=>{if(k.test(e.params)){const n=d(e.params);const i=String(transformMediaList(n,r));if(t.preserve){e.cloneBefore({params:i})}else{e.params=i}}})};const E=/^media$/i;const k=/\(--[A-z][\w-]*\)/;function writeCustomMediaToCssFile(e,r){return _writeCustomMediaToCssFile.apply(this,arguments)}function _writeCustomMediaToCssFile(){_writeCustomMediaToCssFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`@custom-media ${t} ${r[t]};`);return e},[]).join("\n");const n=`${t}\n`;yield D(e,n)});return _writeCustomMediaToCssFile.apply(this,arguments)}function writeCustomMediaToJsonFile(e,r){return _writeCustomMediaToJsonFile.apply(this,arguments)}function _writeCustomMediaToJsonFile(){_writeCustomMediaToJsonFile=_asyncToGenerator(function*(e,r){const t=JSON.stringify({"custom-media":r},null," ");const n=`${t}\n`;yield D(e,n)});return _writeCustomMediaToJsonFile.apply(this,arguments)}function writeCustomMediaToCjsFile(e,r){return _writeCustomMediaToCjsFile.apply(this,arguments)}function _writeCustomMediaToCjsFile(){_writeCustomMediaToCjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t\t'${A(t)}': '${A(r[t])}'`);return e},[]).join(",\n");const n=`module.exports = {\n\tcustomMedia: {\n${t}\n\t}\n};\n`;yield D(e,n)});return _writeCustomMediaToCjsFile.apply(this,arguments)}function writeCustomMediaToMjsFile(e,r){return _writeCustomMediaToMjsFile.apply(this,arguments)}function _writeCustomMediaToMjsFile(){_writeCustomMediaToMjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t'${A(t)}': '${A(r[t])}'`);return e},[]).join(",\n");const n=`export const customMedia = {\n${t}\n};\n`;yield D(e,n)});return _writeCustomMediaToMjsFile.apply(this,arguments)}function writeCustomMediaToExports(e,r){return Promise.all(r.map(function(){var r=_asyncToGenerator(function*(r){if(r instanceof Function){yield r(P(e))}else{const t=r===Object(r)?r:{to:String(r)};const n=t.toJSON||P;if("customMedia"in t){t.customMedia=n(e)}else if("custom-media"in t){t["custom-media"]=n(e)}else{const r=String(t.to||"");const i=(t.type||o.extname(r).slice(1)).toLowerCase();const s=n(e);if(i==="css"){yield writeCustomMediaToCssFile(r,s)}if(i==="js"){yield writeCustomMediaToCjsFile(r,s)}if(i==="json"){yield writeCustomMediaToJsonFile(r,s)}if(i==="mjs"){yield writeCustomMediaToMjsFile(r,s)}}}});return function(e){return r.apply(this,arguments)}}()))}const P=e=>{return Object.keys(e).reduce((r,t)=>{r[t]=String(e[t]);return r},{})};const D=(e,r)=>new Promise((t,n)=>{i.writeFile(e,r,e=>{if(e){n(e)}else{t()}})});const A=e=>e.replace(/\\([\s\S])|(')/g,"\\$1$2").replace(/\n/g,"\\n").replace(/\r/g,"\\r");var R=n.plugin("postcss-custom-media",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):false;const t=[].concat(Object(e).importFrom||[]);const n=[].concat(Object(e).exportTo||[]);const i=getCustomMediaFromSources(t);return function(){var e=_asyncToGenerator(function*(e){const t=Object.assign(yield i,b(e,{preserve:r}));yield writeCustomMediaToExports(t,n);T(e,t,{preserve:r})});return function(r){return e.apply(this,arguments)}}()});e.exports=R},8713:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=_interopDefault(t(5747));var s=_interopDefault(t(5622));function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function parse(e){return i(e).parse()}function isBlockIgnored(e){var r=e.selector?e:e.parent;return/(!\s*)?postcss-custom-properties:\s*off\b/i.test(r.toString())}function isRuleIgnored(e){var r=e.prev();return Boolean(isBlockIgnored(e)||r&&r.type==="comment"&&/(!\s*)?postcss-custom-properties:\s*ignore\s+next\b/i.test(r.text))}function getCustomPropertiesFromRoot(e,r){const t={};const n={};e.nodes.slice().forEach(e=>{const i=c(e)?t:l(e)?n:null;if(i){e.nodes.slice().forEach(e=>{if(p(e)&&!isBlockIgnored(e)){const t=e.prop;i[t]=parse(e.value).nodes;if(!r.preserve){e.remove()}}});if(!r.preserve&&h(e)&&!isBlockIgnored(e)){e.remove()}}});return Object.assign({},t,n)}const a=/^html$/i;const u=/^:root$/i;const f=/^--[A-z][\w-]*$/;const c=e=>e.type==="rule"&&a.test(e.selector)&&Object(e.nodes).length;const l=e=>e.type==="rule"&&u.test(e.selector)&&Object(e.nodes).length;const p=e=>e.type==="decl"&&f.test(e.prop);const h=e=>Object(e.nodes).length===0;function getCustomPropertiesFromCSSFile(e){return _getCustomPropertiesFromCSSFile.apply(this,arguments)}function _getCustomPropertiesFromCSSFile(){_getCustomPropertiesFromCSSFile=_asyncToGenerator(function*(e){const r=yield B(e);const t=n.parse(r,{from:e});return getCustomPropertiesFromRoot(t,{preserve:true})});return _getCustomPropertiesFromCSSFile.apply(this,arguments)}function getCustomPropertiesFromObject(e){const r=Object.assign({},Object(e).customProperties,Object(e)["custom-properties"]);for(const e in r){r[e]=parse(String(r[e])).nodes}return r}function getCustomPropertiesFromJSONFile(e){return _getCustomPropertiesFromJSONFile.apply(this,arguments)}function _getCustomPropertiesFromJSONFile(){_getCustomPropertiesFromJSONFile=_asyncToGenerator(function*(e){const r=yield v(e);return getCustomPropertiesFromObject(r)});return _getCustomPropertiesFromJSONFile.apply(this,arguments)}function getCustomPropertiesFromJSFile(e){return _getCustomPropertiesFromJSFile.apply(this,arguments)}function _getCustomPropertiesFromJSFile(){_getCustomPropertiesFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(e));return getCustomPropertiesFromObject(r)});return _getCustomPropertiesFromJSFile.apply(this,arguments)}function getCustomPropertiesFromImports(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(r.customProperties||r["custom-properties"]){return r}const t=s.resolve(String(r.from||""));const n=(r.type||s.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="css"){return Object.assign(yield e,yield getCustomPropertiesFromCSSFile(i))}if(n==="js"){return Object.assign(yield e,yield getCustomPropertiesFromJSFile(i))}if(n==="json"){return Object.assign(yield e,yield getCustomPropertiesFromJSONFile(i))}return Object.assign(yield e,yield getCustomPropertiesFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const B=e=>new Promise((r,t)=>{o.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const v=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield B(e))});return function readJSON(r){return e.apply(this,arguments)}}();function transformValueAST(e,r){if(e.nodes&&e.nodes.length){e.nodes.slice().forEach(t=>{if(b(t)){const n=t.nodes.slice(1,-1),i=n[0],o=n[1],s=n.slice(2);const a=i.value;if(a in Object(r)){const e=y(r[a],t.raws.before);t.replaceWith(...e);retransformValueAST({nodes:e},r,a)}else if(s.length){const n=e.nodes.indexOf(t);if(n!==-1){e.nodes.splice(n,1,...y(s,t.raws.before))}transformValueAST(e,r)}}else{transformValueAST(t,r)}})}return e}function retransformValueAST(e,r,t){const n=Object.assign({},r);delete n[t];return transformValueAST(e,n)}const d=/^var$/i;const b=e=>e.type==="func"&&d.test(e.value)&&Object(e.nodes).length>0;const y=(e,r)=>{const t=g(e,null);if(t[0]){t[0].raws.before=r}return t};const g=(e,r)=>e.map(e=>m(e,r));const m=(e,r)=>{const t=new e.constructor(e);for(const n in e){if(n==="parent"){t.parent=r}else if(Object(e[n]).constructor===Array){t[n]=g(e.nodes,t)}else if(Object(e[n]).constructor===Object){t[n]=Object.assign({},e[n])}}return t};var C=(e,r,t)=>{e.walkDecls(e=>{if(O(e)&&!isRuleIgnored(e)){const n=e.value;const i=parse(n);const o=String(transformValueAST(i,r));if(o!==n){if(t.preserve){e.cloneBefore({value:o})}else{e.value=o}}}})};const w=/^--[A-z][\w-]*$/;const S=/(^|[^\w-])var\([\W\w]+\)/;const O=e=>!w.test(e.prop)&&S.test(e.value);function writeCustomPropertiesToCssFile(e,r){return _writeCustomPropertiesToCssFile.apply(this,arguments)}function _writeCustomPropertiesToCssFile(){_writeCustomPropertiesToCssFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t${t}: ${r[t]};`);return e},[]).join("\n");const n=`:root {\n${t}\n}\n`;yield E(e,n)});return _writeCustomPropertiesToCssFile.apply(this,arguments)}function writeCustomPropertiesToJsonFile(e,r){return _writeCustomPropertiesToJsonFile.apply(this,arguments)}function _writeCustomPropertiesToJsonFile(){_writeCustomPropertiesToJsonFile=_asyncToGenerator(function*(e,r){const t=JSON.stringify({"custom-properties":r},null," ");const n=`${t}\n`;yield E(e,n)});return _writeCustomPropertiesToJsonFile.apply(this,arguments)}function writeCustomPropertiesToCjsFile(e,r){return _writeCustomPropertiesToCjsFile.apply(this,arguments)}function _writeCustomPropertiesToCjsFile(){_writeCustomPropertiesToCjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t\t'${k(t)}': '${k(r[t])}'`);return e},[]).join(",\n");const n=`module.exports = {\n\tcustomProperties: {\n${t}\n\t}\n};\n`;yield E(e,n)});return _writeCustomPropertiesToCjsFile.apply(this,arguments)}function writeCustomPropertiesToMjsFile(e,r){return _writeCustomPropertiesToMjsFile.apply(this,arguments)}function _writeCustomPropertiesToMjsFile(){_writeCustomPropertiesToMjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t'${k(t)}': '${k(r[t])}'`);return e},[]).join(",\n");const n=`export const customProperties = {\n${t}\n};\n`;yield E(e,n)});return _writeCustomPropertiesToMjsFile.apply(this,arguments)}function writeCustomPropertiesToExports(e,r){return Promise.all(r.map(function(){var r=_asyncToGenerator(function*(r){if(r instanceof Function){yield r(T(e))}else{const t=r===Object(r)?r:{to:String(r)};const n=t.toJSON||T;if("customProperties"in t){t.customProperties=n(e)}else if("custom-properties"in t){t["custom-properties"]=n(e)}else{const r=String(t.to||"");const i=(t.type||s.extname(t.to).slice(1)).toLowerCase();const o=n(e);if(i==="css"){yield writeCustomPropertiesToCssFile(r,o)}if(i==="js"){yield writeCustomPropertiesToCjsFile(r,o)}if(i==="json"){yield writeCustomPropertiesToJsonFile(r,o)}if(i==="mjs"){yield writeCustomPropertiesToMjsFile(r,o)}}}});return function(e){return r.apply(this,arguments)}}()))}const T=e=>{return Object.keys(e).reduce((r,t)=>{r[t]=String(e[t]);return r},{})};const E=(e,r)=>new Promise((t,n)=>{o.writeFile(e,r,e=>{if(e){n(e)}else{t()}})});const k=e=>e.replace(/\\([\s\S])|(')/g,"\\$1$2").replace(/\n/g,"\\n").replace(/\r/g,"\\r");var P=n.plugin("postcss-custom-properties",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;const t=[].concat(Object(e).importFrom||[]);const n=[].concat(Object(e).exportTo||[]);const i=getCustomPropertiesFromImports(t);const o=e=>{const t=getCustomPropertiesFromRoot(e,{preserve:r});C(e,t,{preserve:r})};const s=function(){var e=_asyncToGenerator(function*(e){const t=Object.assign({},yield i,getCustomPropertiesFromRoot(e,{preserve:r}));yield writeCustomPropertiesToExports(t,n);C(e,t,{preserve:r})});return function asyncTransform(r){return e.apply(this,arguments)}}();const a=t.length===0&&n.length===0;return a?o:s});e.exports=P},8758:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(2152));var i=_interopDefault(t(5747));var o=_interopDefault(t(5622));var s=_interopDefault(t(4633));function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function _defineProperty(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function _objectSpread(e){for(var r=1;r{let r;n(e=>{r=e}).processSync(e);return r};var u=(e,r)=>{const t={};e.nodes.slice().forEach(e=>{if(l(e)){const n=e.params.match(c),i=_slicedToArray(n,3),o=i[1],s=i[2];t[o]=a(s);if(!Object(r).preserve){e.remove()}}});return t};const f=/^custom-selector$/i;const c=/^(:--[A-z][\w-]*)\s+([\W\w]+)\s*$/;const l=e=>e.type==="atrule"&&f.test(e.name)&&c.test(e.params);function transformSelectorList(e,r){let t=e.nodes.length-1;while(t>=0){const n=transformSelector(e.nodes[t],r);if(n.length){e.nodes.splice(t,1,...n)}--t}return e}function transformSelector(e,r){const t=[];for(const u in e.nodes){const f=e.nodes[u],c=f.value,l=f.nodes;if(c in r){var n=true;var i=false;var o=undefined;try{for(var s=r[c].nodes[Symbol.iterator](),a;!(n=(a=s.next()).done);n=true){const n=a.value;const i=e.clone();i.nodes.splice(u,1,...n.clone().nodes.map(r=>{r.spaces=_objectSpread({},e.nodes[u].spaces);return r}));const o=transformSelector(i,r);d(i.nodes,Number(u));if(o.length){t.push(...o)}else{t.push(i)}}}catch(e){i=true;o=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(i){throw o}}}return t}else if(l&&l.length){transformSelectorList(e.nodes[u],r)}}return t}const p=/^(tag|universal)$/;const h=/^(class|id|pseudo|tag|universal)$/;const B=e=>p.test(Object(e).type);const v=e=>h.test(Object(e).type);const d=(e,r)=>{if(r&&B(e[r])&&v(e[r-1])){let t=r-1;while(t&&v(e[t])){--t}if(t{e.walkRules(y,e=>{const i=n(e=>{transformSelectorList(e,r,t)}).processSync(e.selector);if(t.preserve){e.cloneBefore({selector:i})}else{e.selector=i}})};const y=/:--[A-z][\w-]*/;function importCustomSelectorsFromCSSAST(e){return u(e)}function importCustomSelectorsFromCSSFile(e){return _importCustomSelectorsFromCSSFile.apply(this,arguments)}function _importCustomSelectorsFromCSSFile(){_importCustomSelectorsFromCSSFile=_asyncToGenerator(function*(e){const r=yield g(o.resolve(e));const t=s.parse(r,{from:o.resolve(e)});return importCustomSelectorsFromCSSAST(t)});return _importCustomSelectorsFromCSSFile.apply(this,arguments)}function importCustomSelectorsFromObject(e){const r=Object.assign({},Object(e).customSelectors||Object(e)["custom-selectors"]);for(const e in r){r[e]=a(r[e])}return r}function importCustomSelectorsFromJSONFile(e){return _importCustomSelectorsFromJSONFile.apply(this,arguments)}function _importCustomSelectorsFromJSONFile(){_importCustomSelectorsFromJSONFile=_asyncToGenerator(function*(e){const r=yield m(o.resolve(e));return importCustomSelectorsFromObject(r)});return _importCustomSelectorsFromJSONFile.apply(this,arguments)}function importCustomSelectorsFromJSFile(e){return _importCustomSelectorsFromJSFile.apply(this,arguments)}function _importCustomSelectorsFromJSFile(){_importCustomSelectorsFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(o.resolve(e)));return importCustomSelectorsFromObject(r)});return _importCustomSelectorsFromJSFile.apply(this,arguments)}function importCustomSelectorsFromSources(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(Object(r).customSelectors||Object(r)["custom-selectors"]){return r}const t=String(r.from||"");const n=(r.type||o.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="ast"){return Object.assign(e,importCustomSelectorsFromCSSAST(i))}if(n==="css"){return Object.assign(e,yield importCustomSelectorsFromCSSFile(i))}if(n==="js"){return Object.assign(e,yield importCustomSelectorsFromJSFile(i))}if(n==="json"){return Object.assign(e,yield importCustomSelectorsFromJSONFile(i))}return Object.assign(e,importCustomSelectorsFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const g=e=>new Promise((r,t)=>{i.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const m=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield g(e))});return function readJSON(r){return e.apply(this,arguments)}}();function exportCustomSelectorsToCssFile(e,r){return _exportCustomSelectorsToCssFile.apply(this,arguments)}function _exportCustomSelectorsToCssFile(){_exportCustomSelectorsToCssFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`@custom-selector ${t} ${r[t]};`);return e},[]).join("\n");const n=`${t}\n`;yield w(e,n)});return _exportCustomSelectorsToCssFile.apply(this,arguments)}function exportCustomSelectorsToJsonFile(e,r){return _exportCustomSelectorsToJsonFile.apply(this,arguments)}function _exportCustomSelectorsToJsonFile(){_exportCustomSelectorsToJsonFile=_asyncToGenerator(function*(e,r){const t=JSON.stringify({"custom-selectors":r},null," ");const n=`${t}\n`;yield w(e,n)});return _exportCustomSelectorsToJsonFile.apply(this,arguments)}function exportCustomSelectorsToCjsFile(e,r){return _exportCustomSelectorsToCjsFile.apply(this,arguments)}function _exportCustomSelectorsToCjsFile(){_exportCustomSelectorsToCjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t\t'${S(t)}': '${S(r[t])}'`);return e},[]).join(",\n");const n=`module.exports = {\n\tcustomSelectors: {\n${t}\n\t}\n};\n`;yield w(e,n)});return _exportCustomSelectorsToCjsFile.apply(this,arguments)}function exportCustomSelectorsToMjsFile(e,r){return _exportCustomSelectorsToMjsFile.apply(this,arguments)}function _exportCustomSelectorsToMjsFile(){_exportCustomSelectorsToMjsFile=_asyncToGenerator(function*(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t'${S(t)}': '${S(r[t])}'`);return e},[]).join(",\n");const n=`export const customSelectors = {\n${t}\n};\n`;yield w(e,n)});return _exportCustomSelectorsToMjsFile.apply(this,arguments)}function exportCustomSelectorsToDestinations(e,r){return Promise.all(r.map(function(){var r=_asyncToGenerator(function*(r){if(r instanceof Function){yield r(C(e))}else{const t=r===Object(r)?r:{to:String(r)};const n=t.toJSON||C;if("customSelectors"in t){t.customSelectors=n(e)}else if("custom-selectors"in t){t["custom-selectors"]=n(e)}else{const r=String(t.to||"");const i=(t.type||o.extname(t.to).slice(1)).toLowerCase();const s=n(e);if(i==="css"){yield exportCustomSelectorsToCssFile(r,s)}if(i==="js"){yield exportCustomSelectorsToCjsFile(r,s)}if(i==="json"){yield exportCustomSelectorsToJsonFile(r,s)}if(i==="mjs"){yield exportCustomSelectorsToMjsFile(r,s)}}}});return function(e){return r.apply(this,arguments)}}()))}const C=e=>{return Object.keys(e).reduce((r,t)=>{r[t]=String(e[t]);return r},{})};const w=(e,r)=>new Promise((t,n)=>{i.writeFile(e,r,e=>{if(e){n(e)}else{t()}})});const S=e=>e.replace(/\\([\s\S])|(')/g,"\\$1$2").replace(/\n/g,"\\n").replace(/\r/g,"\\r");var O=s.plugin("postcss-custom-selectors",e=>{const r=Boolean(Object(e).preserve);const t=[].concat(Object(e).importFrom||[]);const n=[].concat(Object(e).exportTo||[]);const i=importCustomSelectorsFromSources(t);return function(){var e=_asyncToGenerator(function*(e){const t=Object.assign(yield i,u(e,{preserve:r}));yield exportCustomSelectorsToDestinations(t,n);b(e,t,{preserve:r})});return function(r){return e.apply(this,arguments)}}()});e.exports=O},666:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(7291);var i=_interopRequireDefault(n);var o=t(2341);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},1387:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(1387);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},3982:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},3687:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},9211:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},5420:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(3982);var i=_interopRequireDefault(n);var o=t(3687);var s=_interopRequireDefault(o);var a=t(4274);var u=_interopRequireDefault(a);var f=t(9211);var c=_interopRequireDefault(f);var l=t(7732);var p=_interopRequireDefault(l);var h=t(3589);var B=_interopRequireDefault(h);var v=t(1692);var d=_interopRequireDefault(v);var b=t(6522);var y=_interopRequireDefault(b);var g=t(3390);var m=_interopRequireDefault(g);var C=t(1989);var w=_interopRequireDefault(C);var S=t(5535);var O=_interopRequireDefault(S);var T=t(9479);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},8541:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(9151);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},7732:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},2341:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(9151);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(5420);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(8526);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},6512:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},917:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(8541);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},6522:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(8541);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},1989:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(917);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},5535:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(6512);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},9151:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},9479:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(6512);var i=_interopRequireDefault(n);var o=t(9151);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},7813:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},9676:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},7210:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(9676);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},560:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},456:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},2196:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(3806);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(456);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(560);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(7012);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},7012:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},3806:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},3650:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9182));var o=n.plugin("postcss-dir-pseudo-class",e=>{const r=Object(e).dir;const t=Boolean(Object(e).preserve);return e=>{e.walkRules(/:dir\([^\)]*\)/,e=>{let n=e;if(t){n=e.cloneBefore()}n.selector=i(e=>{e.nodes.forEach(e=>{e.walk(t=>{if("pseudo"===t.type&&":dir"===t.value){const n=t.prev();const o=t.next();const s=n&&n.type&&"combinator"===n.type&&" "===n.value;const a=o&&o.type&&"combinator"===o.type&&" "===o.value;if(s&&(a||!o)){t.replaceWith(i.universal())}else{t.remove()}const u=e.nodes[0];const f=u&&"combinator"===u.type&&" "===u.value;const c=u&&"tag"===u.type&&"html"===u.value;const l=u&&"pseudo"===u.type&&":root"===u.value;if(u&&!c&&!l&&!f){e.prepend(i.combinator({value:" "}))}const p=t.nodes.toString();const h=r===p;const B=i.attribute({attribute:"dir",operator:"=",quoteMark:'"',value:`"${p}"`});const v=i.pseudo({value:`${c||l?"":"html"}:not`});v.append(i.attribute({attribute:"dir",operator:"=",quoteMark:'"',value:`"${"ltr"===p?"rtl":"ltr"}"`}));if(h){if(c){e.insertAfter(u,v)}else{e.prepend(v)}}else if(c){e.insertAfter(u,B)}else{e.prepend(B)}}})})}).processSync(n.selector)})}});e.exports=o},3730:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(7274);var i=_interopRequireDefault(n);var o=t(3639);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},1927:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(1927);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},8067:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},3198:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},7517:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},9338:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(8067);var i=_interopRequireDefault(n);var o=t(3198);var s=_interopRequireDefault(o);var a=t(6931);var u=_interopRequireDefault(a);var f=t(7517);var c=_interopRequireDefault(f);var l=t(1931);var p=_interopRequireDefault(l);var h=t(4712);var B=_interopRequireDefault(h);var v=t(7614);var d=_interopRequireDefault(v);var b=t(1026);var y=_interopRequireDefault(b);var g=t(5445);var m=_interopRequireDefault(g);var C=t(6959);var w=_interopRequireDefault(C);var S=t(5546);var O=_interopRequireDefault(S);var T=t(4411);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},3130:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(2958);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},1931:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},3639:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(2958);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(9338);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(6924);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},7264:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},4944:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(3130);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},1026:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(3130);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},6959:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(4944);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},5546:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(7264);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},2958:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},4411:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(7264);var i=_interopRequireDefault(n);var o=t(2958);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},9611:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},5791:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},26:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(5791);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},7315:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},5558:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},4225:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(310);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(5558);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(7315);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(51);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},51:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},310:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},3030:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=n.plugin("postcss-double-position-gradients",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;return e=>{e.walkDecls(e=>{const t=e.value;if(s.test(t)){const n=i(t).parse();n.walkFunctionNodes(e=>{if(a.test(e.value)){const r=e.nodes.slice(1,-1);r.forEach((t,n)=>{const o=Object(r[n-1]);const s=Object(r[n-2]);const a=s.type&&o.type==="number"&&t.type==="number";if(a){const r=s.clone();const n=i.comma({value:",",raws:{after:" "}});e.insertBefore(t,n);e.insertBefore(t,r)}})}});const o=n.toString();if(t!==o){e.cloneBefore({value:o});if(!r){e.remove()}}}})}});const s=/(repeating-)?(conic|linear|radial)-gradient\([\W\w]*\)/i;const a=/^(repeating-)?(conic|linear|radial)-gradient$/i;e.exports=o},5538:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(9448));var i=_interopDefault(t(5747));var o=_interopDefault(t(5622));var s=_interopDefault(t(4633));function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}const a=/^--/;var u=e=>{const r=String(e.nodes.slice(1,-1));return a.test(r)?r:undefined};var f=(e,r)=>{const t=u(e);if(typeof t==="string"&&t in r){e.replaceWith(...c(r[t],e.raws.before))}};const c=(e,r)=>{const t=l(e,null);if(t[0]){t[0].raws.before=r}return t};const l=(e,r)=>e.map(e=>p(e,r));const p=(e,r)=>{const t=new e.constructor(e);for(const n in e){if(n==="parent"){t.parent=r}else if(Object(e[n]).constructor===Array){t[n]=l(e.nodes,t)}else if(Object(e[n]).constructor===Object){t[n]=Object.assign({},e[n])}}return t};var h=e=>e&&e.type==="func"&&e.value==="env";function walk(e,r){e.nodes.slice(0).forEach(e=>{if(e.nodes){walk(e,r)}if(h(e)){r(e)}})}var B=(e,r)=>{const t=n(e).parse();walk(t,e=>{f(e,r)});return String(t)};var v=e=>e&&e.type==="atrule";var d=e=>e&&e.type==="decl";var b=e=>v(e)&&e.params||d(e)&&e.value;function setSupportedValue(e,r){if(v(e)){e.params=r}if(d(e)){e.value=r}}function importEnvironmentVariablesFromObject(e){const r=Object.assign({},Object(e).environmentVariables||Object(e)["environment-variables"]);for(const e in r){r[e]=n(r[e]).parse().nodes}return r}function importEnvironmentVariablesFromJSONFile(e){return _importEnvironmentVariablesFromJSONFile.apply(this,arguments)}function _importEnvironmentVariablesFromJSONFile(){_importEnvironmentVariablesFromJSONFile=_asyncToGenerator(function*(e){const r=yield g(o.resolve(e));return importEnvironmentVariablesFromObject(r)});return _importEnvironmentVariablesFromJSONFile.apply(this,arguments)}function importEnvironmentVariablesFromJSFile(e){return _importEnvironmentVariablesFromJSFile.apply(this,arguments)}function _importEnvironmentVariablesFromJSFile(){_importEnvironmentVariablesFromJSFile=_asyncToGenerator(function*(e){const r=yield Promise.resolve(require(o.resolve(e)));return importEnvironmentVariablesFromObject(r)});return _importEnvironmentVariablesFromJSFile.apply(this,arguments)}function importEnvironmentVariablesFromSources(e){return e.map(e=>{if(e instanceof Promise){return e}else if(e instanceof Function){return e()}const r=e===Object(e)?e:{from:String(e)};if(r.environmentVariables||r["environment-variables"]){return r}const t=String(r.from||"");const n=(r.type||o.extname(t).slice(1)).toLowerCase();return{type:n,from:t}}).reduce(function(){var e=_asyncToGenerator(function*(e,r){const t=yield r,n=t.type,i=t.from;if(n==="js"){return Object.assign(e,yield importEnvironmentVariablesFromJSFile(i))}if(n==="json"){return Object.assign(e,yield importEnvironmentVariablesFromJSONFile(i))}return Object.assign(e,importEnvironmentVariablesFromObject(yield r))});return function(r,t){return e.apply(this,arguments)}}(),{})}const y=e=>new Promise((r,t)=>{i.readFile(e,"utf8",(e,n)=>{if(e){t(e)}else{r(n)}})});const g=function(){var e=_asyncToGenerator(function*(e){return JSON.parse(yield y(e))});return function readJSON(r){return e.apply(this,arguments)}}();var m=s.plugin("postcss-env-fn",e=>{const r=[].concat(Object(e).importFrom||[]);const t=importEnvironmentVariablesFromSources(r);return function(){var e=_asyncToGenerator(function*(e){const r=yield t;e.walk(e=>{const t=b(e);if(t){const n=B(t,r);if(n!==t){setSupportedValue(e,n)}}})});return function(r){return e.apply(this,arguments)}}()});e.exports=m},9642:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/:focus-visible([^\w-]|$)/gi;var o=n.plugin("postcss-focus-visible",e=>{const r=String(Object(e).replaceWith||".focus-visible");const t=Boolean("preserve"in Object(e)?e.preserve:true);return e=>{e.walkRules(i,e=>{const n=e.selector.replace(i,(e,t)=>{return`${r}${t}`});const o=e.clone({selector:n});if(t){e.before(o)}else{e.replaceWith(o)}})}});e.exports=o},8059:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/:focus-within([^\w-]|$)/gi;var o=n.plugin("postcss-focus-within",e=>{const r=String(Object(e).replaceWith||"[focus-within]");const t=Boolean("preserve"in Object(e)?e.preserve:true);return e=>{e.walkRules(i,e=>{const n=e.selector.replace(i,(e,t)=>{return`${r}${t}`});const o=e.clone({selector:n});if(t){e.before(o)}else{e.replaceWith(o)}})}});e.exports=o},3203:(e,r,t)=>{var n=t(4633);var i={"font-variant-ligatures":{"common-ligatures":'"liga", "clig"',"no-common-ligatures":'"liga", "clig off"',"discretionary-ligatures":'"dlig"',"no-discretionary-ligatures":'"dlig" off',"historical-ligatures":'"hlig"',"no-historical-ligatures":'"hlig" off',contextual:'"calt"',"no-contextual":'"calt" off'},"font-variant-position":{sub:'"subs"',super:'"sups"',normal:'"subs" off, "sups" off'},"font-variant-caps":{"small-caps":'"c2sc"',"all-small-caps":'"smcp", "c2sc"',"petite-caps":'"pcap"',"all-petite-caps":'"pcap", "c2pc"',unicase:'"unic"',"titling-caps":'"titl"'},"font-variant-numeric":{"lining-nums":'"lnum"',"oldstyle-nums":'"onum"',"proportional-nums":'"pnum"',"tabular-nums":'"tnum"',"diagonal-fractions":'"frac"',"stacked-fractions":'"afrc"',ordinal:'"ordn"',"slashed-zero":'"zero"'},"font-kerning":{normal:'"kern"',none:'"kern" off'},"font-variant":{normal:"normal",inherit:"inherit"}};for(var o in i){var s=i[o];for(var a in s){if(!(a in i["font-variant"])){i["font-variant"][a]=s[a]}}}function getFontFeatureSettingsPrevTo(e){var r=null;e.parent.walkDecls(function(e){if(e.prop==="font-feature-settings"){r=e}});if(r===null){r=e.clone();r.prop="font-feature-settings";r.value="";e.parent.insertBefore(e,r)}return r}e.exports=n.plugin("postcss-font-variant",function(){return function(e){e.walkRules(function(e){var r=null;e.walkDecls(function(e){if(!i[e.prop]){return null}var t=e.value;if(e.prop==="font-variant"){t=e.value.split(/\s+/g).map(function(e){return i["font-variant"][e]}).join(", ")}else if(i[e.prop][e.value]){t=i[e.prop][e.value]}if(r===null){r=getFontFeatureSettingsPrevTo(e)}if(r.value&&r.value!==t){r.value+=", "+t}else{r.value=t}})})}})},9547:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));const i=/^(column-gap|gap|row-gap)$/i;var o=n.plugin("postcss-gap-properties",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;return e=>{e.walkDecls(i,e=>{e.cloneBefore({prop:`grid-${e.prop}`});if(!r){e.remove()}})}});e.exports=o},4287:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));var o=e=>Object(e).type==="comma";const s=/^(-webkit-)?image-set$/i;var a=e=>Object(e).type==="func"&&/^(cross-fade|image|(repeating-)?(conic|linear|radial)-gradient|url)$/i.test(e.value)&&!(e.parent.parent&&e.parent.parent.type==="func"&&s.test(e.parent.parent.value))?String(e):Object(e).type==="string"?e.value:false;const u={dpcm:2.54,dpi:1,dppx:96,x:96};var f=(e,r)=>{if(Object(e).type==="number"&&e.unit in u){const t=Number(e.value)*u[e.unit.toLowerCase()];const i=Math.floor(t/u.x*100)/100;if(t in r){return false}else{const e=r[t]=n.atRule({name:"media",params:`(-webkit-min-device-pixel-ratio: ${i}), (min-resolution: ${t}dpi)`});return e}}else{return false}};var c=(e,r,t)=>{if(e.oninvalid==="warn"){e.decl.warn(e.result,r,{word:String(t)})}else if(e.oninvalid==="throw"){throw e.decl.error(r,{word:String(t)})}};var l=(e,r,t)=>{const n=r.parent;const i={};let s=e.length;let u=-1;while(ue-r).map(e=>i[e]);if(l.length){const e=l[0].nodes[0].nodes[0];if(l.length===1){r.value=e.value}else{const i=n.nodes;const o=i.slice(0,i.indexOf(r)).concat(e);if(o.length){const e=n.cloneBefore().removeAll();e.append(o)}n.before(l.slice(1));if(!t.preserve){r.remove();if(!n.nodes.length){n.remove()}}}}};const p=/(^|[^\w-])(-webkit-)?image-set\(/;const h=/^(-webkit-)?image-set$/i;var B=n.plugin("postcss-image-set-function",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;const t="oninvalid"in Object(e)?e.oninvalid:"ignore";return(e,n)=>{e.walkDecls(e=>{const o=e.value;if(p.test(o)){const s=i(o).parse();s.walkType("func",i=>{if(h.test(i.value)){l(i.nodes.slice(1,-1),e,{decl:e,oninvalid:t,preserve:r,result:n})}})}})}});e.exports=B},7501:(e,r,t)=>{var n=t(4633);var i=t(7552);e.exports=n.plugin("postcss-initial",function(e){e=e||{};e.reset=e.reset||"all";e.replace=e.replace||false;var r=i(e.reset==="inherited");var t=function(e,r){var t=false;r.parent.walkDecls(function(e){if(e.prop===r.prop&&e.value!==r.value){t=true}});return t};return function(n){n.walkDecls(function(n){if(n.value.indexOf("initial")<0){return}var i=r(n.prop,n.value);if(i.length===0)return;i.forEach(function(e){if(!t(n.prop,n)){n.cloneBefore(e)}});if(e.replace===true){n.remove()}})}})},7552:(e,r,t)=>{var n=t(8589);var i=t(9614);function _getRulesMap(e){return e.filter(function(e){return!e.combined}).reduce(function(e,r){e[r.prop.replace(/\-/g,"")]=r.initial;return e},{})}function _compileDecls(e){var r=_getRulesMap(e);return e.map(function(e){if(e.combined&&e.initial){var t=n(e.initial.replace(/\-/g,""));e.initial=t(r)}return e})}function _getRequirements(e){return e.reduce(function(e,r){if(!r.contains)return e;return r.contains.reduce(function(e,t){e[t]=r;return e},e)},{})}function _expandContainments(e){var r=_getRequirements(e);return e.filter(function(e){return!e.contains}).map(function(e){var t=r[e.prop];if(t){e.requiredBy=t.prop;e.basic=e.basic||t.basic;e.inherited=e.inherited||t.inherited}return e})}var o=_expandContainments(_compileDecls(i));function _clearDecls(e,r){return e.map(function(e){return{prop:e.prop,value:r.replace(/initial/g,e.initial)}})}function _allDecls(e){return o.filter(function(r){var t=r.combined||r.basic;if(e)return t&&r.inherited;return t})}function _concreteDecl(e){return o.filter(function(r){return e===r.prop||e===r.requiredBy})}function makeFallbackFunction(e){return function(r,t){var n;if(r==="all"){n=_allDecls(e)}else{n=_concreteDecl(r)}return _clearDecls(n,t)}}e.exports=makeFallbackFunction},7972:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=t(4567);var i=_interopDefault(t(4633));var o=_interopDefault(t(9448));var s=i.plugin("postcss-lab-function",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):false;return e=>{e.walkDecls(e=>{const t=e.value;if(a.test(t)){const i=o(t).parse();i.walkType("func",e=>{if(u.test(e.value)){const r=e.nodes.slice(1,-1);const t=f.test(e.value);const i=c.test(e.value);const o=!i&&S(r);const s=!i&&O(r);const a=i&&T(r);if(o||s){e.value="rgb";const i=r[3];const o=r[4];if(o){if(y(o)&&!v(o)){o.unit="";o.value=String(o.value/100)}if(o.value==="1"){i.remove();o.remove()}else{e.value+="a"}}if(i&&g(i)){i.replaceWith(E())}const s=t?n.lab2rgb:n.lch2rgb;const a=s(...[r[0].value,r[1].value,r[2].value].map(e=>parseFloat(e))).map(e=>Math.max(Math.min(parseInt(e*2.55),255),0));r[0].value=String(a[0]);r[1].value=String(a[1]);r[2].value=String(a[2]);e.nodes.splice(3,0,[E()]);e.nodes.splice(2,0,[E()])}else if(a){e.value="rgb";const t=r[2];const i=n.lab2rgb(...[r[0].value,0,0].map(e=>parseFloat(e))).map(e=>Math.max(Math.min(parseInt(e*2.55),255),0));e.removeAll().append(P("(")).append(k(i[0])).append(E()).append(k(i[1])).append(E()).append(k(i[2])).append(P(")"));if(t){if(y(t)&&!v(t)){t.unit="";t.value=String(t.value/100)}if(t.value!=="1"){e.value+="a";e.insertBefore(e.last,E()).insertBefore(e.last,t)}}}}});const s=String(i);if(r){e.cloneBefore({value:s})}else{e.value=s}}})}});const a=/(^|[^\w-])(lab|lch|gray)\(/i;const u=/^(lab|lch|gray)$/i;const f=/^lab$/i;const c=/^gray$/i;const l=/^%?$/i;const p=/^calc$/i;const h=/^(deg|grad|rad|turn)?$/i;const B=e=>v(e)||e.type==="number"&&l.test(e.unit);const v=e=>e.type==="func"&&p.test(e.value);const d=e=>v(e)||e.type==="number"&&h.test(e.unit);const b=e=>v(e)||e.type==="number"&&e.unit==="";const y=e=>v(e)||e.type==="number"&&e.unit==="%";const g=e=>e.type==="operator"&&e.value==="/";const m=[b,b,b,g,B];const C=[b,b,d,g,B];const w=[b,g,B];const S=e=>e.every((e,r)=>typeof m[r]==="function"&&m[r](e));const O=e=>e.every((e,r)=>typeof C[r]==="function"&&C[r](e));const T=e=>e.every((e,r)=>typeof w[r]==="function"&&w[r](e));const E=()=>o.comma({value:","});const k=e=>o.number({value:e});const P=e=>o.paren({value:e});e.exports=s},562:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=(e,r)=>{const t=Object(e.parent).type==="rule"?e.parent.clone({raws:{}}).removeAll():n.rule({selector:"&"});t.selectors=t.selectors.map(e=>`${e}:dir(${r})`);return t};const o=/^\s*logical\s+/i;const s=/^border(-width|-style|-color)?$/i;const a=/^border-(block|block-start|block-end|inline|inline-start|inline-end|start|end)(-(width|style|color))?$/i;var u={border:(e,r,t)=>{const n=o.test(r[0]);if(n){r[0]=r[0].replace(o,"")}const a=[e.clone({prop:`border-top${e.prop.replace(s,"$1")}`,value:r[0]}),e.clone({prop:`border-left${e.prop.replace(s,"$1")}`,value:r[1]||r[0]}),e.clone({prop:`border-bottom${e.prop.replace(s,"$1")}`,value:r[2]||r[0]}),e.clone({prop:`border-right${e.prop.replace(s,"$1")}`,value:r[3]||r[1]||r[0]})];const u=[e.clone({prop:`border-top${e.prop.replace(s,"$1")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(s,"$1")}`,value:r[1]||r[0]}),e.clone({prop:`border-bottom${e.prop.replace(s,"$1")}`,value:r[2]||r[0]}),e.clone({prop:`border-left${e.prop.replace(s,"$1")}`,value:r[3]||r[1]||r[0]})];return n?1===r.length?e.clone({value:e.value.replace(o,"")}):!r[3]||r[3]===r[1]?[e.clone({prop:`border-top${e.prop.replace(s,"$1")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(s,"$1")}`,value:r[3]||r[1]||r[0]}),e.clone({prop:`border-bottom${e.prop.replace(s,"$1")}`,value:r[2]||r[0]}),e.clone({prop:`border-left${e.prop.replace(s,"$1")}`,value:r[1]||r[0]})]:"ltr"===t?a:"rtl"===t?u:[i(e,"ltr").append(a),i(e,"rtl").append(u)]:null},"border-block":(e,r)=>[e.clone({prop:`border-top${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-bottom${e.prop.replace(a,"$2")}`,value:r[0]})],"border-block-start":e=>{e.prop="border-top"},"border-block-end":e=>{e.prop="border-bottom"},"border-inline":(e,r,t)=>{const n=[e.clone({prop:`border-left${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];const o=[e.clone({prop:`border-right${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-left${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];const s=1===r.length||2===r.length&&r[0]===r[1];return s?n:"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"border-inline-start":(e,r,t)=>{const n=e.clone({prop:`border-left${e.prop.replace(a,"$2")}`});const o=e.clone({prop:`border-right${e.prop.replace(a,"$2")}`});return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"border-inline-end":(e,r,t)=>{const n=e.clone({prop:`border-right${e.prop.replace(a,"$2")}`});const o=e.clone({prop:`border-left${e.prop.replace(a,"$2")}`});return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"border-start":(e,r,t)=>{const n=[e.clone({prop:`border-top${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-left${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];const o=[e.clone({prop:`border-top${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"border-end":(e,r,t)=>{const n=[e.clone({prop:`border-bottom${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-right${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];const o=[e.clone({prop:`border-bottom${e.prop.replace(a,"$2")}`,value:r[0]}),e.clone({prop:`border-left${e.prop.replace(a,"$2")}`,value:r[1]||r[0]})];return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]}};var f=(e,r,t)=>{const n=e.clone({value:"left"});const o=e.clone({value:"right"});return/^inline-start$/i.test(e.value)?"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]:/^inline-end$/i.test(e.value)?"ltr"===t?o:"rtl"===t?n:[i(e,"ltr").append(o),i(e,"rtl").append(n)]:null};var c=(e,r,t)=>{if("logical"!==r[0]){return[e.clone({prop:"top",value:r[0]}),e.clone({prop:"right",value:r[1]||r[0]}),e.clone({prop:"bottom",value:r[2]||r[0]}),e.clone({prop:"left",value:r[3]||r[1]||r[0]})]}const n=!r[4]||r[4]===r[2];const o=[e.clone({prop:"top",value:r[1]}),e.clone({prop:"left",value:r[2]||r[1]}),e.clone({prop:"bottom",value:r[3]||r[1]}),e.clone({prop:"right",value:r[4]||r[2]||r[1]})];const s=[e.clone({prop:"top",value:r[1]}),e.clone({prop:"right",value:r[2]||r[1]}),e.clone({prop:"bottom",value:r[3]||r[1]}),e.clone({prop:"left",value:r[4]||r[2]||r[1]})];return n||"ltr"===t?o:"rtl"===t?s:[i(e,"ltr").append(o),i(e,"rtl").append(s)]};var l=e=>/^block$/i.test(e.value)?e.clone({value:"vertical"}):/^inline$/i.test(e.value)?e.clone({value:"horizontal"}):null;var p=/^(inset|margin|padding)(?:-(block|block-start|block-end|inline|inline-start|inline-end|start|end))$/i;var h=/^inset-/i;var B=(e,r,t)=>e.clone({prop:`${e.prop.replace(p,"$1")}${r}`.replace(h,""),value:t});var v={block:(e,r)=>[B(e,"-top",r[0]),B(e,"-bottom",r[1]||r[0])],"block-start":e=>{e.prop=e.prop.replace(p,"$1-top").replace(h,"")},"block-end":e=>{e.prop=e.prop.replace(p,"$1-bottom").replace(h,"")},inline:(e,r,t)=>{const n=[B(e,"-left",r[0]),B(e,"-right",r[1]||r[0])];const o=[B(e,"-right",r[0]),B(e,"-left",r[1]||r[0])];const s=1===r.length||2===r.length&&r[0]===r[1];return s?n:"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"inline-start":(e,r,t)=>{const n=B(e,"-left",e.value);const o=B(e,"-right",e.value);return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},"inline-end":(e,r,t)=>{const n=B(e,"-right",e.value);const o=B(e,"-left",e.value);return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},start:(e,r,t)=>{const n=[B(e,"-top",r[0]),B(e,"-left",r[1]||r[0])];const o=[B(e,"-top",r[0]),B(e,"-right",r[1]||r[0])];return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]},end:(e,r,t)=>{const n=[B(e,"-bottom",r[0]),B(e,"-right",r[1]||r[0])];const o=[B(e,"-bottom",r[0]),B(e,"-left",r[1]||r[0])];return"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]}};var d=/^(min-|max-)?(block|inline)-(size)$/i;var b=e=>{e.prop=e.prop.replace(d,(e,r,t)=>`${r||""}${"block"===t?"height":"width"}`)};var y=(e,r,t)=>{if("logical"!==r[0]){return null}const n=!r[4]||r[4]===r[2];const o=e.clone({value:[r[1],r[4]||r[2]||r[1],r[3]||r[1],r[2]||r[1]].join(" ")});const s=e.clone({value:[r[1],r[2]||r[1],r[3]||r[1],r[4]||r[2]||r[1]].join(" ")});return n?e.clone({value:e.value.replace(/^\s*logical\s+/i,"")}):"ltr"===t?o:"rtl"===t?s:[i(e,"ltr").append(o),i(e,"rtl").append(s)]};var g=(e,r,t)=>{const n=e.clone({value:"left"});const o=e.clone({value:"right"});return/^start$/i.test(e.value)?"ltr"===t?n:"rtl"===t?o:[i(e,"ltr").append(n),i(e,"rtl").append(o)]:/^end$/i.test(e.value)?"ltr"===t?o:"rtl"===t?n:[i(e,"ltr").append(o),i(e,"rtl").append(n)]:null};function splitByComma(e,r){return splitByRegExp(e,/^,$/,r)}function splitBySpace(e,r){return splitByRegExp(e,/^\s$/,r)}function splitBySlash(e,r){return splitByRegExp(e,/^\/$/,r)}function splitByRegExp(e,r,t){const n=[];let i="";let o=false;let s=0;let a=-1;while(++a0){s-=1}}else if(s===0){if(r.test(u)){o=true}}if(o){if(!t||i.trim()){n.push(t?i.trim():i)}if(!t){n.push(u)}i="";o=false}else{i+=u}}if(i!==""){n.push(t?i.trim():i)}return n}var m=(e,r,t)=>{const n=[];const o=[];splitByComma(e.value).forEach(e=>{let r=false;splitBySpace(e).forEach((e,t,i)=>{if(e in C){r=true;C[e].ltr.forEach(e=>{const r=i.slice();r.splice(t,1,e);if(n.length&&!/^,$/.test(n[n.length-1])){n.push(",")}n.push(r.join(""))});C[e].rtl.forEach(e=>{const r=i.slice();r.splice(t,1,e);if(o.length&&!/^,$/.test(o[o.length-1])){o.push(",")}o.push(r.join(""))})}});if(!r){n.push(e);o.push(e)}});const s=e.clone({value:n.join("")});const a=e.clone({value:o.join("")});return n.length&&"ltr"===t?s:o.length&&"rtl"===t?a:s.value!==a.value?[i(e,"ltr").append(s),i(e,"rtl").append(a)]:null};const C={"border-block":{ltr:["border-top","border-bottom"],rtl:["border-top","border-bottom"]},"border-block-color":{ltr:["border-top-color","border-bottom-color"],rtl:["border-top-color","border-bottom-color"]},"border-block-end":{ltr:["border-bottom"],rtl:["border-bottom"]},"border-block-end-color":{ltr:["border-bottom-color"],rtl:["border-bottom-color"]},"border-block-end-style":{ltr:["border-bottom-style"],rtl:["border-bottom-style"]},"border-block-end-width":{ltr:["border-bottom-width"],rtl:["border-bottom-width"]},"border-block-start":{ltr:["border-top"],rtl:["border-top"]},"border-block-start-color":{ltr:["border-top-color"],rtl:["border-top-color"]},"border-block-start-style":{ltr:["border-top-style"],rtl:["border-top-style"]},"border-block-start-width":{ltr:["border-top-width"],rtl:["border-top-width"]},"border-block-style":{ltr:["border-top-style","border-bottom-style"],rtl:["border-top-style","border-bottom-style"]},"border-block-width":{ltr:["border-top-width","border-bottom-width"],rtl:["border-top-width","border-bottom-width"]},"border-end":{ltr:["border-bottom","border-right"],rtl:["border-bottom","border-left"]},"border-end-color":{ltr:["border-bottom-color","border-right-color"],rtl:["border-bottom-color","border-left-color"]},"border-end-style":{ltr:["border-bottom-style","border-right-style"],rtl:["border-bottom-style","border-left-style"]},"border-end-width":{ltr:["border-bottom-width","border-right-width"],rtl:["border-bottom-width","border-left-width"]},"border-inline":{ltr:["border-left","border-right"],rtl:["border-left","border-right"]},"border-inline-color":{ltr:["border-left-color","border-right-color"],rtl:["border-left-color","border-right-color"]},"border-inline-end":{ltr:["border-right"],rtl:["border-left"]},"border-inline-end-color":{ltr:["border-right-color"],rtl:["border-left-color"]},"border-inline-end-style":{ltr:["border-right-style"],rtl:["border-left-style"]},"border-inline-end-width":{ltr:["border-right-width"],rtl:["border-left-width"]},"border-inline-start":{ltr:["border-left"],rtl:["border-right"]},"border-inline-start-color":{ltr:["border-left-color"],rtl:["border-right-color"]},"border-inline-start-style":{ltr:["border-left-style"],rtl:["border-right-style"]},"border-inline-start-width":{ltr:["border-left-width"],rtl:["border-right-width"]},"border-inline-style":{ltr:["border-left-style","border-right-style"],rtl:["border-left-style","border-right-style"]},"border-inline-width":{ltr:["border-left-width","border-right-width"],rtl:["border-left-width","border-right-width"]},"border-start":{ltr:["border-top","border-left"],rtl:["border-top","border-right"]},"border-start-color":{ltr:["border-top-color","border-left-color"],rtl:["border-top-color","border-right-color"]},"border-start-style":{ltr:["border-top-style","border-left-style"],rtl:["border-top-style","border-right-style"]},"border-start-width":{ltr:["border-top-width","border-left-width"],rtl:["border-top-width","border-right-width"]},"block-size":{ltr:["height"],rtl:["height"]},"inline-size":{ltr:["width"],rtl:["width"]},inset:{ltr:["top","right","bottom","left"],rtl:["top","right","bottom","left"]},"inset-block":{ltr:["top","bottom"],rtl:["top","bottom"]},"inset-block-start":{ltr:["top"],rtl:["top"]},"inset-block-end":{ltr:["bottom"],rtl:["bottom"]},"inset-end":{ltr:["bottom","right"],rtl:["bottom","left"]},"inset-inline":{ltr:["left","right"],rtl:["left","right"]},"inset-inline-start":{ltr:["left"],rtl:["right"]},"inset-inline-end":{ltr:["right"],rtl:["left"]},"inset-start":{ltr:["top","left"],rtl:["top","right"]},"margin-block":{ltr:["margin-top","margin-bottom"],rtl:["margin-top","margin-bottom"]},"margin-block-start":{ltr:["margin-top"],rtl:["margin-top"]},"margin-block-end":{ltr:["margin-bottom"],rtl:["margin-bottom"]},"margin-end":{ltr:["margin-bottom","margin-right"],rtl:["margin-bottom","margin-left"]},"margin-inline":{ltr:["margin-left","margin-right"],rtl:["margin-left","margin-right"]},"margin-inline-start":{ltr:["margin-left"],rtl:["margin-right"]},"margin-inline-end":{ltr:["margin-right"],rtl:["margin-left"]},"margin-start":{ltr:["margin-top","margin-left"],rtl:["margin-top","margin-right"]},"padding-block":{ltr:["padding-top","padding-bottom"],rtl:["padding-top","padding-bottom"]},"padding-block-start":{ltr:["padding-top"],rtl:["padding-top"]},"padding-block-end":{ltr:["padding-bottom"],rtl:["padding-bottom"]},"padding-end":{ltr:["padding-bottom","padding-right"],rtl:["padding-bottom","padding-left"]},"padding-inline":{ltr:["padding-left","padding-right"],rtl:["padding-left","padding-right"]},"padding-inline-start":{ltr:["padding-left"],rtl:["padding-right"]},"padding-inline-end":{ltr:["padding-right"],rtl:["padding-left"]},"padding-start":{ltr:["padding-top","padding-left"],rtl:["padding-top","padding-right"]}};var w=/^(?:(inset|margin|padding)(?:-(block|block-start|block-end|inline|inline-start|inline-end|start|end))|(min-|max-)?(block|inline)-(size))$/i;const S={border:u["border"],"border-width":u["border"],"border-style":u["border"],"border-color":u["border"],"border-block":u["border-block"],"border-block-width":u["border-block"],"border-block-style":u["border-block"],"border-block-color":u["border-block"],"border-block-start":u["border-block-start"],"border-block-start-width":u["border-block-start"],"border-block-start-style":u["border-block-start"],"border-block-start-color":u["border-block-start"],"border-block-end":u["border-block-end"],"border-block-end-width":u["border-block-end"],"border-block-end-style":u["border-block-end"],"border-block-end-color":u["border-block-end"],"border-inline":u["border-inline"],"border-inline-width":u["border-inline"],"border-inline-style":u["border-inline"],"border-inline-color":u["border-inline"],"border-inline-start":u["border-inline-start"],"border-inline-start-width":u["border-inline-start"],"border-inline-start-style":u["border-inline-start"],"border-inline-start-color":u["border-inline-start"],"border-inline-end":u["border-inline-end"],"border-inline-end-width":u["border-inline-end"],"border-inline-end-style":u["border-inline-end"],"border-inline-end-color":u["border-inline-end"],"border-start":u["border-start"],"border-start-width":u["border-start"],"border-start-style":u["border-start"],"border-start-color":u["border-start"],"border-end":u["border-end"],"border-end-width":u["border-end"],"border-end-style":u["border-end"],"border-end-color":u["border-end"],clear:f,inset:c,margin:y,padding:y,block:v["block"],"block-start":v["block-start"],"block-end":v["block-end"],inline:v["inline"],"inline-start":v["inline-start"],"inline-end":v["inline-end"],start:v["start"],end:v["end"],float:f,resize:l,size:b,"text-align":g,transition:m,"transition-property":m};const O=/^border(-block|-inline|-start|-end)?(-width|-style|-color)?$/i;var T=n.plugin("postcss-logical-properties",e=>{const r=Boolean(Object(e).preserve);const t=!r&&typeof Object(e).dir==="string"?/^rtl$/i.test(e.dir)?"rtl":"ltr":false;return e=>{e.walkDecls(e=>{const n=e.parent;const i=O.test(e.prop)?splitBySlash(e.value,true):splitBySpace(e.value,true);const o=e.prop.replace(w,"$2$5").toLowerCase();if(o in S){const s=S[o](e,i,t);if(s){[].concat(s).forEach(r=>{if(r.type==="rule"){n.before(r)}else{e.before(r)}});if(!r){e.remove();if(!n.nodes.length){n.remove()}}}}})}});e.exports=T},601:(e,r,t)=>{var n=t(4633);e.exports=n.plugin("postcss-media-minmax",function(){return function(e){var r={width:"px",height:"px","device-width":"px","device-height":"px","aspect-ratio":"","device-aspect-ratio":"",color:"","color-index":"",monochrome:"",resolution:"dpi"};var t=Object.keys(r);var n=.001;var i={">":1,"<":-1};var o={">":"min","<":"max"};function create_query(e,t,s,a,u){return a.replace(/([-\d\.]+)(.*)/,function(a,u,f){var c=parseFloat(u);if(parseFloat(u)||s){if(!s){if(f==="px"&&c===parseInt(u,10)){u=c+i[t]}else{u=Number(Math.round(parseFloat(u)+n*i[t]+"e6")+"e-6")}}}else{u=i[t]+r[e]}return"("+o[t]+"-"+e+": "+u+f+")"})}e.walkAtRules(function(e,r){if(e.name!=="media"&&e.name!=="custom-media"){return}e.params=e.params.replace(/\(\s*([a-z-]+?)\s*([<>])(=?)\s*((?:-?\d*\.?(?:\s*\/?\s*)?\d+[a-z]*)?)\s*\)/gi,function(r,n,i,o,s){var a="";if(t.indexOf(n)>-1){return create_query(n,i,o,s,e.params)}return r});e.params=e.params.replace(/\(\s*((?:-?\d*\.?(?:\s*\/?\s*)?\d+[a-z]*)?)\s*(<|>)(=?)\s*([a-z-]+)\s*(<|>)(=?)\s*((?:-?\d*\.?(?:\s*\/?\s*)?\d+[a-z]*)?)\s*\)/gi,function(e,r,n,i,o,s,a,u){if(t.indexOf(o)>-1){if(n==="<"&&s==="<"||n===">"&&s===">"){var f=n==="<"?r:u;var c=n==="<"?u:r;var l=i;var p=a;if(n===">"){l=a;p=i}return create_query(o,">",l,f)+" and "+create_query(o,"<",p,c)}}return e})})}})},9717:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=t(4633);var i=_interopDefault(n);function shiftNodesBeforeParent(e){const r=e.parent;const t=r.index(e);if(t){r.cloneBefore().removeAll().append(r.nodes.slice(0,t))}r.before(e);return r}function cleanupParent(e){if(!e.nodes.length){e.remove()}}var o=/&(?:[^\w-|]|$)/;const s=/&/g;function mergeSelectors(e,r){return e.reduce((e,t)=>e.concat(r.map(e=>e.replace(s,t))),[])}function transformRuleWithinRule(e){const r=shiftNodesBeforeParent(e);e.selectors=mergeSelectors(r.selectors,e.selectors);const t=e.type==="rule"&&r.type==="rule"&&e.selector===r.selector||e.type==="atrule"&&r.type==="atrule"&&e.params===r.params;if(t){e.append(...r.nodes)}cleanupParent(r)}const a=e=>e.type==="rule"&&Object(e.parent).type==="rule"&&e.selectors.every(e=>e.trim().lastIndexOf("&")===0&&o.test(e));const u=n.list.comma;function transformNestRuleWithinRule(e){const r=shiftNodesBeforeParent(e);const t=r.clone().removeAll().append(e.nodes);e.replaceWith(t);t.selectors=mergeSelectors(r.selectors,u(e.params));cleanupParent(r);walk(t)}const f=e=>e.type==="atrule"&&e.name==="nest"&&Object(e.parent).type==="rule"&&u(e.params).every(e=>e.split("&").length===2&&o.test(e));var c=["document","media","supports"];function atruleWithinRule(e){const r=shiftNodesBeforeParent(e);const t=r.clone().removeAll().append(e.nodes);e.append(t);cleanupParent(r);walk(t)}const l=e=>e.type==="atrule"&&c.indexOf(e.name)!==-1&&Object(e.parent).type==="rule";const p=n.list.comma;function mergeParams(e,r){return p(e).map(e=>p(r).map(r=>`${e} and ${r}`).join(", ")).join(", ")}function transformAtruleWithinAtrule(e){const r=shiftNodesBeforeParent(e);e.params=mergeParams(r.params,e.params);cleanupParent(r)}const h=e=>e.type==="atrule"&&c.indexOf(e.name)!==-1&&Object(e.parent).type==="atrule"&&e.name===e.parent.name;function walk(e){e.nodes.slice(0).forEach(r=>{if(r.parent===e){if(a(r)){transformRuleWithinRule(r)}else if(f(r)){transformNestRuleWithinRule(r)}else if(l(r)){atruleWithinRule(r)}else if(h(r)){transformAtruleWithinAtrule(r)}if(Object(r.nodes).length){walk(r)}}})}var B=i.plugin("postcss-nesting",()=>walk);e.exports=B},498:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}const i=n.list.space;const o=/^overflow$/i;var s=n.plugin("postcss-overflow-shorthand",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;return e=>{e.walkDecls(o,e=>{const t=i(e.value),n=_toArray(t),o=n[0],s=n[1],a=n.slice(2);if(s&&!a.length){e.cloneBefore({prop:`${e.prop}-x`,value:o});e.cloneBefore({prop:`${e.prop}-y`,value:s});if(!r){e.remove()}}})}});e.exports=s},2841:(e,r,t)=>{var n=t(4633);e.exports=n.plugin("postcss-page-break",function(){return function(e){e.walkDecls(/^break-(inside|before|after)/,function(e){if(e.value.search(/column|region/)>=0){return}var r;switch(e.value){case"page":r="always";break;case"avoid-page":r="avoid";break;default:r=e.value}e.cloneBefore({prop:"page-"+e.prop,value:r})})}})},1431:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(9448));const o=/^place-(content|items|self)/;var s=n.plugin("postcss-place",e=>{const r="preserve"in Object(e)?Boolean(e.prefix):true;return e=>{e.walkDecls(o,e=>{const t=e.prop.match(o)[1];const n=i(e.value).parse();const s=n.nodes[0].nodes;const a=s.length===1?e.value:String(s.slice(0,1)).trim();const u=s.length===1?e.value:String(s.slice(1)).trim();e.cloneBefore({prop:`align-${t}`,value:a});e.cloneBefore({prop:`justify-${t}`,value:u});if(!r){e.remove()}})}});e.exports=s},7435:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(3501));var i=_interopDefault(t(3561));var o=_interopDefault(t(3094));var s=_interopDefault(t(4633));var a=_interopDefault(t(2347));var u=_interopDefault(t(9883));var f=_interopDefault(t(7814));var c=_interopDefault(t(489));var l=_interopDefault(t(8157));var p=_interopDefault(t(8881));var h=_interopDefault(t(9971));var B=_interopDefault(t(4731));var v=_interopDefault(t(8713));var d=_interopDefault(t(8758));var b=_interopDefault(t(3650));var y=_interopDefault(t(3030));var g=_interopDefault(t(5538));var m=_interopDefault(t(9642));var C=_interopDefault(t(8059));var w=_interopDefault(t(3203));var S=_interopDefault(t(9547));var O=_interopDefault(t(9555));var T=_interopDefault(t(4287));var E=_interopDefault(t(7501));var k=_interopDefault(t(7972));var P=_interopDefault(t(562));var D=_interopDefault(t(601));var A=_interopDefault(t(9717));var R=_interopDefault(t(498));var F=_interopDefault(t(2841));var x=_interopDefault(t(1431));var j=_interopDefault(t(2207));var I=_interopDefault(t(1832));var M=_interopDefault(t(9020));var _=_interopDefault(t(40));var N=_interopDefault(t(8158));var L=t(4338);var q=_interopDefault(t(5747));var G=_interopDefault(t(5622));var U=s.plugin("postcss-system-ui-font",()=>e=>{e.walkDecls(J,e=>{e.value=e.value.replace(H,K)})});const J=/(?:^(?:-|\\002d){2})|(?:^font(?:-family)?$)/i;const W="[\\f\\n\\r\\x09\\x20]";const Q=["system-ui","-apple-system","Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans","sans-serif"];const H=new RegExp(`(^|,|${W}+)(?:system-ui${W}*)(?:,${W}*(?:${Q.join("|")})${W}*)?(,|$)`,"i");const K=`$1${Q.join(", ")}$2`;var Y={"all-property":E,"any-link-pseudo-class":I,"blank-pseudo-class":u,"break-properties":F,"case-insensitive-attributes":a,"color-functional-notation":f,"color-mod-function":p,"custom-media-queries":B,"custom-properties":v,"custom-selectors":d,"dir-pseudo-class":b,"double-position-gradients":y,"environment-variables":g,"focus-visible-pseudo-class":m,"focus-within-pseudo-class":C,"font-variant-property":w,"gap-properties":S,"gray-function":c,"has-pseudo-class":O,"hexadecimal-alpha-notation":l,"image-set-function":T,"lab-function":k,"logical-properties-and-values":P,"matches-pseudo-class":_,"media-query-ranges":D,"nesting-rules":A,"not-pseudo-class":N,"overflow-property":R,"overflow-wrap-property":M,"place-properties":x,"prefers-color-scheme-query":j,"rebeccapurple-color":h,"system-ui-font-family":U};function getTransformedInsertions(e,r){return Object.keys(e).map(t=>[].concat(e[t]).map(e=>({[r]:true,plugin:e,id:t}))).reduce((e,r)=>e.concat(r),[])}function getUnsupportedBrowsersByFeature(e){const r=L.features[e];if(r){const e=L.feature(r).stats;const t=Object.keys(e).reduce((r,t)=>r.concat(Object.keys(e[t]).filter(r=>e[t][r].indexOf("y")!==0).map(e=>`${t} ${e}`)),[]);return t}else{return["> 0%"]}}var z=["custom-media-queries","custom-properties","environment-variables","image-set-function","media-query-ranges","prefers-color-scheme-query","nesting-rules","custom-selectors","any-link-pseudo-class","case-insensitive-attributes","focus-visible-pseudo-class","focus-within-pseudo-class","matches-pseudo-class","not-pseudo-class","logical-properties-and-values","dir-pseudo-class","all-property","color-functional-notation","double-position-gradients","gray-function","hexadecimal-alpha-notation","lab-function","rebeccapurple-color","color-mod-function","blank-pseudo-class","break-properties","font-variant-property","has-pseudo-class","gap-properties","overflow-property","overflow-wrap-property","place-properties","system-ui-font-family"];function asyncGeneratorStep(e,r,t,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,i,_next,_throw,"throw",e)}_next(undefined)})}}function getCustomMediaAsCss(e){const r=Object.keys(e).reduce((r,t)=>{r.push(`@custom-media ${t} ${e[t]};`);return r},[]).join("\n");const t=`${r}\n`;return t}function getCustomPropertiesAsCss(e){const r=Object.keys(e).reduce((r,t)=>{r.push(`\t${t}: ${e[t]};`);return r},[]).join("\n");const t=`:root {\n${r}\n}\n`;return t}function getCustomSelectorsAsCss(e){const r=Object.keys(e).reduce((r,t)=>{r.push(`@custom-selector ${t} ${e[t]};`);return r},[]).join("\n");const t=`${r}\n`;return t}function writeExportsToCssFile(e,r,t,n){return _writeExportsToCssFile.apply(this,arguments)}function _writeExportsToCssFile(){_writeExportsToCssFile=_asyncToGenerator(function*(e,r,t,n){const i=getCustomPropertiesAsCss(t);const o=getCustomMediaAsCss(r);const s=getCustomSelectorsAsCss(n);const a=`${o}\n${s}\n${i}`;yield writeFile(e,a)});return _writeExportsToCssFile.apply(this,arguments)}function writeExportsToJsonFile(e,r,t,n){return _writeExportsToJsonFile.apply(this,arguments)}function _writeExportsToJsonFile(){_writeExportsToJsonFile=_asyncToGenerator(function*(e,r,t,n){const i=JSON.stringify({"custom-media":r,"custom-properties":t,"custom-selectors":n},null," ");const o=`${i}\n`;yield writeFile(e,o)});return _writeExportsToJsonFile.apply(this,arguments)}function getObjectWithKeyAsCjs(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t\t'${escapeForJS(t)}': '${escapeForJS(r[t])}'`);return e},[]).join(",\n");const n=`\n\t${e}: {\n${t}\n\t}`;return n}function writeExportsToCjsFile(e,r,t,n){return _writeExportsToCjsFile.apply(this,arguments)}function _writeExportsToCjsFile(){_writeExportsToCjsFile=_asyncToGenerator(function*(e,r,t,n){const i=getObjectWithKeyAsCjs("customMedia",r);const o=getObjectWithKeyAsCjs("customProperties",t);const s=getObjectWithKeyAsCjs("customSelectors",n);const a=`module.exports = {${i},${o},${s}\n};\n`;yield writeFile(e,a)});return _writeExportsToCjsFile.apply(this,arguments)}function getObjectWithKeyAsMjs(e,r){const t=Object.keys(r).reduce((e,t)=>{e.push(`\t'${escapeForJS(t)}': '${escapeForJS(r[t])}'`);return e},[]).join(",\n");const n=`export const ${e} = {\n${t}\n};\n`;return n}function writeExportsToMjsFile(e,r,t,n){return _writeExportsToMjsFile.apply(this,arguments)}function _writeExportsToMjsFile(){_writeExportsToMjsFile=_asyncToGenerator(function*(e,r,t,n){const i=getObjectWithKeyAsMjs("customMedia",r);const o=getObjectWithKeyAsMjs("customProperties",t);const s=getObjectWithKeyAsMjs("customSelectors",n);const a=`${i}\n${o}\n${s}`;yield writeFile(e,a)});return _writeExportsToMjsFile.apply(this,arguments)}function writeToExports(e,r){return Promise.all([].concat(r).map(function(){var r=_asyncToGenerator(function*(r){if(r instanceof Function){yield r({customMedia:getObjectWithStringifiedKeys(e.customMedia),customProperties:getObjectWithStringifiedKeys(e.customProperties),customSelectors:getObjectWithStringifiedKeys(e.customSelectors)})}else{const t=r===Object(r)?r:{to:String(r)};const n=t.toJSON||getObjectWithStringifiedKeys;if("customMedia"in t||"customProperties"in t||"customSelectors"in t){t.customMedia=n(e.customMedia);t.customProperties=n(e.customProperties);t.customSelectors=n(e.customSelectors)}else if("custom-media"in t||"custom-properties"in t||"custom-selectors"in t){t["custom-media"]=n(e.customMedia);t["custom-properties"]=n(e.customProperties);t["custom-selectors"]=n(e.customSelectors)}else{const r=String(t.to||"");const i=(t.type||G.extname(t.to).slice(1)).toLowerCase();const o=n(e.customMedia);const s=n(e.customProperties);const a=n(e.customSelectors);if(i==="css"){yield writeExportsToCssFile(r,o,s,a)}if(i==="js"){yield writeExportsToCjsFile(r,o,s,a)}if(i==="json"){yield writeExportsToJsonFile(r,o,s,a)}if(i==="mjs"){yield writeExportsToMjsFile(r,o,s,a)}}}});return function(e){return r.apply(this,arguments)}}()))}function getObjectWithStringifiedKeys(e){return Object.keys(e).reduce((r,t)=>{r[t]=String(e[t]);return r},{})}function writeFile(e,r){return new Promise((t,n)=>{q.writeFile(e,r,e=>{if(e){n(e)}else{t()}})})}function escapeForJS(e){return e.replace(/\\([\s\S])|(')/g,"\\$1$2").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var $=s.plugin("postcss-preset-env",e=>{const r=Object(Object(e).features);const t=Object(Object(e).insertBefore);const s=Object(Object(e).insertAfter);const a=Object(e).browsers;const u="stage"in Object(e)?e.stage===false?5:parseInt(e.stage)||0:2;const f=Object(e).autoprefixer;const c=X(Object(e));const l=f===false?()=>{}:n(Object.assign({overrideBrowserslist:a},f));const p=o.concat(getTransformedInsertions(t,"insertBefore"),getTransformedInsertions(s,"insertAfter")).filter(e=>e.insertBefore||e.id in Y).sort((e,r)=>z.indexOf(e.id)-z.indexOf(r.id)||(e.insertBefore?-1:r.insertBefore?1:0)||(e.insertAfter?1:r.insertAfter?-1:0)).map(e=>{const r=getUnsupportedBrowsersByFeature(e.caniuse);return e.insertBefore||e.insertAfter?{browsers:r,plugin:e.plugin,id:`${e.insertBefore?"before":"after"}-${e.id}`,stage:6}:{browsers:r,plugin:Y[e.id],id:e.id,stage:e.stage}});const h=p.filter(e=>e.id in r?r[e.id]:e.stage>=u).map(e=>({browsers:e.browsers,plugin:typeof e.plugin.process==="function"?r[e.id]===true?c?e.plugin(Object.assign({},c)):e.plugin():c?e.plugin(Object.assign({},c,r[e.id])):e.plugin(Object.assign({},r[e.id])):e.plugin,id:e.id}));const B=i(a,{ignoreUnknownVersions:true});const v=h.filter(e=>B.some(r=>i(e.browsers,{ignoreUnknownVersions:true}).some(e=>e===r)));return(r,t)=>{const n=v.reduce((e,r)=>e.then(()=>r.plugin(t.root,t)),Promise.resolve()).then(()=>l(t.root,t)).then(()=>{if(Object(e).exportTo){writeToExports(c.exportTo,e.exportTo)}});return n}});const X=e=>{if("importFrom"in e||"exportTo"in e||"preserve"in e){const r={};if("importFrom"in e){r.importFrom=e.importFrom}if("exportTo"in e){r.exportTo={customMedia:{},customProperties:{},customSelectors:{}}}if("preserve"in e){r.preserve=e.preserve}return r}return false};e.exports=$},1832:(e,r,t)=>{"use strict";function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(t(4633));var i=_interopDefault(t(741));const o=/:any-link/;var s=n.plugin("postcss-pseudo-class-any-link",e=>{const r="preserve"in Object(e)?Boolean(e.preserve):true;return e=>{e.walkRules(o,e=>{const t=e.raws.selector&&e.raws.selector.raw||e.selector;if(t[t.length-1]!==":"){const n=i(e=>{let r;let t;let n;let i;let o;let s=-1;while(n=e.nodes[++s]){t=-1;while(r=n.nodes[++t]){if(r.value===":any-link"){i=n.clone();o=n.clone();i.nodes[t].value=":link";o.nodes[t].value=":visited";e.nodes.splice(s--,1,i,o);break}}}}).processSync(t);if(n!==t){if(r){e.cloneBefore({selector:n})}else{e.selector=n}}}})}});e.exports=s},9018:e=>{"use strict";var r={};var t=r.hasOwnProperty;var n=function merge(e,r){if(!e){return r}var n={};for(var i in r){n[i]=t.call(e,i)?e[i]:r[i]}return n};var i=/[ -,\.\/;-@\[-\^`\{-~]/;var o=/[ -,\.\/;-@\[\]\^`\{-~]/;var s=/['"\\]/;var a=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;var u=function cssesc(e,r){r=n(r,cssesc.options);if(r.quotes!="single"&&r.quotes!="double"){r.quotes="single"}var t=r.quotes=="double"?'"':"'";var s=r.isIdentifier;var u=e.charAt(0);var f="";var c=0;var l=e.length;while(c126){if(h>=55296&&h<=56319&&c{"use strict";r.__esModule=true;var n=t(268);var i=_interopRequireDefault(n);var o=t(5848);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=function parser(e){return new i.default(e)};Object.assign(a,s);delete a.__esModule;r.default=a;e.exports=r["default"]},4682:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Parser);this.rule=e;this.options=Object.assign({lossy:false,safe:false},r);this.position=0;this.css=typeof this.rule==="string"?this.rule:this.rule.selector;this.tokens=(0,N.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var t=getTokenSourceSpan(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new p.default({source:t});this.root.errorGenerator=this._errorGenerator();var n=new B.default({source:{start:{line:1,column:1}}});this.root.append(n);this.current=n;this.loop()}Parser.prototype._errorGenerator=function _errorGenerator(){var e=this;return function(r,t){if(typeof e.rule==="string"){return new Error(r)}return e.rule.error(r,t)}};Parser.prototype.attribute=function attribute(){var e=[];var r=this.currToken;this.position++;while(this.position1&&arguments[1]!==undefined?arguments[1]:false;var n="";var i="";e.forEach(function(e){var o=r.lossySpace(e.spaces.before,t);var s=r.lossySpace(e.rawSpaceBefore,t);n+=o+r.lossySpace(e.spaces.after,t&&o.length===0);i+=o+e.value+r.lossySpace(e.rawSpaceAfter,t&&s.length===0)});if(i===n){i=undefined}var o={space:n,rawSpace:i};return o};Parser.prototype.isNamedCombinator=function isNamedCombinator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position;return this.tokens[e+0]&&this.tokens[e+0][_.FIELDS.TYPE]===q.slash&&this.tokens[e+1]&&this.tokens[e+1][_.FIELDS.TYPE]===q.word&&this.tokens[e+2]&&this.tokens[e+2][_.FIELDS.TYPE]===q.slash};Parser.prototype.namedCombinator=function namedCombinator(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]);var r=(0,J.unesc)(e).toLowerCase();var t={};if(r!==e){t.value="/"+e+"/"}var n=new F.default({value:"/"+r+"/",source:getSource(this.currToken[_.FIELDS.START_LINE],this.currToken[_.FIELDS.START_COL],this.tokens[this.position+2][_.FIELDS.END_LINE],this.tokens[this.position+2][_.FIELDS.END_COL]),sourceIndex:this.currToken[_.FIELDS.START_POS],raws:t});this.position=this.position+3;return n}else{this.unexpected()}};Parser.prototype.combinator=function combinator(){var e=this;if(this.content()==="|"){return this.namespace()}var r=this.locateNextMeaningfulToken(this.position);if(r<0||this.tokens[r][_.FIELDS.TYPE]===q.comma){var t=this.parseWhitespaceEquivalentTokens(r);if(t.length>0){var n=this.current.last;if(n){var i=this.convertWhitespaceNodesToSpace(t),o=i.space,s=i.rawSpace;if(s!==undefined){n.rawSpaceAfter+=s}n.spaces.after+=o}else{t.forEach(function(r){return e.newNode(r)})}}return}var a=this.currToken;var u=undefined;if(r>this.position){u=this.parseWhitespaceEquivalentTokens(r)}var f=void 0;if(this.isNamedCombinator()){f=this.namedCombinator()}else if(this.currToken[_.FIELDS.TYPE]===q.combinator){f=new F.default({value:this.content(),source:getTokenSource(this.currToken),sourceIndex:this.currToken[_.FIELDS.START_POS]});this.position++}else if(W[this.currToken[_.FIELDS.TYPE]]){}else if(!u){this.unexpected()}if(f){if(u){var c=this.convertWhitespaceNodesToSpace(u),l=c.space,p=c.rawSpace;f.spaces.before=l;f.rawSpaceBefore=p}}else{var h=this.convertWhitespaceNodesToSpace(u,true),B=h.space,v=h.rawSpace;if(!v){v=B}var d={};var b={spaces:{}};if(B.endsWith(" ")&&v.endsWith(" ")){d.before=B.slice(0,B.length-1);b.spaces.before=v.slice(0,v.length-1)}else if(B.startsWith(" ")&&v.startsWith(" ")){d.after=B.slice(1);b.spaces.after=v.slice(1)}else{b.value=v}f=new F.default({value:" ",source:getTokenSourceSpan(a,this.tokens[this.position-1]),sourceIndex:a[_.FIELDS.START_POS],spaces:d,raws:b})}if(this.currToken&&this.currToken[_.FIELDS.TYPE]===q.space){f.spaces.after=this.optionalSpace(this.content());this.position++}return this.newNode(f)};Parser.prototype.comma=function comma(){if(this.position===this.tokens.length-1){this.root.trailingComma=true;this.position++;return}this.current._inferEndPosition();var e=new B.default({source:{start:tokenStart(this.tokens[this.position+1])}});this.current.parent.append(e);this.current=e;this.position++};Parser.prototype.comment=function comment(){var e=this.currToken;this.newNode(new y.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.error=function error(e,r){throw this.root.error(e,r)};Parser.prototype.missingBackslash=function missingBackslash(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[_.FIELDS.START_POS]})};Parser.prototype.missingParenthesis=function missingParenthesis(){return this.expected("opening parenthesis",this.currToken[_.FIELDS.START_POS])};Parser.prototype.missingSquareBracket=function missingSquareBracket(){return this.expected("opening square bracket",this.currToken[_.FIELDS.START_POS])};Parser.prototype.unexpected=function unexpected(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[_.FIELDS.START_POS])};Parser.prototype.namespace=function namespace(){var e=this.prevToken&&this.content(this.prevToken)||true;if(this.nextToken[_.FIELDS.TYPE]===q.word){this.position++;return this.word(e)}else if(this.nextToken[_.FIELDS.TYPE]===q.asterisk){this.position++;return this.universal(e)}};Parser.prototype.nesting=function nesting(){if(this.nextToken){var e=this.content(this.nextToken);if(e==="|"){this.position++;return}}var r=this.currToken;this.newNode(new j.default({value:this.content(),source:getTokenSource(r),sourceIndex:r[_.FIELDS.START_POS]}));this.position++};Parser.prototype.parentheses=function parentheses(){var e=this.current.last;var r=1;this.position++;if(e&&e.type===U.PSEUDO){var t=new B.default({source:{start:tokenStart(this.tokens[this.position-1])}});var n=this.current;e.append(t);this.current=t;while(this.position1&&e.nextToken&&e.nextToken[_.FIELDS.TYPE]===q.openParenthesis){e.error("Misplaced parenthesis.",{index:e.nextToken[_.FIELDS.START_POS]})}})}else{return this.expected(["pseudo-class","pseudo-element"],this.currToken[_.FIELDS.START_POS])}};Parser.prototype.space=function space(){var e=this.content();if(this.position===0||this.prevToken[_.FIELDS.TYPE]===q.comma||this.prevToken[_.FIELDS.TYPE]===q.openParenthesis){this.spaces=this.optionalSpace(e);this.position++}else if(this.position===this.tokens.length-1||this.nextToken[_.FIELDS.TYPE]===q.comma||this.nextToken[_.FIELDS.TYPE]===q.closeParenthesis){this.current.last.spaces.after=this.optionalSpace(e);this.position++}else{this.combinator()}};Parser.prototype.string=function string(){var e=this.currToken;this.newNode(new O.default({value:this.content(),source:getTokenSource(e),sourceIndex:e[_.FIELDS.START_POS]}));this.position++};Parser.prototype.universal=function universal(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}var t=this.currToken;this.newNode(new A.default({value:this.content(),source:getTokenSource(t),sourceIndex:t[_.FIELDS.START_POS]}),e);this.position++};Parser.prototype.splitWord=function splitWord(e,r){var t=this;var n=this.nextToken;var i=this.content();while(n&&~[q.dollar,q.caret,q.equals,q.word].indexOf(n[_.FIELDS.TYPE])){this.position++;var o=this.content();i+=o;if(o.lastIndexOf("\\")===o.length-1){var s=this.nextToken;if(s&&s[_.FIELDS.TYPE]===q.space){i+=this.requiredSpace(this.content(s));this.position++}}n=this.nextToken}var a=(0,u.default)(i,".").filter(function(e){return i[e-1]!=="\\"});var f=(0,u.default)(i,"#");var l=(0,u.default)(i,"#{");if(l.length){f=f.filter(function(e){return!~l.indexOf(e)})}var p=(0,M.default)((0,c.default)([0].concat(a,f)));p.forEach(function(n,o){var s=p[o+1]||i.length;var u=i.slice(n,s);if(o===0&&r){return r.call(t,u,p.length)}var c=void 0;var l=t.currToken;var h=l[_.FIELDS.START_POS]+p[o];var B=getSource(l[1],l[2]+n,l[3],l[2]+(s-1));if(~a.indexOf(n)){var v={value:u.slice(1),source:B,sourceIndex:h};c=new d.default(unescapeProp(v,"value"))}else if(~f.indexOf(n)){var b={value:u.slice(1),source:B,sourceIndex:h};c=new m.default(unescapeProp(b,"value"))}else{var y={value:u,source:B,sourceIndex:h};unescapeProp(y,"value");c=new w.default(y)}t.newNode(c,e);e=null});this.position++};Parser.prototype.word=function word(e){var r=this.nextToken;if(r&&this.content(r)==="|"){this.position++;return this.namespace()}return this.splitWord(e)};Parser.prototype.loop=function loop(){while(this.position0&&arguments[0]!==undefined?arguments[0]:this.currToken;return this.css.slice(e[_.FIELDS.START_POS],e[_.FIELDS.END_POS])};Parser.prototype.locateNextMeaningfulToken=function locateNextMeaningfulToken(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.position+1;var r=e;while(r{"use strict";r.__esModule=true;var n=t(4682);var i=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=function(){function Processor(e,r){_classCallCheck(this,Processor);this.func=e||function noop(){};this.funcRes=null;this.options=r}Processor.prototype._shouldUpdateSelector=function _shouldUpdateSelector(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=Object.assign({},this.options,r);if(t.updateSelector===false){return false}else{return typeof e!=="string"}};Processor.prototype._isLossy=function _isLossy(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=Object.assign({},this.options,e);if(r.lossless===false){return true}else{return false}};Processor.prototype._root=function _root(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=new i.default(e,this._parseOptions(r));return t.root};Processor.prototype._parseOptions=function _parseOptions(e){return{lossy:this._isLossy(e)}};Processor.prototype._run=function _run(e){var r=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){try{var o=r._root(e,t);Promise.resolve(r.func(o)).then(function(n){var i=undefined;if(r._shouldUpdateSelector(e,t)){i=o.toString();e.selector=i}return{transform:n,root:o,string:i}}).then(n,i)}catch(e){i(e);return}})};Processor.prototype._runSync=function _runSync(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var t=this._root(e,r);var n=this.func(t);if(n&&typeof n.then==="function"){throw new Error("Selector processor returned a promise to a synchronous call.")}var i=undefined;if(r.updateSelector&&typeof e!=="string"){i=t.toString();e.selector=i}return{transform:n,root:t,string:i}};Processor.prototype.ast=function ast(e,r){return this._run(e,r).then(function(e){return e.root})};Processor.prototype.astSync=function astSync(e,r){return this._runSync(e,r).root};Processor.prototype.transform=function transform(e,r){return this._run(e,r).then(function(e){return e.transform})};Processor.prototype.transformSync=function transformSync(e,r){return this._runSync(e,r).transform};Processor.prototype.process=function process(e,r){return this._run(e,r).then(function(e){return e.string||e.root.toString()})};Processor.prototype.processSync=function processSync(e,r){var t=this._runSync(e,r);return t.string||t.root.toString()};return Processor}();r.default=o;e.exports=r["default"]},7239:(e,r,t)=>{"use strict";r.__esModule=true;var n;var i=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Attribute);var t=_possibleConstructorReturn(this,e.call(this,handleDeprecatedContructorOpts(r)));t.type=l.ATTRIBUTE;t.raws=t.raws||{};Object.defineProperty(t.raws,"unquoted",{get:h(function(){return t.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:h(function(){return t.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")});t._constructed=true;return t}Attribute.prototype.getQuotedValue=function getQuotedValue(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._determineQuoteMark(e);var t=g[r];var n=(0,s.default)(this._value,t);return n};Attribute.prototype._determineQuoteMark=function _determineQuoteMark(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)};Attribute.prototype.setValue=function setValue(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._value=e;this._quoteMark=this._determineQuoteMark(r);this._syncRawValue()};Attribute.prototype.smartQuoteMark=function smartQuoteMark(e){var r=this.value;var t=r.replace(/[^']/g,"").length;var n=r.replace(/[^"]/g,"").length;if(t+n===0){var i=(0,s.default)(r,{isIdentifier:true});if(i===r){return Attribute.NO_QUOTE}else{var o=this.preferredQuoteMark(e);if(o===Attribute.NO_QUOTE){var a=this.quoteMark||e.quoteMark||Attribute.DOUBLE_QUOTE;var u=g[a];var f=(0,s.default)(r,u);if(f.length1&&arguments[1]!==undefined?arguments[1]:e;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultAttrConcat;var n=this._spacesFor(r);return t(this.stringifyProperty(e),n)};Attribute.prototype.offsetOf=function offsetOf(e){var r=1;var t=this._spacesFor("attribute");r+=t.before.length;if(e==="namespace"||e==="ns"){return this.namespace?r:-1}if(e==="attributeNS"){return r}r+=this.namespaceString.length;if(this.namespace){r+=1}if(e==="attribute"){return r}r+=this.stringifyProperty("attribute").length;r+=t.after.length;var n=this._spacesFor("operator");r+=n.before.length;var i=this.stringifyProperty("operator");if(e==="operator"){return i?r:-1}r+=i.length;r+=n.after.length;var o=this._spacesFor("value");r+=o.before.length;var s=this.stringifyProperty("value");if(e==="value"){return s?r:-1}r+=s.length;r+=o.after.length;var a=this._spacesFor("insensitive");r+=a.before.length;if(e==="insensitive"){return this.insensitive?r:-1}return-1};Attribute.prototype.toString=function toString(){var e=this;var r=[this.rawSpaceBefore,"["];r.push(this._stringFor("qualifiedAttribute","attribute"));if(this.operator&&this.value){r.push(this._stringFor("operator"));r.push(this._stringFor("value"));r.push(this._stringFor("insensitiveFlag","insensitive",function(r,t){if(r.length>0&&!e.quoted&&t.before.length===0&&!(e.spaces.value&&e.spaces.value.after)){t.before=" "}return defaultAttrConcat(r,t)}))}r.push("]");r.push(this.rawSpaceAfter);return r.join("")};i(Attribute,[{key:"quoted",get:function get(){var e=this.quoteMark;return e==="'"||e==='"'},set:function set(e){d()}},{key:"quoteMark",get:function get(){return this._quoteMark},set:function set(e){if(!this._constructed){this._quoteMark=e;return}if(this._quoteMark!==e){this._quoteMark=e;this._syncRawValue()}}},{key:"qualifiedAttribute",get:function get(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function get(){return this.insensitive?"i":""}},{key:"value",get:function get(){return this._value},set:function set(e){if(this._constructed){var r=unescapeValue(e),t=r.deprecatedUsage,n=r.unescaped,i=r.quoteMark;if(t){v()}if(n===this._value&&i===this._quoteMark){return}this._value=n;this._quoteMark=i;this._syncRawValue()}else{this._value=e}}},{key:"attribute",get:function get(){return this._attribute},set:function set(e){this._handleEscapes("attribute",e);this._attribute=e}}]);return Attribute}(c.default);y.NO_QUOTE=null;y.SINGLE_QUOTE="'";y.DOUBLE_QUOTE='"';r.default=y;var g=(n={"'":{quotes:"single",wrap:true},'"':{quotes:"double",wrap:true}},n[null]={isIdentifier:true},n);function defaultAttrConcat(e,r){return""+r.before+e+r.after}},2961:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Combinator,e);function Combinator(r){_classCallCheck(this,Combinator);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMBINATOR;return t}return Combinator}(i.default);r.default=s;e.exports=r["default"]},2622:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Comment,e);function Comment(r){_classCallCheck(this,Comment);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.COMMENT;return t}return Comment}(i.default);r.default=s;e.exports=r["default"]},4649:(e,r,t)=>{"use strict";r.__esModule=true;r.universal=r.tag=r.string=r.selector=r.root=r.pseudo=r.nesting=r.id=r.comment=r.combinator=r.className=r.attribute=undefined;var n=t(7239);var i=_interopRequireDefault(n);var o=t(2961);var s=_interopRequireDefault(o);var a=t(415);var u=_interopRequireDefault(a);var f=t(2622);var c=_interopRequireDefault(f);var l=t(6856);var p=_interopRequireDefault(l);var h=t(7939);var B=_interopRequireDefault(h);var v=t(9189);var d=_interopRequireDefault(v);var b=t(7156);var y=_interopRequireDefault(b);var g=t(8727);var m=_interopRequireDefault(g);var C=t(1572);var w=_interopRequireDefault(C);var S=t(2252);var O=_interopRequireDefault(S);var T=t(3447);var E=_interopRequireDefault(T);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var k=r.attribute=function attribute(e){return new i.default(e)};var P=r.className=function className(e){return new s.default(e)};var D=r.combinator=function combinator(e){return new u.default(e)};var A=r.comment=function comment(e){return new c.default(e)};var R=r.id=function id(e){return new p.default(e)};var F=r.nesting=function nesting(e){return new B.default(e)};var x=r.pseudo=function pseudo(e){return new d.default(e)};var j=r.root=function root(e){return new y.default(e)};var I=r.selector=function selector(e){return new m.default(e)};var M=r.string=function string(e){return new w.default(e)};var _=r.tag=function tag(e){return new O.default(e)};var N=r.universal=function universal(e){return new E.default(e)}},8837:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t=e){this.indexes[t]=r-1}}return this};Container.prototype.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};Container.prototype.empty=function empty(){return this.removeAll()};Container.prototype.insertAfter=function insertAfter(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t+1,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(t<=n){this.indexes[i]=n+1}}return this};Container.prototype.insertBefore=function insertBefore(e,r){r.parent=this;var t=this.index(e);this.nodes.splice(t,0,r);r.parent=this;var n=void 0;for(var i in this.indexes){n=this.indexes[i];if(n<=t){this.indexes[i]=n+1}}return this};Container.prototype._findChildAtPosition=function _findChildAtPosition(e,r){var t=undefined;this.each(function(n){if(n.atPosition){var i=n.atPosition(e,r);if(i){t=i;return false}}else if(n.isAtPosition(e,r)){t=n;return false}});return t};Container.prototype.atPosition=function atPosition(e,r){if(this.isAtPosition(e,r)){return this._findChildAtPosition(e,r)||this}else{return undefined}};Container.prototype._inferEndPosition=function _inferEndPosition(){if(this.last&&this.last.source&&this.last.source.end){this.source=this.source||{};this.source.end=this.source.end||{};Object.assign(this.source.end,this.last.source.end)}};Container.prototype.each=function each(e){if(!this.lastEach){this.lastEach=0}if(!this.indexes){this.indexes={}}this.lastEach++;var r=this.lastEach;this.indexes[r]=0;if(!this.length){return undefined}var t=void 0,n=void 0;while(this.indexes[r]{"use strict";r.__esModule=true;r.isUniversal=r.isTag=r.isString=r.isSelector=r.isRoot=r.isPseudo=r.isNesting=r.isIdentifier=r.isComment=r.isCombinator=r.isClassName=r.isAttribute=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i;r.isNode=isNode;r.isPseudoElement=isPseudoElement;r.isPseudoClass=isPseudoClass;r.isContainer=isContainer;r.isNamespace=isNamespace;var o=t(9);var s=(i={},i[o.ATTRIBUTE]=true,i[o.CLASS]=true,i[o.COMBINATOR]=true,i[o.COMMENT]=true,i[o.ID]=true,i[o.NESTING]=true,i[o.PSEUDO]=true,i[o.ROOT]=true,i[o.SELECTOR]=true,i[o.STRING]=true,i[o.TAG]=true,i[o.UNIVERSAL]=true,i);function isNode(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&s[e.type]}function isNodeType(e,r){return isNode(r)&&r.type===e}var a=r.isAttribute=isNodeType.bind(null,o.ATTRIBUTE);var u=r.isClassName=isNodeType.bind(null,o.CLASS);var f=r.isCombinator=isNodeType.bind(null,o.COMBINATOR);var c=r.isComment=isNodeType.bind(null,o.COMMENT);var l=r.isIdentifier=isNodeType.bind(null,o.ID);var p=r.isNesting=isNodeType.bind(null,o.NESTING);var h=r.isPseudo=isNodeType.bind(null,o.PSEUDO);var B=r.isRoot=isNodeType.bind(null,o.ROOT);var v=r.isSelector=isNodeType.bind(null,o.SELECTOR);var d=r.isString=isNodeType.bind(null,o.STRING);var b=r.isTag=isNodeType.bind(null,o.TAG);var y=r.isUniversal=isNodeType.bind(null,o.UNIVERSAL);function isPseudoElement(e){return h(e)&&e.value&&(e.value.startsWith("::")||e.value===":before"||e.value===":after")}function isPseudoClass(e){return h(e)&&!isPseudoElement(e)}function isContainer(e){return!!(isNode(e)&&e.walk)}function isNamespace(e){return a(e)||b(e)}},6856:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(ID,e);function ID(r){_classCallCheck(this,ID);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.ID;return t}ID.prototype.toString=function toString(){return[this.rawSpaceBefore,String("#"+this.stringifyProperty("value")),this.rawSpaceAfter].join("")};return ID}(i.default);r.default=s;e.exports=r["default"]},5848:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(9);Object.keys(n).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return n[e]}})});var i=t(4649);Object.keys(i).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return i[e]}})});var o=t(7910);Object.keys(o).forEach(function(e){if(e==="default"||e==="__esModule")return;Object.defineProperty(r,e,{enumerable:true,get:function get(){return o[e]}})})},7937:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Nesting,e);function Nesting(r){_classCallCheck(this,Nesting);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.NESTING;t.value="&";return t}return Nesting}(i.default);r.default=s;e.exports=r["default"]},5387:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Node);Object.assign(this,e);this.spaces=this.spaces||{};this.spaces.before=this.spaces.before||"";this.spaces.after=this.spaces.after||""}Node.prototype.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};Node.prototype.replaceWith=function replaceWith(){if(this.parent){for(var e in arguments){this.parent.insertBefore(this,arguments[e])}this.remove()}return this};Node.prototype.next=function next(){return this.parent.at(this.parent.index(this)+1)};Node.prototype.prev=function prev(){return this.parent.at(this.parent.index(this)-1)};Node.prototype.clone=function clone(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=s(this);for(var t in e){r[t]=e[t]}return r};Node.prototype.appendToPropertyAndEscape=function appendToPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}var n=this[e];var i=this.raws[e];this[e]=n+r;if(i||t!==r){this.raws[e]=(i||n)+t}else{delete this.raws[e]}};Node.prototype.setPropertyAndEscape=function setPropertyAndEscape(e,r,t){if(!this.raws){this.raws={}}this[e]=r;this.raws[e]=t};Node.prototype.setPropertyWithoutEscape=function setPropertyWithoutEscape(e,r){this[e]=r;if(this.raws){delete this.raws[e]}};Node.prototype.isAtPosition=function isAtPosition(e,r){if(this.source&&this.source.start&&this.source.end){if(this.source.start.line>e){return false}if(this.source.end.liner){return false}if(this.source.end.line===e&&this.source.end.column{"use strict";r.__esModule=true;var n=t(8837);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Pseudo,e);function Pseudo(r){_classCallCheck(this,Pseudo);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.PSEUDO;return t}Pseudo.prototype.toString=function toString(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")};return Pseudo}(i.default);r.default=s;e.exports=r["default"]},7156:(e,r,t)=>{"use strict";r.__esModule=true;var n=function(){function defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;var n=t(8837);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Selector,e);function Selector(r){_classCallCheck(this,Selector);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.SELECTOR;return t}return Selector}(i.default);r.default=s;e.exports=r["default"]},1572:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(5387);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(String,e);function String(r){_classCallCheck(this,String);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.STRING;return t}return String}(i.default);r.default=s;e.exports=r["default"]},2252:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(7937);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Tag,e);function Tag(r){_classCallCheck(this,Tag);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.TAG;return t}return Tag}(i.default);r.default=s;e.exports=r["default"]},9:(e,r)=>{"use strict";r.__esModule=true;var t=r.TAG="tag";var n=r.STRING="string";var i=r.SELECTOR="selector";var o=r.ROOT="root";var s=r.PSEUDO="pseudo";var a=r.NESTING="nesting";var u=r.ID="id";var f=r.COMMENT="comment";var c=r.COMBINATOR="combinator";var l=r.CLASS="class";var p=r.ATTRIBUTE="attribute";var h=r.UNIVERSAL="universal"},3447:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(7937);var i=_interopRequireDefault(n);var o=t(9);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,r){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r&&(typeof r==="object"||typeof r==="function")?r:e}function _inherits(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof r)}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(r)Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r}var s=function(e){_inherits(Universal,e);function Universal(r){_classCallCheck(this,Universal);var t=_possibleConstructorReturn(this,e.call(this,r));t.type=o.UNIVERSAL;t.value="*";return t}return Universal}(i.default);r.default=s;e.exports=r["default"]},1949:(e,r)=>{"use strict";r.__esModule=true;r.default=sortAscending;function sortAscending(e){return e.sort(function(e,r){return e-r})}e.exports=r["default"]},7620:(e,r)=>{"use strict";r.__esModule=true;var t=r.ampersand=38;var n=r.asterisk=42;var i=r.at=64;var o=r.comma=44;var s=r.colon=58;var a=r.semicolon=59;var u=r.openParenthesis=40;var f=r.closeParenthesis=41;var c=r.openSquare=91;var l=r.closeSquare=93;var p=r.dollar=36;var h=r.tilde=126;var B=r.caret=94;var v=r.plus=43;var d=r.equals=61;var b=r.pipe=124;var y=r.greaterThan=62;var g=r.space=32;var m=r.singleQuote=39;var C=r.doubleQuote=34;var w=r.slash=47;var S=r.bang=33;var O=r.backslash=92;var T=r.cr=13;var E=r.feed=12;var k=r.newline=10;var P=r.tab=9;var D=r.str=m;var A=r.comment=-1;var R=r.word=-2;var F=r.combinator=-3},6317:(e,r,t)=>{"use strict";r.__esModule=true;r.FIELDS=undefined;var n,i;r.default=tokenize;var o=t(7620);var s=_interopRequireWildcard(o);function _interopRequireWildcard(e){if(e&&e.__esModule){return e}else{var r={};if(e!=null){for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]}}r.default=e;return r}}var a=(n={},n[s.tab]=true,n[s.newline]=true,n[s.cr]=true,n[s.feed]=true,n);var u=(i={},i[s.space]=true,i[s.tab]=true,i[s.newline]=true,i[s.cr]=true,i[s.feed]=true,i[s.ampersand]=true,i[s.asterisk]=true,i[s.bang]=true,i[s.comma]=true,i[s.colon]=true,i[s.semicolon]=true,i[s.openParenthesis]=true,i[s.closeParenthesis]=true,i[s.openSquare]=true,i[s.closeSquare]=true,i[s.singleQuote]=true,i[s.doubleQuote]=true,i[s.plus]=true,i[s.pipe]=true,i[s.tilde]=true,i[s.greaterThan]=true,i[s.equals]=true,i[s.dollar]=true,i[s.caret]=true,i[s.slash]=true,i);var f={};var c="0123456789abcdefABCDEF";for(var l=0;l0){g=a+d;m=y-b[d].length}else{g=a;m=o}w=s.comment;a=g;h=g;p=y-m}else if(c===s.slash){y=u;w=c;h=a;p=u-o;f=y+1}else{y=consumeWord(t,u);w=s.word;h=a;p=y-o}f=y+1;break}r.push([w,a,u-o,h,p,u,f]);if(m){o=m;m=null}u=f}return r}},2058:(e,r)=>{"use strict";r.__esModule=true;r.default=ensureObject;function ensureObject(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){e[i]={}}e=e[i]}}e.exports=r["default"]},4600:(e,r)=>{"use strict";r.__esModule=true;r.default=getProp;function getProp(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n0){var i=t.shift();if(!e[i]){return undefined}e=e[i]}return e}e.exports=r["default"]},6913:(e,r,t)=>{"use strict";r.__esModule=true;var n=t(6474);Object.defineProperty(r,"unesc",{enumerable:true,get:function get(){return _interopRequireDefault(n).default}});var i=t(4600);Object.defineProperty(r,"getProp",{enumerable:true,get:function get(){return _interopRequireDefault(i).default}});var o=t(2058);Object.defineProperty(r,"ensureObject",{enumerable:true,get:function get(){return _interopRequireDefault(o).default}});var s=t(6817);Object.defineProperty(r,"stripComments",{enumerable:true,get:function get(){return _interopRequireDefault(s).default}});function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},6817:(e,r)=>{"use strict";r.__esModule=true;r.default=stripComments;function stripComments(e){var r="";var t=e.indexOf("/*");var n=0;while(t>=0){r=r+e.slice(n,t);var i=e.indexOf("*/",t+2);if(i<0){return r}n=i+2;t=e.indexOf("/*",n)}r=r+e.slice(n);return r}e.exports=r["default"]},6474:(e,r)=>{"use strict";r.__esModule=true;r.default=unesc;var t=/\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;var n=/\\(.)/g;function unesc(e){e=e.replace(t,function(e,r,t){var n=r||t;var i=parseInt(n,16);return String.fromCharCode(i)});e=e.replace(n,function(e,r){return r});return e}e.exports=r["default"]},9020:(e,r,t)=>{var n=t(4633);e.exports=n.plugin("postcss-replace-overflow-wrap",function(e){e=e||{};var r=e.method||"replace";return function(e){e.walkDecls("overflow-wrap",function(e){e.cloneBefore({prop:"word-wrap"});if(r==="replace"){e.remove()}})}})},40:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var n=t(4633);var i=_interopRequireDefault(n);var o=t(8746);var s=_interopRequireDefault(o);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function explodeSelectors(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(r){r.walkRules(function(r){if(r.selector&&r.selector.indexOf(":matches")>-1){r.selector=(0,s.default)(r,e)}})}}r.default=i.default.plugin("postcss-selector-matches",explodeSelectors);e.exports=r.default},8746:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.default=replaceRuleSelector;var n=t(7009);var i=_interopRequireDefault(n);var o=t(587);var s=_interopRequireDefault(o);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _toConsumableArray(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r-1){var t=[];var n=e.match(/^\s+/);var o=n?n[0]:"";var u=i.default.comma(e);u.forEach(function(e){var n=e.indexOf(a);var u=e.slice(0,n);var f=e.slice(n);var c=(0,s.default)("(",")",f);var l=c&&c.body?i.default.comma(c.body).reduce(function(e,t){return[].concat(_toConsumableArray(e),_toConsumableArray(explodeSelector(t,r)))},[]):[f];var p=c&&c.post?explodeSelector(c.post,r):[];var h=void 0;if(p.length===0){if(n===-1||u.indexOf(" ")>-1){h=l.map(function(e){return o+u+e})}else{h=l.map(function(e){return normalizeSelector(e,o,u)})}}else{h=[];p.forEach(function(e){l.forEach(function(r){h.push(o+u+r+e)})})}t=[].concat(_toConsumableArray(t),_toConsumableArray(h))});return t}return[e]}function replaceRuleSelector(e,r){var t=e.raws&&e.raws.before?e.raws.before.split("\n").pop():"";return explodeSelector(e.selector,r).join(","+(r.lineBreak?"\n"+t:" "))}e.exports=r.default},8158:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var n=t(4633);var i=_interopRequireDefault(n);var o=t(7009);var s=_interopRequireDefault(o);var a=t(587);var u=_interopRequireDefault(a);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function explodeSelector(e,r){var t=locatePseudoClass(r,e);if(r&&t>-1){var n=r.slice(0,t);var i=(0,u.default)("(",")",r.slice(t));var o=i.body?s.default.comma(i.body).map(function(r){return explodeSelector(e,r)}).join(`)${e}(`):"";var a=i.post?explodeSelector(e,i.post):"";return`${n}${e}(${o})${a}`}return r}var f={};function locatePseudoClass(e,r){f[r]=f[r]||new RegExp(`([^\\\\]|^)${r}`);var t=f[r];var n=e.search(t);if(n===-1){return-1}return n+e.slice(n).indexOf(r)}function explodeSelectors(e){return function(){return function(r){r.walkRules(function(r){if(r.selector&&r.selector.indexOf(e)>-1){r.selector=explodeSelector(e,r.selector)}})}}}r.default=i.default.plugin("postcss-selector-not",explodeSelectors(":not"));e.exports=r.default},2334:(e,r,t)=>{"use strict";const n=t(9745);class AtWord extends n{constructor(e){super(e);this.type="atword"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,"@",String.prototype.toString.call(this.value),this.raws.after].join("")}}n.registerWalker(AtWord);e.exports=AtWord},1776:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Colon extends i{constructor(e){super(e);this.type="colon"}}n.registerWalker(Colon);e.exports=Colon},6429:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Comma extends i{constructor(e){super(e);this.type="comma"}}n.registerWalker(Comma);e.exports=Comma},8688:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Comment extends i{constructor(e){super(e);this.type="comment";this.inline=Object(e).inline||false}toString(){return[this.raws.before,this.inline?"//":"/*",String(this.value),this.inline?"":"*/",this.raws.after].join("")}}n.registerWalker(Comment);e.exports=Comment},9745:(e,r,t)=>{"use strict";const n=t(7203);class Container extends n{constructor(e){super(e);if(!this.nodes){this.nodes=[]}}push(e){e.parent=this;this.nodes.push(e);return this}each(e){if(!this.lastEach)this.lastEach=0;if(!this.indexes)this.indexes={};this.lastEach+=1;let r=this.lastEach,t,n;this.indexes[r]=0;if(!this.nodes)return undefined;while(this.indexes[r]{let n=e(r,t);if(n!==false&&r.walk){n=r.walk(e)}return n})}walkType(e,r){if(!e||!r){throw new Error("Parameters {type} and {callback} are required.")}const t=typeof e==="function";return this.walk((n,i)=>{if(t&&n instanceof e||!t&&n.type===e){return r.call(this,n,i)}})}append(e){e.parent=this;this.nodes.push(e);return this}prepend(e){e.parent=this;this.nodes.unshift(e);return this}cleanRaws(e){super.cleanRaws(e);if(this.nodes){for(let r of this.nodes)r.cleanRaws(e)}}insertAfter(e,r){let t=this.index(e),n;this.nodes.splice(t+1,0,r);for(let e in this.indexes){n=this.indexes[e];if(t<=n){this.indexes[e]=n+this.nodes.length}}return this}insertBefore(e,r){let t=this.index(e),n;this.nodes.splice(t,0,r);for(let e in this.indexes){n=this.indexes[e];if(t<=n){this.indexes[e]=n+this.nodes.length}}return this}removeChild(e){e=this.index(e);this.nodes[e].parent=undefined;this.nodes.splice(e,1);let r;for(let t in this.indexes){r=this.indexes[t];if(r>=e){this.indexes[t]=r-1}}return this}removeAll(){for(let e of this.nodes)e.parent=undefined;this.nodes=[];return this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){if(typeof e==="number"){return e}else{return this.nodes.indexOf(e)}}get first(){if(!this.nodes)return undefined;return this.nodes[0]}get last(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}toString(){let e=this.nodes.map(String).join("");if(this.value){e=this.value+e}if(this.raws.before){e=this.raws.before+e}if(this.raws.after){e+=this.raws.after}return e}}Container.registerWalker=(e=>{let r="walk"+e.name;if(r.lastIndexOf("s")!==r.length-1){r+="s"}if(Container.prototype[r]){return}Container.prototype[r]=function(r){return this.walkType(e,r)}});e.exports=Container},7016:e=>{"use strict";class ParserError extends Error{constructor(e){super(e);this.name=this.constructor.name;this.message=e||"An error ocurred while parsing.";if(typeof Error.captureStackTrace==="function"){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error(e).stack}}}e.exports=ParserError},4828:e=>{"use strict";class TokenizeError extends Error{constructor(e){super(e);this.name=this.constructor.name;this.message=e||"An error ocurred while tokzenizing.";if(typeof Error.captureStackTrace==="function"){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error(e).stack}}}e.exports=TokenizeError},7615:(e,r,t)=>{"use strict";const n=t(9745);class FunctionNode extends n{constructor(e){super(e);this.type="func";this.unbalanced=-1}}n.registerWalker(FunctionNode);e.exports=FunctionNode},9448:(e,r,t)=>{"use strict";const n=t(3663);const i=t(2334);const o=t(1776);const s=t(6429);const a=t(8688);const u=t(7615);const f=t(2541);const c=t(6005);const l=t(6827);const p=t(3300);const h=t(2897);const B=t(2964);const v=t(2945);let d=function(e,r){return new n(e,r)};d.atword=function(e){return new i(e)};d.colon=function(e){return new o(Object.assign({value:":"},e))};d.comma=function(e){return new s(Object.assign({value:","},e))};d.comment=function(e){return new a(e)};d.func=function(e){return new u(e)};d.number=function(e){return new f(e)};d.operator=function(e){return new c(e)};d.paren=function(e){return new l(Object.assign({value:"("},e))};d.string=function(e){return new p(Object.assign({quote:"'"},e))};d.value=function(e){return new B(e)};d.word=function(e){return new v(e)};d.unicodeRange=function(e){return new h(e)};e.exports=d},7203:e=>{"use strict";let r=function(e,t){let n=new e.constructor;for(let i in e){if(!e.hasOwnProperty(i))continue;let o=e[i],s=typeof o;if(i==="parent"&&s==="object"){if(t)n[i]=t}else if(i==="source"){n[i]=o}else if(o instanceof Array){n[i]=o.map(e=>r(e,n))}else if(i!=="before"&&i!=="after"&&i!=="between"&&i!=="semicolon"){if(s==="object"&&o!==null)o=r(o);n[i]=o}}return n};e.exports=class Node{constructor(e){e=e||{};this.raws={before:"",after:""};for(let r in e){this[r]=e[r]}}remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this}toString(){return[this.raws.before,String(this.value),this.raws.after].join("")}clone(e){e=e||{};let t=r(this);for(let r in e){t[r]=e[r]}return t}cloneBefore(e){e=e||{};let r=this.clone(e);this.parent.insertBefore(this,r);return r}cloneAfter(e){e=e||{};let r=this.clone(e);this.parent.insertAfter(this,r);return r}replaceWith(){let e=Array.prototype.slice.call(arguments);if(this.parent){for(let r of e){this.parent.insertBefore(this,r)}this.remove()}return this}moveTo(e){this.cleanRaws(this.root()===e.root());this.remove();e.append(this);return this}moveBefore(e){this.cleanRaws(this.root()===e.root());this.remove();e.parent.insertBefore(e,this);return this}moveAfter(e){this.cleanRaws(this.root()===e.root());this.remove();e.parent.insertAfter(e,this);return this}next(){let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){let e=this.parent.index(this);return this.parent.nodes[e-1]}toJSON(){let e={};for(let r in this){if(!this.hasOwnProperty(r))continue;if(r==="parent")continue;let t=this[r];if(t instanceof Array){e[r]=t.map(e=>{if(typeof e==="object"&&e.toJSON){return e.toJSON()}else{return e}})}else if(typeof t==="object"&&t.toJSON){e[r]=t.toJSON()}else{e[r]=t}}return e}root(){let e=this;while(e.parent)e=e.parent;return e}cleanRaws(e){delete this.raws.before;delete this.raws.after;if(!e)delete this.raws.between}positionInside(e){let r=this.toString(),t=this.source.start.column,n=this.source.start.line;for(let i=0;i{"use strict";const n=t(9745);const i=t(7203);class NumberNode extends i{constructor(e){super(e);this.type="number";this.unit=Object(e).unit||""}toString(){return[this.raws.before,String(this.value),this.unit,this.raws.after].join("")}}n.registerWalker(NumberNode);e.exports=NumberNode},6005:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Operator extends i{constructor(e){super(e);this.type="operator"}}n.registerWalker(Operator);e.exports=Operator},6827:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Parenthesis extends i{constructor(e){super(e);this.type="paren";this.parenType=""}}n.registerWalker(Parenthesis);e.exports=Parenthesis},3663:(e,r,t)=>{"use strict";const n=t(2413);const i=t(2964);const o=t(2334);const s=t(1776);const a=t(6429);const u=t(8688);const f=t(7615);const c=t(2541);const l=t(6005);const p=t(6827);const h=t(3300);const B=t(2945);const v=t(2897);const d=t(868);const b=t(5202);const y=t(4751);const g=t(5632);const m=t(7016);function sortAscending(e){return e.sort((e,r)=>e-r)}e.exports=class Parser{constructor(e,r){const t={loose:false};this.cache=[];this.input=e;this.options=Object.assign({},t,r);this.position=0;this.unbalanced=0;this.root=new n;let o=new i;this.root.append(o);this.current=o;this.tokens=d(e,this.options)}parse(){return this.loop()}colon(){let e=this.currToken;this.newNode(new s({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]}));this.position++}comma(){let e=this.currToken;this.newNode(new a({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]}));this.position++}comment(){let e=false,r=this.currToken[1].replace(/\/\*|\*\//g,""),t;if(this.options.loose&&r.startsWith("//")){r=r.substring(2);e=true}t=new u({value:r,inline:e,source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]});this.newNode(t);this.position++}error(e,r){throw new m(e+` at line: ${r[2]}, column ${r[3]}`)}loop(){while(this.position0){if(this.current.type==="func"&&this.current.value==="calc"){if(this.prevToken[0]!=="space"&&this.prevToken[0]!=="("){this.error("Syntax Error",this.currToken)}else if(this.nextToken[0]!=="space"&&this.nextToken[0]!=="word"){this.error("Syntax Error",this.currToken)}else if(this.nextToken[0]==="word"&&this.current.last.type!=="operator"&&this.current.last.value!=="("){this.error("Syntax Error",this.currToken)}}else if(this.nextToken[0]==="space"||this.nextToken[0]==="operator"||this.prevToken[0]==="operator"){this.error("Syntax Error",this.currToken)}}}if(!this.options.loose){if(this.nextToken[0]==="word"){return this.word()}}else{if((!this.current.nodes.length||this.current.last&&this.current.last.type==="operator")&&this.nextToken[0]==="word"){return this.word()}}}r=new l({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]});this.position++;return this.newNode(r)}parseTokens(){switch(this.currToken[0]){case"space":this.space();break;case"colon":this.colon();break;case"comma":this.comma();break;case"comment":this.comment();break;case"(":this.parenOpen();break;case")":this.parenClose();break;case"atword":case"word":this.word();break;case"operator":this.operator();break;case"string":this.string();break;case"unicoderange":this.unicodeRange();break;default:this.word();break}}parenOpen(){let e=1,r=this.position+1,t=this.currToken,n;while(r=this.tokens.length-1&&!this.current.unbalanced){return}this.current.unbalanced--;if(this.current.unbalanced<0){this.error("Expected opening parenthesis",e)}if(!this.current.unbalanced&&this.cache.length){this.current=this.cache.pop()}}space(){let e=this.currToken;if(this.position===this.tokens.length-1||this.nextToken[0]===","||this.nextToken[0]===")"){this.current.last.raws.after+=e[1];this.position++}else{this.spaces=e[1];this.position++}}unicodeRange(){let e=this.currToken;this.newNode(new v({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]}));this.position++}splitWord(){let e=this.nextToken,r=this.currToken[1],t=/^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/,n=/^(?!\#([a-z0-9]+))[\#\{\}]/gi,i,s;if(!n.test(r)){while(e&&e[0]==="word"){this.position++;let t=this.currToken[1];r+=t;e=this.nextToken}}i=y(r,"@");s=sortAscending(g(b([[0],i])));s.forEach((n,a)=>{let u=s[a+1]||r.length,l=r.slice(n,u),p;if(~i.indexOf(n)){p=new o({value:l.slice(1),source:{start:{line:this.currToken[2],column:this.currToken[3]+n},end:{line:this.currToken[4],column:this.currToken[3]+(u-1)}},sourceIndex:this.currToken[6]+s[a]})}else if(t.test(this.currToken[1])){let e=l.replace(t,"");p=new c({value:l.replace(e,""),source:{start:{line:this.currToken[2],column:this.currToken[3]+n},end:{line:this.currToken[4],column:this.currToken[3]+(u-1)}},sourceIndex:this.currToken[6]+s[a],unit:e})}else{p=new(e&&e[0]==="("?f:B)({value:l,source:{start:{line:this.currToken[2],column:this.currToken[3]+n},end:{line:this.currToken[4],column:this.currToken[3]+(u-1)}},sourceIndex:this.currToken[6]+s[a]});if(p.constructor.name==="Word"){p.isHex=/^#(.+)/.test(l);p.isColor=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(l)}else{this.cache.push(this.current)}}this.newNode(p)});this.position++}string(){let e=this.currToken,r=this.currToken[1],t=/^(\"|\')/,n=t.test(r),i="",o;if(n){i=r.match(t)[0];r=r.slice(1,r.length-1)}o=new h({value:r,source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6],quoted:n});o.raws.quote=i;this.newNode(o);this.position++}word(){return this.splitWord()}newNode(e){if(this.spaces){e.raws.before+=this.spaces;this.spaces=""}return this.current.append(e)}get currToken(){return this.tokens[this.position]}get nextToken(){return this.tokens[this.position+1]}get prevToken(){return this.tokens[this.position-1]}}},2413:(e,r,t)=>{"use strict";const n=t(9745);e.exports=class Root extends n{constructor(e){super(e);this.type="root"}}},3300:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class StringNode extends i{constructor(e){super(e);this.type="string"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,e,this.value+"",e,this.raws.after].join("")}}n.registerWalker(StringNode);e.exports=StringNode},868:(e,r,t)=>{"use strict";const n="{".charCodeAt(0);const i="}".charCodeAt(0);const o="(".charCodeAt(0);const s=")".charCodeAt(0);const a="'".charCodeAt(0);const u='"'.charCodeAt(0);const f="\\".charCodeAt(0);const c="/".charCodeAt(0);const l=".".charCodeAt(0);const p=",".charCodeAt(0);const h=":".charCodeAt(0);const B="*".charCodeAt(0);const v="-".charCodeAt(0);const d="+".charCodeAt(0);const b="#".charCodeAt(0);const y="\n".charCodeAt(0);const g=" ".charCodeAt(0);const m="\f".charCodeAt(0);const C="\t".charCodeAt(0);const w="\r".charCodeAt(0);const S="@".charCodeAt(0);const O="e".charCodeAt(0);const T="E".charCodeAt(0);const E="0".charCodeAt(0);const k="9".charCodeAt(0);const P="u".charCodeAt(0);const D="U".charCodeAt(0);const A=/[ \n\t\r\{\(\)'"\\;,/]/g;const R=/[ \n\t\r\(\)\{\}\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;const F=/[ \n\t\r\(\)\{\}\*:;@!&'"\-\+\|~>,\[\]\\]|\//g;const x=/^[a-z0-9]/i;const j=/^[a-f0-9?\-]/i;const I=t(1669);const M=t(4828);e.exports=function tokenize(e,r){r=r||{};let t=[],_=e.valueOf(),N=_.length,L=-1,q=1,G=0,U=0,J=null,W,Q,H,K,Y,z,$,X,Z,V,ee,re;function unclosed(e){let r=I.format("Unclosed %s at line: %d, column: %d, token: %d",e,q,G-L,G);throw new M(r)}function tokenizeError(){let e=I.format("Syntax error at line: %d, column: %d, token: %d",q,G-L,G);throw new M(e)}while(G0&&t[t.length-1][0]==="word"&&t[t.length-1][1]==="url";t.push(["(","(",q,G-L,q,Q-L,G]);break;case s:U--;J=J&&U>0;t.push([")",")",q,G-L,q,Q-L,G]);break;case a:case u:H=W===a?"'":'"';Q=G;do{V=false;Q=_.indexOf(H,Q+1);if(Q===-1){unclosed("quote",H)}ee=Q;while(_.charCodeAt(ee-1)===f){ee-=1;V=!V}}while(V);t.push(["string",_.slice(G,Q+1),q,G-L,q,Q-L,G]);G=Q;break;case S:A.lastIndex=G+1;A.test(_);if(A.lastIndex===0){Q=_.length-1}else{Q=A.lastIndex-2}t.push(["atword",_.slice(G,Q+1),q,G-L,q,Q-L,G]);G=Q;break;case f:Q=G;W=_.charCodeAt(Q+1);if($&&(W!==c&&W!==g&&W!==y&&W!==C&&W!==w&&W!==m)){Q+=1}t.push(["word",_.slice(G,Q+1),q,G-L,q,Q-L,G]);G=Q;break;case d:case v:case B:Q=G+1;re=_.slice(G+1,Q+1);let e=_.slice(G-1,G);if(W===v&&re.charCodeAt(0)===v){Q++;t.push(["word",_.slice(G,Q),q,G-L,q,Q-L,G]);G=Q-1;break}t.push(["operator",_.slice(G,Q),q,G-L,q,Q-L,G]);G=Q-1;break;default:if(W===c&&(_.charCodeAt(G+1)===B||r.loose&&!J&&_.charCodeAt(G+1)===c)){const e=_.charCodeAt(G+1)===B;if(e){Q=_.indexOf("*/",G+2)+1;if(Q===0){unclosed("comment","*/")}}else{const e=_.indexOf("\n",G+2);Q=e!==-1?e-1:N}z=_.slice(G,Q+1);K=z.split("\n");Y=K.length-1;if(Y>0){X=q+Y;Z=Q-K[Y].length}else{X=q;Z=L}t.push(["comment",z,q,G-L,X,Q-Z,G]);L=Z;q=X;G=Q}else if(W===b&&!x.test(_.slice(G+1,G+2))){Q=G+1;t.push(["#",_.slice(G,Q),q,G-L,q,Q-L,G]);G=Q-1}else if((W===P||W===D)&&_.charCodeAt(G+1)===d){Q=G+2;do{Q+=1;W=_.charCodeAt(Q)}while(Q=E&&W<=k){e=F}e.lastIndex=G+1;e.test(_);if(e.lastIndex===0){Q=_.length-1}else{Q=e.lastIndex-2}if(e===F||W===l){let e=_.charCodeAt(Q),r=_.charCodeAt(Q+1),t=_.charCodeAt(Q+2);if((e===O||e===T)&&(r===v||r===d)&&(t>=E&&t<=k)){F.lastIndex=Q+2;F.test(_);if(F.lastIndex===0){Q=_.length-1}else{Q=F.lastIndex-2}}}t.push(["word",_.slice(G,Q+1),q,G-L,q,Q-L,G]);G=Q}break}G++}return t}},2897:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class UnicodeRange extends i{constructor(e){super(e);this.type="unicode-range"}}n.registerWalker(UnicodeRange);e.exports=UnicodeRange},2964:(e,r,t)=>{"use strict";const n=t(9745);e.exports=class Value extends n{constructor(e){super(e);this.type="value";this.unbalanced=0}}},2945:(e,r,t)=>{"use strict";const n=t(9745);const i=t(7203);class Word extends i{constructor(e){super(e);this.type="word"}}n.registerWalker(Word);e.exports=Word},4217:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(5878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(r){var t;t=e.call(this,r)||this;t.type="atrule";return t}var r=AtRule.prototype;r.append=function append(){var r;if(!this.nodes)this.nodes=[];for(var t=arguments.length,n=new Array(t),i=0;i{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(1497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}var i=function(e){_inheritsLoose(Comment,e);function Comment(r){var t;t=e.call(this,r)||this;t.type="comment";return t}return Comment}(n.default);var o=i;r.default=o;e.exports=r.default},5878:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3605));var i=_interopRequireDefault(t(8259));var o=_interopRequireDefault(t(1497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;t=a.length)break;c=a[f++]}else{f=a.next();if(f.done)break;c=f.value}var l=c;this.nodes.push(l)}}return this};r.prepend=function prepend(){for(var e=arguments.length,r=new Array(e),t=0;t=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;var u=this.normalize(a,this.first,"prepend").reverse();for(var f=u,c=Array.isArray(f),l=0,f=c?f:f[Symbol.iterator]();;){var p;if(c){if(l>=f.length)break;p=f[l++]}else{l=f.next();if(l.done)break;p=l.value}var h=p;this.nodes.unshift(h)}for(var B in this.indexes){this.indexes[B]=this.indexes[B]+u.length}}return this};r.cleanRaws=function cleanRaws(r){e.prototype.cleanRaws.call(this,r);if(this.nodes){for(var t=this.nodes,n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(i>=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;s.cleanRaws(r)}}};r.insertBefore=function insertBefore(e,r){e=this.index(e);var t=e===0?"prepend":false;var n=this.normalize(r,this.nodes[e],t).reverse();for(var i=n,o=Array.isArray(i),s=0,i=o?i:i[Symbol.iterator]();;){var a;if(o){if(s>=i.length)break;a=i[s++]}else{s=i.next();if(s.done)break;a=s.value}var u=a;this.nodes.splice(e,0,u)}var f;for(var c in this.indexes){f=this.indexes[c];if(e<=f){this.indexes[c]=f+n.length}}return this};r.insertAfter=function insertAfter(e,r){e=this.index(e);var t=this.normalize(r,this.nodes[e]).reverse();for(var n=t,i=Array.isArray(n),o=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(o>=n.length)break;s=n[o++]}else{o=n.next();if(o.done)break;s=o.value}var a=s;this.nodes.splice(e+1,0,a)}var u;for(var f in this.indexes){u=this.indexes[f];if(e=e){this.indexes[t]=r-1}}return this};r.removeAll=function removeAll(){for(var e=this.nodes,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;i.parent=undefined}this.nodes=[];return this};r.replaceValues=function replaceValues(e,r,t){if(!t){t=r;r={}}this.walkDecls(function(n){if(r.props&&r.props.indexOf(n.prop)===-1)return;if(r.fast&&n.value.indexOf(r.fast)===-1)return;n.value=n.value.replace(e,t)});return this};r.every=function every(e){return this.nodes.every(e)};r.some=function some(e){return this.nodes.some(e)};r.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};r.normalize=function normalize(e,r){var o=this;if(typeof e==="string"){var s=t(3749);e=cleanSource(s(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var a=e,u=Array.isArray(a),f=0,a=u?a:a[Symbol.iterator]();;){var c;if(u){if(f>=a.length)break;c=a[f++]}else{f=a.next();if(f.done)break;c=f.value}var l=c;if(l.parent)l.parent.removeChild(l,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var p=e,h=Array.isArray(p),B=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(B>=p.length)break;v=p[B++]}else{B=p.next();if(B.done)break;v=B.value}var d=v;if(d.parent)d.parent.removeChild(d,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var b=t(7797);e=[new b(e)]}else if(e.name){var y=t(4217);e=[new y(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var g=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(r&&typeof r.raws.before!=="undefined"){e.raws.before=r.raws.before.replace(/[^\s]/g,"")}}e.parent=o;return e});return g};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(o.default);var a=s;r.default=a;e.exports=r.default},9535:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(8327));var i=_interopRequireDefault(t(2242));var o=_interopRequireDefault(t(8300));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}function _wrapNativeSuper(e){var r=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof r!=="undefined"){if(r.has(e))return r.get(e);r.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,r,t){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,r,t){var n=[null];n.push.apply(n,r);var i=Function.bind.apply(e,n);var o=new i;if(t)_setPrototypeOf(o,t.prototype);return o}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,r){e.__proto__=r;return e};return _setPrototypeOf(e,r)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var s=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(r,t,n,i,o,s){var a;a=e.call(this,r)||this;a.name="CssSyntaxError";a.reason=r;if(o){a.file=o}if(i){a.source=i}if(s){a.plugin=s}if(typeof t!=="undefined"&&typeof n!=="undefined"){a.line=t;a.column=n}a.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(a),CssSyntaxError)}return a}var r=CssSyntaxError.prototype;r.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};r.showSourceCode=function showSourceCode(e){var r=this;if(!this.source)return"";var t=this.source;if(o.default){if(typeof e==="undefined")e=n.default.stdout;if(e)t=(0,o.default)(t)}var s=t.split(/\r?\n/);var a=Math.max(this.line-3,0);var u=Math.min(this.line+2,s.length);var f=String(u).length;function mark(r){if(e&&i.default.red){return i.default.red.bold(r)}return r}function aside(r){if(e&&i.default.gray){return i.default.gray(r)}return r}return s.slice(a,u).map(function(e,t){var n=a+1+t;var i=" "+(" "+n).slice(-f)+" | ";if(n===r.line){var o=aside(i.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+o+mark("^")}return" "+aside(i)+e}).join("\n")};r.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var a=s;r.default=a;e.exports=r.default},3605:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(1497));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(r){var t;t=e.call(this,r)||this;t.type="decl";return t}return Declaration}(n.default);var o=i;r.default=o;e.exports=r.default},4905:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(5622));var i=_interopRequireDefault(t(9535));var o=_interopRequireDefault(t(2713));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;t"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,r,t,n){if(n===void 0){n={}}var o;var s=this.origin(r,t);if(s){o=new i.default(e,s.line,s.column,s.source,s.file,n.plugin)}else{o=new i.default(e,r,t,this.css,this.file,n.plugin)}o.input={line:r,column:t,source:this.css};if(this.file)o.input.file=this.file;return o};e.origin=function origin(e,r){if(!this.map)return false;var t=this.map.consumer();var n=t.originalPositionFor({line:e,column:r});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var o=t.sourceContentFor(n.source);if(o)i.source=o;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var u=a;r.default=u;e.exports=r.default},1169:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3595));var i=_interopRequireDefault(t(7549));var o=_interopRequireDefault(t(3831));var s=_interopRequireDefault(t(7613));var a=_interopRequireDefault(t(3749));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;tparseInt(s[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+t+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,r){var t=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){t.asyncTick(e,r)}).catch(function(e){t.handleError(e,n);t.processed=true;r(e)})}else{this.asyncTick(e,r)}}catch(e){this.processed=true;r(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(r,t){if(e.error){t(e.error)}else{r(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(r,t){if(e.error)return t(e.error);e.plugin=0;e.asyncTick(r,t)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(t>=e.length)break;n=e[t++]}else{t=e.next();if(t.done)break;n=t.value}var i=n;var o=this.run(i);if(isPromise(o)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(r){this.handleError(r,e);throw r}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var r=i.default;if(e.syntax)r=e.syntax.stringify;if(e.stringifier)r=e.stringifier;if(r.stringify)r=r.stringify;var t=new n.default(r,this.result.root,this.result.opts);var o=t.generate();this.result.css=o[0];this.result.map=o[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=u;r.default=f;e.exports=r.default},7009:(e,r)=>{"use strict";r.__esModule=true;r.default=void 0;var t={split:function split(e,r,t){var n=[];var i="";var split=false;var o=0;var s=false;var a=false;for(var u=0;u0)o-=1}else if(o===0){if(r.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(t||i!=="")n.push(i.trim());return n},space:function space(e){var r=[" ","\n","\t"];return t.split(e,r)},comma:function comma(e){return t.split(e,[","],true)}};var n=t;r.default=n;e.exports=r.default},3595:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(6241));var i=_interopRequireDefault(t(5622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o=function(){function MapGenerator(e,r,t){this.stringify=e;this.mapOpts=t.map||{};this.root=r;this.opts=t}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(r){if(r.source&&r.source.input.map){var t=r.source.input.map;if(e.previousMaps.indexOf(t)===-1){e.previousMaps.push(t)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var r=this.root.nodes.length-1;r>=0;r--){e=this.root.nodes[r];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(r)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var r={};this.root.walk(function(t){if(t.source){var n=t.source.input.from;if(n&&!r[n]){r[n]=true;var i=e.relative(n);e.map.setSourceContent(i,t.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),r=Array.isArray(e),t=0,e=r?e:e[Symbol.iterator]();;){var o;if(r){if(t>=e.length)break;o=e[t++]}else{t=e.next();if(t.done)break;o=t.value}var s=o;var a=this.relative(s.file);var u=s.root||i.default.dirname(s.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(s.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=s.consumer()}this.map.applySourceMap(f,a,this.relative(u))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var r="\n";if(this.css.indexOf("\r\n")!==-1)r="\r\n";this.css+=r+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var r=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){r=i.default.dirname(i.default.resolve(r,this.mapOpts.annotation))}e=i.default.relative(r,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var r=1;var t=1;var i,o;this.stringify(this.root,function(n,s,a){e.css+=n;if(s&&a!=="end"){if(s.source&&s.source.start){e.map.addMapping({source:e.sourcePath(s),generated:{line:r,column:t-1},original:{line:s.source.start.line,column:s.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:r,column:t-1}})}}i=n.match(/\n/g);if(i){r+=i.length;o=n.lastIndexOf("\n");t=n.length-o}else{t+=n.length}if(s&&a!=="start"){var u=s.parent||{raws:{}};if(s.type!=="decl"||s!==u.last||u.raws.semicolon){if(s.source&&s.source.end){e.map.addMapping({source:e.sourcePath(s),generated:{line:r,column:t-2},original:{line:s.source.end.line,column:s.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:r,column:t-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(r){e+=r});return[e]};return MapGenerator}();var s=o;r.default=s;e.exports=r.default},1497:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(9535));var i=_interopRequireDefault(t(3935));var o=_interopRequireDefault(t(7549));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,r){var t=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var o=typeof i;if(n==="parent"&&o==="object"){if(r)t[n]=r}else if(n==="source"){t[n]=i}else if(i instanceof Array){t[n]=i.map(function(e){return cloneNode(e,t)})}else{if(o==="object"&&i!==null)i=cloneNode(i);t[n]=i}}return t}var s=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var r in e){this[r]=e[r]}}var e=Node.prototype;e.error=function error(e,r){if(r===void 0){r={}}if(this.source){var t=this.positionBy(r);return this.source.input.error(e,t.line,t.column,r)}return new n.default(e)};e.warn=function warn(e,r,t){var n={node:this};for(var i in t){n[i]=t[i]}return e.warn(r,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=o.default}if(e.stringify)e=e.stringify;var r="";e(this,function(e){r+=e});return r};e.clone=function clone(e){if(e===void 0){e={}}var r=cloneNode(this);for(var t in e){r[t]=e[t]}return r};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var r=this.clone(e);this.parent.insertBefore(this,r);return r};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var r=this.clone(e);this.parent.insertAfter(this,r);return r};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,r=new Array(e),t=0;t{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(9570));var i=_interopRequireDefault(t(4905));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e,r){var t=new i.default(e,r);var o=new n.default(t);try{o.parse()}catch(e){if(process.env.NODE_ENV!=="production"){if(e.name==="CssSyntaxError"&&r&&r.from){if(/\.scss$/i.test(r.from)){e.message+="\nYou tried to parse SCSS with "+"the standard CSS parser; "+"try again with the postcss-scss parser"}else if(/\.sass/i.test(r.from)){e.message+="\nYou tried to parse Sass with "+"the standard CSS parser; "+"try again with the postcss-sass parser"}else if(/\.less$/i.test(r.from)){e.message+="\nYou tried to parse Less with "+"the standard CSS parser; "+"try again with the postcss-less parser"}}}throw e}return o.root}var o=parse;r.default=o;e.exports=r.default},9570:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3605));var i=_interopRequireDefault(t(1926));var o=_interopRequireDefault(t(8259));var s=_interopRequireDefault(t(4217));var a=_interopRequireDefault(t(5907));var u=_interopRequireDefault(t(7797));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f=function(){function Parser(e){this.input=e;this.root=new a.default;this.current=this.root;this.spaces="";this.semicolon=false;this.createTokenizer();this.root.source={input:e,start:{line:1,column:1}}}var e=Parser.prototype;e.createTokenizer=function createTokenizer(){this.tokenizer=(0,i.default)(this.input)};e.parse=function parse(){var e;while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();switch(e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}}this.endFile()};e.comment=function comment(e){var r=new o.default;this.init(r,e[2],e[3]);r.source.end={line:e[4],column:e[5]};var t=e[1].slice(2,-2);if(/^\s*$/.test(t)){r.text="";r.raws.left=t;r.raws.right=""}else{var n=t.match(/^(\s*)([^]*[^\s])(\s*)$/);r.text=n[2];r.raws.left=n[1];r.raws.right=n[3]}};e.emptyRule=function emptyRule(e){var r=new u.default;this.init(r,e[2],e[3]);r.selector="";r.raws.between="";this.current=r};e.other=function other(e){var r=false;var t=null;var n=false;var i=null;var o=[];var s=[];var a=e;while(a){t=a[0];s.push(a);if(t==="("||t==="["){if(!i)i=a;o.push(t==="("?")":"]")}else if(o.length===0){if(t===";"){if(n){this.decl(s);return}else{break}}else if(t==="{"){this.rule(s);return}else if(t==="}"){this.tokenizer.back(s.pop());r=true;break}else if(t===":"){n=true}}else if(t===o[o.length-1]){o.pop();if(o.length===0)i=null}a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())r=true;if(o.length>0)this.unclosedBracket(i);if(r&&n){while(s.length){a=s[s.length-1][0];if(a!=="space"&&a!=="comment")break;this.tokenizer.back(s.pop())}this.decl(s)}else{this.unknownWord(s)}};e.rule=function rule(e){e.pop();var r=new u.default;this.init(r,e[0][2],e[0][3]);r.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(r,"selector",e);this.current=r};e.decl=function decl(e){var r=new n.default;this.init(r);var t=e[e.length-1];if(t[0]===";"){this.semicolon=true;e.pop()}if(t[4]){r.source.end={line:t[4],column:t[5]}}else{r.source.end={line:t[2],column:t[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);r.raws.before+=e.shift()[1]}r.source.start={line:e[0][2],column:e[0][3]};r.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}r.prop+=e.shift()[1]}r.raws.between="";var o;while(e.length){o=e.shift();if(o[0]===":"){r.raws.between+=o[1];break}else{if(o[0]==="word"&&/\w/.test(o[1])){this.unknownWord([o])}r.raws.between+=o[1]}}if(r.prop[0]==="_"||r.prop[0]==="*"){r.raws.before+=r.prop[0];r.prop=r.prop.slice(1)}r.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var s=e.length-1;s>0;s--){o=e[s];if(o[1].toLowerCase()==="!important"){r.important=true;var a=this.stringFrom(e,s);a=this.spacesFromEnd(e)+a;if(a!==" !important")r.raws.important=a;break}else if(o[1].toLowerCase()==="important"){var u=e.slice(0);var f="";for(var c=s;c>0;c--){var l=u[c][0];if(f.trim().indexOf("!")===0&&l!=="space"){break}f=u.pop()[1]+f}if(f.trim().indexOf("!")===0){r.important=true;r.raws.important=f;e=u}}if(o[0]!=="space"&&o[0]!=="comment"){break}}this.raw(r,"value",e);if(r.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var r=new s.default;r.name=e[1].slice(1);if(r.name===""){this.unnamedAtrule(r,e)}this.init(r,e[2],e[3]);var t;var n;var i=false;var o=false;var a=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){r.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){o=true;break}else if(e[0]==="}"){if(a.length>0){n=a.length-1;t=a[n];while(t&&t[0]==="space"){t=a[--n]}if(t){r.source.end={line:t[4],column:t[5]}}}this.end(e);break}else{a.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}r.raws.between=this.spacesAndCommentsFromEnd(a);if(a.length){r.raws.afterName=this.spacesAndCommentsFromStart(a);this.raw(r,"params",a);if(i){e=a[a.length-1];r.source.end={line:e[4],column:e[5]};this.spaces=r.raws.between;r.raws.between=""}}else{r.raws.afterName="";r.params=""}if(o){r.nodes=[];this.current=r}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var r=this.current.nodes[this.current.nodes.length-1];if(r&&r.type==="rule"&&!r.raws.ownSemicolon){r.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,r,t){this.current.push(e);e.source={start:{line:r,column:t},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,r,t){var n,i;var o=t.length;var s="";var a=true;var u,f;var c=/^([.|#])?([\w])+/i;for(var l=0;l=0;i--){n=e[i];if(n[0]!=="space"){t+=1;if(t===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();r.default=f;e.exports=r.default},4633:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3605));var i=_interopRequireDefault(t(8074));var o=_interopRequireDefault(t(7549));var s=_interopRequireDefault(t(8259));var a=_interopRequireDefault(t(4217));var u=_interopRequireDefault(t(216));var f=_interopRequireDefault(t(3749));var c=_interopRequireDefault(t(7009));var l=_interopRequireDefault(t(7797));var p=_interopRequireDefault(t(5907));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,r=new Array(e),t=0;t{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(6241));var i=_interopRequireDefault(t(5622));var o=_interopRequireDefault(t(5747));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function fromBase64(e){if(Buffer){return Buffer.from(e,"base64").toString()}else{return window.atob(e)}}var s=function(){function PreviousMap(e,r){this.loadAnnotation(e);this.inline=this.startWith(this.annotation,"data:");var t=r.map?r.map.prev:undefined;var n=this.loadMap(r.from,t);if(n)this.text=n}var e=PreviousMap.prototype;e.consumer=function consumer(){if(!this.consumerCache){this.consumerCache=new n.default.SourceMapConsumer(this.text)}return this.consumerCache};e.withContent=function withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)};e.startWith=function startWith(e,r){if(!e)return false;return e.substr(0,r.length)===r};e.getAnnotationURL=function getAnnotationURL(e){return e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1].trim()};e.loadAnnotation=function loadAnnotation(e){var r=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//gm);if(r&&r.length>0){var t=r[r.length-1];if(t){this.annotation=this.getAnnotationURL(t)}}};e.decodeInline=function decodeInline(e){var r=/^data:application\/json;charset=utf-?8;base64,/;var t=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(r.test(e)||t.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,r){if(r===false)return false;if(r){if(typeof r==="string"){return r}else if(typeof r==="function"){var t=r(e);if(t&&o.default.existsSync&&o.default.existsSync(t)){return o.default.readFileSync(t,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+t.toString())}}else if(r instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(r).toString()}else if(r instanceof n.default.SourceMapGenerator){return r.toString()}else if(this.isMap(r)){return JSON.stringify(r)}else{throw new Error("Unsupported previous source map format: "+r.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var s=this.annotation;if(e)s=i.default.join(i.default.dirname(e),s);this.root=i.default.dirname(s);if(o.default.existsSync&&o.default.existsSync(s)){return o.default.readFileSync(s,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var a=s;r.default=a;e.exports=r.default},8074:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(1169));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.32";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(r){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,r){if(r===void 0){r={}}if(this.plugins.length===0&&r.parser===r.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,r)});e.normalize=function normalize(e){var r=[];for(var t=e,n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(i>=t.length)break;o=t[i++]}else{i=t.next();if(i.done)break;o=i.value}var s=o;if(s.postcss)s=s.postcss;if(typeof s==="object"&&Array.isArray(s.plugins)){r=r.concat(s.plugins)}else if(typeof s==="function"){r.push(s)}else if(typeof s==="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(s+" is not a PostCSS plugin")}}return r};return Processor}();var o=i;r.default=o;e.exports=r.default},7613:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(7338));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(5878));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;e.__proto__=r}var i=function(e){_inheritsLoose(Root,e);function Root(r){var t;t=e.call(this,r)||this;t.type="root";if(!t.nodes)t.nodes=[];return t}var r=Root.prototype;r.removeChild=function removeChild(r,t){var n=this.index(r);if(!t&&n===0&&this.nodes.length>1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,r)};r.normalize=function normalize(r,t,n){var i=e.prototype.normalize.call(this,r);if(t){if(n==="prepend"){if(this.nodes.length>1){t.raws.before=this.nodes[1].raws.before}else{delete t.raws.before}}else if(this.first!==t){for(var o=i,s=Array.isArray(o),a=0,o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{a=o.next();if(a.done)break;u=a.value}var f=u;f.raws.before=t.raws.before}}}return i};r.toResult=function toResult(e){if(e===void 0){e={}}var r=t(1169);var n=t(8074);var i=new r(new n,this,e);return i.stringify()};return Root}(n.default);var o=i;r.default=o;e.exports=r.default},7797:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(5878));var i=_interopRequireDefault(t(7009));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,r){for(var t=0;t{"use strict";r.__esModule=true;r.default=void 0;var t={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:false};function capitalize(e){return e[0].toUpperCase()+e.slice(1)}var n=function(){function Stringifier(e){this.builder=e}var e=Stringifier.prototype;e.stringify=function stringify(e,r){this[e.type](e,r)};e.root=function root(e){this.body(e);if(e.raws.after)this.builder(e.raws.after)};e.comment=function comment(e){var r=this.raw(e,"left","commentLeft");var t=this.raw(e,"right","commentRight");this.builder("/*"+r+e.text+t+"*/",e)};e.decl=function decl(e,r){var t=this.raw(e,"between","colon");var n=e.prop+t+this.rawValue(e,"value");if(e.important){n+=e.raws.important||" !important"}if(r)n+=";";this.builder(n,e)};e.rule=function rule(e){this.block(e,this.rawValue(e,"selector"));if(e.raws.ownSemicolon){this.builder(e.raws.ownSemicolon,e,"end")}};e.atrule=function atrule(e,r){var t="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!=="undefined"){t+=e.raws.afterName}else if(n){t+=" "}if(e.nodes){this.block(e,t+n)}else{var i=(e.raws.between||"")+(r?";":"");this.builder(t+n+i,e)}};e.body=function body(e){var r=e.nodes.length-1;while(r>0){if(e.nodes[r].type!=="comment")break;r-=1}var t=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){r=e.raws.after;if(r.indexOf("\n")!==-1){r=r.replace(/[^\n]+$/,"")}return false}}});if(r)r=r.replace(/[^\s]/g,"");return r};e.rawBeforeOpen=function rawBeforeOpen(e){var r;e.walk(function(e){if(e.type!=="decl"){r=e.raws.between;if(typeof r!=="undefined")return false}});return r};e.rawColon=function rawColon(e){var r;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){r=e.raws.between.replace(/[^\s:]/g,"");return false}});return r};e.beforeAfter=function beforeAfter(e,r){var t;if(e.type==="decl"){t=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){t=this.raw(e,null,"beforeComment")}else if(r==="before"){t=this.raw(e,null,"beforeRule")}else{t=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(t.indexOf("\n")!==-1){var o=this.raw(e,null,"indent");if(o.length){for(var s=0;s{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(3935));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringify(e,r){var t=new n.default(r);t.stringify(e)}var i=stringify;r.default=i;e.exports=r.default},8300:(e,r,t)=>{"use strict";r.__esModule=true;r.default=void 0;var n=_interopRequireDefault(t(2242));var i=_interopRequireDefault(t(1926));var o=_interopRequireDefault(t(4905));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s={brackets:n.default.cyan,"at-word":n.default.cyan,comment:n.default.gray,string:n.default.green,class:n.default.yellow,call:n.default.cyan,hash:n.default.magenta,"(":n.default.cyan,")":n.default.cyan,"{":n.default.yellow,"}":n.default.yellow,"[":n.default.yellow,"]":n.default.yellow,":":n.default.yellow,";":n.default.yellow};function getTokenType(e,r){var t=e[0],n=e[1];if(t==="word"){if(n[0]==="."){return"class"}if(n[0]==="#"){return"hash"}}if(!r.endOfFile()){var i=r.nextToken();r.back(i);if(i[0]==="brackets"||i[0]==="(")return"call"}return t}function terminalHighlight(e){var r=(0,i.default)(new o.default(e),{ignoreErrors:true});var t="";var n=function _loop(){var e=r.nextToken();var n=s[getTokenType(e,r)];if(n){t+=e[1].split(/\r?\n/).map(function(e){return n(e)}).join("\n")}else{t+=e[1]}};while(!r.endOfFile()){n()}return t}var a=terminalHighlight;r.default=a;e.exports=r.default},1926:(e,r)=>{"use strict";r.__esModule=true;r.default=tokenizer;var t="'".charCodeAt(0);var n='"'.charCodeAt(0);var i="\\".charCodeAt(0);var o="/".charCodeAt(0);var s="\n".charCodeAt(0);var a=" ".charCodeAt(0);var u="\f".charCodeAt(0);var f="\t".charCodeAt(0);var c="\r".charCodeAt(0);var l="[".charCodeAt(0);var p="]".charCodeAt(0);var h="(".charCodeAt(0);var B=")".charCodeAt(0);var v="{".charCodeAt(0);var d="}".charCodeAt(0);var b=";".charCodeAt(0);var y="*".charCodeAt(0);var g=":".charCodeAt(0);var m="@".charCodeAt(0);var C=/[ \n\t\r\f{}()'"\\;/[\]#]/g;var w=/[ \n\t\r\f(){}:;@!'"\\\][#]|\/(?=\*)/g;var S=/.[\\/("'\n]/;var O=/[a-f0-9]/i;function tokenizer(e,r){if(r===void 0){r={}}var T=e.css.valueOf();var E=r.ignoreErrors;var k,P,D,A,R,F,x;var j,I,M,_,N,L,q;var G=T.length;var U=-1;var J=1;var W=0;var Q=[];var H=[];function position(){return W}function unclosed(r){throw e.error("Unclosed "+r,J,W-U)}function endOfFile(){return H.length===0&&W>=G}function nextToken(e){if(H.length)return H.pop();if(W>=G)return;var r=e?e.ignoreUnclosed:false;k=T.charCodeAt(W);if(k===s||k===u||k===c&&T.charCodeAt(W+1)!==s){U=W;J+=1}switch(k){case s:case a:case f:case c:case u:P=W;do{P+=1;k=T.charCodeAt(P);if(k===s){U=P;J+=1}}while(k===a||k===s||k===f||k===c||k===u);q=["space",T.slice(W,P)];W=P-1;break;case l:case p:case v:case d:case g:case b:case B:var K=String.fromCharCode(k);q=[K,K,J,W-U];break;case h:N=Q.length?Q.pop()[1]:"";L=T.charCodeAt(W+1);if(N==="url"&&L!==t&&L!==n&&L!==a&&L!==s&&L!==f&&L!==u&&L!==c){P=W;do{M=false;P=T.indexOf(")",P+1);if(P===-1){if(E||r){P=W;break}else{unclosed("bracket")}}_=P;while(T.charCodeAt(_-1)===i){_-=1;M=!M}}while(M);q=["brackets",T.slice(W,P+1),J,W-U,J,P-U];W=P}else{P=T.indexOf(")",W+1);F=T.slice(W,P+1);if(P===-1||S.test(F)){q=["(","(",J,W-U]}else{q=["brackets",F,J,W-U,J,P-U];W=P}}break;case t:case n:D=k===t?"'":'"';P=W;do{M=false;P=T.indexOf(D,P+1);if(P===-1){if(E||r){P=W+1;break}else{unclosed("string")}}_=P;while(T.charCodeAt(_-1)===i){_-=1;M=!M}}while(M);F=T.slice(W,P+1);A=F.split("\n");R=A.length-1;if(R>0){j=J+R;I=P-A[R].length}else{j=J;I=U}q=["string",T.slice(W,P+1),J,W-U,j,P-I];U=I;J=j;W=P;break;case m:C.lastIndex=W+1;C.test(T);if(C.lastIndex===0){P=T.length-1}else{P=C.lastIndex-2}q=["at-word",T.slice(W,P+1),J,W-U,J,P-U];W=P;break;case i:P=W;x=true;while(T.charCodeAt(P+1)===i){P+=1;x=!x}k=T.charCodeAt(P+1);if(x&&k!==o&&k!==a&&k!==s&&k!==f&&k!==c&&k!==u){P+=1;if(O.test(T.charAt(P))){while(O.test(T.charAt(P+1))){P+=1}if(T.charCodeAt(P+1)===a){P+=1}}}q=["word",T.slice(W,P+1),J,W-U,J,P-U];W=P;break;default:if(k===o&&T.charCodeAt(W+1)===y){P=T.indexOf("*/",W+2)+1;if(P===0){if(E||r){P=T.length}else{unclosed("comment")}}F=T.slice(W,P+1);A=F.split("\n");R=A.length-1;if(R>0){j=J+R;I=P-A[R].length}else{j=J;I=U}q=["comment",F,J,W-U,j,P-I];U=I;J=j;W=P}else{w.lastIndex=W+1;w.test(T);if(w.lastIndex===0){P=T.length-1}else{P=w.lastIndex-2}q=["word",T.slice(W,P+1),J,W-U,J,P-U];Q.push(q);W=P}break}W++;return q}function back(e){H.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=r.default},216:(e,r)=>{"use strict";r.__esModule=true;r.default=void 0;var t={prefix:function prefix(e){var r=e.match(/^(-\w+-)/);if(r){return r[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=t;r.default=n;e.exports=r.default},3831:(e,r)=>{"use strict";r.__esModule=true;r.default=warnOnce;var t={};function warnOnce(e){if(t[e])return;t[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=r.default},7338:(e,r)=>{"use strict";r.__esModule=true;r.default=void 0;var t=function(){function Warning(e,r){if(r===void 0){r={}}this.type="warning";this.text=e;if(r.node&&r.node.source){var t=r.node.positionBy(r);this.line=t.line;this.column=t.column}for(var n in r){this[n]=r[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=t;r.default=n;e.exports=r.default},183:e=>{"use strict";e.exports=((e,r)=>{r=r||process.argv;const t=e.startsWith("-")?"":e.length===1?"-":"--";const n=r.indexOf(t+e);const i=r.indexOf("--");return n!==-1&&(i===-1?true:n{"use strict";const n=t(2087);const i=t(183);const{env:o}=process;let s;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){s=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){s=1}if("FORCE_COLOR"in o){if(o.FORCE_COLOR===true||o.FORCE_COLOR==="true"){s=1}else if(o.FORCE_COLOR===false||o.FORCE_COLOR==="false"){s=0}else{s=o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(s===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&s===undefined){return 0}const r=s||0;if(o.TERM==="dumb"){return r}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in o)||o.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}return r}function getSupportLevel(e){const r=supportsColor(e);return translateLevel(r)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},5632:e=>{"use strict";function unique_pred(e,r){var t=1,n=e.length,i=e[0],o=e[0];for(var s=1;s{"use strict";e.exports=require("browserslist")},4338:e=>{"use strict";e.exports=require("caniuse-lite")},5543:e=>{"use strict";e.exports=require("caniuse-lite/data/features/border-radius")},6944:e=>{"use strict";e.exports=require("caniuse-lite/data/features/css-featurequeries")},2242:e=>{"use strict";e.exports=require("chalk")},5747:e=>{"use strict";e.exports=require("fs")},6241:e=>{"use strict";e.exports=require("next/dist/compiled/source-map")},2087:e=>{"use strict";e.exports=require("os")},5622:e=>{"use strict";e.exports=require("path")},1669:e=>{"use strict";e.exports=require("util")}};var r={};function __nccwpck_require__(t){if(r[t]){return r[t].exports}var n=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t](n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}n.loaded=true;return n.exports}(()=>{__nccwpck_require__.nmd=(e=>{e.paths=[];if(!e.children)e.children=[];return e})})();__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(7435)})(); \ No newline at end of file diff --git a/packages/next/compiled/resolve-url-loader/engine/postcss.js b/packages/next/compiled/resolve-url-loader/engine/postcss.js index d9ea25c9a3e1..44f30e217bc9 100644 --- a/packages/next/compiled/resolve-url-loader/engine/postcss.js +++ b/packages/next/compiled/resolve-url-loader/engine/postcss.js @@ -1 +1 @@ -module.exports=(()=>{"use strict";var e={379:e=>{e.exports=((e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n{var n=r(87),i=r(622),s=r(707);var o=r(95);var u=/\r(?!\n)(.|\n)?/g;function process(e,t,r){var a=r.removeCR&&n.EOL!=="\r"?t.replace(u," $1"):t;return s([s.plugin("postcss-resolve-url",postcssPlugin)]).process(a,{from:o.prepend(e),map:r.outputSourceMap&&{prev:!!r.absSourceMap&&o.prepend(r.absSourceMap),inline:false,annotation:false,sourcesContent:true}}).then(e=>({content:e.css,map:r.outputSourceMap?o.remove(e.map.toJSON()):null}));function postcssPlugin(){return function(e){e.walkDecls(eachDeclaration)};function eachDeclaration(e){var n=e.value&&e.value.indexOf("url")>=0;if(n){var s=e.source.start,a=r.sourceMapConsumer&&r.sourceMapConsumer.originalPositionFor(s);var f=a&&a.source&&o.remove(i.dirname(a.source));if(f){e.value=r.transformDeclaration(e.value,f)}else if(r.sourceMapConsumer){throw new Error("source-map information is not available at url() declaration "+(u.test(t)?"(found orphan CR, try removeCR option)":"(no orphan CR found)"))}}}}}e.exports=process},95:(e,t)=>{function prepend(e){if(typeof e==="string"){return"file://"+e}else if(e&&typeof e==="object"&&Array.isArray(e.sources)){return Object.assign({},e,{sources:e.sources.map(prepend)})}else{throw new Error("expected string|object")}}t.prepend=prepend;function remove(e){if(typeof e==="string"){return e.replace(/^file:\/{2}/,"")}else if(e&&typeof e==="object"&&Array.isArray(e.sources)){return Object.assign({},e,{sources:e.sources.map(remove)})}else{throw new Error("expected string|object")}}t.remove=remove},226:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(820));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Comment,e);function Comment(t){var r;r=e.call(this,t)||this;r.type="comment";return r}return Comment}(n.default);var s=i;t.default=s;e.exports=t.default},820:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(142));var i=_interopRequireDefault(r(676));var s=_interopRequireDefault(r(3));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(972);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var w=v;if(w.parent)w.parent.removeChild(w,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(714);e=[new m(e)]}else if(e.name){var g=r(226);e=[new g(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var y=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return y};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},698:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(127));var i=_interopRequireDefault(r(242));var s=_interopRequireDefault(r(706));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},142:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},702:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(622));var i=_interopRequireDefault(r(698));var s=_interopRequireDefault(r(990));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},805:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(129));var i=_interopRequireDefault(r(885));var s=_interopRequireDefault(r(294));var o=_interopRequireDefault(r(292));var u=_interopRequireDefault(r(972));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},534:(e,t)=>{t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},129:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(241));var i=_interopRequireDefault(r(622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},3:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(698));var i=_interopRequireDefault(r(218));var s=_interopRequireDefault(r(885));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(172));var i=_interopRequireDefault(r(702));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e,t){var r=new i.default(e,t);var s=new n.default(r);try{s.parse()}catch(e){if(process.env.NODE_ENV!=="production"){if(e.name==="CssSyntaxError"&&t&&t.from){if(/\.scss$/i.test(t.from)){e.message+="\nYou tried to parse SCSS with "+"the standard CSS parser; "+"try again with the postcss-scss parser"}else if(/\.sass/i.test(t.from)){e.message+="\nYou tried to parse Sass with "+"the standard CSS parser; "+"try again with the postcss-sass parser"}else if(/\.less$/i.test(t.from)){e.message+="\nYou tried to parse Less with "+"the standard CSS parser; "+"try again with the postcss-less parser"}}}throw e}return s.root}var s=parse;t.default=s;e.exports=t.default},172:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(142));var i=_interopRequireDefault(r(462));var s=_interopRequireDefault(r(676));var o=_interopRequireDefault(r(226));var u=_interopRequireDefault(r(234));var a=_interopRequireDefault(r(714));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f=function(){function Parser(e){this.input=e;this.root=new u.default;this.current=this.root;this.spaces="";this.semicolon=false;this.createTokenizer();this.root.source={input:e,start:{line:1,column:1}}}var e=Parser.prototype;e.createTokenizer=function createTokenizer(){this.tokenizer=(0,i.default)(this.input)};e.parse=function parse(){var e;while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();switch(e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}}this.endFile()};e.comment=function comment(e){var t=new s.default;this.init(t,e[2],e[3]);t.source.end={line:e[4],column:e[5]};var r=e[1].slice(2,-2);if(/^\s*$/.test(r)){t.text="";t.raws.left=r;t.raws.right=""}else{var n=r.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=n[2];t.raws.left=n[1];t.raws.right=n[3]}};e.emptyRule=function emptyRule(e){var t=new a.default;this.init(t,e[2],e[3]);t.selector="";t.raws.between="";this.current=t};e.other=function other(e){var t=false;var r=null;var n=false;var i=null;var s=[];var o=[];var u=e;while(u){r=u[0];o.push(u);if(r==="("||r==="["){if(!i)i=u;s.push(r==="("?")":"]")}else if(s.length===0){if(r===";"){if(n){this.decl(o);return}else{break}}else if(r==="{"){this.rule(o);return}else if(r==="}"){this.tokenizer.back(o.pop());t=true;break}else if(r===":"){n=true}}else if(r===s[s.length-1]){s.pop();if(s.length===0)i=null}u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())t=true;if(s.length>0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},707:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(142));var i=_interopRequireDefault(r(155));var s=_interopRequireDefault(r(885));var o=_interopRequireDefault(r(676));var u=_interopRequireDefault(r(226));var a=_interopRequireDefault(r(661));var f=_interopRequireDefault(r(972));var l=_interopRequireDefault(r(534));var c=_interopRequireDefault(r(714));var h=_interopRequireDefault(r(234));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(241));var i=_interopRequireDefault(r(622));var s=_interopRequireDefault(r(747));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function fromBase64(e){if(Buffer){return Buffer.from(e,"base64").toString()}else{return window.atob(e)}}var o=function(){function PreviousMap(e,t){this.loadAnnotation(e);this.inline=this.startWith(this.annotation,"data:");var r=t.map?t.map.prev:undefined;var n=this.loadMap(t.from,r);if(n)this.text=n}var e=PreviousMap.prototype;e.consumer=function consumer(){if(!this.consumerCache){this.consumerCache=new n.default.SourceMapConsumer(this.text)}return this.consumerCache};e.withContent=function withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);if(t)this.annotation=t[1].trim()};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},155:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(805));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.21";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},292:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(356));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(820));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Root,e);function Root(t){var r;r=e.call(this,t)||this;r.type="root";if(!r.nodes)r.nodes=[];return r}var t=Root.prototype;t.removeChild=function removeChild(t,r){var n=this.index(t);if(!r&&n===0&&this.nodes.length>1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(805);var n=r(155);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},714:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(820));var i=_interopRequireDefault(r(534));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r{t.__esModule=true;t.default=void 0;var r={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:false};function capitalize(e){return e[0].toUpperCase()+e.slice(1)}var n=function(){function Stringifier(e){this.builder=e}var e=Stringifier.prototype;e.stringify=function stringify(e,t){this[e.type](e,t)};e.root=function root(e){this.body(e);if(e.raws.after)this.builder(e.raws.after)};e.comment=function comment(e){var t=this.raw(e,"left","commentLeft");var r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)};e.decl=function decl(e,t){var r=this.raw(e,"between","colon");var n=e.prop+r+this.rawValue(e,"value");if(e.important){n+=e.raws.important||" !important"}if(t)n+=";";this.builder(n,e)};e.rule=function rule(e){this.block(e,this.rawValue(e,"selector"));if(e.raws.ownSemicolon){this.builder(e.raws.ownSemicolon,e,"end")}};e.atrule=function atrule(e,t){var r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!=="undefined"){r+=e.raws.afterName}else if(n){r+=" "}if(e.nodes){this.block(e,r+n)}else{var i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}};e.body=function body(e){var t=e.nodes.length-1;while(t>0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(218));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringify(e,t){var r=new n.default(t);r.stringify(e)}var i=stringify;t.default=i;e.exports=t.default},706:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(242));var i=_interopRequireDefault(r(462));var s=_interopRequireDefault(r(702));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o={brackets:n.default.cyan,"at-word":n.default.cyan,comment:n.default.gray,string:n.default.green,class:n.default.yellow,call:n.default.cyan,hash:n.default.magenta,"(":n.default.cyan,")":n.default.cyan,"{":n.default.yellow,"}":n.default.yellow,"[":n.default.yellow,"]":n.default.yellow,":":n.default.yellow,";":n.default.yellow};function getTokenType(e,t){var r=e[0],n=e[1];if(r==="word"){if(n[0]==="."){return"class"}if(n[0]==="#"){return"hash"}}if(!t.endOfFile()){var i=t.nextToken();t.back(i);if(i[0]==="brackets"||i[0]==="(")return"call"}return r}function terminalHighlight(e){var t=(0,i.default)(new s.default(e),{ignoreErrors:true});var r="";var n=function _loop(){var e=t.nextToken();var n=o[getTokenType(e,t)];if(n){r+=e[1].split(/\r?\n/).map(function(e){return n(e)}).join("\n")}else{r+=e[1]}};while(!t.endOfFile()){n()}return r}var u=terminalHighlight;t.default=u;e.exports=t.default},462:(e,t)=>{t.__esModule=true;t.default=tokenizer;var r="'".charCodeAt(0);var n='"'.charCodeAt(0);var i="\\".charCodeAt(0);var s="/".charCodeAt(0);var o="\n".charCodeAt(0);var u=" ".charCodeAt(0);var a="\f".charCodeAt(0);var f="\t".charCodeAt(0);var l="\r".charCodeAt(0);var c="[".charCodeAt(0);var h="]".charCodeAt(0);var p="(".charCodeAt(0);var d=")".charCodeAt(0);var v="{".charCodeAt(0);var w="}".charCodeAt(0);var m=";".charCodeAt(0);var g="*".charCodeAt(0);var y=":".charCodeAt(0);var b="@".charCodeAt(0);var C=/[ \n\t\r\f{}()'"\\;/[\]#]/g;var R=/[ \n\t\r\f(){}:;@!'"\\\][#]|\/(?=\*)/g;var S=/.[\\/("'\n]/;var O=/[a-f0-9]/i;function tokenizer(e,t){if(t===void 0){t={}}var M=e.css.valueOf();var A=t.ignoreErrors;var D,k,E,x,q,N,F;var I,B,T,j,z,L,P;var V=M.length;var W=-1;var U=1;var $=0;var G=[];var J=[];function position(){return $}function unclosed(t){throw e.error("Unclosed "+t,U,$-W)}function endOfFile(){return J.length===0&&$>=V}function nextToken(e){if(J.length)return J.pop();if($>=V)return;var t=e?e.ignoreUnclosed:false;D=M.charCodeAt($);if(D===o||D===a||D===l&&M.charCodeAt($+1)!==o){W=$;U+=1}switch(D){case o:case u:case f:case l:case a:k=$;do{k+=1;D=M.charCodeAt(k);if(D===o){W=k;U+=1}}while(D===u||D===o||D===f||D===l||D===a);P=["space",M.slice($,k)];$=k-1;break;case c:case h:case v:case w:case y:case m:case d:var Y=String.fromCharCode(D);P=[Y,Y,U,$-W];break;case p:z=G.length?G.pop()[1]:"";L=M.charCodeAt($+1);if(z==="url"&&L!==r&&L!==n&&L!==u&&L!==o&&L!==f&&L!==a&&L!==l){k=$;do{T=false;k=M.indexOf(")",k+1);if(k===-1){if(A||t){k=$;break}else{unclosed("bracket")}}j=k;while(M.charCodeAt(j-1)===i){j-=1;T=!T}}while(T);P=["brackets",M.slice($,k+1),U,$-W,U,k-W];$=k}else{k=M.indexOf(")",$+1);N=M.slice($,k+1);if(k===-1||S.test(N)){P=["(","(",U,$-W]}else{P=["brackets",N,U,$-W,U,k-W];$=k}}break;case r:case n:E=D===r?"'":'"';k=$;do{T=false;k=M.indexOf(E,k+1);if(k===-1){if(A||t){k=$+1;break}else{unclosed("string")}}j=k;while(M.charCodeAt(j-1)===i){j-=1;T=!T}}while(T);N=M.slice($,k+1);x=N.split("\n");q=x.length-1;if(q>0){I=U+q;B=k-x[q].length}else{I=U;B=W}P=["string",M.slice($,k+1),U,$-W,I,k-B];W=B;U=I;$=k;break;case b:C.lastIndex=$+1;C.test(M);if(C.lastIndex===0){k=M.length-1}else{k=C.lastIndex-2}P=["at-word",M.slice($,k+1),U,$-W,U,k-W];$=k;break;case i:k=$;F=true;while(M.charCodeAt(k+1)===i){k+=1;F=!F}D=M.charCodeAt(k+1);if(F&&D!==s&&D!==u&&D!==o&&D!==f&&D!==l&&D!==a){k+=1;if(O.test(M.charAt(k))){while(O.test(M.charAt(k+1))){k+=1}if(M.charCodeAt(k+1)===u){k+=1}}}P=["word",M.slice($,k+1),U,$-W,U,k-W];$=k;break;default:if(D===s&&M.charCodeAt($+1)===g){k=M.indexOf("*/",$+2)+1;if(k===0){if(A||t){k=M.length}else{unclosed("comment")}}N=M.slice($,k+1);x=N.split("\n");q=x.length-1;if(q>0){I=U+q;B=k-x[q].length}else{I=U;B=W}P=["comment",N,U,$-W,I,k-B];W=B;U=I;$=k}else{R.lastIndex=$+1;R.test(M);if(R.lastIndex===0){k=M.length-1}else{k=R.lastIndex-2}P=["word",M.slice($,k+1),U,$-W,U,k-W];G.push(P);$=k}break}$++;return P}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},661:(e,t)=>{t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},294:(e,t)=>{t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},356:(e,t)=>{t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},127:(e,t,r)=>{const n=r(87);const i=r(379);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},242:e=>{e.exports=require("chalk")},747:e=>{e.exports=require("fs")},241:e=>{e.exports=require("next/dist/compiled/source-map")},87:e=>{e.exports=require("os")},622:e=>{e.exports=require("path")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var n=t[r]={exports:{}};var i=true;try{e[r](n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return n.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(136)})(); \ No newline at end of file +module.exports=(()=>{"use strict";var e={136:(e,t,r)=>{var n=r(87),i=r(622),s=r(707);var o=r(95);var u=/\r(?!\n)(.|\n)?/g;function process(e,t,r){var a=r.removeCR&&n.EOL!=="\r"?t.replace(u," $1"):t;return s([s.plugin("postcss-resolve-url",postcssPlugin)]).process(a,{from:o.prepend(e),map:r.outputSourceMap&&{prev:!!r.absSourceMap&&o.prepend(r.absSourceMap),inline:false,annotation:false,sourcesContent:true}}).then(e=>({content:e.css,map:r.outputSourceMap?o.remove(e.map.toJSON()):null}));function postcssPlugin(){return function(e){e.walkDecls(eachDeclaration)};function eachDeclaration(e){var n=e.value&&e.value.indexOf("url")>=0;if(n){var s=e.source.start,a=r.sourceMapConsumer&&r.sourceMapConsumer.originalPositionFor(s);var f=a&&a.source&&o.remove(i.dirname(a.source));if(f){e.value=r.transformDeclaration(e.value,f)}else if(r.sourceMapConsumer){throw new Error("source-map information is not available at url() declaration "+(u.test(t)?"(found orphan CR, try removeCR option)":"(no orphan CR found)"))}}}}}e.exports=process},95:(e,t)=>{function prepend(e){if(typeof e==="string"){return"file://"+e}else if(e&&typeof e==="object"&&Array.isArray(e.sources)){return Object.assign({},e,{sources:e.sources.map(prepend)})}else{throw new Error("expected string|object")}}t.prepend=prepend;function remove(e){if(typeof e==="string"){return e.replace(/^file:\/{2}/,"")}else if(e&&typeof e==="object"&&Array.isArray(e.sources)){return Object.assign({},e,{sources:e.sources.map(remove)})}else{throw new Error("expected string|object")}}t.remove=remove},755:e=>{e.exports=((e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(820));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(AtRule,e);function AtRule(t){var r;r=e.call(this,t)||this;r.type="atrule";return r}var t=AtRule.prototype;t.append=function append(){var t;if(!this.nodes)this.nodes=[];for(var r=arguments.length,n=new Array(r),i=0;i{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Comment,e);function Comment(t){var r;r=e.call(this,t)||this;r.type="comment";return r}return Comment}(n.default);var s=i;t.default=s;e.exports=t.default},820:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(142));var i=_interopRequireDefault(r(676));var s=_interopRequireDefault(r(3));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;this.nodes.push(c)}}return this};t.prepend=function prepend(){for(var e=arguments.length,t=new Array(e),r=0;r=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;var a=this.normalize(u,this.first,"prepend").reverse();for(var f=a,l=Array.isArray(f),c=0,f=l?f:f[Symbol.iterator]();;){var h;if(l){if(c>=f.length)break;h=f[c++]}else{c=f.next();if(c.done)break;h=c.value}var p=h;this.nodes.unshift(p)}for(var d in this.indexes){this.indexes[d]=this.indexes[d]+a.length}}return this};t.cleanRaws=function cleanRaws(t){e.prototype.cleanRaws.call(this,t);if(this.nodes){for(var r=this.nodes,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;o.cleanRaws(t)}}};t.insertBefore=function insertBefore(e,t){e=this.index(e);var r=e===0?"prepend":false;var n=this.normalize(t,this.nodes[e],r).reverse();for(var i=n,s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{o=i.next();if(o.done)break;u=o.value}var a=u;this.nodes.splice(e,0,a)}var f;for(var l in this.indexes){f=this.indexes[l];if(e<=f){this.indexes[l]=f+n.length}}return this};t.insertAfter=function insertAfter(e,t){e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();for(var n=r,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{s=n.next();if(s.done)break;o=s.value}var u=o;this.nodes.splice(e+1,0,u)}var a;for(var f in this.indexes){a=this.indexes[f];if(e=e){this.indexes[r]=t-1}}return this};t.removeAll=function removeAll(){for(var e=this.nodes,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;i.parent=undefined}this.nodes=[];return this};t.replaceValues=function replaceValues(e,t,r){if(!r){r=t;t={}}this.walkDecls(function(n){if(t.props&&t.props.indexOf(n.prop)===-1)return;if(t.fast&&n.value.indexOf(t.fast)===-1)return;n.value=n.value.replace(e,r)});return this};t.every=function every(e){return this.nodes.every(e)};t.some=function some(e){return this.nodes.some(e)};t.index=function index(e){if(typeof e==="number"){return e}return this.nodes.indexOf(e)};t.normalize=function normalize(e,t){var s=this;if(typeof e==="string"){var o=r(972);e=cleanSource(o(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var u=e,a=Array.isArray(u),f=0,u=a?u:u[Symbol.iterator]();;){var l;if(a){if(f>=u.length)break;l=u[f++]}else{f=u.next();if(f.done)break;l=f.value}var c=l;if(c.parent)c.parent.removeChild(c,"ignore")}}else if(e.type==="root"){e=e.nodes.slice(0);for(var h=e,p=Array.isArray(h),d=0,h=p?h:h[Symbol.iterator]();;){var v;if(p){if(d>=h.length)break;v=h[d++]}else{d=h.next();if(d.done)break;v=d.value}var w=v;if(w.parent)w.parent.removeChild(w,"ignore")}}else if(e.type){e=[e]}else if(e.prop){if(typeof e.value==="undefined"){throw new Error("Value field is missed in node creation")}else if(typeof e.value!=="string"){e.value=String(e.value)}e=[new n.default(e)]}else if(e.selector){var m=r(714);e=[new m(e)]}else if(e.name){var g=r(226);e=[new g(e)]}else if(e.text){e=[new i.default(e)]}else{throw new Error("Unknown node type in node creation")}var y=e.map(function(e){if(e.parent)e.parent.removeChild(e);if(typeof e.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined"){e.raws.before=t.raws.before.replace(/[^\s]/g,"")}}e.parent=s;return e});return y};_createClass(Container,[{key:"first",get:function get(){if(!this.nodes)return undefined;return this.nodes[0]}},{key:"last",get:function get(){if(!this.nodes)return undefined;return this.nodes[this.nodes.length-1]}}]);return Container}(s.default);var u=o;t.default=u;e.exports=t.default},698:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(127));var i=_interopRequireDefault(r(242));var s=_interopRequireDefault(r(706));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=Function.bind.apply(e,n);var s=new i;if(r)_setPrototypeOf(s,r.prototype);return s}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}var o=function(e){_inheritsLoose(CssSyntaxError,e);function CssSyntaxError(t,r,n,i,s,o){var u;u=e.call(this,t)||this;u.name="CssSyntaxError";u.reason=t;if(s){u.file=s}if(i){u.source=i}if(o){u.plugin=o}if(typeof r!=="undefined"&&typeof n!=="undefined"){u.line=r;u.column=n}u.setMessage();if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(u),CssSyntaxError)}return u}var t=CssSyntaxError.prototype;t.setMessage=function setMessage(){this.message=this.plugin?this.plugin+": ":"";this.message+=this.file?this.file:"";if(typeof this.line!=="undefined"){this.message+=":"+this.line+":"+this.column}this.message+=": "+this.reason};t.showSourceCode=function showSourceCode(e){var t=this;if(!this.source)return"";var r=this.source;if(s.default){if(typeof e==="undefined")e=n.default.stdout;if(e)r=(0,s.default)(r)}var o=r.split(/\r?\n/);var u=Math.max(this.line-3,0);var a=Math.min(this.line+2,o.length);var f=String(a).length;function mark(t){if(e&&i.default.red){return i.default.red.bold(t)}return t}function aside(t){if(e&&i.default.gray){return i.default.gray(t)}return t}return o.slice(u,a).map(function(e,r){var n=u+1+r;var i=" "+(" "+n).slice(-f)+" | ";if(n===t.line){var s=aside(i.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return mark(">")+aside(i)+e+"\n "+s+mark("^")}return" "+aside(i)+e}).join("\n")};t.toString=function toString(){var e=this.showSourceCode();if(e){e="\n\n"+e+"\n"}return this.name+": "+this.message+e};return CssSyntaxError}(_wrapNativeSuper(Error));var u=o;t.default=u;e.exports=t.default},142:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(3));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Declaration,e);function Declaration(t){var r;r=e.call(this,t)||this;r.type="decl";return r}return Declaration}(n.default);var s=i;t.default=s;e.exports=t.default},702:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(622));var i=_interopRequireDefault(r(698));var s=_interopRequireDefault(r(990));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r"}if(this.map)this.map.file=this.from}var e=Input.prototype;e.error=function error(e,t,r,n){if(n===void 0){n={}}var s;var o=this.origin(t,r);if(o){s=new i.default(e,o.line,o.column,o.source,o.file,n.plugin)}else{s=new i.default(e,t,r,this.css,this.file,n.plugin)}s.input={line:t,column:r,source:this.css};if(this.file)s.input.file=this.file;return s};e.origin=function origin(e,t){if(!this.map)return false;var r=this.map.consumer();var n=r.originalPositionFor({line:e,column:t});if(!n.source)return false;var i={file:this.mapResolve(n.source),line:n.line,column:n.column};var s=r.sourceContentFor(n.source);if(s)i.source=s;return i};e.mapResolve=function mapResolve(e){if(/^\w+:\/\//.test(e)){return e}return n.default.resolve(this.map.consumer().sourceRoot||".",e)};_createClass(Input,[{key:"from",get:function get(){return this.file||this.id}}]);return Input}();var a=u;t.default=a;e.exports=t.default},805:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(129));var i=_interopRequireDefault(r(885));var s=_interopRequireDefault(r(294));var o=_interopRequireDefault(r(292));var u=_interopRequireDefault(r(972));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;rparseInt(o[1])){console.error("Unknown error from PostCSS plugin. Your current PostCSS "+"version is "+i+", but "+r+" uses "+n+". Perhaps this is the source of the error below.")}}}}catch(e){if(console&&console.error)console.error(e)}};e.asyncTick=function asyncTick(e,t){var r=this;if(this.plugin>=this.processor.plugins.length){this.processed=true;return e()}try{var n=this.processor.plugins[this.plugin];var i=this.run(n);this.plugin+=1;if(isPromise(i)){i.then(function(){r.asyncTick(e,t)}).catch(function(e){r.handleError(e,n);r.processed=true;t(e)})}else{this.asyncTick(e,t)}}catch(e){this.processed=true;t(e)}};e.async=function async(){var e=this;if(this.processed){return new Promise(function(t,r){if(e.error){r(e.error)}else{t(e.stringify())}})}if(this.processing){return this.processing}this.processing=new Promise(function(t,r){if(e.error)return r(e.error);e.plugin=0;e.asyncTick(t,r)}).then(function(){e.processed=true;return e.stringify()});return this.processing};e.sync=function sync(){if(this.processed)return this.result;this.processed=true;if(this.processing){throw new Error("Use process(css).then(cb) to work with async plugins")}if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{r=e.next();if(r.done)break;n=r.value}var i=n;var s=this.run(i);if(isPromise(s)){throw new Error("Use process(css).then(cb) to work with async plugins")}}return this.result};e.run=function run(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){this.handleError(t,e);throw t}};e.stringify=function stringify(){if(this.stringified)return this.result;this.stringified=true;this.sync();var e=this.result.opts;var t=i.default;if(e.syntax)t=e.syntax.stringify;if(e.stringifier)t=e.stringifier;if(t.stringify)t=t.stringify;var r=new n.default(t,this.result.root,this.result.opts);var s=r.generate();this.result.css=s[0];this.result.map=s[1];return this.result};_createClass(LazyResult,[{key:"processor",get:function get(){return this.result.processor}},{key:"opts",get:function get(){return this.result.opts}},{key:"css",get:function get(){return this.stringify().css}},{key:"content",get:function get(){return this.stringify().content}},{key:"map",get:function get(){return this.stringify().map}},{key:"root",get:function get(){return this.sync().root}},{key:"messages",get:function get(){return this.sync().messages}}]);return LazyResult}();var f=a;t.default=f;e.exports=t.default},534:(e,t)=>{t.__esModule=true;t.default=void 0;var r={split:function split(e,t,r){var n=[];var i="";var split=false;var s=0;var o=false;var u=false;for(var a=0;a0)s-=1}else if(s===0){if(t.indexOf(f)!==-1)split=true}if(split){if(i!=="")n.push(i.trim());i="";split=false}else{i+=f}}if(r||i!=="")n.push(i.trim());return n},space:function space(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function comma(e){return r.split(e,[","],true)}};var n=r;t.default=n;e.exports=t.default},129:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(241));var i=_interopRequireDefault(r(622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s=function(){function MapGenerator(e,t,r){this.stringify=e;this.mapOpts=r.map||{};this.root=t;this.opts=r}var e=MapGenerator.prototype;e.isMap=function isMap(){if(typeof this.opts.map!=="undefined"){return!!this.opts.map}return this.previous().length>0};e.previous=function previous(){var e=this;if(!this.previousMaps){this.previousMaps=[];this.root.walk(function(t){if(t.source&&t.source.input.map){var r=t.source.input.map;if(e.previousMaps.indexOf(r)===-1){e.previousMaps.push(r)}}})}return this.previousMaps};e.isInline=function isInline(){if(typeof this.mapOpts.inline!=="undefined"){return this.mapOpts.inline}var e=this.mapOpts.annotation;if(typeof e!=="undefined"&&e!==true){return false}if(this.previous().length){return this.previous().some(function(e){return e.inline})}return true};e.isSourcesContent=function isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined"){return this.mapOpts.sourcesContent}if(this.previous().length){return this.previous().some(function(e){return e.withContent()})}return true};e.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation===false)return;var e;for(var t=this.root.nodes.length-1;t>=0;t--){e=this.root.nodes[t];if(e.type!=="comment")continue;if(e.text.indexOf("# sourceMappingURL=")===0){this.root.removeChild(t)}}};e.setSourcesContent=function setSourcesContent(){var e=this;var t={};this.root.walk(function(r){if(r.source){var n=r.source.input.from;if(n&&!t[n]){t[n]=true;var i=e.relative(n);e.map.setSourceContent(i,r.source.input.css)}}})};e.applyPrevMaps=function applyPrevMaps(){for(var e=this.previous(),t=Array.isArray(e),r=0,e=t?e:e[Symbol.iterator]();;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{r=e.next();if(r.done)break;s=r.value}var o=s;var u=this.relative(o.file);var a=o.root||i.default.dirname(o.file);var f=void 0;if(this.mapOpts.sourcesContent===false){f=new n.default.SourceMapConsumer(o.text);if(f.sourcesContent){f.sourcesContent=f.sourcesContent.map(function(){return null})}}else{f=o.consumer()}this.map.applySourceMap(f,u,this.relative(a))}};e.isAnnotation=function isAnnotation(){if(this.isInline()){return true}if(typeof this.mapOpts.annotation!=="undefined"){return this.mapOpts.annotation}if(this.previous().length){return this.previous().some(function(e){return e.annotation})}return true};e.toBase64=function toBase64(e){if(Buffer){return Buffer.from(e).toString("base64")}return window.btoa(unescape(encodeURIComponent(e)))};e.addAnnotation=function addAnnotation(){var e;if(this.isInline()){e="data:application/json;base64,"+this.toBase64(this.map.toString())}else if(typeof this.mapOpts.annotation==="string"){e=this.mapOpts.annotation}else{e=this.outputFile()+".map"}var t="\n";if(this.css.indexOf("\r\n")!==-1)t="\r\n";this.css+=t+"/*# sourceMappingURL="+e+" */"};e.outputFile=function outputFile(){if(this.opts.to){return this.relative(this.opts.to)}if(this.opts.from){return this.relative(this.opts.from)}return"to.css"};e.generateMap=function generateMap(){this.generateString();if(this.isSourcesContent())this.setSourcesContent();if(this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline()){return[this.css]}return[this.css,this.map]};e.relative=function relative(e){if(e.indexOf("<")===0)return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?i.default.dirname(this.opts.to):".";if(typeof this.mapOpts.annotation==="string"){t=i.default.dirname(i.default.resolve(t,this.mapOpts.annotation))}e=i.default.relative(t,e);if(i.default.sep==="\\"){return e.replace(/\\/g,"/")}return e};e.sourcePath=function sourcePath(e){if(this.mapOpts.from){return this.mapOpts.from}return this.relative(e.source.input.from)};e.generateString=function generateString(){var e=this;this.css="";this.map=new n.default.SourceMapGenerator({file:this.outputFile()});var t=1;var r=1;var i,s;this.stringify(this.root,function(n,o,u){e.css+=n;if(o&&u!=="end"){if(o.source&&o.source.start){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-1},original:{line:o.source.start.line,column:o.source.start.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}i=n.match(/\n/g);if(i){t+=i.length;s=n.lastIndexOf("\n");r=n.length-s}else{r+=n.length}if(o&&u!=="start"){var a=o.parent||{raws:{}};if(o.type!=="decl"||o!==a.last||a.raws.semicolon){if(o.source&&o.source.end){e.map.addMapping({source:e.sourcePath(o),generated:{line:t,column:r-2},original:{line:o.source.end.line,column:o.source.end.column-1}})}else{e.map.addMapping({source:"",original:{line:1,column:0},generated:{line:t,column:r-1}})}}}})};e.generate=function generate(){this.clearAnnotation();if(this.isMap()){return this.generateMap()}var e="";this.stringify(this.root,function(t){e+=t});return[e]};return MapGenerator}();var o=s;t.default=o;e.exports=t.default},3:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(698));var i=_interopRequireDefault(r(218));var s=_interopRequireDefault(r(885));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function cloneNode(e,t){var r=new e.constructor;for(var n in e){if(!e.hasOwnProperty(n))continue;var i=e[n];var s=typeof i;if(n==="parent"&&s==="object"){if(t)r[n]=t}else if(n==="source"){r[n]=i}else if(i instanceof Array){r[n]=i.map(function(e){return cloneNode(e,r)})}else{if(s==="object"&&i!==null)i=cloneNode(i);r[n]=i}}return r}var o=function(){function Node(e){if(e===void 0){e={}}this.raws={};if(process.env.NODE_ENV!=="production"){if(typeof e!=="object"&&typeof e!=="undefined"){throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(e))}}for(var t in e){this[t]=e[t]}}var e=Node.prototype;e.error=function error(e,t){if(t===void 0){t={}}if(this.source){var r=this.positionBy(t);return this.source.input.error(e,r.line,r.column,t)}return new n.default(e)};e.warn=function warn(e,t,r){var n={node:this};for(var i in r){n[i]=r[i]}return e.warn(t,n)};e.remove=function remove(){if(this.parent){this.parent.removeChild(this)}this.parent=undefined;return this};e.toString=function toString(e){if(e===void 0){e=s.default}if(e.stringify)e=e.stringify;var t="";e(this,function(e){t+=e});return t};e.clone=function clone(e){if(e===void 0){e={}}var t=cloneNode(this);for(var r in e){t[r]=e[r]}return t};e.cloneBefore=function cloneBefore(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertBefore(this,t);return t};e.cloneAfter=function cloneAfter(e){if(e===void 0){e={}}var t=this.clone(e);this.parent.insertAfter(this,t);return t};e.replaceWith=function replaceWith(){if(this.parent){for(var e=arguments.length,t=new Array(e),r=0;r{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(172));var i=_interopRequireDefault(r(702));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e,t){var r=new i.default(e,t);var s=new n.default(r);try{s.parse()}catch(e){if(process.env.NODE_ENV!=="production"){if(e.name==="CssSyntaxError"&&t&&t.from){if(/\.scss$/i.test(t.from)){e.message+="\nYou tried to parse SCSS with "+"the standard CSS parser; "+"try again with the postcss-scss parser"}else if(/\.sass/i.test(t.from)){e.message+="\nYou tried to parse Sass with "+"the standard CSS parser; "+"try again with the postcss-sass parser"}else if(/\.less$/i.test(t.from)){e.message+="\nYou tried to parse Less with "+"the standard CSS parser; "+"try again with the postcss-less parser"}}}throw e}return s.root}var s=parse;t.default=s;e.exports=t.default},172:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(142));var i=_interopRequireDefault(r(462));var s=_interopRequireDefault(r(676));var o=_interopRequireDefault(r(226));var u=_interopRequireDefault(r(234));var a=_interopRequireDefault(r(714));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f=function(){function Parser(e){this.input=e;this.root=new u.default;this.current=this.root;this.spaces="";this.semicolon=false;this.createTokenizer();this.root.source={input:e,start:{line:1,column:1}}}var e=Parser.prototype;e.createTokenizer=function createTokenizer(){this.tokenizer=(0,i.default)(this.input)};e.parse=function parse(){var e;while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();switch(e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}}this.endFile()};e.comment=function comment(e){var t=new s.default;this.init(t,e[2],e[3]);t.source.end={line:e[4],column:e[5]};var r=e[1].slice(2,-2);if(/^\s*$/.test(r)){t.text="";t.raws.left=r;t.raws.right=""}else{var n=r.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=n[2];t.raws.left=n[1];t.raws.right=n[3]}};e.emptyRule=function emptyRule(e){var t=new a.default;this.init(t,e[2],e[3]);t.selector="";t.raws.between="";this.current=t};e.other=function other(e){var t=false;var r=null;var n=false;var i=null;var s=[];var o=[];var u=e;while(u){r=u[0];o.push(u);if(r==="("||r==="["){if(!i)i=u;s.push(r==="("?")":"]")}else if(s.length===0){if(r===";"){if(n){this.decl(o);return}else{break}}else if(r==="{"){this.rule(o);return}else if(r==="}"){this.tokenizer.back(o.pop());t=true;break}else if(r===":"){n=true}}else if(r===s[s.length-1]){s.pop();if(s.length===0)i=null}u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())t=true;if(s.length>0)this.unclosedBracket(i);if(t&&n){while(o.length){u=o[o.length-1][0];if(u!=="space"&&u!=="comment")break;this.tokenizer.back(o.pop())}this.decl(o)}else{this.unknownWord(o)}};e.rule=function rule(e){e.pop();var t=new a.default;this.init(t,e[0][2],e[0][3]);t.raws.between=this.spacesAndCommentsFromEnd(e);this.raw(t,"selector",e);this.current=t};e.decl=function decl(e){var t=new n.default;this.init(t);var r=e[e.length-1];if(r[0]===";"){this.semicolon=true;e.pop()}if(r[4]){t.source.end={line:r[4],column:r[5]}}else{t.source.end={line:r[2],column:r[3]}}while(e[0][0]!=="word"){if(e.length===1)this.unknownWord(e);t.raws.before+=e.shift()[1]}t.source.start={line:e[0][2],column:e[0][3]};t.prop="";while(e.length){var i=e[0][0];if(i===":"||i==="space"||i==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";var s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{if(s[0]==="word"&&/\w/.test(s[1])){this.unknownWord([s])}t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){s=e[o];if(s[1].toLowerCase()==="!important"){t.important=true;var u=this.stringFrom(e,o);u=this.spacesFromEnd(e)+u;if(u!==" !important")t.raws.important=u;break}else if(s[1].toLowerCase()==="important"){var a=e.slice(0);var f="";for(var l=o;l>0;l--){var c=a[l][0];if(f.trim().indexOf("!")===0&&c!=="space"){break}f=a.pop()[1]+f}if(f.trim().indexOf("!")===0){t.important=true;t.raws.important=f;e=a}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.indexOf(":")!==-1)this.checkMissedSemicolon(e)};e.atrule=function atrule(e){var t=new o.default;t.name=e[1].slice(1);if(t.name===""){this.unnamedAtrule(t,e)}this.init(t,e[2],e[3]);var r;var n;var i=false;var s=false;var u=[];while(!this.tokenizer.endOfFile()){e=this.tokenizer.nextToken();if(e[0]===";"){t.source.end={line:e[2],column:e[3]};this.semicolon=true;break}else if(e[0]==="{"){s=true;break}else if(e[0]==="}"){if(u.length>0){n=u.length-1;r=u[n];while(r&&r[0]==="space"){r=u[--n]}if(r){t.source.end={line:r[4],column:r[5]}}}this.end(e);break}else{u.push(e)}if(this.tokenizer.endOfFile()){i=true;break}}t.raws.between=this.spacesAndCommentsFromEnd(u);if(u.length){t.raws.afterName=this.spacesAndCommentsFromStart(u);this.raw(t,"params",u);if(i){e=u[u.length-1];t.source.end={line:e[4],column:e[5]};this.spaces=t.raws.between;t.raws.between=""}}else{t.raws.afterName="";t.params=""}if(s){t.nodes=[];this.current=t}};e.end=function end(e){if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.semicolon=false;this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.spaces="";if(this.current.parent){this.current.source.end={line:e[2],column:e[3]};this.current=this.current.parent}else{this.unexpectedClose(e)}};e.endFile=function endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length){this.current.raws.semicolon=this.semicolon}this.current.raws.after=(this.current.raws.after||"")+this.spaces};e.freeSemicolon=function freeSemicolon(e){this.spaces+=e[1];if(this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon){t.raws.ownSemicolon=this.spaces;this.spaces=""}}};e.init=function init(e,t,r){this.current.push(e);e.source={start:{line:t,column:r},input:this.input};e.raws.before=this.spaces;this.spaces="";if(e.type!=="comment")this.semicolon=false};e.raw=function raw(e,t,r){var n,i;var s=r.length;var o="";var u=true;var a,f;var l=/^([.|#])?([\w])+/i;for(var c=0;c=0;i--){n=e[i];if(n[0]!=="space"){r+=1;if(r===2)break}}throw this.input.error("Missed semicolon",n[2],n[3])};return Parser}();t.default=f;e.exports=t.default},707:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(142));var i=_interopRequireDefault(r(155));var s=_interopRequireDefault(r(885));var o=_interopRequireDefault(r(676));var u=_interopRequireDefault(r(226));var a=_interopRequireDefault(r(661));var f=_interopRequireDefault(r(972));var l=_interopRequireDefault(r(534));var c=_interopRequireDefault(r(714));var h=_interopRequireDefault(r(234));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function postcss(){for(var e=arguments.length,t=new Array(e),r=0;r{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(241));var i=_interopRequireDefault(r(622));var s=_interopRequireDefault(r(747));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function fromBase64(e){if(Buffer){return Buffer.from(e,"base64").toString()}else{return window.atob(e)}}var o=function(){function PreviousMap(e,t){this.loadAnnotation(e);this.inline=this.startWith(this.annotation,"data:");var r=t.map?t.map.prev:undefined;var n=this.loadMap(t.from,r);if(n)this.text=n}var e=PreviousMap.prototype;e.consumer=function consumer(){if(!this.consumerCache){this.consumerCache=new n.default.SourceMapConsumer(this.text)}return this.consumerCache};e.withContent=function withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)};e.startWith=function startWith(e,t){if(!e)return false;return e.substr(0,t.length)===t};e.loadAnnotation=function loadAnnotation(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);if(t)this.annotation=t[1].trim()};e.decodeInline=function decodeInline(e){var t=/^data:application\/json;charset=utf-?8;base64,/;var r=/^data:application\/json;base64,/;var n="data:application/json,";if(this.startWith(e,n)){return decodeURIComponent(e.substr(n.length))}if(t.test(e)||r.test(e)){return fromBase64(e.substr(RegExp.lastMatch.length))}var i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)};e.loadMap=function loadMap(e,t){if(t===false)return false;if(t){if(typeof t==="string"){return t}else if(typeof t==="function"){var r=t(e);if(r&&s.default.existsSync&&s.default.existsSync(r)){return s.default.readFileSync(r,"utf-8").toString().trim()}else{throw new Error("Unable to load previous source map: "+r.toString())}}else if(t instanceof n.default.SourceMapConsumer){return n.default.SourceMapGenerator.fromSourceMap(t).toString()}else if(t instanceof n.default.SourceMapGenerator){return t.toString()}else if(this.isMap(t)){return JSON.stringify(t)}else{throw new Error("Unsupported previous source map format: "+t.toString())}}else if(this.inline){return this.decodeInline(this.annotation)}else if(this.annotation){var o=this.annotation;if(e)o=i.default.join(i.default.dirname(e),o);this.root=i.default.dirname(o);if(s.default.existsSync&&s.default.existsSync(o)){return s.default.readFileSync(o,"utf-8").toString().trim()}else{return false}}};e.isMap=function isMap(e){if(typeof e!=="object")return false;return typeof e.mappings==="string"||typeof e._mappings==="string"};return PreviousMap}();var u=o;t.default=u;e.exports=t.default},155:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(805));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=function(){function Processor(e){if(e===void 0){e=[]}this.version="7.0.21";this.plugins=this.normalize(e)}var e=Processor.prototype;e.use=function use(e){this.plugins=this.plugins.concat(this.normalize([e]));return this};e.process=function(e){function process(t){return e.apply(this,arguments)}process.toString=function(){return e.toString()};return process}(function(e,t){if(t===void 0){t={}}if(this.plugins.length===0&&t.parser===t.stringifier){if(process.env.NODE_ENV!=="production"){if(typeof console!=="undefined"&&console.warn){console.warn("You did not set any plugins, parser, or stringifier. "+"Right now, PostCSS does nothing. Pick plugins for your case "+"on https://www.postcss.parts/ and use them in postcss.config.js.")}}}return new n.default(this,e,t)});e.normalize=function normalize(e){var t=[];for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{i=r.next();if(i.done)break;s=i.value}var o=s;if(o.postcss)o=o.postcss;if(typeof o==="object"&&Array.isArray(o.plugins)){t=t.concat(o.plugins)}else if(typeof o==="function"){t.push(o)}else if(typeof o==="object"&&(o.parse||o.stringify)){if(process.env.NODE_ENV!=="production"){throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use "+"one of the syntax/parser/stringifier options as outlined "+"in your PostCSS runner documentation.")}}else{throw new Error(o+" is not a PostCSS plugin")}}return t};return Processor}();var s=i;t.default=s;e.exports=t.default},292:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(356));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(820));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i=function(e){_inheritsLoose(Root,e);function Root(t){var r;r=e.call(this,t)||this;r.type="root";if(!r.nodes)r.nodes=[];return r}var t=Root.prototype;t.removeChild=function removeChild(t,r){var n=this.index(t);if(!r&&n===0&&this.nodes.length>1){this.nodes[1].raws.before=this.nodes[n].raws.before}return e.prototype.removeChild.call(this,t)};t.normalize=function normalize(t,r,n){var i=e.prototype.normalize.call(this,t);if(r){if(n==="prepend"){if(this.nodes.length>1){r.raws.before=this.nodes[1].raws.before}else{delete r.raws.before}}else if(this.first!==r){for(var s=i,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var a;if(o){if(u>=s.length)break;a=s[u++]}else{u=s.next();if(u.done)break;a=u.value}var f=a;f.raws.before=r.raws.before}}}return i};t.toResult=function toResult(e){if(e===void 0){e={}}var t=r(805);var n=r(155);var i=new t(new n,this,e);return i.stringify()};return Root}(n.default);var s=i;t.default=s;e.exports=t.default},714:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(820));var i=_interopRequireDefault(r(534));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperties(e,t){for(var r=0;r{t.__esModule=true;t.default=void 0;var r={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:false};function capitalize(e){return e[0].toUpperCase()+e.slice(1)}var n=function(){function Stringifier(e){this.builder=e}var e=Stringifier.prototype;e.stringify=function stringify(e,t){this[e.type](e,t)};e.root=function root(e){this.body(e);if(e.raws.after)this.builder(e.raws.after)};e.comment=function comment(e){var t=this.raw(e,"left","commentLeft");var r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)};e.decl=function decl(e,t){var r=this.raw(e,"between","colon");var n=e.prop+r+this.rawValue(e,"value");if(e.important){n+=e.raws.important||" !important"}if(t)n+=";";this.builder(n,e)};e.rule=function rule(e){this.block(e,this.rawValue(e,"selector"));if(e.raws.ownSemicolon){this.builder(e.raws.ownSemicolon,e,"end")}};e.atrule=function atrule(e,t){var r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!=="undefined"){r+=e.raws.afterName}else if(n){r+=" "}if(e.nodes){this.block(e,r+n)}else{var i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}};e.body=function body(e){var t=e.nodes.length-1;while(t>0){if(e.nodes[t].type!=="comment")break;t-=1}var r=this.raw(e,"semicolon");for(var n=0;n0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.indexOf("\n")!==-1){t=t.replace(/[^\n]+$/,"")}return false}}});if(t)t=t.replace(/[^\s]/g,"");return t};e.rawBeforeOpen=function rawBeforeOpen(e){var t;e.walk(function(e){if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}});return t};e.rawColon=function rawColon(e){var t;e.walkDecls(function(e){if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}});return t};e.beforeAfter=function beforeAfter(e,t){var r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}var n=e.parent;var i=0;while(n&&n.type!=="root"){i+=1;n=n.parent}if(r.indexOf("\n")!==-1){var s=this.raw(e,null,"indent");if(s.length){for(var o=0;o{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(218));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringify(e,t){var r=new n.default(t);r.stringify(e)}var i=stringify;t.default=i;e.exports=t.default},706:(e,t,r)=>{t.__esModule=true;t.default=void 0;var n=_interopRequireDefault(r(242));var i=_interopRequireDefault(r(462));var s=_interopRequireDefault(r(702));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o={brackets:n.default.cyan,"at-word":n.default.cyan,comment:n.default.gray,string:n.default.green,class:n.default.yellow,call:n.default.cyan,hash:n.default.magenta,"(":n.default.cyan,")":n.default.cyan,"{":n.default.yellow,"}":n.default.yellow,"[":n.default.yellow,"]":n.default.yellow,":":n.default.yellow,";":n.default.yellow};function getTokenType(e,t){var r=e[0],n=e[1];if(r==="word"){if(n[0]==="."){return"class"}if(n[0]==="#"){return"hash"}}if(!t.endOfFile()){var i=t.nextToken();t.back(i);if(i[0]==="brackets"||i[0]==="(")return"call"}return r}function terminalHighlight(e){var t=(0,i.default)(new s.default(e),{ignoreErrors:true});var r="";var n=function _loop(){var e=t.nextToken();var n=o[getTokenType(e,t)];if(n){r+=e[1].split(/\r?\n/).map(function(e){return n(e)}).join("\n")}else{r+=e[1]}};while(!t.endOfFile()){n()}return r}var u=terminalHighlight;t.default=u;e.exports=t.default},462:(e,t)=>{t.__esModule=true;t.default=tokenizer;var r="'".charCodeAt(0);var n='"'.charCodeAt(0);var i="\\".charCodeAt(0);var s="/".charCodeAt(0);var o="\n".charCodeAt(0);var u=" ".charCodeAt(0);var a="\f".charCodeAt(0);var f="\t".charCodeAt(0);var l="\r".charCodeAt(0);var c="[".charCodeAt(0);var h="]".charCodeAt(0);var p="(".charCodeAt(0);var d=")".charCodeAt(0);var v="{".charCodeAt(0);var w="}".charCodeAt(0);var m=";".charCodeAt(0);var g="*".charCodeAt(0);var y=":".charCodeAt(0);var b="@".charCodeAt(0);var C=/[ \n\t\r\f{}()'"\\;/[\]#]/g;var R=/[ \n\t\r\f(){}:;@!'"\\\][#]|\/(?=\*)/g;var S=/.[\\/("'\n]/;var O=/[a-f0-9]/i;function tokenizer(e,t){if(t===void 0){t={}}var M=e.css.valueOf();var A=t.ignoreErrors;var D,k,E,x,q,N,F;var I,B,T,j,z,L,P;var V=M.length;var W=-1;var U=1;var $=0;var G=[];var J=[];function position(){return $}function unclosed(t){throw e.error("Unclosed "+t,U,$-W)}function endOfFile(){return J.length===0&&$>=V}function nextToken(e){if(J.length)return J.pop();if($>=V)return;var t=e?e.ignoreUnclosed:false;D=M.charCodeAt($);if(D===o||D===a||D===l&&M.charCodeAt($+1)!==o){W=$;U+=1}switch(D){case o:case u:case f:case l:case a:k=$;do{k+=1;D=M.charCodeAt(k);if(D===o){W=k;U+=1}}while(D===u||D===o||D===f||D===l||D===a);P=["space",M.slice($,k)];$=k-1;break;case c:case h:case v:case w:case y:case m:case d:var Y=String.fromCharCode(D);P=[Y,Y,U,$-W];break;case p:z=G.length?G.pop()[1]:"";L=M.charCodeAt($+1);if(z==="url"&&L!==r&&L!==n&&L!==u&&L!==o&&L!==f&&L!==a&&L!==l){k=$;do{T=false;k=M.indexOf(")",k+1);if(k===-1){if(A||t){k=$;break}else{unclosed("bracket")}}j=k;while(M.charCodeAt(j-1)===i){j-=1;T=!T}}while(T);P=["brackets",M.slice($,k+1),U,$-W,U,k-W];$=k}else{k=M.indexOf(")",$+1);N=M.slice($,k+1);if(k===-1||S.test(N)){P=["(","(",U,$-W]}else{P=["brackets",N,U,$-W,U,k-W];$=k}}break;case r:case n:E=D===r?"'":'"';k=$;do{T=false;k=M.indexOf(E,k+1);if(k===-1){if(A||t){k=$+1;break}else{unclosed("string")}}j=k;while(M.charCodeAt(j-1)===i){j-=1;T=!T}}while(T);N=M.slice($,k+1);x=N.split("\n");q=x.length-1;if(q>0){I=U+q;B=k-x[q].length}else{I=U;B=W}P=["string",M.slice($,k+1),U,$-W,I,k-B];W=B;U=I;$=k;break;case b:C.lastIndex=$+1;C.test(M);if(C.lastIndex===0){k=M.length-1}else{k=C.lastIndex-2}P=["at-word",M.slice($,k+1),U,$-W,U,k-W];$=k;break;case i:k=$;F=true;while(M.charCodeAt(k+1)===i){k+=1;F=!F}D=M.charCodeAt(k+1);if(F&&D!==s&&D!==u&&D!==o&&D!==f&&D!==l&&D!==a){k+=1;if(O.test(M.charAt(k))){while(O.test(M.charAt(k+1))){k+=1}if(M.charCodeAt(k+1)===u){k+=1}}}P=["word",M.slice($,k+1),U,$-W,U,k-W];$=k;break;default:if(D===s&&M.charCodeAt($+1)===g){k=M.indexOf("*/",$+2)+1;if(k===0){if(A||t){k=M.length}else{unclosed("comment")}}N=M.slice($,k+1);x=N.split("\n");q=x.length-1;if(q>0){I=U+q;B=k-x[q].length}else{I=U;B=W}P=["comment",N,U,$-W,I,k-B];W=B;U=I;$=k}else{R.lastIndex=$+1;R.test(M);if(R.lastIndex===0){k=M.length-1}else{k=R.lastIndex-2}P=["word",M.slice($,k+1),U,$-W,U,k-W];G.push(P);$=k}break}$++;return P}function back(e){J.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}e.exports=t.default},661:(e,t)=>{t.__esModule=true;t.default=void 0;var r={prefix:function prefix(e){var t=e.match(/^(-\w+-)/);if(t){return t[0]}return""},unprefixed:function unprefixed(e){return e.replace(/^-\w+-/,"")}};var n=r;t.default=n;e.exports=t.default},294:(e,t)=>{t.__esModule=true;t.default=warnOnce;var r={};function warnOnce(e){if(r[e])return;r[e]=true;if(typeof console!=="undefined"&&console.warn){console.warn(e)}}e.exports=t.default},356:(e,t)=>{t.__esModule=true;t.default=void 0;var r=function(){function Warning(e,t){if(t===void 0){t={}}this.type="warning";this.text=e;if(t.node&&t.node.source){var r=t.node.positionBy(t);this.line=r.line;this.column=r.column}for(var n in t){this[n]=t[n]}}var e=Warning.prototype;e.toString=function toString(){if(this.node){return this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message}if(this.plugin){return this.plugin+": "+this.text}return this.text};return Warning}();var n=r;t.default=n;e.exports=t.default},127:(e,t,r)=>{const n=r(87);const i=r(755);const{env:s}=process;let o;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){o=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR===true||s.FORCE_COLOR==="true"){o=1}else if(s.FORCE_COLOR===false||s.FORCE_COLOR==="false"){o=0}else{o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o===undefined){return 0}const t=o||0;if(s.TERM==="dumb"){return t}if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},242:e=>{e.exports=require("chalk")},747:e=>{e.exports=require("fs")},241:e=>{e.exports=require("next/dist/compiled/source-map")},87:e=>{e.exports=require("os")},622:e=>{e.exports=require("path")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var n=t[r]={exports:{}};var i=true;try{e[r](n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return n.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(136)})(); \ No newline at end of file diff --git a/packages/next/compiled/webpack/bundle4.js b/packages/next/compiled/webpack/bundle4.js index 00b1d6c5bfe6..6069067b9468 100644 --- a/packages/next/compiled/webpack/bundle4.js +++ b/packages/next/compiled/webpack/bundle4.js @@ -32613,7 +32613,207 @@ module.exports = function normalize(path) { /***/ }), -/***/ 53024: +/***/ 4870: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var isExtendable = __webpack_require__(29502); +var forIn = __webpack_require__(43086); + +function mixinDeep(target, objects) { + var len = arguments.length, i = 0; + while (++i < len) { + var obj = arguments[i]; + if (isObject(obj)) { + forIn(obj, copy, target); + } + } + return target; +} + +/** + * Copy properties from the source object to the + * target object. + * + * @param {*} `val` + * @param {String} `key` + */ + +function copy(val, key) { + if (!isValidKey(key)) { + return; + } + + var obj = this[key]; + if (isObject(val) && isObject(obj)) { + mixinDeep(obj, val); + } else { + this[key] = val; + } +} + +/** + * Returns true if `val` is an object or function. + * + * @param {any} val + * @return {Boolean} + */ + +function isObject(val) { + return isExtendable(val) && !Array.isArray(val); +} + +/** + * Returns true if `key` is a valid key to use when extending objects. + * + * @param {String} `key` + * @return {Boolean} + */ + +function isValidKey(key) { + return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'; +}; + +/** + * Expose `mixinDeep` + */ + +module.exports = mixinDeep; + + +/***/ }), + +/***/ 29502: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + + + +var isPlainObject = __webpack_require__(81064); + +module.exports = function isExtendable(val) { + return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); +}; + + +/***/ }), + +/***/ 50998: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var path = __webpack_require__(85622); +var fs = __webpack_require__(35747); +var _0777 = parseInt('0777', 8); + +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + +function mkdirP (p, opts, f, made) { + if (typeof opts === 'function') { + f = opts; + opts = {}; + } + else if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 + } + if (!made) made = null; + + var cb = f || function () {}; + p = path.resolve(p); + + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p; + return cb(null, made); + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return cb(er); + mkdirP(path.dirname(p), opts, function (er, made) { + if (er) cb(er, made); + else mkdirP(p, opts, cb, made); + }); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) cb(er, made) + else cb(null, made); + }); + break; + } + }); +} + +mkdirP.sync = function sync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 + } + if (!made) made = null; + + p = path.resolve(p); + + try { + xfs.mkdirSync(p, mode); + made = made || p; + } + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = sync(path.dirname(p), opts, made); + sync(p, opts, made); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat; + try { + stat = xfs.statSync(p); + } + catch (err1) { + throw err0; + } + if (!stat.isDirectory()) throw err0; + break; + } + } + + return made; +}; + + +/***/ }), + +/***/ 57925: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -32624,18 +32824,17 @@ module.exports = function normalize(path) { */ var util = __webpack_require__(31669); -var braces = __webpack_require__(50559); var toRegex = __webpack_require__(51279); -var extend = __webpack_require__(3767); +var extend = __webpack_require__(69148); /** * Local dependencies */ -var compilers = __webpack_require__(26113); -var parsers = __webpack_require__(14086); -var cache = __webpack_require__(34743); -var utils = __webpack_require__(63976); +var compilers = __webpack_require__(4756); +var parsers = __webpack_require__(5333); +var cache = __webpack_require__(58250); +var utils = __webpack_require__(41340); var MAX_LENGTH = 1024 * 64; /** @@ -32643,10 +32842,10 @@ var MAX_LENGTH = 1024 * 64; * glob patterns to use for matching. * * ```js - * var mm = require('micromatch'); - * mm(list, patterns[, options]); + * var nm = require('nanomatch'); + * nm(list, patterns[, options]); * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); + * console.log(nm(['a.js', 'a.txt'], ['*.js'])); * //=> [ 'a.js' ] * ``` * @param {Array} `list` A list of strings to match @@ -32657,7 +32856,7 @@ var MAX_LENGTH = 1024 * 64; * @api public */ -function micromatch(list, patterns, options) { +function nanomatch(list, patterns, options) { patterns = utils.arrayify(patterns); list = utils.arrayify(list); @@ -32667,9 +32866,10 @@ function micromatch(list, patterns, options) { } if (len === 1) { - return micromatch.match(list, patterns[0], options); + return nanomatch.match(list, patterns[0], options); } + var negated = false; var omit = []; var keep = []; var idx = -1; @@ -32678,9 +32878,22 @@ function micromatch(list, patterns, options) { var pattern = patterns[idx]; if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) { - omit.push.apply(omit, micromatch.match(list, pattern.slice(1), options)); + omit.push.apply(omit, nanomatch.match(list, pattern.slice(1), options)); + negated = true; } else { - keep.push.apply(keep, micromatch.match(list, pattern, options)); + keep.push.apply(keep, nanomatch.match(list, pattern, options)); + } + } + + // minimatch.match parity + if (negated && keep.length === 0) { + if (options && options.unixify === false) { + keep = list.slice(); + } else { + var unixify = utils.unixify(options); + for (var i = 0; i < list.length; i++) { + keep.push(unixify(list[i])); + } } } @@ -32696,10 +32909,10 @@ function micromatch(list, patterns, options) { * Similar to the main function, but `pattern` must be a string. * * ```js - * var mm = require('micromatch'); - * mm.match(list, pattern[, options]); + * var nm = require('nanomatch'); + * nm.match(list, pattern[, options]); * - * console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); + * console.log(nm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); * //=> ['a.a', 'a.aa'] * ``` * @param {Array} `list` Array of strings to match @@ -32709,13 +32922,13 @@ function micromatch(list, patterns, options) { * @api public */ -micromatch.match = function(list, pattern, options) { +nanomatch.match = function(list, pattern, options) { if (Array.isArray(pattern)) { throw new TypeError('expected pattern to be a string'); } var unixify = utils.unixify(options); - var isMatch = memoize('match', pattern, options, micromatch.matcher); + var isMatch = memoize('match', pattern, options, nanomatch.matcher); var matches = []; list = utils.arrayify(list); @@ -32745,7 +32958,7 @@ micromatch.match = function(list, pattern, options) { // if `opts.ignore` was defined, diff ignored list if (options.ignore) { - matches = micromatch.not(matches, options.ignore, options); + matches = nanomatch.not(matches, options.ignore, options); } return options.nodupes !== false ? utils.unique(matches) : matches; @@ -32755,12 +32968,12 @@ micromatch.match = function(list, pattern, options) { * Returns true if the specified `string` matches the given glob `pattern`. * * ```js - * var mm = require('micromatch'); - * mm.isMatch(string, pattern[, options]); + * var nm = require('nanomatch'); + * nm.isMatch(string, pattern[, options]); * - * console.log(mm.isMatch('a.a', '*.a')); + * console.log(nm.isMatch('a.a', '*.a')); * //=> true - * console.log(mm.isMatch('a.b', '*.a')); + * console.log(nm.isMatch('a.b', '*.a')); * //=> false * ``` * @param {String} `string` String to match @@ -32770,12 +32983,12 @@ micromatch.match = function(list, pattern, options) { * @api public */ -micromatch.isMatch = function(str, pattern, options) { +nanomatch.isMatch = function(str, pattern, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } - if (isEmptyString(str) || isEmptyString(pattern)) { + if (utils.isEmptyString(str) || utils.isEmptyString(pattern)) { return false; } @@ -32784,21 +32997,21 @@ micromatch.isMatch = function(str, pattern, options) { return true; } - var isMatch = memoize('isMatch', pattern, options, micromatch.matcher); + var isMatch = memoize('isMatch', pattern, options, nanomatch.matcher); return isMatch(str); }; /** - * Returns true if some of the strings in the given `list` match any of the + * Returns true if some of the elements in the given `list` match any of the * given glob `patterns`. * * ```js - * var mm = require('micromatch'); - * mm.some(list, patterns[, options]); + * var nm = require('nanomatch'); + * nm.some(list, patterns[, options]); * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * console.log(nm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); + * console.log(nm.some(['foo.js'], ['*.js', '!foo.js'])); * // false * ``` * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. @@ -32808,33 +33021,35 @@ micromatch.isMatch = function(str, pattern, options) { * @api public */ -micromatch.some = function(list, patterns, options) { +nanomatch.some = function(list, patterns, options) { if (typeof list === 'string') { list = [list]; } + for (var i = 0; i < list.length; i++) { - if (micromatch(list[i], patterns, options).length === 1) { + if (nanomatch(list[i], patterns, options).length === 1) { return true; } } + return false; }; /** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. + * Returns true if every element in the given `list` matches + * at least one of the given glob `patterns`. * * ```js - * var mm = require('micromatch'); - * mm.every(list, patterns[, options]); + * var nm = require('nanomatch'); + * nm.every(list, patterns[, options]); * - * console.log(mm.every('foo.js', ['foo.js'])); + * console.log(nm.every('foo.js', ['foo.js'])); * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); + * console.log(nm.every(['foo.js', 'bar.js'], ['*.js'])); * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * console.log(nm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); + * console.log(nm.every(['foo.js'], ['*.js', '!foo.js'])); * // false * ``` * @param {String|Array} `list` The string or array of strings to test. @@ -32844,15 +33059,17 @@ micromatch.some = function(list, patterns, options) { * @api public */ -micromatch.every = function(list, patterns, options) { +nanomatch.every = function(list, patterns, options) { if (typeof list === 'string') { list = [list]; } + for (var i = 0; i < list.length; i++) { - if (micromatch(list[i], patterns, options).length !== 1) { + if (nanomatch(list[i], patterns, options).length !== 1) { return false; } } + return true; }; @@ -32861,12 +33078,12 @@ micromatch.every = function(list, patterns, options) { * match the specified `string`. * * ```js - * var mm = require('micromatch'); - * mm.any(string, patterns[, options]); + * var nm = require('nanomatch'); + * nm.any(string, patterns[, options]); * - * console.log(mm.any('a.a', ['b.*', '*.a'])); + * console.log(nm.any('a.a', ['b.*', '*.a'])); * //=> true - * console.log(mm.any('a.a', 'b.*')); + * console.log(nm.any('a.a', 'b.*')); * //=> false * ``` * @param {String|Array} `str` The string to test. @@ -32876,12 +33093,12 @@ micromatch.every = function(list, patterns, options) { * @api public */ -micromatch.any = function(str, patterns, options) { +nanomatch.any = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } - if (isEmptyString(str) || isEmptyString(patterns)) { + if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { return false; } @@ -32890,7 +33107,7 @@ micromatch.any = function(str, patterns, options) { } for (var i = 0; i < patterns.length; i++) { - if (micromatch.isMatch(str, patterns[i], options)) { + if (nanomatch.isMatch(str, patterns[i], options)) { return true; } } @@ -32898,23 +33115,23 @@ micromatch.any = function(str, patterns, options) { }; /** - * Returns true if **all** of the given `patterns` match - * the specified string. + * Returns true if **all** of the given `patterns` + * match the specified string. * * ```js - * var mm = require('micromatch'); - * mm.all(string, patterns[, options]); + * var nm = require('nanomatch'); + * nm.all(string, patterns[, options]); * - * console.log(mm.all('foo.js', ['foo.js'])); + * console.log(nm.all('foo.js', ['foo.js'])); * // true * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); + * console.log(nm.all('foo.js', ['*.js', '!foo.js'])); * // false * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); + * console.log(nm.all('foo.js', ['*.js', 'foo.js'])); * // true * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); + * console.log(nm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); * // true * ``` * @param {String|Array} `str` The string to test. @@ -32924,15 +33141,17 @@ micromatch.any = function(str, patterns, options) { * @api public */ -micromatch.all = function(str, patterns, options) { +nanomatch.all = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } + if (typeof patterns === 'string') { patterns = [patterns]; } + for (var i = 0; i < patterns.length; i++) { - if (!micromatch.isMatch(str, patterns[i], options)) { + if (!nanomatch.isMatch(str, patterns[i], options)) { return false; } } @@ -32943,10 +33162,10 @@ micromatch.all = function(str, patterns, options) { * Returns a list of strings that _**do not match any**_ of the given `patterns`. * * ```js - * var mm = require('micromatch'); - * mm.not(list, patterns[, options]); + * var nm = require('nanomatch'); + * nm.not(list, patterns[, options]); * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); + * console.log(nm.not(['a.a', 'b.b', 'c.c'], '*.a')); * //=> ['b.b', 'c.c'] * ``` * @param {Array} `list` Array of strings to match. @@ -32956,17 +33175,16 @@ micromatch.all = function(str, patterns, options) { * @api public */ -micromatch.not = function(list, patterns, options) { +nanomatch.not = function(list, patterns, options) { var opts = extend({}, options); var ignore = opts.ignore; delete opts.ignore; - var unixify = utils.unixify(opts); - list = utils.arrayify(list).map(unixify); + list = utils.arrayify(list); - var matches = utils.diff(list, micromatch(list, patterns, opts)); + var matches = utils.diff(list, nanomatch(list, patterns, opts)); if (ignore) { - matches = utils.diff(matches, micromatch(list, ignore)); + matches = utils.diff(matches, nanomatch(list, ignore)); } return opts.nodupes !== false ? utils.unique(matches) : matches; @@ -32977,12 +33195,12 @@ micromatch.not = function(list, patterns, options) { * to [.isMatch](#isMatch) but the pattern can match any part of the string. * * ```js - * var mm = require('micromatch'); - * mm.contains(string, pattern[, options]); + * var nm = require('nanomatch'); + * nm.contains(string, pattern[, options]); * - * console.log(mm.contains('aa/bb/cc', '*b')); + * console.log(nm.contains('aa/bb/cc', '*b')); * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); + * console.log(nm.contains('aa/bb/cc', '*d')); * //=> false * ``` * @param {String} `str` The string to match. @@ -32992,13 +33210,13 @@ micromatch.not = function(list, patterns, options) { * @api public */ -micromatch.contains = function(str, patterns, options) { +nanomatch.contains = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (typeof patterns === 'string') { - if (isEmptyString(str) || isEmptyString(patterns)) { + if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { return false; } @@ -33013,7 +33231,7 @@ micromatch.contains = function(str, patterns, options) { } var opts = extend({}, options, {contains: true}); - return micromatch.any(str, patterns, opts); + return nanomatch.any(str, patterns, opts); }; /** @@ -33023,7 +33241,7 @@ micromatch.contains = function(str, patterns, options) { * @api private */ -micromatch.matchBase = function(pattern, options) { +nanomatch.matchBase = function(pattern, options) { if (pattern && pattern.indexOf('/') !== -1 || !options) return false; return options.basename === true || options.matchBase === true; }; @@ -33034,11 +33252,11 @@ micromatch.matchBase = function(pattern, options) { * use [glob-object][] instead. * * ```js - * var mm = require('micromatch'); - * mm.matchKeys(object, patterns[, options]); + * var nm = require('nanomatch'); + * nm.matchKeys(object, patterns[, options]); * * var obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); + * console.log(nm.matchKeys(obj, '*b')); * //=> { ab: 'b' } * ``` * @param {Object} `object` The object with keys to filter. @@ -33048,11 +33266,11 @@ micromatch.matchBase = function(pattern, options) { * @api public */ -micromatch.matchKeys = function(obj, patterns, options) { +nanomatch.matchKeys = function(obj, patterns, options) { if (!utils.isObject(obj)) { throw new TypeError('expected the first argument to be an object'); } - var keys = micromatch(Object.keys(obj), patterns, options); + var keys = nanomatch(Object.keys(obj), patterns, options); return utils.pick(obj, keys); }; @@ -33062,10 +33280,10 @@ micromatch.matchKeys = function(obj, patterns, options) { * true if the string is a match. * * ```js - * var mm = require('micromatch'); - * mm.matcher(pattern[, options]); + * var nm = require('nanomatch'); + * nm.matcher(pattern[, options]); * - * var isMatch = mm.matcher('*.!(*a)'); + * var isMatch = nm.matcher('*.!(*a)'); * console.log(isMatch('a.a')); * //=> false * console.log(isMatch('a.b')); @@ -33077,7 +33295,13 @@ micromatch.matchKeys = function(obj, patterns, options) { * @api public */ -micromatch.matcher = function matcher(pattern, options) { +nanomatch.matcher = function matcher(pattern, options) { + if (utils.isEmptyString(pattern)) { + return function() { + return false; + }; + } + if (Array.isArray(pattern)) { return compose(pattern, options, matcher); } @@ -33101,10 +33325,10 @@ micromatch.matcher = function matcher(pattern, options) { } // if pattern is a glob string - var re = micromatch.makeRe(pattern, options); + var re = nanomatch.makeRe(pattern, options); // if `options.matchBase` or `options.basename` is defined - if (micromatch.matchBase(pattern, options)) { + if (nanomatch.matchBase(pattern, options)) { return utils.matchBasename(re, options); } @@ -33124,25 +33348,25 @@ micromatch.matcher = function matcher(pattern, options) { }; } - var fn = test(re); - Object.defineProperty(fn, 'result', { - configurable: true, - enumerable: false, - value: re.result - }); - return fn; + // create matcher function + var matcherFn = test(re); + // set result object from compiler on matcher function, + // as a non-enumerable property. useful for debugging + utils.define(matcherFn, 'result', re.result); + return matcherFn; }; /** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. + * Returns an array of matches captured by `pattern` in `string, or + * `null` if the pattern did not match. * * ```js - * var mm = require('micromatch'); - * mm.capture(pattern, string[, options]); + * var nm = require('nanomatch'); + * nm.capture(pattern, string[, options]); * - * console.log(mm.capture('test/*.js', 'test/foo.js')); + * console.log(nm.capture('test/*.js', 'test/foo.js')); * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); + * console.log(nm.capture('test/*.js', 'foo/bar.css')); * //=> null * ``` * @param {String} `pattern` Glob pattern to use for matching. @@ -33152,8 +33376,8 @@ micromatch.matcher = function matcher(pattern, options) { * @api public */ -micromatch.capture = function(pattern, str, options) { - var re = micromatch.makeRe(pattern, extend({capture: true}, options)); +nanomatch.capture = function(pattern, str, options) { + var re = nanomatch.makeRe(pattern, extend({capture: true}, options)); var unixify = utils.unixify(options); function match() { @@ -33175,10 +33399,10 @@ micromatch.capture = function(pattern, str, options) { * Create a regular expression from the given glob `pattern`. * * ```js - * var mm = require('micromatch'); - * mm.makeRe(pattern[, options]); + * var nm = require('nanomatch'); + * nm.makeRe(pattern[, options]); * - * console.log(mm.makeRe('*.js')); + * console.log(nm.makeRe('*.js')); * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ * ``` * @param {String} `pattern` A glob pattern to convert to regex. @@ -33187,7 +33411,11 @@ micromatch.capture = function(pattern, str, options) { * @api public */ -micromatch.makeRe = function(pattern, options) { +nanomatch.makeRe = function(pattern, options) { + if (pattern instanceof RegExp) { + return pattern; + } + if (typeof pattern !== 'string') { throw new TypeError('expected pattern to be a string'); } @@ -33197,20 +33425,10 @@ micromatch.makeRe = function(pattern, options) { } function makeRe() { - var result = micromatch.create(pattern, options); - var ast_array = []; - var output = result.map(function(obj) { - obj.ast.state = obj.state; - ast_array.push(obj.ast); - return obj.output; - }); - - var regex = toRegex(output.join('|'), options); - Object.defineProperty(regex, 'result', { - configurable: true, - enumerable: false, - value: ast_array - }); + var opts = utils.extend({wrap: false}, options); + var result = nanomatch.create(pattern, opts); + var regex = toRegex(result.output, opts); + utils.define(regex, 'result', result); return regex; } @@ -33218,58 +33436,15 @@ micromatch.makeRe = function(pattern, options) { }; /** - * Expand the given brace `pattern`. - * - * ```js - * var mm = require('micromatch'); - * console.log(mm.braces('foo/{a,b}/bar')); - * //=> ['foo/(a|b)/bar'] - * - * console.log(mm.braces('foo/{a,b}/bar', {expand: true})); - * //=> ['foo/(a|b)/bar'] - * ``` - * @param {String} `pattern` String with brace pattern to expand. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ - -micromatch.braces = function(pattern, options) { - if (typeof pattern !== 'string' && !Array.isArray(pattern)) { - throw new TypeError('expected pattern to be an array or string'); - } - - function expand() { - if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) { - return utils.arrayify(pattern); - } - return braces(pattern, options); - } - - return memoize('braces', pattern, options, expand); -}; - -/** - * Proxy to the [micromatch.braces](#method), for parity with - * minimatch. - */ - -micromatch.braceExpand = function(pattern, options) { - var opts = extend({}, options, {expand: true}); - return micromatch.braces(pattern, opts); -}; - -/** - * Parses the given glob `pattern` and returns an array of abstract syntax - * trees (ASTs), with the compiled `output` and optional source `map` on - * each AST. + * Parses the given glob `pattern` and returns an object with the compiled `output` + * and optional source `map`. * * ```js - * var mm = require('micromatch'); - * mm.create(pattern[, options]); + * var nm = require('nanomatch'); + * nm.create(pattern[, options]); * - * console.log(mm.create('abc/*.js')); - * // [{ options: { source: 'string', sourcemap: true }, + * console.log(nm.create('abc/*.js')); + * // { options: { source: 'string', sourcemap: true }, * // state: {}, * // compilers: * // { ... }, @@ -33291,7 +33466,7 @@ micromatch.braceExpand = function(pattern, options) { * // position: { line: 1, column: 28 }, * // content: {}, * // files: {}, - * // idx: 6 }] + * // idx: 6 } * ``` * @param {String} `pattern` Glob pattern to parse and compile. * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed. @@ -33299,32 +33474,24 @@ micromatch.braceExpand = function(pattern, options) { * @api public */ -micromatch.create = function(pattern, options) { - return memoize('create', pattern, options, function() { - function create(str, opts) { - return micromatch.compile(micromatch.parse(str, opts), opts); - } - - pattern = micromatch.braces(pattern, options); - var len = pattern.length; - var idx = -1; - var res = []; - - while (++idx < len) { - res.push(create(pattern[idx], options)); - } - return res; - }); +nanomatch.create = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + function create() { + return nanomatch.compile(nanomatch.parse(pattern, options), options); + } + return memoize('create', pattern, options, create); }; /** * Parse the given `str` with the given `options`. * * ```js - * var mm = require('micromatch'); - * mm.parse(pattern[, options]); + * var nm = require('nanomatch'); + * nm.parse(pattern[, options]); * - * var ast = mm.parse('a/{b,c}/d'); + * var ast = nm.parse('a/{b,c}/d'); * console.log(ast); * // { type: 'root', * // errors: [], @@ -33346,7 +33513,7 @@ micromatch.create = function(pattern, options) { * @api public */ -micromatch.parse = function(pattern, options) { +nanomatch.parse = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } @@ -33368,11 +33535,11 @@ micromatch.parse = function(pattern, options) { * Compile the given `ast` or string with the given `options`. * * ```js - * var mm = require('micromatch'); - * mm.compile(ast[, options]); + * var nm = require('nanomatch'); + * nm.compile(ast[, options]); * - * var ast = mm.parse('a/{b,c}/d'); - * console.log(mm.compile(ast)); + * var ast = nm.parse('a/{b,c}/d'); + * console.log(nm.compile(ast)); * // { options: { source: 'string' }, * // state: {}, * // compilers: @@ -33394,39 +33561,33 @@ micromatch.parse = function(pattern, options) { * @api public */ -micromatch.compile = function(ast, options) { +nanomatch.compile = function(ast, options) { if (typeof ast === 'string') { - ast = micromatch.parse(ast, options); + ast = nanomatch.parse(ast, options); } - return memoize('compile', ast.input, options, function() { + function compile() { var snapdragon = utils.instantiate(ast, options); compilers(snapdragon, options); return snapdragon.compile(ast, options); - }); + } + + return memoize('compile', ast.input, options, compile); }; /** * Clear the regex cache. * * ```js - * mm.clearCache(); + * nm.clearCache(); * ``` * @api public */ -micromatch.clearCache = function() { - micromatch.cache.caches = {}; +nanomatch.clearCache = function() { + nanomatch.cache.__data__ = {}; }; -/** - * Returns true if the given value is effectively an empty string - */ - -function isEmptyString(val) { - return String(val) === '' || String(val) === './'; -} - /** * Compose a matcher function with the given patterns. * This allows matcher functions to be compiled once and @@ -33481,24 +33642,24 @@ function memoize(type, pattern, options, fn) { } /** - * Expose compiler, parser and cache on `micromatch` + * Expose compiler, parser and cache on `nanomatch` */ -micromatch.compilers = compilers; -micromatch.parsers = parsers; -micromatch.caches = cache.caches; +nanomatch.compilers = compilers; +nanomatch.parsers = parsers; +nanomatch.cache = cache; /** - * Expose `micromatch` + * Expose `nanomatch` * @type {Function} */ -module.exports = micromatch; +module.exports = nanomatch; /***/ }), -/***/ 34743: +/***/ 58250: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { module.exports = new (__webpack_require__(49908))(); @@ -33506,14231 +33667,13687 @@ module.exports = new (__webpack_require__(49908))(); /***/ }), -/***/ 26113: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 4756: +/***/ (function(module) { "use strict"; -var nanomatch = __webpack_require__(57925); -var extglob = __webpack_require__(66675); - -module.exports = function(snapdragon) { - var compilers = snapdragon.compiler.compilers; - var opts = snapdragon.options; - - // register nanomatch compilers - snapdragon.use(nanomatch.compilers); +/** +* Nanomatch compilers +*/ - // get references to some specific nanomatch compilers before they - // are overridden by the extglob and/or custom compilers - var escape = compilers.escape; - var qmark = compilers.qmark; - var slash = compilers.slash; - var star = compilers.star; - var text = compilers.text; - var plus = compilers.plus; - var dot = compilers.dot; +module.exports = function(nanomatch, options) { + function slash() { + if (options && typeof options.slash === 'string') { + return options.slash; + } + if (options && typeof options.slash === 'function') { + return options.slash.call(nanomatch); + } + return '\\\\/'; + } - // register extglob compilers or escape exglobs if disabled - if (opts.extglob === false || opts.noext === true) { - snapdragon.compiler.use(escapeExtglobs); - } else { - snapdragon.use(extglob.compilers); + function star() { + if (options && typeof options.star === 'string') { + return options.star; + } + if (options && typeof options.star === 'function') { + return options.star.call(nanomatch); + } + return '[^' + slash() + ']*?'; } - snapdragon.use(function() { - this.options.star = this.options.star || function(/*node*/) { - return '[^\\\\/]*?'; - }; - }); + var ast = nanomatch.ast = nanomatch.parser.ast; + ast.state = nanomatch.parser.state; + nanomatch.compiler.state = ast.state; + nanomatch.compiler - // custom micromatch compilers - snapdragon.compiler + /** + * Negation / escaping + */ - // reset referenced compiler - .set('dot', dot) - .set('escape', escape) - .set('plus', plus) - .set('slash', slash) - .set('qmark', qmark) - .set('star', star) - .set('text', text); -}; + .set('not', function(node) { + var prev = this.prev(); + if (this.options.nonegate === true || prev.type !== 'bos') { + return this.emit('\\' + node.val, node); + } + return this.emit(node.val, node); + }) + .set('escape', function(node) { + if (this.options.unescape && /^[-\w_.]/.test(node.val)) { + return this.emit(node.val, node); + } + return this.emit('\\' + node.val, node); + }) + .set('quoted', function(node) { + return this.emit(node.val, node); + }) -function escapeExtglobs(compiler) { - compiler.set('paren', function(node) { - var val = ''; - visit(node, function(tok) { - if (tok.val) val += (/^\W/.test(tok.val) ? '\\' : '') + tok.val; - }); - return this.emit(val, node); - }); + /** + * Regex + */ - /** - * Visit `node` with the given `fn` - */ + .set('dollar', function(node) { + if (node.parent.type === 'bracket') { + return this.emit(node.val, node); + } + return this.emit('\\' + node.val, node); + }) - function visit(node, fn) { - return node.nodes ? mapVisit(node.nodes, fn) : fn(node); - } + /** + * Dot: "." + */ - /** - * Map visit over array of `nodes`. - */ + .set('dot', function(node) { + if (node.dotfiles === true) this.dotfiles = true; + return this.emit('\\' + node.val, node); + }) - function mapVisit(nodes, fn) { - var len = nodes.length; - var idx = -1; - while (++idx < len) { - visit(nodes[idx], fn); - } - } -} + /** + * Slashes: "/" and "\" + */ + .set('backslash', function(node) { + return this.emit(node.val, node); + }) + .set('slash', function(node, nodes, i) { + var val = '[' + slash() + ']'; + var parent = node.parent; + var prev = this.prev(); -/***/ }), + // set "node.hasSlash" to true on all ancestor parens nodes + while (parent.type === 'paren' && !parent.hasSlash) { + parent.hasSlash = true; + parent = parent.parent; + } -/***/ 14086: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if (prev.addQmark) { + val += '?'; + } -"use strict"; + // word boundary + if (node.rest.slice(0, 2) === '\\b') { + return this.emit(val, node); + } + // globstars + if (node.parsed === '**' || node.parsed === './**') { + this.output = '(?:' + this.output; + return this.emit(val + ')?', node); + } -var extglob = __webpack_require__(66675); -var nanomatch = __webpack_require__(57925); -var regexNot = __webpack_require__(30931); -var toRegex = __webpack_require__(51279); -var not; + // negation + if (node.parsed === '!**' && this.options.nonegate !== true) { + return this.emit(val + '?\\b', node); + } + return this.emit(val, node); + }) -/** - * Characters to use in negation regex (we want to "not" match - * characters that are matched by other parsers) - */ + /** + * Square brackets + */ -var TEXT = '([!@*?+]?\\(|\\)|\\[:?(?=.*?:?\\])|:?\\]|[*+?!^$.\\\\/])+'; -var createNotRegex = function(opts) { - return not || (not = textRegex(TEXT)); -}; + .set('bracket', function(node) { + var close = node.close; + var open = !node.escaped ? '[' : '\\['; + var negated = node.negated; + var inner = node.inner; + var val = node.val; -/** - * Parsers - */ + if (node.escaped === true) { + inner = inner.replace(/\\?(\W)/g, '\\$1'); + negated = ''; + } -module.exports = function(snapdragon) { - var parsers = snapdragon.parser.parsers; + if (inner === ']-') { + inner = '\\]\\-'; + } - // register nanomatch parsers - snapdragon.use(nanomatch.parsers); + if (negated && inner.indexOf('.') === -1) { + inner += '.'; + } + if (negated && inner.indexOf('/') === -1) { + inner += '/'; + } - // get references to some specific nanomatch parsers before they - // are overridden by the extglob and/or parsers - var escape = parsers.escape; - var slash = parsers.slash; - var qmark = parsers.qmark; - var plus = parsers.plus; - var star = parsers.star; - var dot = parsers.dot; + val = open + negated + inner + close; + return this.emit(val, node); + }) - // register extglob parsers - snapdragon.use(extglob.parsers); + /** + * Square: "[.]" (only matches a single character in brackets) + */ - // custom micromatch parsers - snapdragon.parser - .use(function() { - // override "notRegex" created in nanomatch parser - this.notRegex = /^\!+(?!\()/; + .set('square', function(node) { + var val = (/^\W/.test(node.val) ? '\\' : '') + node.val; + return this.emit(val, node); }) - // reset the referenced parsers - .capture('escape', escape) - .capture('slash', slash) - .capture('qmark', qmark) - .capture('star', star) - .capture('plus', plus) - .capture('dot', dot) /** - * Override `text` parser + * Question mark: "?" */ - .capture('text', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(createNotRegex(this.options)); - if (!m || !m[0]) return; + .set('qmark', function(node) { + var prev = this.prev(); + // don't use "slash" variable so that we always avoid + // matching backslashes and slashes with a qmark + var val = '[^.\\\\/]'; + if (this.options.dot || (prev.type !== 'bos' && prev.type !== 'slash')) { + val = '[^\\\\/]'; + } - // escape regex boundary characters and simple brackets - var val = m[0].replace(/([[\]^$])/g, '\\$1'); + if (node.parsed.slice(-1) === '(') { + var ch = node.rest.charAt(0); + if (ch === '!' || ch === '=' || ch === ':') { + return this.emit(node.val, node); + } + } - return pos({ - type: 'text', - val: val - }); - }); -}; + if (node.val.length > 1) { + val += '{' + node.val.length + '}'; + } + return this.emit(val, node); + }) -/** - * Create text regex - */ + /** + * Plus + */ -function textRegex(pattern) { - var notStr = regexNot.create(pattern, {contains: true, strictClose: false}); - var prefix = '(?:[\\^]|\\\\|'; - return toRegex(prefix + notStr + ')', {strictClose: false}); -} + .set('plus', function(node) { + var prev = node.parsed.slice(-1); + if (prev === ']' || prev === ')') { + return this.emit(node.val, node); + } + if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { + return this.emit('\\+', node); + } + var ch = this.output.slice(-1); + if (/\w/.test(ch) && !node.inside) { + return this.emit('+\\+?', node); + } + return this.emit('+', node); + }) + /** + * globstar: '**' + */ -/***/ }), + .set('globstar', function(node, nodes, i) { + if (!this.output) { + this.state.leadingGlobstar = true; + } -/***/ 63976: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + var prev = this.prev(); + var before = this.prev(2); + var next = this.next(); + var after = this.next(2); + var type = prev.type; + var val = node.val; -"use strict"; + if (prev.type === 'slash' && next.type === 'slash') { + if (before.type === 'text') { + this.output += '?'; + if (after.type !== 'text') { + this.output += '\\b'; + } + } + } -var utils = module.exports; -var path = __webpack_require__(85622); + var parsed = node.parsed; + if (parsed.charAt(0) === '!') { + parsed = parsed.slice(1); + } -/** - * Module dependencies - */ + var isInside = node.isInside.paren || node.isInside.brace; + if (parsed && type !== 'slash' && type !== 'bos' && !isInside) { + val = star(); + } else { + val = this.options.dot !== true + ? '(?:(?!(?:[' + slash() + ']|^)\\.).)*?' + : '(?:(?!(?:[' + slash() + ']|^)(?:\\.{1,2})($|[' + slash() + ']))(?!\\.{2}).)*?'; + } -var Snapdragon = __webpack_require__(79285); -utils.define = __webpack_require__(35851); -utils.diff = __webpack_require__(9455); -utils.extend = __webpack_require__(3767); -utils.pick = __webpack_require__(38509); -utils.typeOf = __webpack_require__(19613); -utils.unique = __webpack_require__(19009); + if ((type === 'slash' || type === 'bos') && this.options.dot !== true) { + val = '(?!\\.)' + val; + } -/** - * Returns true if the platform is windows, or `path.sep` is `\\`. - * This is defined as a function to allow `path.sep` to be set in unit tests, - * or by the user, if there is a reason to do so. - * @return {Boolean} - */ + if (prev.type === 'slash' && next.type === 'slash' && before.type !== 'text') { + if (after.type === 'text' || after.type === 'star') { + node.addQmark = true; + } + } -utils.isWindows = function() { - return path.sep === '\\' || process.platform === 'win32'; -}; + if (this.options.capture) { + val = '(' + val + ')'; + } -/** - * Get the `Snapdragon` instance to use - */ + return this.emit(val, node); + }) -utils.instantiate = function(ast, options) { - var snapdragon; - // if an instance was created by `.parse`, use that instance - if (utils.typeOf(ast) === 'object' && ast.snapdragon) { - snapdragon = ast.snapdragon; - // if the user supplies an instance on options, use that instance - } else if (utils.typeOf(options) === 'object' && options.snapdragon) { - snapdragon = options.snapdragon; - // create a new instance - } else { - snapdragon = new Snapdragon(options); - } + /** + * Star: "*" + */ - utils.define(snapdragon, 'parse', function(str, options) { - var parsed = Snapdragon.prototype.parse.apply(this, arguments); - parsed.input = str; + .set('star', function(node, nodes, i) { + var prior = nodes[i - 2] || {}; + var prev = this.prev(); + var next = this.next(); + var type = prev.type; - // escape unmatched brace/bracket/parens - var last = this.parser.stack.pop(); - if (last && this.options.strictErrors !== true) { - var open = last.nodes[0]; - var inner = last.nodes[1]; - if (last.type === 'bracket') { - if (inner.val.charAt(0) === '[') { - inner.val = '\\' + inner.val; + function isStart(n) { + return n.type === 'bos' || n.type === 'slash'; + } + + if (this.output === '' && this.options.contains !== true) { + this.output = '(?![' + slash() + '])'; + } + + if (type === 'bracket' && this.options.bash === false) { + var str = next && next.type === 'bracket' ? star() : '*?'; + if (!prev.nodes || prev.nodes[1].type !== 'posix') { + return this.emit(str, node); } + } - } else { - open.val = '\\' + open.val; - var sibling = open.parent.nodes[1]; - if (sibling.type === 'star') { - sibling.loose = true; + var prefix = !this.dotfiles && type !== 'text' && type !== 'escape' + ? (this.options.dot ? '(?!(?:^|[' + slash() + '])\\.{1,2}(?:$|[' + slash() + ']))' : '(?!\\.)') + : ''; + + if (isStart(prev) || (isStart(prior) && type === 'not')) { + if (prefix !== '(?!\\.)') { + prefix += '(?!(\\.{2}|\\.[' + slash() + ']))(?=.)'; + } else { + prefix += '(?=.)'; } + } else if (prefix === '(?!\\.)') { + prefix = ''; } - } - // add non-enumerable parser reference - utils.define(parsed, 'parser', this.parser); - return parsed; - }); + if (prev.type === 'not' && prior.type === 'bos' && this.options.dot === true) { + this.output = '(?!\\.)' + this.output; + } - return snapdragon; -}; + var output = prefix + star(); + if (this.options.capture) { + output = '(' + output + ')'; + } -/** - * Create the key to use for memoization. The key is generated - * by iterating over the options and concatenating key-value pairs - * to the pattern string. - */ - -utils.createKey = function(pattern, options) { - if (utils.typeOf(options) !== 'object') { - return pattern; - } - var val = pattern; - var keys = Object.keys(options); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - val += ';' + key + '=' + String(options[key]); - } - return val; -}; + return this.emit(output, node); + }) -/** - * Cast `val` to an array - * @return {Array} - */ + /** + * Text + */ -utils.arrayify = function(val) { - if (typeof val === 'string') return [val]; - return val ? (Array.isArray(val) ? val : [val]) : []; -}; + .set('text', function(node) { + return this.emit(node.val, node); + }) -/** - * Return true if `val` is a non-empty string - */ + /** + * End-of-string + */ -utils.isString = function(val) { - return typeof val === 'string'; -}; + .set('eos', function(node) { + var prev = this.prev(); + var val = node.val; -/** - * Return true if `val` is a non-empty string - */ + this.output = '(?:\\.[' + slash() + '](?=.))?' + this.output; + if (this.state.metachar && prev.type !== 'qmark' && prev.type !== 'slash') { + val += (this.options.contains ? '[' + slash() + ']?' : '(?:[' + slash() + ']|$)'); + } -utils.isObject = function(val) { - return utils.typeOf(val) === 'object'; -}; + return this.emit(val, node); + }); -/** - * Returns true if the given `str` has special characters - */ + /** + * Allow custom compilers to be passed on options + */ -utils.hasSpecialChars = function(str) { - return /(?:(?:(^|\/)[!.])|[*?+()|\[\]{}]|[+@]\()/.test(str); + if (options && typeof options.compilers === 'function') { + options.compilers(nanomatch.compiler); + } }; -/** - * Escape regex characters in the given string - */ - -utils.escapeRegex = function(str) { - return str.replace(/[-[\]{}()^$|*+?.\\\/\s]/g, '\\$&'); -}; -/** - * Normalize slashes in the given filepath. - * - * @param {String} `filepath` - * @return {String} - */ -utils.toPosixPath = function(str) { - return str.replace(/\\+/g, '/'); -}; +/***/ }), -/** - * Strip backslashes before special characters in a string. - * - * @param {String} `str` - * @return {String} - */ +/***/ 5333: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -utils.unescape = function(str) { - return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, '')); -}; +"use strict"; -/** - * Strip the prefix from a filepath - * @param {String} `fp` - * @return {String} - */ -utils.stripPrefix = function(str) { - if (str.charAt(0) !== '.') { - return str; - } - var ch = str.charAt(1); - if (utils.isSlash(ch)) { - return str.slice(2); - } - return str; -}; +var regexNot = __webpack_require__(30931); +var toRegex = __webpack_require__(51279); /** - * Returns true if the given str is an escaped or - * unescaped path character + * Characters to use in negation regex (we want to "not" match + * characters that are matched by other parsers) */ -utils.isSlash = function(str) { - return str === '/' || str === '\\/' || str === '\\' || str === '\\\\'; -}; +var cached; +var NOT_REGEX = '[\\[!*+?$^"\'.\\\\/]+'; +var not = createTextRegex(NOT_REGEX); /** - * Returns a function that returns true if the given - * pattern matches or contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} + * Nanomatch parsers */ -utils.matchPath = function(pattern, options) { - return (options && options.contains) - ? utils.containsPattern(pattern, options) - : utils.equalsPattern(pattern, options); -}; +module.exports = function(nanomatch, options) { + var parser = nanomatch.parser; + var opts = parser.options; -/** - * Returns true if the given (original) filepath or unixified path are equal - * to the given pattern. - */ + parser.state = { + slashes: 0, + paths: [] + }; -utils._equals = function(filepath, unixPath, pattern) { - return pattern === filepath || pattern === unixPath; -}; + parser.ast.state = parser.state; + parser -/** - * Returns true if the given (original) filepath or unixified path contain - * the given pattern. - */ + /** + * Beginning-of-string + */ -utils._contains = function(filepath, unixPath, pattern) { - return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1; -}; + .capture('prefix', function() { + if (this.parsed) return; + var m = this.match(/^\.[\\/]/); + if (!m) return; + this.state.strictOpen = !!this.options.strictOpen; + this.state.addPrefix = true; + }) -/** - * Returns a function that returns true if the given - * pattern is the same as a given `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ + /** + * Escape: "\\." + */ -utils.equalsPattern = function(pattern, options) { - var unixify = utils.unixify(options); - options = options || {}; + .capture('escape', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(/^(?:\\(.)|([$^]))/); + if (!m) return; - return function fn(filepath) { - var equal = utils._equals(filepath, unixify(filepath), pattern); - if (equal === true || options.nocase !== true) { - return equal; - } - var lower = filepath.toLowerCase(); - return utils._equals(lower, unixify(lower), pattern); - }; -}; + return pos({ + type: 'escape', + val: m[2] || m[1] + }); + }) -/** - * Returns a function that returns true if the given - * pattern contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ + /** + * Quoted strings + */ -utils.containsPattern = function(pattern, options) { - var unixify = utils.unixify(options); - options = options || {}; + .capture('quoted', function() { + var pos = this.position(); + var m = this.match(/^["']/); + if (!m) return; - return function(filepath) { - var contains = utils._contains(filepath, unixify(filepath), pattern); - if (contains === true || options.nocase !== true) { - return contains; - } - var lower = filepath.toLowerCase(); - return utils._contains(lower, unixify(lower), pattern); - }; -}; + var quote = m[0]; + if (this.input.indexOf(quote) === -1) { + return pos({ + type: 'escape', + val: quote + }); + } -/** - * Returns a function that returns true if the given - * regex matches the `filename` of a file path. - * - * @param {RegExp} `re` Matching regex - * @return {Function} - */ + var tok = advanceTo(this.input, quote); + this.consume(tok.len); -utils.matchBasename = function(re) { - return function(filepath) { - return re.test(path.basename(filepath)); - }; -}; + return pos({ + type: 'quoted', + val: tok.esc + }); + }) -/** - * Determines the filepath to return based on the provided options. - * @return {any} - */ + /** + * Negations: "!" + */ -utils.value = function(str, unixify, options) { - if (options && options.unixify === false) { - return str; - } - return unixify(str); -}; + .capture('not', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(this.notRegex || /^!+/); + if (!m) return; + var val = m[0]; -/** - * Returns a function that normalizes slashes in a string to forward - * slashes, strips `./` from beginning of paths, and optionally unescapes - * special characters. - * @return {Function} - */ + var isNegated = (val.length % 2) === 1; + if (parsed === '' && !isNegated) { + val = ''; + } -utils.unixify = function(options) { - options = options || {}; - return function(filepath) { - if (utils.isWindows() || options.unixify === true) { - filepath = utils.toPosixPath(filepath); - } - if (options.stripPrefix !== false) { - filepath = utils.stripPrefix(filepath); - } - if (options.unescape === true) { - filepath = utils.unescape(filepath); - } - return filepath; - }; -}; + // if nothing has been parsed, we know `!` is at the start, + // so we need to wrap the result in a negation regex + if (parsed === '' && isNegated && this.options.nonegate !== true) { + this.bos.val = '(?!^(?:'; + this.append = ')$).*'; + val = ''; + } + return pos({ + type: 'not', + val: val + }); + }) + /** + * Dot: "." + */ -/***/ }), + .capture('dot', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\.+/); + if (!m) return; -/***/ 50559: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + var val = m[0]; + this.state.dot = val === '.' && (parsed === '' || parsed.slice(-1) === '/'); -"use strict"; + return pos({ + type: 'dot', + dotfiles: this.state.dot, + val: val + }); + }) + /** + * Plus: "+" + */ -/** - * Module dependencies - */ + .capture('plus', /^\+(?!\()/) -var toRegex = __webpack_require__(51279); -var unique = __webpack_require__(19009); -var extend = __webpack_require__(92845); + /** + * Question mark: "?" + */ -/** - * Local dependencies - */ + .capture('qmark', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\?+(?!\()/); + if (!m) return; -var compilers = __webpack_require__(90808); -var parsers = __webpack_require__(46362); -var Braces = __webpack_require__(12638); -var utils = __webpack_require__(38640); -var MAX_LENGTH = 1024 * 64; -var cache = {}; + this.state.metachar = true; + this.state.qmark = true; -/** - * Convert the given `braces` pattern into a regex-compatible string. By default, only one string is generated for every input string. Set `options.expand` to true to return an array of patterns (similar to Bash or minimatch. Before using `options.expand`, it's recommended that you read the [performance notes](#performance)). - * - * ```js - * var braces = require('braces'); - * console.log(braces('{a,b,c}')); - * //=> ['(a|b|c)'] - * - * console.log(braces('{a,b,c}', {expand: true})); - * //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ + return pos({ + type: 'qmark', + parsed: parsed, + val: m[0] + }); + }) -function braces(pattern, options) { - var key = utils.createKey(String(pattern), options); - var arr = []; + /** + * Globstar: "**" + */ - var disabled = options && options.cache === false; - if (!disabled && cache.hasOwnProperty(key)) { - return cache[key]; - } + .capture('globstar', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\*{2}(?![*(])(?=[,)/]|$)/); + if (!m) return; - if (Array.isArray(pattern)) { - for (var i = 0; i < pattern.length; i++) { - arr.push.apply(arr, braces.create(pattern[i], options)); - } - } else { - arr = braces.create(pattern, options); - } + var type = opts.noglobstar !== true ? 'globstar' : 'star'; + var node = pos({type: type, parsed: parsed}); + this.state.metachar = true; - if (options && options.nodupes === true) { - arr = unique(arr); - } + while (this.input.slice(0, 4) === '/**/') { + this.input = this.input.slice(3); + } - if (!disabled) { - cache[key] = arr; - } - return arr; -} + node.isInside = { + brace: this.isInside('brace'), + paren: this.isInside('paren') + }; -/** - * Expands a brace pattern into an array. This method is called by the main [braces](#braces) function when `options.expand` is true. Before using this method it's recommended that you read the [performance notes](#performance)) and advantages of using [.optimize](#optimize) instead. - * - * ```js - * var braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + if (type === 'globstar') { + this.state.globstar = true; + node.val = '**'; -braces.expand = function(pattern, options) { - return braces.create(pattern, extend({}, options, {expand: true})); -}; + } else { + this.state.star = true; + node.val = '*'; + } -/** - * Expands a brace pattern into a regex-compatible, optimized string. This method is called by the main [braces](#braces) function by default. - * - * ```js - * var braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + return node; + }) -braces.optimize = function(pattern, options) { - return braces.create(pattern, options); -}; + /** + * Star: "*" + */ -/** - * Processes a brace pattern and returns either an expanded array (if `options.expand` is true), a highly optimized regex-compatible string. This method is called by the main [braces](#braces) function. - * - * ```js - * var braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + .capture('star', function() { + var pos = this.position(); + var starRe = /^(?:\*(?![*(])|[*]{3,}(?!\()|[*]{2}(?![(/]|$)|\*(?=\*\())/; + var m = this.match(starRe); + if (!m) return; -braces.create = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } + this.state.metachar = true; + this.state.star = true; + return pos({ + type: 'star', + val: m[0] + }); + }) - var maxLength = (options && options.maxLength) || MAX_LENGTH; - if (pattern.length >= maxLength) { - throw new Error('expected pattern to be less than ' + maxLength + ' characters'); - } + /** + * Slash: "/" + */ - function create() { - if (pattern === '' || pattern.length < 3) { - return [pattern]; - } + .capture('slash', function() { + var pos = this.position(); + var m = this.match(/^\//); + if (!m) return; - if (utils.isEmptySets(pattern)) { - return []; - } + this.state.slashes++; + return pos({ + type: 'slash', + val: m[0] + }); + }) - if (utils.isQuotedString(pattern)) { - return [pattern.slice(1, -1)]; - } + /** + * Backslash: "\\" + */ - var proto = new Braces(options); - var result = !options || options.expand !== true - ? proto.optimize(pattern, options) - : proto.expand(pattern, options); + .capture('backslash', function() { + var pos = this.position(); + var m = this.match(/^\\(?![*+?(){}[\]'"])/); + if (!m) return; - // get the generated pattern(s) - var arr = result.output; + var val = m[0]; - // filter out empty strings if specified - if (options && options.noempty === true) { - arr = arr.filter(Boolean); - } + if (this.isInside('bracket')) { + val = '\\'; + } else if (val.length > 1) { + val = '\\\\'; + } - // filter out duplicates if specified - if (options && options.nodupes === true) { - arr = unique(arr); - } + return pos({ + type: 'backslash', + val: val + }); + }) - Object.defineProperty(arr, 'result', { - enumerable: false, - value: result - }); + /** + * Square: "[.]" + */ - return arr; - } + .capture('square', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(/^\[([^!^\\])\]/); + if (!m) return; - return memoize('create', pattern, options, create); -}; + return pos({ + type: 'square', + val: m[1] + }); + }) -/** - * Create a regular expression from the given string `pattern`. - * - * ```js - * var braces = require('braces'); - * - * console.log(braces.makeRe('id-{200..300}')); - * //=> /^(?:id-(20[0-9]|2[1-9][0-9]|300))$/ - * ``` - * @param {String} `pattern` The pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ + /** + * Brackets: "[...]" (basic, this can be overridden by other parsers) + */ -braces.makeRe = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } + .capture('bracket', function() { + var pos = this.position(); + var m = this.match(/^(?:\[([!^]?)([^\]]+|\]-)(\]|[^*+?]+)|\[)/); + if (!m) return; - var maxLength = (options && options.maxLength) || MAX_LENGTH; - if (pattern.length >= maxLength) { - throw new Error('expected pattern to be less than ' + maxLength + ' characters'); - } + var val = m[0]; + var negated = m[1] ? '^' : ''; + var inner = (m[2] || '').replace(/\\\\+/, '\\\\'); + var close = m[3] || ''; - function makeRe() { - var arr = braces(pattern, options); - var opts = extend({strictErrors: false}, options); - return toRegex(arr, opts); - } + if (m[2] && inner.length < m[2].length) { + val = val.replace(/\\\\+/, '\\\\'); + } - return memoize('makeRe', pattern, options, makeRe); -}; + var esc = this.input.slice(0, 2); + if (inner === '' && esc === '\\]') { + inner += esc; + this.consume(2); -/** - * Parse the given `str` with the given `options`. - * - * ```js - * var braces = require('braces'); - * var ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * // { type: 'root', - * // errors: [], - * // input: 'a/{b,c}/d', - * // nodes: - * // [ { type: 'bos', val: '' }, - * // { type: 'text', val: 'a/' }, - * // { type: 'brace', - * // nodes: - * // [ { type: 'brace.open', val: '{' }, - * // { type: 'text', val: 'b,c' }, - * // { type: 'brace.close', val: '}' } ] }, - * // { type: 'text', val: '/d' }, - * // { type: 'eos', val: '' } ] } - * ``` - * @param {String} `pattern` Brace pattern to parse - * @param {Object} `options` - * @return {Object} Returns an AST - * @api public - */ + var str = this.input; + var idx = -1; + var ch; -braces.parse = function(pattern, options) { - var proto = new Braces(options); - return proto.parse(pattern, options); -}; + while ((ch = str[++idx])) { + this.consume(1); + if (ch === ']') { + close = ch; + break; + } + inner += ch; + } + } -/** - * Compile the given `ast` or string with the given `options`. - * - * ```js - * var braces = require('braces'); - * var ast = braces.parse('a/{b,c}/d'); - * console.log(braces.compile(ast)); - * // { options: { source: 'string' }, - * // state: {}, - * // compilers: - * // { eos: [Function], - * // noop: [Function], - * // bos: [Function], - * // brace: [Function], - * // 'brace.open': [Function], - * // text: [Function], - * // 'brace.close': [Function] }, - * // output: [ 'a/(b|c)/d' ], - * // ast: - * // { ... }, - * // parsingErrors: [] } - * ``` - * @param {Object|String} `ast` AST from [.parse](#parse). If a string is passed it will be parsed first. - * @param {Object} `options` - * @return {Object} Returns an object that has an `output` property with the compiled string. - * @api public - */ + return pos({ + type: 'bracket', + val: val, + escaped: close !== ']', + negated: negated, + inner: inner, + close: close + }); + }) -braces.compile = function(ast, options) { - var proto = new Braces(options); - return proto.compile(ast, options); -}; + /** + * Text + */ -/** - * Clear the regex cache. - * - * ```js - * braces.clearCache(); - * ``` - * @api public - */ + .capture('text', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(not); + if (!m || !m[0]) return; -braces.clearCache = function() { - cache = braces.cache = {}; + return pos({ + type: 'text', + val: m[0] + }); + }); + + /** + * Allow custom parsers to be passed on options + */ + + if (options && typeof options.parsers === 'function') { + options.parsers(nanomatch.parser); + } }; /** - * Memoize a generated regex or function. A unique key is generated - * from the method name, pattern, and user-defined options. Set - * options.memoize to false to disable. + * Advance to the next non-escaped character */ -function memoize(type, pattern, options, fn) { - var key = utils.createKey(type + ':' + pattern, options); - var disabled = options && options.cache === false; - if (disabled) { - braces.clearCache(); - return fn(pattern, options); - } +function advanceTo(input, endChar) { + var ch = input.charAt(0); + var tok = { len: 1, val: '', esc: '' }; + var idx = 0; - if (cache.hasOwnProperty(key)) { - return cache[key]; + function advance() { + if (ch !== '\\') { + tok.esc += '\\' + ch; + tok.val += ch; + } + + ch = input.charAt(++idx); + tok.len++; + + if (ch === '\\') { + advance(); + advance(); + } } - var res = fn(pattern, options); - cache[key] = res; - return res; + while (ch && ch !== endChar) { + advance(); + } + return tok; } /** - * Expose `Braces` constructor and methods - * @type {Function} + * Create text regex */ -braces.Braces = Braces; -braces.compilers = compilers; -braces.parsers = parsers; -braces.cache = cache; +function createTextRegex(pattern) { + if (cached) return cached; + var opts = {contains: true, strictClose: false}; + var not = regexNot.create(pattern, opts); + var re = toRegex('^(?:[*]\\((?=.)|' + not + ')', opts); + return (cached = re); +} /** - * Expose `braces` - * @type {Function} + * Expose negation string */ -module.exports = braces; +module.exports.not = NOT_REGEX; /***/ }), -/***/ 12638: +/***/ 41340: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var extend = __webpack_require__(92845); +var utils = module.exports; +var path = __webpack_require__(85622); + +/** + * Module dependencies + */ + +var isWindows = __webpack_require__(8025)(); var Snapdragon = __webpack_require__(79285); -var compilers = __webpack_require__(90808); -var parsers = __webpack_require__(46362); -var utils = __webpack_require__(38640); +utils.define = __webpack_require__(18918); +utils.diff = __webpack_require__(9455); +utils.extend = __webpack_require__(69148); +utils.pick = __webpack_require__(38509); +utils.typeOf = __webpack_require__(42556); +utils.unique = __webpack_require__(19009); /** - * Customize Snapdragon parser and renderer + * Returns true if the given value is effectively an empty string */ -function Braces(options) { - this.options = extend({}, options); -} +utils.isEmptyString = function(val) { + return String(val) === '' || String(val) === './'; +}; /** - * Initialize braces + * Returns true if the platform is windows, or `path.sep` is `\\`. + * This is defined as a function to allow `path.sep` to be set in unit tests, + * or by the user, if there is a reason to do so. + * @return {Boolean} */ -Braces.prototype.init = function(options) { - if (this.isInitialized) return; - this.isInitialized = true; - var opts = utils.createOptions({}, this.options, options); - this.snapdragon = this.options.snapdragon || new Snapdragon(opts); - this.compiler = this.snapdragon.compiler; - this.parser = this.snapdragon.parser; +utils.isWindows = function() { + return path.sep === '\\' || isWindows === true; +}; - compilers(this.snapdragon, opts); - parsers(this.snapdragon, opts); +/** + * Return the last element from an array + */ - /** - * Call Snapdragon `.parse` method. When AST is returned, we check to - * see if any unclosed braces are left on the stack and, if so, we iterate - * over the stack and correct the AST so that compilers are called in the correct - * order and unbalance braces are properly escaped. - */ +utils.last = function(arr, n) { + return arr[arr.length - (n || 1)]; +}; - utils.define(this.snapdragon, 'parse', function(pattern, options) { - var parsed = Snapdragon.prototype.parse.apply(this, arguments); - this.parser.ast.input = pattern; +/** + * Get the `Snapdragon` instance to use + */ - var stack = this.parser.stack; - while (stack.length) { - addParent({type: 'brace.close', val: ''}, stack.pop()); - } +utils.instantiate = function(ast, options) { + var snapdragon; + // if an instance was created by `.parse`, use that instance + if (utils.typeOf(ast) === 'object' && ast.snapdragon) { + snapdragon = ast.snapdragon; + // if the user supplies an instance on options, use that instance + } else if (utils.typeOf(options) === 'object' && options.snapdragon) { + snapdragon = options.snapdragon; + // create a new instance + } else { + snapdragon = new Snapdragon(options); + } - function addParent(node, parent) { - utils.define(node, 'parent', parent); - parent.nodes.push(node); + utils.define(snapdragon, 'parse', function(str, options) { + var parsed = Snapdragon.prototype.parse.call(this, str, options); + parsed.input = str; + + // escape unmatched brace/bracket/parens + var last = this.parser.stack.pop(); + if (last && this.options.strictErrors !== true) { + var open = last.nodes[0]; + var inner = last.nodes[1]; + if (last.type === 'bracket') { + if (inner.val.charAt(0) === '[') { + inner.val = '\\' + inner.val; + } + + } else { + open.val = '\\' + open.val; + var sibling = open.parent.nodes[1]; + if (sibling.type === 'star') { + sibling.loose = true; + } + } } // add non-enumerable parser reference utils.define(parsed, 'parser', this.parser); return parsed; }); + + return snapdragon; }; /** - * Decorate `.parse` method + * Create the key to use for memoization. The key is generated + * by iterating over the options and concatenating key-value pairs + * to the pattern string. */ -Braces.prototype.parse = function(ast, options) { - if (ast && typeof ast === 'object' && ast.nodes) return ast; - this.init(options); - return this.snapdragon.parse(ast, options); +utils.createKey = function(pattern, options) { + if (typeof options === 'undefined') { + return pattern; + } + var key = pattern; + for (var prop in options) { + if (options.hasOwnProperty(prop)) { + key += ';' + prop + '=' + String(options[prop]); + } + } + return key; }; /** - * Decorate `.compile` method + * Cast `val` to an array + * @return {Array} */ -Braces.prototype.compile = function(ast, options) { - if (typeof ast === 'string') { - ast = this.parse(ast, options); - } else { - this.init(options); - } - return this.snapdragon.compile(ast, options); +utils.arrayify = function(val) { + if (typeof val === 'string') return [val]; + return val ? (Array.isArray(val) ? val : [val]) : []; }; /** - * Expand + * Return true if `val` is a non-empty string */ -Braces.prototype.expand = function(pattern) { - var ast = this.parse(pattern, {expand: true}); - return this.compile(ast, {expand: true}); +utils.isString = function(val) { + return typeof val === 'string'; }; /** - * Optimize + * Return true if `val` is a non-empty string */ -Braces.prototype.optimize = function(pattern) { - var ast = this.parse(pattern, {optimize: true}); - return this.compile(ast, {optimize: true}); +utils.isRegex = function(val) { + return utils.typeOf(val) === 'regexp'; }; /** - * Expose `Braces` + * Return true if `val` is a non-empty string */ -module.exports = Braces; +utils.isObject = function(val) { + return utils.typeOf(val) === 'object'; +}; +/** + * Escape regex characters in the given string + */ -/***/ }), +utils.escapeRegex = function(str) { + return str.replace(/[-[\]{}()^$|*+?.\\/\s]/g, '\\$&'); +}; -/***/ 90808: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/** + * Combines duplicate characters in the provided `input` string. + * @param {String} `input` + * @returns {String} + */ -"use strict"; +utils.combineDupes = function(input, patterns) { + patterns = utils.arrayify(patterns).join('|').split('|'); + patterns = patterns.map(function(s) { + return s.replace(/\\?([+*\\/])/g, '\\$1'); + }); + var substr = patterns.join('|'); + var regex = new RegExp('(' + substr + ')(?=\\1)', 'g'); + return input.replace(regex, ''); +}; +/** + * Returns true if the given `str` has special characters + */ -var utils = __webpack_require__(38640); +utils.hasSpecialChars = function(str) { + return /(?:(?:(^|\/)[!.])|[*?+()|[\]{}]|[+@]\()/.test(str); +}; -module.exports = function(braces, options) { - braces.compiler +/** + * Normalize slashes in the given filepath. + * + * @param {String} `filepath` + * @return {String} + */ - /** - * bos - */ +utils.toPosixPath = function(str) { + return str.replace(/\\+/g, '/'); +}; - .set('bos', function() { - if (this.output) return; - this.ast.queue = isEscaped(this.ast) ? [this.ast.val] : []; - this.ast.count = 1; - }) +/** + * Strip backslashes before special characters in a string. + * + * @param {String} `str` + * @return {String} + */ - /** - * Square brackets - */ +utils.unescape = function(str) { + return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, '')); +}; - .set('bracket', function(node) { - var close = node.close; - var open = !node.escaped ? '[' : '\\['; - var negated = node.negated; - var inner = node.inner; +/** + * Strip the drive letter from a windows filepath + * @param {String} `fp` + * @return {String} + */ - inner = inner.replace(/\\(?=[\\\w]|$)/g, '\\\\'); - if (inner === ']-') { - inner = '\\]\\-'; - } +utils.stripDrive = function(fp) { + return utils.isWindows() ? fp.replace(/^[a-z]:[\\/]+?/i, '/') : fp; +}; - if (negated && inner.indexOf('.') === -1) { - inner += '.'; - } - if (negated && inner.indexOf('/') === -1) { - inner += '/'; - } +/** + * Strip the prefix from a filepath + * @param {String} `fp` + * @return {String} + */ - var val = open + negated + inner + close; - var queue = node.parent.queue; - var last = utils.arrayify(queue.pop()); +utils.stripPrefix = function(str) { + if (str.charAt(0) === '.' && (str.charAt(1) === '/' || str.charAt(1) === '\\')) { + return str.slice(2); + } + return str; +}; - queue.push(utils.join(last, val)); - queue.push.apply(queue, []); - }) +/** + * Returns true if `str` is a common character that doesn't need + * to be processed to be used for matching. + * @param {String} `str` + * @return {Boolean} + */ - /** - * Brace - */ +utils.isSimpleChar = function(str) { + return str.trim() === '' || str === '.'; +}; - .set('brace', function(node) { - node.queue = isEscaped(node) ? [node.val] : []; - node.count = 1; - return this.mapVisit(node.nodes); - }) +/** + * Returns true if the given str is an escaped or + * unescaped path character + */ - /** - * Open - */ +utils.isSlash = function(str) { + return str === '/' || str === '\\/' || str === '\\' || str === '\\\\'; +}; - .set('brace.open', function(node) { - node.parent.open = node.val; - }) +/** + * Returns a function that returns true if the given + * pattern matches or contains a `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ - /** - * Inner - */ +utils.matchPath = function(pattern, options) { + return (options && options.contains) + ? utils.containsPattern(pattern, options) + : utils.equalsPattern(pattern, options); +}; - .set('text', function(node) { - var queue = node.parent.queue; - var escaped = node.escaped; - var segs = [node.val]; +/** + * Returns true if the given (original) filepath or unixified path are equal + * to the given pattern. + */ - if (node.optimize === false) { - options = utils.extend({}, options, {optimize: false}); - } +utils._equals = function(filepath, unixPath, pattern) { + return pattern === filepath || pattern === unixPath; +}; - if (node.multiplier > 1) { - node.parent.count *= node.multiplier; - } +/** + * Returns true if the given (original) filepath or unixified path contain + * the given pattern. + */ - if (options.quantifiers === true && utils.isQuantifier(node.val)) { - escaped = true; +utils._contains = function(filepath, unixPath, pattern) { + return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1; +}; - } else if (node.val.length > 1) { - if (isType(node.parent, 'brace') && !isEscaped(node)) { - var expanded = utils.expand(node.val, options); - segs = expanded.segs; +/** + * Returns a function that returns true if the given + * pattern is the same as a given `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ - if (expanded.isOptimized) { - node.parent.isOptimized = true; - } +utils.equalsPattern = function(pattern, options) { + var unixify = utils.unixify(options); + options = options || {}; - // if nothing was expanded, we probably have a literal brace - if (!segs.length) { - var val = (expanded.val || node.val); - if (options.unescape !== false) { - // unescape unexpanded brace sequence/set separators - val = val.replace(/\\([,.])/g, '$1'); - // strip quotes - val = val.replace(/["'`]/g, ''); - } + return function fn(filepath) { + var equal = utils._equals(filepath, unixify(filepath), pattern); + if (equal === true || options.nocase !== true) { + return equal; + } + var lower = filepath.toLowerCase(); + return utils._equals(lower, unixify(lower), pattern); + }; +}; - segs = [val]; - escaped = true; - } - } +/** + * Returns a function that returns true if the given + * pattern contains a `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ - } else if (node.val === ',') { - if (options.expand) { - node.parent.queue.push(['']); - segs = ['']; - } else { - segs = ['|']; - } - } else { - escaped = true; - } +utils.containsPattern = function(pattern, options) { + var unixify = utils.unixify(options); + options = options || {}; - if (escaped && isType(node.parent, 'brace')) { - if (node.parent.nodes.length <= 4 && node.parent.count === 1) { - node.parent.escaped = true; - } else if (node.parent.length <= 3) { - node.parent.escaped = true; - } - } + return function(filepath) { + var contains = utils._contains(filepath, unixify(filepath), pattern); + if (contains === true || options.nocase !== true) { + return contains; + } + var lower = filepath.toLowerCase(); + return utils._contains(lower, unixify(lower), pattern); + }; +}; - if (!hasQueue(node.parent)) { - node.parent.queue = segs; - return; - } +/** + * Returns a function that returns true if the given + * regex matches the `filename` of a file path. + * + * @param {RegExp} `re` Matching regex + * @return {Function} + */ - var last = utils.arrayify(queue.pop()); - if (node.parent.count > 1 && options.expand) { - last = multiply(last, node.parent.count); - node.parent.count = 1; - } +utils.matchBasename = function(re) { + return function(filepath) { + return re.test(filepath) || re.test(path.basename(filepath)); + }; +}; - queue.push(utils.join(utils.flatten(last), segs.shift())); - queue.push.apply(queue, segs); - }) +/** + * Returns the given value unchanced. + * @return {any} + */ - /** - * Close - */ +utils.identity = function(val) { + return val; +}; - .set('brace.close', function(node) { - var queue = node.parent.queue; - var prev = node.parent.parent; - var last = prev.queue.pop(); - var open = node.parent.open; - var close = node.val; +/** + * Determines the filepath to return based on the provided options. + * @return {any} + */ - if (open && close && isOptimized(node, options)) { - open = '('; - close = ')'; - } +utils.value = function(str, unixify, options) { + if (options && options.unixify === false) { + return str; + } + if (options && typeof options.unixify === 'function') { + return options.unixify(str); + } + return unixify(str); +}; - // if a close brace exists, and the previous segment is one character - // don't wrap the result in braces or parens - var ele = utils.last(queue); - if (node.parent.count > 1 && options.expand) { - ele = multiply(queue.pop(), node.parent.count); - node.parent.count = 1; - queue.push(ele); - } +/** + * Returns a function that normalizes slashes in a string to forward + * slashes, strips `./` from beginning of paths, and optionally unescapes + * special characters. + * @return {Function} + */ - if (close && typeof ele === 'string' && ele.length === 1) { - open = ''; - close = ''; - } +utils.unixify = function(options) { + var opts = options || {}; + return function(filepath) { + if (opts.stripPrefix !== false) { + filepath = utils.stripPrefix(filepath); + } + if (opts.unescape === true) { + filepath = utils.unescape(filepath); + } + if (opts.unixify === true || utils.isWindows()) { + filepath = utils.toPosixPath(filepath); + } + return filepath; + }; +}; - if ((isLiteralBrace(node, options) || noInner(node)) && !node.parent.hasEmpty) { - queue.push(utils.join(open, queue.pop() || '')); - queue = utils.flatten(utils.join(queue, close)); - } - if (typeof last === 'undefined') { - prev.queue = [queue]; - } else { - prev.queue.push(utils.flatten(utils.join(last, queue))); - } - }) +/***/ }), - /** - * eos - */ +/***/ 18918: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - .set('eos', function(node) { - if (this.input) return; +"use strict"; +/*! + * define-property + * + * Copyright (c) 2015-2018, Jon Schlinkert. + * Released under the MIT License. + */ - if (options.optimize !== false) { - this.output = utils.last(utils.flatten(this.ast.queue)); - } else if (Array.isArray(utils.last(this.ast.queue))) { - this.output = utils.flatten(this.ast.queue.pop()); - } else { - this.output = utils.flatten(this.ast.queue); - } - if (node.parent.count > 1 && options.expand) { - this.output = multiply(this.output, node.parent.count); - } - this.output = utils.arrayify(this.output); - this.ast.queue = []; - }); +var isobject = __webpack_require__(96667); +var isDescriptor = __webpack_require__(44133); +var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) + ? Reflect.defineProperty + : Object.defineProperty; + +module.exports = function defineProperty(obj, key, val) { + if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) { + throw new TypeError('expected an object, function, or array'); + } + + if (typeof key !== 'string') { + throw new TypeError('expected "key" to be a string'); + } + + if (isDescriptor(val)) { + define(obj, key, val); + return obj; + } + define(obj, key, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); + + return obj; }; -/** - * Multiply the segments in the current brace level - */ -function multiply(queue, n, options) { - return utils.flatten(utils.repeat(utils.arrayify(queue), n)); -} +/***/ }), -/** - * Return true if `node` is escaped - */ +/***/ 69148: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -function isEscaped(node) { - return node.escaped === true; -} +"use strict"; -/** - * Returns true if regex parens should be used for sets. If the parent `type` - * is not `brace`, then we're on a root node, which means we should never - * expand segments and open/close braces should be `{}` (since this indicates - * a brace is missing from the set) - */ -function isOptimized(node, options) { - if (node.parent.isOptimized) return true; - return isType(node.parent, 'brace') - && !isEscaped(node.parent) - && options.expand !== true; -} +var isExtendable = __webpack_require__(61781); +var assignSymbols = __webpack_require__(64353); -/** - * Returns true if the value in `node` should be wrapped in a literal brace. - * @return {Boolean} - */ +module.exports = Object.assign || function(obj/*, objects*/) { + if (obj === null || typeof obj === 'undefined') { + throw new TypeError('Cannot convert undefined or null to object'); + } + if (!isObject(obj)) { + obj = {}; + } + for (var i = 1; i < arguments.length; i++) { + var val = arguments[i]; + if (isString(val)) { + val = toObject(val); + } + if (isObject(val)) { + assign(obj, val); + assignSymbols(obj, val); + } + } + return obj; +}; -function isLiteralBrace(node, options) { - return isEscaped(node.parent) || options.optimize !== false; +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } } -/** - * Returns true if the given `node` does not have an inner value. - * @return {Boolean} - */ +function isString(val) { + return (val && typeof val === 'string'); +} -function noInner(node, type) { - if (node.parent.queue.length === 1) { - return true; +function toObject(str) { + var obj = {}; + for (var i in str) { + obj[i] = str[i]; } - var nodes = node.parent.nodes; - return nodes.length === 3 - && isType(nodes[0], 'brace.open') - && !isType(nodes[1], 'text') - && isType(nodes[2], 'brace.close'); + return obj; } -/** - * Returns true if the given `node` is the given `type` - * @return {Boolean} - */ - -function isType(node, type) { - return typeof node !== 'undefined' && node.type === type; +function isObject(val) { + return (val && typeof val === 'object') || isExtendable(val); } /** - * Returns true if the given `node` has a non-empty queue. - * @return {Boolean} + * Returns true if the given `key` is an own property of `obj`. */ -function hasQueue(node) { - return Array.isArray(node.queue) && node.queue.length; +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +function isEnum(obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); } /***/ }), -/***/ 46362: +/***/ 61781: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ -var Node = __webpack_require__(12579); -var utils = __webpack_require__(38640); - -/** - * Braces parsers - */ -module.exports = function(braces, options) { - braces.parser - .set('bos', function() { - if (!this.parsed) { - this.ast = this.nodes[0] = new Node(this.ast); - } - }) +var isPlainObject = __webpack_require__(81064); - /** - * Character parsers - */ +module.exports = function isExtendable(val) { + return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); +}; - .set('escape', function() { - var pos = this.position(); - var m = this.match(/^(?:\\(.)|\$\{)/); - if (!m) return; - var prev = this.prev(); - var last = utils.last(prev.nodes); +/***/ }), - var node = pos(new Node({ - type: 'text', - multiplier: 1, - val: m[0] - })); +/***/ 8025: +/***/ (function(module, exports) { - if (node.val === '\\\\') { - return node; - } +/*! + * is-windows + * + * Copyright © 2015-2018, Jon Schlinkert. + * Released under the MIT License. + */ - if (node.val === '${') { - var str = this.input; - var idx = -1; - var ch; +(function(factory) { + if (exports && typeof exports === 'object' && "object" !== 'undefined') { + module.exports = factory(); + } else if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof window !== 'undefined') { + window.isWindows = factory(); + } else if (typeof global !== 'undefined') { + global.isWindows = factory(); + } else if (typeof self !== 'undefined') { + self.isWindows = factory(); + } else { + this.isWindows = factory(); + } +})(function() { + 'use strict'; + return function isWindows() { + return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)); + }; +}); - while ((ch = str[++idx])) { - this.consume(1); - node.val += ch; - if (ch === '\\') { - node.val += str[++idx]; - continue; - } - if (ch === '}') { - break; - } - } - } - if (this.options.unescape !== false) { - node.val = node.val.replace(/\\([{}])/g, '$1'); - } +/***/ }), - if (last.val === '"' && this.input.charAt(0) === '"') { - last.val = node.val; - this.consume(1); - return; - } +/***/ 42556: +/***/ (function(module) { - return concatNodes.call(this, pos, node, prev, options); - }) +var toString = Object.prototype.toString; - /** - * Brackets: "[...]" (basic, this is overridden by - * other parsers in more advanced implementations) - */ +module.exports = function kindOf(val) { + if (val === void 0) return 'undefined'; + if (val === null) return 'null'; - .set('bracket', function() { - var isInside = this.isInside('brace'); - var pos = this.position(); - var m = this.match(/^(?:\[([!^]?)([^\]]{2,}|\]-)(\]|[^*+?]+)|\[)/); - if (!m) return; + var type = typeof val; + if (type === 'boolean') return 'boolean'; + if (type === 'string') return 'string'; + if (type === 'number') return 'number'; + if (type === 'symbol') return 'symbol'; + if (type === 'function') { + return isGeneratorFn(val) ? 'generatorfunction' : 'function'; + } - var prev = this.prev(); - var val = m[0]; - var negated = m[1] ? '^' : ''; - var inner = m[2] || ''; - var close = m[3] || ''; + if (isArray(val)) return 'array'; + if (isBuffer(val)) return 'buffer'; + if (isArguments(val)) return 'arguments'; + if (isDate(val)) return 'date'; + if (isError(val)) return 'error'; + if (isRegexp(val)) return 'regexp'; - if (isInside && prev.type === 'brace') { - prev.text = prev.text || ''; - prev.text += val; - } + switch (ctorName(val)) { + case 'Symbol': return 'symbol'; + case 'Promise': return 'promise'; - var esc = this.input.slice(0, 2); - if (inner === '' && esc === '\\]') { - inner += esc; - this.consume(2); + // Set, Map, WeakSet, WeakMap + case 'WeakMap': return 'weakmap'; + case 'WeakSet': return 'weakset'; + case 'Map': return 'map'; + case 'Set': return 'set'; - var str = this.input; - var idx = -1; - var ch; + // 8-bit typed arrays + case 'Int8Array': return 'int8array'; + case 'Uint8Array': return 'uint8array'; + case 'Uint8ClampedArray': return 'uint8clampedarray'; - while ((ch = str[++idx])) { - this.consume(1); - if (ch === ']') { - close = ch; - break; - } - inner += ch; - } - } + // 16-bit typed arrays + case 'Int16Array': return 'int16array'; + case 'Uint16Array': return 'uint16array'; - return pos(new Node({ - type: 'bracket', - val: val, - escaped: close !== ']', - negated: negated, - inner: inner, - close: close - })); - }) + // 32-bit typed arrays + case 'Int32Array': return 'int32array'; + case 'Uint32Array': return 'uint32array'; + case 'Float32Array': return 'float32array'; + case 'Float64Array': return 'float64array'; + } - /** - * Empty braces (we capture these early to - * speed up processing in the compiler) - */ + if (isGeneratorObj(val)) { + return 'generator'; + } - .set('multiplier', function() { - var isInside = this.isInside('brace'); - var pos = this.position(); - var m = this.match(/^\{((?:,|\{,+\})+)\}/); - if (!m) return; + // Non-plain objects + type = toString.call(val); + switch (type) { + case '[object Object]': return 'object'; + // iterators + case '[object Map Iterator]': return 'mapiterator'; + case '[object Set Iterator]': return 'setiterator'; + case '[object String Iterator]': return 'stringiterator'; + case '[object Array Iterator]': return 'arrayiterator'; + } - this.multiplier = true; - var prev = this.prev(); - var val = m[0]; + // other + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); +}; - if (isInside && prev.type === 'brace') { - prev.text = prev.text || ''; - prev.text += val; - } +function ctorName(val) { + return typeof val.constructor === 'function' ? val.constructor.name : null; +} - var node = pos(new Node({ - type: 'text', - multiplier: 1, - match: m, - val: val - })); +function isArray(val) { + if (Array.isArray) return Array.isArray(val); + return val instanceof Array; +} - return concatNodes.call(this, pos, node, prev, options); - }) +function isError(val) { + return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); +} - /** - * Open - */ +function isDate(val) { + if (val instanceof Date) return true; + return typeof val.toDateString === 'function' + && typeof val.getDate === 'function' + && typeof val.setDate === 'function'; +} - .set('brace.open', function() { - var pos = this.position(); - var m = this.match(/^\{(?!(?:[^\\}]?|,+)\})/); - if (!m) return; +function isRegexp(val) { + if (val instanceof RegExp) return true; + return typeof val.flags === 'string' + && typeof val.ignoreCase === 'boolean' + && typeof val.multiline === 'boolean' + && typeof val.global === 'boolean'; +} - var prev = this.prev(); - var last = utils.last(prev.nodes); +function isGeneratorFn(name, val) { + return ctorName(name) === 'GeneratorFunction'; +} - // if the last parsed character was an extglob character - // we need to _not optimize_ the brace pattern because - // it might be mistaken for an extglob by a downstream parser - if (last && last.val && isExtglobChar(last.val.slice(-1))) { - last.optimize = false; - } +function isGeneratorObj(val) { + return typeof val.throw === 'function' + && typeof val.return === 'function' + && typeof val.next === 'function'; +} - var open = pos(new Node({ - type: 'brace.open', - val: m[0] - })); +function isArguments(val) { + try { + if (typeof val.length === 'number' && typeof val.callee === 'function') { + return true; + } + } catch (err) { + if (err.message.indexOf('callee') !== -1) { + return true; + } + } + return false; +} - var node = pos(new Node({ - type: 'brace', - nodes: [] - })); +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ - node.push(open); - prev.push(node); - this.push('brace', node); - }) +function isBuffer(val) { + if (val.constructor && typeof val.constructor.isBuffer === 'function') { + return val.constructor.isBuffer(val); + } + return false; +} - /** - * Close - */ - .set('brace.close', function() { - var pos = this.position(); - var m = this.match(/^\}/); - if (!m || !m[0]) return; +/***/ }), - var brace = this.pop('brace'); - var node = pos(new Node({ - type: 'brace.close', - val: m[0] - })); +/***/ 31368: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (!this.isType(brace, 'brace')) { - if (this.options.strict) { - throw new Error('missing opening "{"'); - } - node.type = 'text'; - node.multiplier = 0; - node.escaped = true; - return node; - } +"use strict"; - var prev = this.prev(); - var last = utils.last(prev.nodes); - if (last.text) { - var lastNode = utils.last(last.nodes); - if (lastNode.val === ')' && /[!@*?+]\(/.test(last.text)) { - var open = last.nodes[0]; - var text = last.nodes[1]; - if (open.type === 'brace.open' && text && text.type === 'text') { - text.optimize = false; - } - } - } - if (brace.nodes.length > 2) { - var first = brace.nodes[1]; - if (first.type === 'text' && first.val === ',') { - brace.nodes.splice(1, 1); - brace.nodes.push(first); - } - } +var typeOf = __webpack_require__(48865); +var copyDescriptor = __webpack_require__(3605); +var define = __webpack_require__(5477); - brace.push(node); - }) +/** + * Copy static properties, prototype properties, and descriptors from one object to another. + * + * ```js + * function App() {} + * var proto = App.prototype; + * App.prototype.set = function() {}; + * App.prototype.get = function() {}; + * + * var obj = {}; + * copy(obj, proto); + * ``` + * @param {Object} `receiver` + * @param {Object} `provider` + * @param {String|Array} `omit` One or more properties to omit + * @return {Object} + * @api public + */ - /** - * Capture boundary characters - */ +function copy(receiver, provider, omit) { + if (!isObject(receiver)) { + throw new TypeError('expected receiving object to be an object.'); + } + if (!isObject(provider)) { + throw new TypeError('expected providing object to be an object.'); + } - .set('boundary', function() { - var pos = this.position(); - var m = this.match(/^[$^](?!\{)/); - if (!m) return; - return pos(new Node({ - type: 'text', - val: m[0] - })); - }) + var props = nativeKeys(provider); + var keys = Object.keys(provider); + var len = props.length; + omit = arrayify(omit); - /** - * One or zero, non-comma characters wrapped in braces - */ + while (len--) { + var key = props[len]; - .set('nobrace', function() { - var isInside = this.isInside('brace'); - var pos = this.position(); - var m = this.match(/^\{[^,]?\}/); - if (!m) return; + if (has(keys, key)) { + define(receiver, key, provider[key]); + } else if (!(key in receiver) && !has(omit, key)) { + copyDescriptor(receiver, provider, key); + } + } +}; - var prev = this.prev(); - var val = m[0]; +/** + * Return true if the given value is an object or function + */ - if (isInside && prev.type === 'brace') { - prev.text = prev.text || ''; - prev.text += val; - } +function isObject(val) { + return typeOf(val) === 'object' || typeof val === 'function'; +} - return pos(new Node({ - type: 'text', - multiplier: 0, - val: val - })); - }) +/** + * Returns true if an array has any of the given elements, or an + * object has any of the give keys. + * + * ```js + * has(['a', 'b', 'c'], 'c'); + * //=> true + * + * has(['a', 'b', 'c'], ['c', 'z']); + * //=> true + * + * has({a: 'b', c: 'd'}, ['c', 'z']); + * //=> true + * ``` + * @param {Object} `obj` + * @param {String|Array} `val` + * @return {Boolean} + */ - /** - * Text - */ +function has(obj, val) { + val = arrayify(val); + var len = val.length; - .set('text', function() { - var isInside = this.isInside('brace'); - var pos = this.position(); - var m = this.match(/^((?!\\)[^${}[\]])+/); - if (!m) return; + if (isObject(obj)) { + for (var key in obj) { + if (val.indexOf(key) > -1) { + return true; + } + } - var prev = this.prev(); - var val = m[0]; + var keys = nativeKeys(obj); + return has(keys, val); + } - if (isInside && prev.type === 'brace') { - prev.text = prev.text || ''; - prev.text += val; + if (Array.isArray(obj)) { + var arr = obj; + while (len--) { + if (arr.indexOf(val[len]) > -1) { + return true; } + } + return false; + } - var node = pos(new Node({ - type: 'text', - multiplier: 1, - val: val - })); - - return concatNodes.call(this, pos, node, prev, options); - }); -}; + throw new TypeError('expected an array or object.'); +} /** - * Returns true if the character is an extglob character. + * Cast the given value to an array. + * + * ```js + * arrayify('foo'); + * //=> ['foo'] + * + * arrayify(['foo']); + * //=> ['foo'] + * ``` + * + * @param {String|Array} `val` + * @return {Array} */ -function isExtglobChar(ch) { - return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+'; +function arrayify(val) { + return val ? (Array.isArray(val) ? val : [val]) : []; } /** - * Combine text nodes, and calculate empty sets (`{,,}`) - * @param {Function} `pos` Function to calculate node position - * @param {Object} `node` AST node - * @return {Object} + * Returns true if a value has a `contructor` + * + * ```js + * hasConstructor({}); + * //=> true + * + * hasConstructor(Object.create(null)); + * //=> false + * ``` + * @param {Object} `value` + * @return {Boolean} */ -function concatNodes(pos, node, parent, options) { - node.orig = node.val; - var prev = this.prev(); - var last = utils.last(prev.nodes); - var isEscaped = false; - - if (node.val.length > 1) { - var a = node.val.charAt(0); - var b = node.val.slice(-1); - - isEscaped = (a === '"' && b === '"') - || (a === "'" && b === "'") - || (a === '`' && b === '`'); - } +function hasConstructor(val) { + return isObject(val) && typeof val.constructor !== 'undefined'; +} - if (isEscaped && options.unescape !== false) { - node.val = node.val.slice(1, node.val.length - 1); - node.escaped = true; - } +/** + * Get the native `ownPropertyNames` from the constructor of the + * given `object`. An empty array is returned if the object does + * not have a constructor. + * + * ```js + * nativeKeys({a: 'b', b: 'c', c: 'd'}) + * //=> ['a', 'b', 'c'] + * + * nativeKeys(function(){}) + * //=> ['length', 'caller'] + * ``` + * + * @param {Object} `obj` Object that has a `constructor`. + * @return {Array} Array of keys. + */ - if (node.match) { - var match = node.match[1]; - if (!match || match.indexOf('}') === -1) { - match = node.match[0]; - } +function nativeKeys(val) { + if (!hasConstructor(val)) return []; + return Object.getOwnPropertyNames(val); +} - // replace each set with a single "," - var val = match.replace(/\{/g, ',').replace(/\}/g, ''); - node.multiplier *= val.length; - node.val = ''; - } +/** + * Expose `copy` + */ - var simpleText = last.type === 'text' - && last.multiplier === 1 - && node.multiplier === 1 - && node.val; +module.exports = copy; - if (simpleText) { - last.val += node.val; - return; - } +/** + * Expose `copy.has` for tests + */ - prev.push(node); -} +module.exports.has = has; /***/ }), -/***/ 38640: +/***/ 59248: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/*! + * object-visit + * + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ -var splitString = __webpack_require__(33218); -var utils = module.exports; -/** - * Module dependencies - */ +var isObject = __webpack_require__(96667); -utils.extend = __webpack_require__(92845); -utils.flatten = __webpack_require__(27299); -utils.isObject = __webpack_require__(96667); -utils.fillRange = __webpack_require__(82593); -utils.repeat = __webpack_require__(69523); -utils.unique = __webpack_require__(19009); +module.exports = function visit(thisArg, method, target, val) { + if (!isObject(thisArg) && typeof thisArg !== 'function') { + throw new Error('object-visit expects `thisArg` to be an object.'); + } -utils.define = function(obj, key, val) { - Object.defineProperty(obj, key, { - writable: true, - configurable: true, - enumerable: false, - value: val - }); -}; - -/** - * Returns true if the given string contains only empty brace sets. - */ - -utils.isEmptySets = function(str) { - return /^(?:\{,\})+$/.test(str); -}; - -/** - * Returns true if the given string contains only empty brace sets. - */ - -utils.isQuotedString = function(str) { - var open = str.charAt(0); - if (open === '\'' || open === '"' || open === '`') { - return str.slice(-1) === open; + if (typeof method !== 'string') { + throw new Error('object-visit expects `method` name to be a string'); } - return false; -}; - -/** - * Create the key to use for memoization. The unique key is generated - * by iterating over the options and concatenating key-value pairs - * to the pattern string. - */ -utils.createKey = function(pattern, options) { - var id = pattern; - if (typeof options === 'undefined') { - return id; - } - var keys = Object.keys(options); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - id += ';' + key + '=' + String(options[key]); + if (typeof thisArg[method] !== 'function') { + return thisArg; } - return id; -}; -/** - * Normalize options - */ + var args = [].slice.call(arguments, 3); + target = target || {}; -utils.createOptions = function(options) { - var opts = utils.extend.apply(null, arguments); - if (typeof opts.expand === 'boolean') { - opts.optimize = !opts.expand; - } - if (typeof opts.optimize === 'boolean') { - opts.expand = !opts.optimize; - } - if (opts.optimize === true) { - opts.makeRe = true; + for (var key in target) { + var arr = [key, target[key]].concat(args); + thisArg[method].apply(thisArg, arr); } - return opts; + return thisArg; }; -/** - * Join patterns in `a` to patterns in `b` - */ - -utils.join = function(a, b, options) { - options = options || {}; - a = utils.arrayify(a); - b = utils.arrayify(b); - - if (!a.length) return b; - if (!b.length) return a; - - var len = a.length; - var idx = -1; - var arr = []; - - while (++idx < len) { - var val = a[idx]; - if (Array.isArray(val)) { - for (var i = 0; i < val.length; i++) { - val[i] = utils.join(val[i], b, options); - } - arr.push(val); - continue; - } - - for (var j = 0; j < b.length; j++) { - var bval = b[j]; - - if (Array.isArray(bval)) { - arr.push(utils.join(val, bval, options)); - } else { - arr.push(val + bval); - } - } - } - return arr; -}; -/** - * Split the given string on `,` if not escaped. - */ +/***/ }), -utils.split = function(str, options) { - var opts = utils.extend({sep: ','}, options); - if (typeof opts.keepQuotes !== 'boolean') { - opts.keepQuotes = true; - } - if (opts.unescape === false) { - opts.keepEscaping = true; - } - return splitString(str, opts, utils.escapeBrackets(opts)); -}; +/***/ 38509: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -/** - * Expand ranges or sets in the given `pattern`. +"use strict"; +/*! + * object.pick * - * @param {String} `str` - * @param {Object} `options` - * @return {Object} + * Copyright (c) 2014-2015 Jon Schlinkert, contributors. + * Licensed under the MIT License */ -utils.expand = function(str, options) { - var opts = utils.extend({rangeLimit: 10000}, options); - var segs = utils.split(str, opts); - var tok = { segs: segs }; - - if (utils.isQuotedString(str)) { - return tok; - } - - if (opts.rangeLimit === true) { - opts.rangeLimit = 10000; - } - if (segs.length > 1) { - if (opts.optimize === false) { - tok.val = segs[0]; - return tok; - } - tok.segs = utils.stringifyArray(tok.segs); - } else if (segs.length === 1) { - var arr = str.split('..'); +var isObject = __webpack_require__(96667); - if (arr.length === 1) { - tok.val = tok.segs[tok.segs.length - 1] || tok.val || str; - tok.segs = []; - return tok; - } +module.exports = function pick(obj, keys) { + if (!isObject(obj) && typeof obj !== 'function') { + return {}; + } - if (arr.length === 2 && arr[0] === arr[1]) { - tok.escaped = true; - tok.val = arr[0]; - tok.segs = []; - return tok; + var res = {}; + if (typeof keys === 'string') { + if (keys in obj) { + res[keys] = obj[keys]; } + return res; + } - if (arr.length > 1) { - if (opts.optimize !== false) { - opts.optimize = true; - delete opts.expand; - } - - if (opts.optimize !== true) { - var min = Math.min(arr[0], arr[1]); - var max = Math.max(arr[0], arr[1]); - var step = arr[2] || 1; - - if (opts.rangeLimit !== false && ((max - min) / step >= opts.rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } - } - - arr.push(opts); - tok.segs = utils.fillRange.apply(null, arr); - - if (!tok.segs.length) { - tok.escaped = true; - tok.val = str; - return tok; - } - - if (opts.optimize === true) { - tok.segs = utils.stringifyArray(tok.segs); - } + var len = keys.length; + var idx = -1; - if (tok.segs === '') { - tok.val = str; - } else { - tok.val = tok.segs[0]; - } - return tok; + while (++idx < len) { + var key = keys[idx]; + if (key in obj) { + res[key] = obj[key]; } - } else { - tok.val = str; } - return tok; + return res; }; -/** - * Ensure commas inside brackets and parens are not split. - * @param {Object} `tok` Token from the `split-string` module - * @return {undefined} - */ - -utils.escapeBrackets = function(options) { - return function(tok) { - if (tok.escaped && tok.val === 'b') { - tok.val = '\\b'; - return; - } - - if (tok.val !== '(' && tok.val !== '[') return; - var opts = utils.extend({}, options); - var brackets = []; - var parens = []; - var stack = []; - var val = tok.val; - var str = tok.str; - var i = tok.idx - 1; - - while (++i < str.length) { - var ch = str[i]; - - if (ch === '\\') { - val += (opts.keepEscaping === false ? '' : ch) + str[++i]; - continue; - } - - if (ch === '(') { - parens.push(ch); - stack.push(ch); - } - - if (ch === '[') { - brackets.push(ch); - stack.push(ch); - } - - if (ch === ')') { - parens.pop(); - stack.pop(); - if (!stack.length) { - val += ch; - break; - } - } - if (ch === ']') { - brackets.pop(); - stack.pop(); - if (!stack.length) { - val += ch; - break; - } - } - val += ch; - } +/***/ }), - tok.split = false; - tok.val = val.slice(1); - tok.idx = i; - }; -}; +/***/ 27255: +/***/ (function(module) { -/** - * Returns true if the given string looks like a regex quantifier - * @return {Boolean} +/*! + * pascalcase + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. */ -utils.isQuantifier = function(str) { - return /^(?:[0-9]?,[0-9]|[0-9],)$/.test(str); -}; +function pascalcase(str) { + if (typeof str !== 'string') { + throw new TypeError('expected a string.'); + } + str = str.replace(/([A-Z])/g, ' $1'); + if (str.length === 1) { return str.toUpperCase(); } + str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase(); + str = str.charAt(0).toUpperCase() + str.slice(1); + return str.replace(/[\W_]+(\w|$)/g, function (_, ch) { + return ch.toUpperCase(); + }); +} -/** - * Cast `val` to an array. - * @param {*} `val` - */ +module.exports = pascalcase; -utils.stringifyArray = function(arr) { - return [utils.arrayify(arr).join('|')]; -}; -/** - * Cast `val` to an array. - * @param {*} `val` - */ +/***/ }), -utils.arrayify = function(arr) { - if (typeof arr === 'undefined') { - return []; - } - if (typeof arr === 'string') { - return [arr]; - } - return arr; -}; +/***/ 88412: +/***/ (function(module) { -/** - * Returns true if the given `str` is a non-empty string - * @return {Boolean} - */ +"use strict"; -utils.isString = function(str) { - return str != null && typeof str === 'string'; -}; /** - * Get the last element from `array` - * @param {Array} `array` - * @return {*} + * POSIX character classes */ -utils.last = function(arr, n) { - return arr[arr.length - (n || 1)]; -}; - -utils.escapeRegex = function(str) { - return str.replace(/\\?([!^*?()[\]{}+?/])/g, '\\$1'); +module.exports = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' }; /***/ }), -/***/ 92845: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 58404: +/***/ (function(module) { "use strict"; -var isObject = __webpack_require__(4585); - -module.exports = function extend(o/*, objects*/) { - if (!isObject(o)) { o = {}; } - - var len = arguments.length; - for (var i = 1; i < len; i++) { - var obj = arguments[i]; +if (typeof process === 'undefined' || + !process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process +} - if (isObject(obj)) { - assign(o, obj); - } +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); } - return o; -}; - -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); } } -/** - * Returns true if the given `key` is an own property of `obj`. - */ - -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} /***/ }), -/***/ 4585: +/***/ 59570: /***/ (function(module) { -"use strict"; /*! - * is-extendable - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ + * prr + * (c) 2013 Rod Vagg + * https://github.com/rvagg/prr + * License: MIT + */ + +(function (name, context, definition) { + if ( true && module.exports) + module.exports = definition() + else + context[name] = definition() +})('prr', this, function() { + + var setProperty = typeof Object.defineProperty == 'function' + ? function (obj, key, options) { + Object.defineProperty(obj, key, options) + return obj + } + : function (obj, key, options) { // < es5 + obj[key] = options.value + return obj + } + + , makeOptions = function (value, options) { + var oo = typeof options == 'object' + , os = !oo && typeof options == 'string' + , op = function (p) { + return oo + ? !!options[p] + : os + ? options.indexOf(p[0]) > -1 + : false + } + + return { + enumerable : op('enumerable') + , configurable : op('configurable') + , writable : op('writable') + , value : value + } + } + , prr = function (obj, key, value, options) { + var k + options = makeOptions(value, options) -module.exports = function isExtendable(val) { - return typeof val !== 'undefined' && val !== null - && (typeof val === 'object' || typeof val === 'function'); -}; + if (typeof key == 'object') { + for (k in key) { + if (Object.hasOwnProperty.call(key, k)) { + options.value = key[k] + setProperty(obj, k, options) + } + } + return obj + } + + return setProperty(obj, key, options) + } + return prr +}) /***/ }), -/***/ 35851: +/***/ 79822: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; -/*! - * define-property - * - * Copyright (c) 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ +module.exports = __webpack_require__(76417).randomBytes +/***/ }), -var isobject = __webpack_require__(96667); -var isDescriptor = __webpack_require__(44133); -var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) - ? Reflect.defineProperty - : Object.defineProperty; +/***/ 42770: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -module.exports = function defineProperty(obj, key, val) { - if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) { - throw new TypeError('expected an object, function, or array'); - } - - if (typeof key !== 'string') { - throw new TypeError('expected "key" to be a string'); - } +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (isDescriptor(val)) { - define(obj, key, val); - return obj; - } +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. - define(obj, key, { - configurable: true, - enumerable: false, - writable: true, - value: val - }); - return obj; -}; +/**/ -/***/ }), +var pna = __webpack_require__(58404); +/**/ -/***/ 3767: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ -"use strict"; +module.exports = Duplex; +/**/ +var util = Object.create(__webpack_require__(78334)); +util.inherits = __webpack_require__(2989); +/**/ -var isExtendable = __webpack_require__(98775); -var assignSymbols = __webpack_require__(64353); +var Readable = __webpack_require__(79341); +var Writable = __webpack_require__(78063); -module.exports = Object.assign || function(obj/*, objects*/) { - if (obj === null || typeof obj === 'undefined') { - throw new TypeError('Cannot convert undefined or null to object'); - } - if (!isObject(obj)) { - obj = {}; - } - for (var i = 1; i < arguments.length; i++) { - var val = arguments[i]; - if (isString(val)) { - val = toObject(val); - } - if (isObject(val)) { - assign(obj, val); - assignSymbols(obj, val); - } - } - return obj; -}; +util.inherits(Duplex, Readable); -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } -function isString(val) { - return (val && typeof val === 'string'); +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); } -function toObject(str) { - var obj = {}; - for (var i in str) { - obj[i] = str[i]; +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; } - return obj; +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); } -function isObject(val) { - return (val && typeof val === 'object') || isExtendable(val); +function onEndNT(self) { + self.end(); } -/** - * Returns true if the given `key` is an own property of `obj`. - */ +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); -function isEnum(obj, key) { - return Object.prototype.propertyIsEnumerable.call(obj, key); -} +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + pna.nextTick(cb, err); +}; /***/ }), -/***/ 82593: +/***/ 60143: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/*! - * fill-range - * - * Copyright (c) 2014-2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ - +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. -var util = __webpack_require__(31669); -var isNumber = __webpack_require__(87218); -var extend = __webpack_require__(13342); -var repeat = __webpack_require__(6332); -var toRegex = __webpack_require__(11846); -/** - * Return a range of numbers or letters. - * - * @param {String} `start` Start of the range - * @param {String} `stop` End of the range - * @param {String} `step` Increment or decrement to use. - * @param {Function} `fn` Custom function to modify each element in the range. - * @return {Array} - */ -function fillRange(start, stop, step, options) { - if (typeof start === 'undefined') { - return []; - } +module.exports = PassThrough; - if (typeof stop === 'undefined' || start === stop) { - // special case, for handling negative zero - var isString = typeof start === 'string'; - if (isNumber(start) && !toNumber(start)) { - return [isString ? '0' : 0]; - } - return [start]; - } +var Transform = __webpack_require__(62826); - if (typeof step !== 'number' && typeof step !== 'string') { - options = step; - step = undefined; - } +/**/ +var util = Object.create(__webpack_require__(78334)); +util.inherits = __webpack_require__(2989); +/**/ - if (typeof options === 'function') { - options = { transform: options }; - } +util.inherits(PassThrough, Transform); - var opts = extend({step: step}, options); - if (opts.step && !isValidNumber(opts.step)) { - if (opts.strictRanges === true) { - throw new TypeError('expected options.step to be a number'); - } - return []; - } +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); - opts.isNumber = isValidNumber(start) && isValidNumber(stop); - if (!opts.isNumber && !isValid(start, stop)) { - if (opts.strictRanges === true) { - throw new RangeError('invalid range arguments: ' + util.inspect([start, stop])); - } - return []; - } + Transform.call(this, options); +} - opts.isPadded = isPadded(start) || isPadded(stop); - opts.toString = opts.stringify - || typeof opts.step === 'string' - || typeof start === 'string' - || typeof stop === 'string' - || !opts.isNumber; +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; - if (opts.isPadded) { - opts.maxLength = Math.max(String(start).length, String(stop).length); - } +/***/ }), - // support legacy minimatch/fill-range options - if (typeof opts.optimize === 'boolean') opts.toRegex = opts.optimize; - if (typeof opts.makeRe === 'boolean') opts.toRegex = opts.makeRe; - return expand(start, stop, opts); -} +/***/ 79341: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -function expand(start, stop, options) { - var a = options.isNumber ? toNumber(start) : start.charCodeAt(0); - var b = options.isNumber ? toNumber(stop) : stop.charCodeAt(0); +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - var step = Math.abs(toNumber(options.step)) || 1; - if (options.toRegex && step === 1) { - return toRange(a, b, start, stop, options); - } - var zero = {greater: [], lesser: []}; - var asc = a < b; - var arr = new Array(Math.round((asc ? b - a : a - b) / step)); - var idx = 0; - while (asc ? a <= b : a >= b) { - var val = options.isNumber ? a : String.fromCharCode(a); - if (options.toRegex && (val >= 0 || !options.isNumber)) { - zero.greater.push(val); - } else { - zero.lesser.push(Math.abs(val)); - } +/**/ - if (options.isPadded) { - val = zeros(val, options); - } +var pna = __webpack_require__(58404); +/**/ - if (options.toString) { - val = String(val); - } +module.exports = Readable; - if (typeof options.transform === 'function') { - arr[idx++] = options.transform(val, a, b, step, idx, arr, options); - } else { - arr[idx++] = val; - } +/**/ +var isArray = __webpack_require__(21352); +/**/ - if (asc) { - a += step; - } else { - a -= step; - } - } +/**/ +var Duplex; +/**/ - if (options.toRegex === true) { - return toSequence(arr, zero, options); - } - return arr; -} +Readable.ReadableState = ReadableState; -function toRange(a, b, start, stop, options) { - if (options.isPadded) { - return toRegex(start, stop, options); - } +/**/ +var EE = __webpack_require__(28614).EventEmitter; - if (options.isNumber) { - return toRegex(Math.min(a, b), Math.max(a, b), options); - } +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ - var start = String.fromCharCode(Math.min(a, b)); - var stop = String.fromCharCode(Math.max(a, b)); - return '[' + start + '-' + stop + ']'; -} +/**/ +var Stream = __webpack_require__(20681); +/**/ -function toSequence(arr, zeros, options) { - var greater = '', lesser = ''; - if (zeros.greater.length) { - greater = zeros.greater.join('|'); - } - if (zeros.lesser.length) { - lesser = '-(' + zeros.lesser.join('|') + ')'; - } - var res = greater && lesser - ? greater + '|' + lesser - : greater || lesser; +/**/ - if (options.capture) { - return '(' + res + ')'; - } - return res; +var Buffer = __webpack_require__(96788).Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); } - -function zeros(val, options) { - if (options.isPadded) { - var str = String(val); - var len = str.length; - var dash = ''; - if (str.charAt(0) === '-') { - dash = '-'; - str = str.slice(1); - } - var diff = options.maxLength - len; - var pad = repeat('0', diff); - val = (dash + pad + str); - } - if (options.stringify) { - return String(val); - } - return val; +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } -function toNumber(val) { - return Number(val) || 0; -} +/**/ -function isPadded(str) { - return /^-?0\d/.test(str); -} +/**/ +var util = Object.create(__webpack_require__(78334)); +util.inherits = __webpack_require__(2989); +/**/ -function isValid(min, max) { - return (isValidNumber(min) || isValidLetter(min)) - && (isValidNumber(max) || isValidLetter(max)); +/**/ +var debugUtil = __webpack_require__(31669); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; } +/**/ -function isValidLetter(ch) { - return typeof ch === 'string' && ch.length === 1 && /^\w+$/.test(ch); -} +var BufferList = __webpack_require__(28878); +var destroyImpl = __webpack_require__(87915); +var StringDecoder; -function isValidNumber(n) { - return isNumber(n) && !/\./.test(n); -} +util.inherits(Readable, Stream); -/** - * Expose `fillRange` - * @type {Function} - */ +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; -module.exports = fillRange; +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} -/***/ }), +function ReadableState(options, stream) { + Duplex = Duplex || __webpack_require__(42770); -/***/ 13342: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + options = options || {}; -"use strict"; + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; -var isObject = __webpack_require__(27244); + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; -module.exports = function extend(o/*, objects*/) { - if (!isObject(o)) { o = {}; } + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; - var len = arguments.length; - for (var i = 1; i < len; i++) { - var obj = arguments[i]; + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - if (isObject(obj)) { - assign(o, obj); - } - } - return o; -}; + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; -/** - * Returns true if the given `key` is an own property of `obj`. - */ + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + // has it been destroyed + this.destroyed = false; -/***/ }), + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; -/***/ 27244: -/***/ (function(module) { + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; -"use strict"; -/*! - * is-extendable - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = __webpack_require__(7395)/* .StringDecoder */ .s; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} +function Readable(options) { + Duplex = Duplex || __webpack_require__(42770); -module.exports = function isExtendable(val) { - return typeof val !== 'undefined' && val !== null - && (typeof val === 'object' || typeof val === 'function'); -}; + if (!(this instanceof Readable)) return new Readable(options); + this._readableState = new ReadableState(options, this); -/***/ }), + // legacy + this.readable = true; -/***/ 98775: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if (options) { + if (typeof options.read === 'function') this._read = options.read; -"use strict"; -/*! - * is-extendable - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + Stream.call(this); +} +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } -var isPlainObject = __webpack_require__(81064); + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); -module.exports = function isExtendable(val) { - return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); }; +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; -/***/ }), - -/***/ 19613: -/***/ (function(module) { - -var toString = Object.prototype.toString; - -module.exports = function kindOf(val) { - if (val === void 0) return 'undefined'; - if (val === null) return 'null'; - - var type = typeof val; - if (type === 'boolean') return 'boolean'; - if (type === 'string') return 'string'; - if (type === 'number') return 'number'; - if (type === 'symbol') return 'symbol'; - if (type === 'function') { - return isGeneratorFn(val) ? 'generatorfunction' : 'function'; + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; } - if (isArray(val)) return 'array'; - if (isBuffer(val)) return 'buffer'; - if (isArguments(val)) return 'arguments'; - if (isDate(val)) return 'date'; - if (isError(val)) return 'error'; - if (isRegexp(val)) return 'regexp'; - - switch (ctorName(val)) { - case 'Symbol': return 'symbol'; - case 'Promise': return 'promise'; - - // Set, Map, WeakSet, WeakMap - case 'WeakMap': return 'weakmap'; - case 'WeakSet': return 'weakset'; - case 'Map': return 'map'; - case 'Set': return 'set'; - - // 8-bit typed arrays - case 'Int8Array': return 'int8array'; - case 'Uint8Array': return 'uint8array'; - case 'Uint8ClampedArray': return 'uint8clampedarray'; - - // 16-bit typed arrays - case 'Int16Array': return 'int16array'; - case 'Uint16Array': return 'uint16array'; + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; - // 32-bit typed arrays - case 'Int32Array': return 'int32array'; - case 'Uint32Array': return 'uint32array'; - case 'Float32Array': return 'float32array'; - case 'Float64Array': return 'float64array'; - } +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; - if (isGeneratorObj(val)) { - return 'generator'; - } +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } - // Non-plain objects - type = toString.call(val); - switch (type) { - case '[object Object]': return 'object'; - // iterators - case '[object Map Iterator]': return 'mapiterator'; - case '[object Set Iterator]': return 'setiterator'; - case '[object String Iterator]': return 'stringiterator'; - case '[object Array Iterator]': return 'arrayiterator'; + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } } - // other - return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); -}; - -function ctorName(val) { - return typeof val.constructor === 'function' ? val.constructor.name : null; + return needMoreData(state); } -function isArray(val) { - if (Array.isArray) return Array.isArray(val); - return val instanceof Array; -} +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); -function isError(val) { - return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); } -function isDate(val) { - if (val instanceof Date) return true; - return typeof val.toDateString === 'function' - && typeof val.getDate === 'function' - && typeof val.setDate === 'function'; +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; } -function isRegexp(val) { - if (val instanceof RegExp) return true; - return typeof val.flags === 'string' - && typeof val.ignoreCase === 'boolean' - && typeof val.multiline === 'boolean' - && typeof val.global === 'boolean'; +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } -function isGeneratorFn(name, val) { - return ctorName(name) === 'GeneratorFunction'; -} +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; -function isGeneratorObj(val) { - return typeof val.throw === 'function' - && typeof val.return === 'function' - && typeof val.next === 'function'; -} +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = __webpack_require__(7395)/* .StringDecoder */ .s; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; -function isArguments(val) { - try { - if (typeof val.length === 'number' && typeof val.callee === 'function') { - return true; - } - } catch (err) { - if (err.message.indexOf('callee') !== -1) { - return true; - } +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; } - return false; + return n; } -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - if (val.constructor && typeof val.constructor.isBuffer === 'function') { - return val.constructor.isBuffer(val); +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } - return false; + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; } +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; -/***/ }), + if (n !== 0) state.emittedReadable = false; -/***/ 11846: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } -"use strict"; -/*! - * to-regex-range - * - * Copyright (c) 2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ + n = howMuchToRead(n, state); + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. -var repeat = __webpack_require__(6332); -var isNumber = __webpack_require__(87218); -var cache = {}; + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); -function toRegexRange(min, max, options) { - if (isNumber(min) === false) { - throw new RangeError('toRegexRange: first argument is invalid.'); + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); } - if (typeof max === 'undefined' || min === max) { - return String(min); + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); } - if (isNumber(max) === false) { - throw new RangeError('toRegexRange: second argument is invalid.'); - } + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; - options = options || {}; - var relax = String(options.relaxZeros); - var shorthand = String(options.shorthand); - var capture = String(options.capture); - var key = min + ':' + max + '=' + relax + shorthand + capture; - if (cache.hasOwnProperty(key)) { - return cache[key].result; + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; } - var a = Math.min(min, max); - var b = Math.max(min, max); + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; - if (Math.abs(a - b) === 1) { - var result = min + '|' + max; - if (options.capture) { - return '(' + result + ')'; - } - return result; + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); } - var isPadded = padding(min) || padding(max); - var positives = []; - var negatives = []; - - var tok = {min: min, max: max, a: a, b: b}; - if (isPadded) { - tok.isPadded = isPadded; - tok.maxLen = String(tok.max).length; - } + if (ret !== null) this.emit('data', ret); - if (a < 0) { - var newMin = b < 0 ? Math.abs(b) : 1; - var newMax = Math.abs(a); - negatives = splitToPatterns(newMin, newMax, tok, options); - a = tok.a = 0; - } + return ret; +}; - if (b >= 0) { - positives = splitToPatterns(a, b, tok, options); +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } } + state.ended = true; - tok.negatives = negatives; - tok.positives = positives; - tok.result = siftPatterns(negatives, positives, options); + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} - if (options.capture && (positives.length + negatives.length) > 1) { - tok.result = '(' + tok.result + ')'; +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } - - cache[key] = tok; - return tok.result; } -function siftPatterns(neg, pos, options) { - var onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; - var onlyPositive = filterPatterns(pos, neg, '', false, options) || []; - var intersected = filterPatterns(neg, pos, '-?', true, options) || []; - var subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); - return subpatterns.join('|'); +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); } -function splitToRanges(min, max) { - min = Number(min); - max = Number(max); - - var nines = 1; - var stops = [max]; - var stop = +countNines(min, nines); - - while (min <= stop && stop <= max) { - stops = push(stops, stop); - nines += 1; - stop = +countNines(min, nines); - } - - var zeros = 1; - stop = countZeros(max + 1, zeros) - 1; - - while (min < stop && stop <= max) { - stops = push(stops, stop); - zeros += 1; - stop = countZeros(max + 1, zeros) - 1; +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); } - - stops.sort(compare); - return stops; } -/** - * Convert a range to a regex pattern - * @param {Number} `start` - * @param {Number} `stop` - * @return {String} - */ - -function rangeToPattern(start, stop, options) { - if (start === stop) { - return {pattern: String(start), digits: []}; +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; } + state.readingMore = false; +} - var zipped = zip(String(start), String(stop)); - var len = zipped.length, i = -1; +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; - var pattern = ''; - var digits = 0; +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; - while (++i < len) { - var numbers = zipped[i]; - var startDigit = numbers[0]; - var stopDigit = numbers[1]; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - if (startDigit === stopDigit) { - pattern += startDigit; + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - } else if (startDigit !== '0' || stopDigit !== '9') { - pattern += toCharacterClass(startDigit, stopDigit); + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - } else { - digits += 1; + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } } } - if (digits) { - pattern += options.shorthand ? '\\d' : '[0-9]'; + function onend() { + debug('onend'); + dest.end(); } - return { pattern: pattern, digits: [digits] }; -} + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); -function splitToPatterns(min, max, tok, options) { - var ranges = splitToRanges(min, max); - var len = ranges.length; - var idx = -1; + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); - var tokens = []; - var start = min; - var prev; + cleanedUp = true; - while (++idx < len) { - var range = ranges[idx]; - var obj = rangeToPattern(start, range, options); - var zeros = ''; + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } - if (!tok.isPadded && prev && prev.pattern === obj.pattern) { - if (prev.digits.length > 1) { - prev.digits.pop(); + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; } - prev.digits.push(obj.digits[0]); - prev.string = prev.pattern + toQuantifier(prev.digits); - start = range + 1; - continue; - } - - if (tok.isPadded) { - zeros = padZeros(range, tok); + src.pause(); } - - obj.string = zeros + obj.pattern + toQuantifier(obj.digits); - tokens.push(obj); - start = range + 1; - prev = obj; } - return tokens; -} - -function filterPatterns(arr, comparison, prefix, intersection, options) { - var res = []; - - for (var i = 0; i < arr.length; i++) { - var tok = arr[i]; - var ele = tok.string; - - if (options.relaxZeros !== false) { - if (prefix === '-' && ele.charAt(0) === '0') { - if (ele.charAt(1) === '{') { - ele = '0*' + ele.replace(/^0\{\d+\}/, ''); - } else { - ele = '0*' + ele.slice(1); - } - } - } + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } - if (!intersection && !contains(comparison, 'string', ele)) { - res.push(prefix + ele); - } + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); - if (intersection && contains(comparison, 'string', ele)) { - res.push(prefix + ele); - } + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); } - return res; -} + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); -/** - * Zip strings (`for in` can be used on string characters) - */ + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } -function zip(a, b) { - var arr = []; - for (var ch in a) arr.push([a[ch], b[ch]]); - return arr; -} + // tell the dest that it's being piped to + dest.emit('pipe', src); -function compare(a, b) { - return a > b ? 1 : b > a ? -1 : 0; -} + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } -function push(arr, ele) { - if (arr.indexOf(ele) === -1) arr.push(ele); - return arr; -} + return dest; +}; -function contains(arr, key, val) { - for (var i = 0; i < arr.length; i++) { - if (arr[i][key] === val) { - return true; +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); } - } - return false; -} - -function countNines(min, len) { - return String(min).slice(0, -len) + repeat('9', len); + }; } -function countZeros(integer, zeros) { - return integer - (integer % Math.pow(10, zeros)); -} +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; -function toQuantifier(digits) { - var start = digits[0]; - var stop = digits[1] ? (',' + digits[1]) : ''; - if (!stop && (!start || start === 1)) { - return ''; - } - return '{' + start + stop + '}'; -} + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; -function toCharacterClass(a, b) { - return '[' + a + ((b - a === 1) ? '' : '-') + b + ']'; -} + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; -function padding(str) { - return /^-?(0+)\d/.exec(str); -} + if (!dest) dest = state.pipes; -function padZeros(val, tok) { - if (tok.isPadded) { - var diff = Math.abs(tok.maxLen - String(val).length); - switch (diff) { - case 0: - return ''; - case 1: - return '0'; - default: { - return '0{' + diff + '}'; - } - } + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; } - return val; -} -/** - * Expose `toRegexRange` - */ + // slow case. multiple pipe destinations. -module.exports = toRegexRange; + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } -/***/ }), + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; -/***/ 4870: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; -"use strict"; + dest.emit('unpipe', this, unpipeInfo); + return this; +}; -var isExtendable = __webpack_require__(29502); -var forIn = __webpack_require__(43086); +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); -function mixinDeep(target, objects) { - var len = arguments.length, i = 0; - while (++i < len) { - var obj = arguments[i]; - if (isObject(obj)) { - forIn(obj, copy, target); + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } } } - return target; -} -/** - * Copy properties from the source object to the - * target object. - * - * @param {*} `val` - * @param {String} `key` - */ + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; -function copy(val, key) { - if (!isValidKey(key)) { - return; +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); } + return this; +}; - var obj = this[key]; - if (isObject(val) && isObject(obj)) { - mixinDeep(obj, val); - } else { - this[key] = val; +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); } } -/** - * Returns true if `val` is an object or function. - * - * @param {any} val - * @return {Boolean} - */ +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } -function isObject(val) { - return isExtendable(val) && !Array.isArray(val); + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); } -/** - * Returns true if `key` is a valid key to use when extending objects. - * - * @param {String} `key` - * @return {Boolean} - */ - -function isValidKey(key) { - return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'; +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; }; -/** - * Expose `mixinDeep` - */ - -module.exports = mixinDeep; - +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} -/***/ }), +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; -/***/ 29502: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + var state = this._readableState; + var paused = false; -"use strict"; -/*! - * is-extendable - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + _this.push(null); + }); + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); -var isPlainObject = __webpack_require__(81064); + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; -module.exports = function isExtendable(val) { - return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); -}; + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } -/***/ }), + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } -/***/ 50998: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; -var path = __webpack_require__(85622); -var fs = __webpack_require__(35747); -var _0777 = parseInt('0777', 8); + return this; +}; -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); -function mkdirP (p, opts, f, made) { - if (typeof opts === 'function') { - f = opts; - opts = {}; - } - else if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 - } - if (!made) made = null; - - var cb = f || function () {}; - p = path.resolve(p); - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - if (path.dirname(p) === p) return cb(er); - mkdirP(path.dirname(p), opts, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, opts, cb, made); - }); - break; +// exposed for testing purposes only. +Readable._fromList = fromList; - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; } -mkdirP.sync = function sync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; } - if (!made) made = null; + ++c; + } + list.length -= c; + return ret; +} - p = path.resolve(p); +function endReadable(stream) { + var state = stream._readableState; - try { - xfs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), opts, made); - sync(p, opts, made); - break; + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = xfs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} - return made; -}; +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} /***/ }), -/***/ 57925: +/***/ 62826: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. -/** - * Module dependencies - */ -var util = __webpack_require__(31669); -var toRegex = __webpack_require__(51279); -var extend = __webpack_require__(69148); +module.exports = Transform; -/** - * Local dependencies - */ +var Duplex = __webpack_require__(42770); -var compilers = __webpack_require__(4756); -var parsers = __webpack_require__(5333); -var cache = __webpack_require__(58250); -var utils = __webpack_require__(41340); -var MAX_LENGTH = 1024 * 64; +/**/ +var util = Object.create(__webpack_require__(78334)); +util.inherits = __webpack_require__(2989); +/**/ -/** - * The main function takes a list of strings and one or more - * glob patterns to use for matching. - * - * ```js - * var nm = require('nanomatch'); - * nm(list, patterns[, options]); - * - * console.log(nm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {Array} `list` A list of strings to match - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ +util.inherits(Transform, Duplex); -function nanomatch(list, patterns, options) { - patterns = utils.arrayify(patterns); - list = utils.arrayify(list); +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; - var len = patterns.length; - if (list.length === 0 || len === 0) { - return []; - } + var cb = ts.writecb; - if (len === 1) { - return nanomatch.match(list, patterns[0], options); + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); } - var negated = false; - var omit = []; - var keep = []; - var idx = -1; + ts.writechunk = null; + ts.writecb = null; - while (++idx < len) { - var pattern = patterns[idx]; + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); - if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) { - omit.push.apply(omit, nanomatch.match(list, pattern.slice(1), options)); - negated = true; - } else { - keep.push.apply(keep, nanomatch.match(list, pattern, options)); - } - } + cb(er); - // minimatch.match parity - if (negated && keep.length === 0) { - if (options && options.unixify === false) { - keep = list.slice(); - } else { - var unixify = utils.unixify(options); - for (var i = 0; i < list.length; i++) { - keep.push(unixify(list[i])); - } - } + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); } +} - var matches = utils.diff(keep, omit); - if (!options || options.nodupes !== false) { - return utils.unique(matches); - } +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); - return matches; -} + Duplex.call(this, options); -/** - * Similar to the main function, but `pattern` must be a string. - * - * ```js - * var nm = require('nanomatch'); - * nm.match(list, pattern[, options]); - * - * console.log(nm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); - * //=> ['a.a', 'a.aa'] - * ``` - * @param {Array} `list` Array of strings to match - * @param {String} `pattern` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of matches - * @api public - */ + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; -nanomatch.match = function(list, pattern, options) { - if (Array.isArray(pattern)) { - throw new TypeError('expected pattern to be a string'); - } + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; - var unixify = utils.unixify(options); - var isMatch = memoize('match', pattern, options, nanomatch.matcher); - var matches = []; + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; - list = utils.arrayify(list); - var len = list.length; - var idx = -1; + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; - while (++idx < len) { - var ele = list[idx]; - if (ele === pattern || isMatch(ele)) { - matches.push(utils.value(ele, unixify, options)); - } + if (typeof options.flush === 'function') this._flush = options.flush; } - // if no options were passed, uniquify results and return - if (typeof options === 'undefined') { - return utils.unique(matches); - } + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} - if (matches.length === 0) { - if (options.failglob === true) { - throw new Error('no matches found for "' + pattern + '"'); - } - if (options.nonull === true || options.nullglob === true) { - return [options.unescape ? utils.unescape(pattern) : pattern]; - } - } +function prefinish() { + var _this = this; - // if `opts.ignore` was defined, diff ignored list - if (options.ignore) { - matches = nanomatch.not(matches, options.ignore, options); + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); } +} - return options.nodupes !== false ? utils.unique(matches) : matches; +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); }; -/** - * Returns true if the specified `string` matches the given glob `pattern`. - * - * ```js - * var nm = require('nanomatch'); - * nm.isMatch(string, pattern[, options]); - * - * console.log(nm.isMatch('a.a', '*.a')); - * //=> true - * console.log(nm.isMatch('a.b', '*.a')); - * //=> false - * ``` - * @param {String} `string` String to match - * @param {String} `pattern` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the string matches the glob pattern. - * @api public - */ +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; -nanomatch.isMatch = function(str, pattern, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } +}; - if (utils.isEmptyString(str) || utils.isEmptyString(pattern)) { - return false; - } +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; - var equals = utils.equalsPattern(options); - if (equals(str)) { - return true; + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } +}; - var isMatch = memoize('isMatch', pattern, options, nanomatch.matcher); - return isMatch(str); +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); }; -/** - * Returns true if some of the elements in the given `list` match any of the - * given glob `patterns`. - * - * ```js - * var nm = require('nanomatch'); - * nm.some(list, patterns[, options]); - * - * console.log(nm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(nm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ +function done(stream, er, data) { + if (er) return stream.emit('error', er); -nanomatch.some = function(list, patterns, options) { - if (typeof list === 'string') { - list = [list]; - } + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); - for (var i = 0; i < list.length; i++) { - if (nanomatch(list[i], patterns, options).length === 1) { - return true; - } - } + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - return false; -}; + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); -/** - * Returns true if every element in the given `list` matches - * at least one of the given glob `patterns`. - * - * ```js - * var nm = require('nanomatch'); - * nm.every(list, patterns[, options]); - * - * console.log(nm.every('foo.js', ['foo.js'])); - * // true - * console.log(nm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(nm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(nm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ + return stream.push(null); +} -nanomatch.every = function(list, patterns, options) { - if (typeof list === 'string') { - list = [list]; - } +/***/ }), - for (var i = 0; i < list.length; i++) { - if (nanomatch(list[i], patterns, options).length !== 1) { - return false; - } - } +/***/ 78063: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - return true; -}; +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -/** - * Returns true if **any** of the given glob `patterns` - * match the specified `string`. - * - * ```js - * var nm = require('nanomatch'); - * nm.any(string, patterns[, options]); - * - * console.log(nm.any('a.a', ['b.*', '*.a'])); - * //=> true - * console.log(nm.any('a.a', 'b.*')); - * //=> false - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. -nanomatch.any = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { - return false; - } - if (typeof patterns === 'string') { - patterns = [patterns]; - } +/**/ - for (var i = 0; i < patterns.length; i++) { - if (nanomatch.isMatch(str, patterns[i], options)) { - return true; - } - } - return false; -}; +var pna = __webpack_require__(58404); +/**/ -/** - * Returns true if **all** of the given `patterns` - * match the specified string. - * - * ```js - * var nm = require('nanomatch'); - * nm.all(string, patterns[, options]); - * - * console.log(nm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(nm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(nm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(nm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ +module.exports = Writable; -nanomatch.all = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} - if (typeof patterns === 'string') { - patterns = [patterns]; - } +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; - for (var i = 0; i < patterns.length; i++) { - if (!nanomatch.isMatch(str, patterns[i], options)) { - return false; - } - } - return true; -}; + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * var nm = require('nanomatch'); - * nm.not(list, patterns[, options]); - * - * console.log(nm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ -nanomatch.not = function(list, patterns, options) { - var opts = extend({}, options); - var ignore = opts.ignore; - delete opts.ignore; +/**/ +var Duplex; +/**/ - list = utils.arrayify(list); +Writable.WritableState = WritableState; - var matches = utils.diff(list, nanomatch(list, patterns, opts)); - if (ignore) { - matches = utils.diff(matches, nanomatch(list, ignore)); - } +/**/ +var util = Object.create(__webpack_require__(78334)); +util.inherits = __webpack_require__(2989); +/**/ - return opts.nodupes !== false ? utils.unique(matches) : matches; +/**/ +var internalUtil = { + deprecate: __webpack_require__(92262) }; +/**/ -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var nm = require('nanomatch'); - * nm.contains(string, pattern[, options]); - * - * console.log(nm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(nm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the patter matches any part of `str`. - * @api public - */ +/**/ +var Stream = __webpack_require__(20681); +/**/ -nanomatch.contains = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } +/**/ - if (typeof patterns === 'string') { - if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { - return false; - } +var Buffer = __webpack_require__(96788).Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} - var equals = utils.equalsPattern(patterns, options); - if (equals(str)) { - return true; - } - var contains = utils.containsPattern(patterns, options); - if (contains(str)) { - return true; - } - } +/**/ - var opts = extend({}, options, {contains: true}); - return nanomatch.any(str, patterns, opts); -}; +var destroyImpl = __webpack_require__(87915); -/** - * Returns true if the given pattern and options should enable - * the `matchBase` option. - * @return {Boolean} - * @api private - */ +util.inherits(Writable, Stream); -nanomatch.matchBase = function(pattern, options) { - if (pattern && pattern.indexOf('/') !== -1 || !options) return false; - return options.basename === true || options.matchBase === true; -}; +function nop() {} -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * var nm = require('nanomatch'); - * nm.matchKeys(object, patterns[, options]); - * - * var obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(nm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ +function WritableState(options, stream) { + Duplex = Duplex || __webpack_require__(42770); -nanomatch.matchKeys = function(obj, patterns, options) { - if (!utils.isObject(obj)) { - throw new TypeError('expected the first argument to be an object'); - } - var keys = nanomatch(Object.keys(obj), patterns, options); - return utils.pick(obj, keys); -}; + options = options || {}; -/** - * Returns a memoized matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * var nm = require('nanomatch'); - * nm.matcher(pattern[, options]); - * - * var isMatch = nm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); - * //=> false - * console.log(isMatch('a.b')); - * //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` See available [options](#options) for changing how matches are performed. - * @return {Function} Returns a matcher function. - * @api public - */ + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; -nanomatch.matcher = function matcher(pattern, options) { - if (utils.isEmptyString(pattern)) { - return function() { - return false; - }; - } + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; - if (Array.isArray(pattern)) { - return compose(pattern, options, matcher); - } + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - // if pattern is a regex - if (pattern instanceof RegExp) { - return test(pattern); - } + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; - // if pattern is invalid - if (!utils.isString(pattern)) { - throw new TypeError('expected pattern to be an array, string or regex'); - } + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - // if pattern is a non-glob string - if (!utils.hasSpecialChars(pattern)) { - if (options && options.nocase === true) { - pattern = pattern.toLowerCase(); - } - return utils.matchPath(pattern, options); - } + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); - // if pattern is a glob string - var re = nanomatch.makeRe(pattern, options); + // if _final has been called + this.finalCalled = false; - // if `options.matchBase` or `options.basename` is defined - if (nanomatch.matchBase(pattern, options)) { - return utils.matchBasename(re, options); - } + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; - function test(regex) { - var equals = utils.equalsPattern(options); - var unixify = utils.unixify(options); + // has it been destroyed + this.destroyed = false; - return function(str) { - if (equals(str)) { - return true; - } + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; - if (regex.test(unixify(str))) { - return true; - } - return false; - }; - } + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - // create matcher function - var matcherFn = test(re); - // set result object from compiler on matcher function, - // as a non-enumerable property. useful for debugging - utils.define(matcherFn, 'result', re.result); - return matcherFn; -}; + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; -/** - * Returns an array of matches captured by `pattern` in `string, or - * `null` if the pattern did not match. - * - * ```js - * var nm = require('nanomatch'); - * nm.capture(pattern, string[, options]); - * - * console.log(nm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(nm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `pattern` Glob pattern to use for matching. - * @param {String} `string` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. - * @api public - */ + // a flag to see when we're in the middle of a write. + this.writing = false; -nanomatch.capture = function(pattern, str, options) { - var re = nanomatch.makeRe(pattern, extend({capture: true}, options)); - var unixify = utils.unixify(options); + // when true all writes will be buffered until .uncork() call + this.corked = 0; - function match() { - return function(string) { - var match = re.exec(unixify(string)); - if (!match) { - return null; - } + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; - return match.slice(1); - }; - } - - var capture = memoize('capture', pattern, options, match); - return capture(str); -}; + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * var nm = require('nanomatch'); - * nm.makeRe(pattern[, options]); - * - * console.log(nm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` See available [options](#options) for changing how matches are performed. - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; -nanomatch.makeRe = function(pattern, options) { - if (pattern instanceof RegExp) { - return pattern; - } + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; - if (typeof pattern !== 'string') { - throw new TypeError('expected pattern to be a string'); - } + // the amount that is being written when _write is called. + this.writelen = 0; - if (pattern.length > MAX_LENGTH) { - throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); - } + this.bufferedRequest = null; + this.lastBufferedRequest = null; - function makeRe() { - var opts = utils.extend({wrap: false}, options); - var result = nanomatch.create(pattern, opts); - var regex = toRegex(result.output, opts); - utils.define(regex, 'result', result); - return regex; - } + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; - return memoize('makeRe', pattern, options, makeRe); -}; + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; -/** - * Parses the given glob `pattern` and returns an object with the compiled `output` - * and optional source `map`. - * - * ```js - * var nm = require('nanomatch'); - * nm.create(pattern[, options]); - * - * console.log(nm.create('abc/*.js')); - * // { options: { source: 'string', sourcemap: true }, - * // state: {}, - * // compilers: - * // { ... }, - * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', - * // ast: - * // { type: 'root', - * // errors: [], - * // nodes: - * // [ ... ], - * // dot: false, - * // input: 'abc/*.js' }, - * // parsingErrors: [], - * // map: - * // { version: 3, - * // sources: [ 'string' ], - * // names: [], - * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', - * // sourcesContent: [ 'abc/*.js' ] }, - * // position: { line: 1, column: 28 }, - * // content: {}, - * // files: {}, - * // idx: 6 } - * ``` - * @param {String} `pattern` Glob pattern to parse and compile. - * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed. - * @return {Object} Returns an object with the parsed AST, compiled string and optional source map. - * @api public - */ + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; -nanomatch.create = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - function create() { - return nanomatch.compile(nanomatch.parse(pattern, options), options); - } - return memoize('create', pattern, options, create); -}; + // count buffered requests + this.bufferedRequestCount = 0; -/** - * Parse the given `str` with the given `options`. - * - * ```js - * var nm = require('nanomatch'); - * nm.parse(pattern[, options]); - * - * var ast = nm.parse('a/{b,c}/d'); - * console.log(ast); - * // { type: 'root', - * // errors: [], - * // input: 'a/{b,c}/d', - * // nodes: - * // [ { type: 'bos', val: '' }, - * // { type: 'text', val: 'a/' }, - * // { type: 'brace', - * // nodes: - * // [ { type: 'brace.open', val: '{' }, - * // { type: 'text', val: 'b,c' }, - * // { type: 'brace.close', val: '}' } ] }, - * // { type: 'text', val: '/d' }, - * // { type: 'eos', val: '' } ] } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an AST - * @api public - */ + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} -nanomatch.parse = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; } + return out; +}; - function parse() { - var snapdragon = utils.instantiate(null, options); - parsers(snapdragon, options); +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); - var ast = snapdragon.parse(pattern, options); - utils.define(ast, 'snapdragon', snapdragon); - ast.input = pattern; - return ast; - } +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; - return memoize('parse', pattern, options, parse); -}; + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} -/** - * Compile the given `ast` or string with the given `options`. - * - * ```js - * var nm = require('nanomatch'); - * nm.compile(ast[, options]); - * - * var ast = nm.parse('a/{b,c}/d'); - * console.log(nm.compile(ast)); - * // { options: { source: 'string' }, - * // state: {}, - * // compilers: - * // { eos: [Function], - * // noop: [Function], - * // bos: [Function], - * // brace: [Function], - * // 'brace.open': [Function], - * // text: [Function], - * // 'brace.close': [Function] }, - * // output: [ 'a/(b|c)/d' ], - * // ast: - * // { ... }, - * // parsingErrors: [] } - * ``` - * @param {Object|String} `ast` - * @param {Object} `options` - * @return {Object} Returns an object that has an `output` property with the compiled string. - * @api public - */ +function Writable(options) { + Duplex = Duplex || __webpack_require__(42770); -nanomatch.compile = function(ast, options) { - if (typeof ast === 'string') { - ast = nanomatch.parse(ast, options); - } + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. - function compile() { - var snapdragon = utils.instantiate(ast, options); - compilers(snapdragon, options); - return snapdragon.compile(ast, options); + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); } - return memoize('compile', ast.input, options, compile); -}; + this._writableState = new WritableState(options, this); -/** - * Clear the regex cache. - * - * ```js - * nm.clearCache(); - * ``` - * @api public - */ + // legacy. + this.writable = true; -nanomatch.clearCache = function() { - nanomatch.cache.__data__ = {}; -}; + if (options) { + if (typeof options.write === 'function') this._write = options.write; -/** - * Compose a matcher function with the given patterns. - * This allows matcher functions to be compiled once and - * called multiple times. - */ + if (typeof options.writev === 'function') this._writev = options.writev; -function compose(patterns, options, matcher) { - var matchers; + if (typeof options.destroy === 'function') this._destroy = options.destroy; - return memoize('compose', String(patterns), options, function() { - return function(file) { - // delay composition until it's invoked the first time, - // after that it won't be called again - if (!matchers) { - matchers = []; - for (var i = 0; i < patterns.length; i++) { - matchers.push(matcher(patterns[i], options)); - } - } + if (typeof options.final === 'function') this._final = options.final; + } - var len = matchers.length; - while (len--) { - if (matchers[len](file) === true) { - return true; - } - } - return false; - }; - }); + Stream.call(this); } -/** - * Memoize a generated regex or function. A unique key is generated - * from the `type` (usually method name), the `pattern`, and - * user-defined options. - */ +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; -function memoize(type, pattern, options, fn) { - var key = utils.createKey(type + '=' + pattern, options); +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} - if (options && options.cache === false) { - return fn(pattern, options); - } +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; - if (cache.has(type, key)) { - return cache.get(type, key); + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); } - - var val = fn(pattern, options); - cache.set(type, key, val); - return val; + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; } -/** - * Expose compiler, parser and cache on `nanomatch` - */ +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); -nanomatch.compilers = compilers; -nanomatch.parsers = parsers; -nanomatch.cache = cache; + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } -/** - * Expose `nanomatch` - * @type {Function} - */ + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } -module.exports = nanomatch; + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== 'function') cb = nop; -/***/ }), + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } -/***/ 58250: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + return ret; +}; -module.exports = new (__webpack_require__(49908))(); +Writable.prototype.cork = function () { + var state = this._writableState; + state.corked++; +}; -/***/ }), +Writable.prototype.uncork = function () { + var state = this._writableState; -/***/ 4756: -/***/ (function(module) { + if (state.corked) { + state.corked--; -"use strict"; + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; -/** -* Nanomatch compilers -*/ +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} -module.exports = function(nanomatch, options) { - function slash() { - if (options && typeof options.slash === 'string') { - return options.slash; - } - if (options && typeof options.slash === 'function') { - return options.slash.call(nanomatch); - } - return '\\\\/'; +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; } +}); - function star() { - if (options && typeof options.star === 'string') { - return options.star; - } - if (options && typeof options.star === 'function') { - return options.star.call(nanomatch); +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; } - return '[^' + slash() + ']*?'; } + var len = state.objectMode ? 1 : chunk.length; - var ast = nanomatch.ast = nanomatch.parser.ast; - ast.state = nanomatch.parser.state; - nanomatch.compiler.state = ast.state; - nanomatch.compiler - - /** - * Negation / escaping - */ - - .set('not', function(node) { - var prev = this.prev(); - if (this.options.nonegate === true || prev.type !== 'bos') { - return this.emit('\\' + node.val, node); - } - return this.emit(node.val, node); - }) - .set('escape', function(node) { - if (this.options.unescape && /^[-\w_.]/.test(node.val)) { - return this.emit(node.val, node); - } - return this.emit('\\' + node.val, node); - }) - .set('quoted', function(node) { - return this.emit(node.val, node); - }) + state.length += len; - /** - * Regex - */ + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - .set('dollar', function(node) { - if (node.parent.type === 'bracket') { - return this.emit(node.val, node); - } - return this.emit('\\' + node.val, node); - }) + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } - /** - * Dot: "." - */ + return ret; +} - .set('dot', function(node) { - if (node.dotfiles === true) this.dotfiles = true; - return this.emit('\\' + node.val, node); - }) +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - /** - * Slashes: "/" and "\" - */ +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; - .set('backslash', function(node) { - return this.emit(node.val, node); - }) - .set('slash', function(node, nodes, i) { - var val = '[' + slash() + ']'; - var parent = node.parent; - var prev = this.prev(); - - // set "node.hasSlash" to true on all ancestor parens nodes - while (parent.type === 'paren' && !parent.hasSlash) { - parent.hasSlash = true; - parent = parent.parent; - } - - if (prev.addQmark) { - val += '?'; - } - - // word boundary - if (node.rest.slice(0, 2) === '\\b') { - return this.emit(val, node); - } + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} - // globstars - if (node.parsed === '**' || node.parsed === './**') { - this.output = '(?:' + this.output; - return this.emit(val + ')?', node); - } +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} - // negation - if (node.parsed === '!**' && this.options.nonegate !== true) { - return this.emit(val + '?\\b', node); - } - return this.emit(val, node); - }) +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; - /** - * Square brackets - */ + onwriteStateUpdate(state); - .set('bracket', function(node) { - var close = node.close; - var open = !node.escaped ? '[' : '\\['; - var negated = node.negated; - var inner = node.inner; - var val = node.val; + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); - if (node.escaped === true) { - inner = inner.replace(/\\?(\W)/g, '\\$1'); - negated = ''; - } + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - if (inner === ']-') { - inner = '\\]\\-'; - } + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} - if (negated && inner.indexOf('.') === -1) { - inner += '.'; - } - if (negated && inner.indexOf('/') === -1) { - inner += '/'; - } +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} - val = open + negated + inner + close; - return this.emit(val, node); - }) +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} - /** - * Square: "[.]" (only matches a single character in brackets) - */ +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - .set('square', function(node) { - var val = (/^\W/.test(node.val) ? '\\' : '') + node.val; - return this.emit(val, node); - }) + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; - /** - * Question mark: "?" - */ + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; - .set('qmark', function(node) { - var prev = this.prev(); - // don't use "slash" variable so that we always avoid - // matching backslashes and slashes with a qmark - var val = '[^.\\\\/]'; - if (this.options.dot || (prev.type !== 'bos' && prev.type !== 'slash')) { - val = '[^\\\\/]'; - } + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - if (node.parsed.slice(-1) === '(') { - var ch = node.rest.charAt(0); - if (ch === '!' || ch === '=' || ch === ':') { - return this.emit(node.val, node); - } - } + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; - if (node.val.length > 1) { - val += '{' + node.val.length + '}'; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; } - return this.emit(val, node); - }) + } - /** - * Plus - */ + if (entry === null) state.lastBufferedRequest = null; + } - .set('plus', function(node) { - var prev = node.parsed.slice(-1); - if (prev === ']' || prev === ')') { - return this.emit(node.val, node); - } - if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { - return this.emit('\\+', node); - } - var ch = this.output.slice(-1); - if (/\w/.test(ch) && !node.inside) { - return this.emit('+\\+?', node); - } - return this.emit('+', node); - }) + state.bufferedRequest = entry; + state.bufferProcessing = false; +} - /** - * globstar: '**' - */ +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; - .set('globstar', function(node, nodes, i) { - if (!this.output) { - this.state.leadingGlobstar = true; - } +Writable.prototype._writev = null; - var prev = this.prev(); - var before = this.prev(2); - var next = this.next(); - var after = this.next(2); - var type = prev.type; - var val = node.val; +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - if (prev.type === 'slash' && next.type === 'slash') { - if (before.type === 'text') { - this.output += '?'; + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } - if (after.type !== 'text') { - this.output += '\\b'; - } - } - } + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - var parsed = node.parsed; - if (parsed.charAt(0) === '!') { - parsed = parsed.slice(1); - } + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } - var isInside = node.isInside.paren || node.isInside.brace; - if (parsed && type !== 'slash' && type !== 'bos' && !isInside) { - val = star(); - } else { - val = this.options.dot !== true - ? '(?:(?!(?:[' + slash() + ']|^)\\.).)*?' - : '(?:(?!(?:[' + slash() + ']|^)(?:\\.{1,2})($|[' + slash() + ']))(?!\\.{2}).)*?'; - } + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; - if ((type === 'slash' || type === 'bos') && this.options.dot !== true) { - val = '(?!\\.)' + val; - } +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} - if (prev.type === 'slash' && next.type === 'slash' && before.type !== 'text') { - if (after.type === 'text' || after.type === 'star') { - node.addQmark = true; - } - } +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} - if (this.options.capture) { - val = '(' + val + ')'; - } +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} - return this.emit(val, node); - }) +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} - /** - * Star: "*" - */ +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } - .set('star', function(node, nodes, i) { - var prior = nodes[i - 2] || {}; - var prev = this.prev(); - var next = this.next(); - var type = prev.type; + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); - function isStart(n) { - return n.type === 'bos' || n.type === 'slash'; - } +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; - if (this.output === '' && this.options.contains !== true) { - this.output = '(?![' + slash() + '])'; - } +/***/ }), - if (type === 'bracket' && this.options.bash === false) { - var str = next && next.type === 'bracket' ? star() : '*?'; - if (!prev.nodes || prev.nodes[1].type !== 'posix') { - return this.emit(str, node); - } - } +/***/ 28878: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - var prefix = !this.dotfiles && type !== 'text' && type !== 'escape' - ? (this.options.dot ? '(?!(?:^|[' + slash() + '])\\.{1,2}(?:$|[' + slash() + ']))' : '(?!\\.)') - : ''; +"use strict"; - if (isStart(prev) || (isStart(prior) && type === 'not')) { - if (prefix !== '(?!\\.)') { - prefix += '(?!(\\.{2}|\\.[' + slash() + ']))(?=.)'; - } else { - prefix += '(?=.)'; - } - } else if (prefix === '(?!\\.)') { - prefix = ''; - } - if (prev.type === 'not' && prior.type === 'bos' && this.options.dot === true) { - this.output = '(?!\\.)' + this.output; - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var output = prefix + star(); - if (this.options.capture) { - output = '(' + output + ')'; - } +var Buffer = __webpack_require__(96788).Buffer; +var util = __webpack_require__(31669); - return this.emit(output, node); - }) +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} - /** - * Text - */ +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); - .set('text', function(node) { - return this.emit(node.val, node); - }) + this.head = null; + this.tail = null; + this.length = 0; + } - /** - * End-of-string - */ + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; - .set('eos', function(node) { - var prev = this.prev(); - var val = node.val; + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; - this.output = '(?:\\.[' + slash() + '](?=.))?' + this.output; - if (this.state.metachar && prev.type !== 'qmark' && prev.type !== 'slash') { - val += (this.options.contains ? '[' + slash() + ']?' : '(?:[' + slash() + ']|$)'); - } + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; - return this.emit(val, node); - }); + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; - /** - * Allow custom compilers to be passed on options - */ + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; - if (options && typeof options.compilers === 'function') { - options.compilers(nanomatch.compiler); - } -}; + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + return BufferList; +}(); +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} /***/ }), -/***/ 5333: +/***/ 87915: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var regexNot = __webpack_require__(30931); -var toRegex = __webpack_require__(51279); +/**/ -/** - * Characters to use in negation regex (we want to "not" match - * characters that are matched by other parsers) - */ +var pna = __webpack_require__(58404); +/**/ -var cached; -var NOT_REGEX = '[\\[!*+?$^"\'.\\\\/]+'; -var not = createTextRegex(NOT_REGEX); - -/** - * Nanomatch parsers - */ - -module.exports = function(nanomatch, options) { - var parser = nanomatch.parser; - var opts = parser.options; +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; - parser.state = { - slashes: 0, - paths: [] - }; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; - parser.ast.state = parser.state; - parser + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } - /** - * Beginning-of-string - */ + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks - .capture('prefix', function() { - if (this.parsed) return; - var m = this.match(/^\.[\\/]/); - if (!m) return; - this.state.strictOpen = !!this.options.strictOpen; - this.state.addPrefix = true; - }) + if (this._readableState) { + this._readableState.destroyed = true; + } - /** - * Escape: "\\." - */ + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } - .capture('escape', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(/^(?:\\(.)|([$^]))/); - if (!m) return; + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); - return pos({ - type: 'escape', - val: m[2] || m[1] - }); - }) + return this; +} - /** - * Quoted strings - */ +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } - .capture('quoted', function() { - var pos = this.position(); - var m = this.match(/^["']/); - if (!m) return; + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} - var quote = m[0]; - if (this.input.indexOf(quote) === -1) { - return pos({ - type: 'escape', - val: quote - }); - } +function emitErrorNT(self, err) { + self.emit('error', err); +} - var tok = advanceTo(this.input, quote); - this.consume(tok.len); +module.exports = { + destroy: destroy, + undestroy: undestroy +}; - return pos({ - type: 'quoted', - val: tok.esc - }); - }) +/***/ }), - /** - * Negations: "!" - */ +/***/ 20681: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - .capture('not', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(this.notRegex || /^!+/); - if (!m) return; - var val = m[0]; +module.exports = __webpack_require__(92413); - var isNegated = (val.length % 2) === 1; - if (parsed === '' && !isNegated) { - val = ''; - } - // if nothing has been parsed, we know `!` is at the start, - // so we need to wrap the result in a negation regex - if (parsed === '' && isNegated && this.options.nonegate !== true) { - this.bos.val = '(?!^(?:'; - this.append = ')$).*'; - val = ''; - } - return pos({ - type: 'not', - val: val - }); - }) +/***/ }), - /** - * Dot: "." - */ +/***/ 96788: +/***/ (function(module, exports, __webpack_require__) { - .capture('dot', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\.+/); - if (!m) return; +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(64293) +var Buffer = buffer.Buffer - var val = m[0]; - this.state.dot = val === '.' && (parsed === '' || parsed.slice(-1) === '/'); +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} - return pos({ - type: 'dot', - dotfiles: this.state.dot, - val: val - }); - }) +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} - /** - * Plus: "+" - */ +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) - .capture('plus', /^\+(?!\()/) +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} - /** - * Question mark: "?" - */ +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} - .capture('qmark', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\?+(?!\()/); - if (!m) return; +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} - this.state.metachar = true; - this.state.qmark = true; +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} - return pos({ - type: 'qmark', - parsed: parsed, - val: m[0] - }); - }) - /** - * Globstar: "**" - */ +/***/ }), - .capture('globstar', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\*{2}(?![*(])(?=[,)/]|$)/); - if (!m) return; +/***/ 7395: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - var type = opts.noglobstar !== true ? 'globstar' : 'star'; - var node = pos({type: type, parsed: parsed}); - this.state.metachar = true; +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - while (this.input.slice(0, 4) === '/**/') { - this.input = this.input.slice(3); - } - node.isInside = { - brace: this.isInside('brace'), - paren: this.isInside('paren') - }; - if (type === 'globstar') { - this.state.globstar = true; - node.val = '**'; +/**/ - } else { - this.state.star = true; - node.val = '*'; - } +var Buffer = __webpack_require__(96788).Buffer; +/**/ - return node; - }) +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; - /** - * Star: "*" - */ +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; - .capture('star', function() { - var pos = this.position(); - var starRe = /^(?:\*(?![*(])|[*]{3,}(?!\()|[*]{2}(?![(/]|$)|\*(?=\*\())/; - var m = this.match(starRe); - if (!m) return; +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} - this.state.metachar = true; - this.state.star = true; - return pos({ - type: 'star', - val: m[0] - }); - }) +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.s = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} - /** - * Slash: "/" - */ +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; - .capture('slash', function() { - var pos = this.position(); - var m = this.match(/^\//); - if (!m) return; +StringDecoder.prototype.end = utf8End; - this.state.slashes++; - return pos({ - type: 'slash', - val: m[0] - }); - }) +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; - /** - * Backslash: "\\" - */ +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; - .capture('backslash', function() { - var pos = this.position(); - var m = this.match(/^\\(?![*+?(){}[\]'"])/); - if (!m) return; +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} - var val = m[0]; +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} - if (this.isInside('bracket')) { - val = '\\'; - } else if (val.length > 1) { - val = '\\\\'; +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; } + } + } +} - return pos({ - type: 'backslash', - val: val - }); - }) - - /** - * Square: "[.]" - */ +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} - .capture('square', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(/^\[([^!^\\])\]/); - if (!m) return; +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} - return pos({ - type: 'square', - val: m[1] - }); - }) +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} - /** - * Brackets: "[...]" (basic, this can be overridden by other parsers) - */ +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} - .capture('bracket', function() { - var pos = this.position(); - var m = this.match(/^(?:\[([!^]?)([^\]]+|\]-)(\]|[^*+?]+)|\[)/); - if (!m) return; +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} - var val = m[0]; - var negated = m[1] ? '^' : ''; - var inner = (m[2] || '').replace(/\\\\+/, '\\\\'); - var close = m[3] || ''; +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} - if (m[2] && inner.length < m[2].length) { - val = val.replace(/\\\\+/, '\\\\'); - } +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} - var esc = this.input.slice(0, 2); - if (inner === '' && esc === '\\]') { - inner += esc; - this.consume(2); +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} - var str = this.input; - var idx = -1; - var ch; +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} - while ((ch = str[++idx])) { - this.consume(1); - if (ch === ']') { - close = ch; - break; - } - inner += ch; - } - } +/***/ }), - return pos({ - type: 'bracket', - val: val, - escaped: close !== ']', - negated: negated, - inner: inner, - close: close - }); - }) +/***/ 68193: +/***/ (function(module, exports, __webpack_require__) { - /** - * Text - */ +var Stream = __webpack_require__(92413); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = __webpack_require__(79341); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __webpack_require__(78063); + exports.Duplex = __webpack_require__(42770); + exports.Transform = __webpack_require__(62826); + exports.PassThrough = __webpack_require__(60143); +} - .capture('text', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(not); - if (!m || !m[0]) return; - return pos({ - type: 'text', - val: m[0] - }); - }); +/***/ }), - /** - * Allow custom parsers to be passed on options - */ +/***/ 30931: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (options && typeof options.parsers === 'function') { - options.parsers(nanomatch.parser); - } -}; +"use strict"; + + +var extend = __webpack_require__(39700); +var safe = __webpack_require__(71217); /** - * Advance to the next non-escaped character + * The main export is a function that takes a `pattern` string and an `options` object. + * + * ```js + & var not = require('regex-not'); + & console.log(not('foo')); + & //=> /^(?:(?!^(?:foo)$).)*$/ + * ``` + * + * @param {String} `pattern` + * @param {Object} `options` + * @return {RegExp} Converts the given `pattern` to a regex using the specified `options`. + * @api public */ -function advanceTo(input, endChar) { - var ch = input.charAt(0); - var tok = { len: 1, val: '', esc: '' }; - var idx = 0; +function toRegex(pattern, options) { + return new RegExp(toRegex.create(pattern, options)); +} - function advance() { - if (ch !== '\\') { - tok.esc += '\\' + ch; - tok.val += ch; - } +/** + * Create a regex-compatible string from the given `pattern` and `options`. + * + * ```js + & var not = require('regex-not'); + & console.log(not.create('foo')); + & //=> '^(?:(?!^(?:foo)$).)*$' + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {String} + * @api public + */ - ch = input.charAt(++idx); - tok.len++; +toRegex.create = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } - if (ch === '\\') { - advance(); - advance(); - } + var opts = extend({}, options); + if (opts.contains === true) { + opts.strictNegate = false; } - while (ch && ch !== endChar) { - advance(); + var open = opts.strictOpen !== false ? '^' : ''; + var close = opts.strictClose !== false ? '$' : ''; + var endChar = opts.endChar ? opts.endChar : '+'; + var str = pattern; + + if (opts.strictNegate === false) { + str = '(?:(?!(?:' + pattern + ')).)' + endChar; + } else { + str = '(?:(?!^(?:' + pattern + ')$).)' + endChar; } - return tok; -} -/** - * Create text regex - */ + var res = open + str + close; + if (opts.safe === true && safe(res) === false) { + throw new Error('potentially unsafe regular expression: ' + res); + } -function createTextRegex(pattern) { - if (cached) return cached; - var opts = {contains: true, strictClose: false}; - var not = regexNot.create(pattern, opts); - var re = toRegex('^(?:[*]\\((?=.)|' + not + ')', opts); - return (cached = re); -} + return res; +}; /** - * Expose negation string + * Expose `toRegex` */ -module.exports.not = NOT_REGEX; +module.exports = toRegex; /***/ }), -/***/ 41340: +/***/ 39700: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var utils = module.exports; -var path = __webpack_require__(85622); +var isExtendable = __webpack_require__(93295); +var assignSymbols = __webpack_require__(64353); -/** - * Module dependencies - */ +module.exports = Object.assign || function(obj/*, objects*/) { + if (obj === null || typeof obj === 'undefined') { + throw new TypeError('Cannot convert undefined or null to object'); + } + if (!isObject(obj)) { + obj = {}; + } + for (var i = 1; i < arguments.length; i++) { + var val = arguments[i]; + if (isString(val)) { + val = toObject(val); + } + if (isObject(val)) { + assign(obj, val); + assignSymbols(obj, val); + } + } + return obj; +}; -var isWindows = __webpack_require__(8025)(); -var Snapdragon = __webpack_require__(79285); -utils.define = __webpack_require__(18918); -utils.diff = __webpack_require__(9455); -utils.extend = __webpack_require__(69148); -utils.pick = __webpack_require__(38509); -utils.typeOf = __webpack_require__(42556); -utils.unique = __webpack_require__(19009); +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} -/** - * Returns true if the given value is effectively an empty string - */ +function isString(val) { + return (val && typeof val === 'string'); +} -utils.isEmptyString = function(val) { - return String(val) === '' || String(val) === './'; -}; +function toObject(str) { + var obj = {}; + for (var i in str) { + obj[i] = str[i]; + } + return obj; +} + +function isObject(val) { + return (val && typeof val === 'object') || isExtendable(val); +} /** - * Returns true if the platform is windows, or `path.sep` is `\\`. - * This is defined as a function to allow `path.sep` to be set in unit tests, - * or by the user, if there is a reason to do so. - * @return {Boolean} + * Returns true if the given `key` is an own property of `obj`. */ -utils.isWindows = function() { - return path.sep === '\\' || isWindows === true; -}; +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} -/** - * Return the last element from an array - */ +function isEnum(obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); +} -utils.last = function(arr, n) { - return arr[arr.length - (n || 1)]; -}; -/** - * Get the `Snapdragon` instance to use - */ +/***/ }), -utils.instantiate = function(ast, options) { - var snapdragon; - // if an instance was created by `.parse`, use that instance - if (utils.typeOf(ast) === 'object' && ast.snapdragon) { - snapdragon = ast.snapdragon; - // if the user supplies an instance on options, use that instance - } else if (utils.typeOf(options) === 'object' && options.snapdragon) { - snapdragon = options.snapdragon; - // create a new instance - } else { - snapdragon = new Snapdragon(options); - } +/***/ 93295: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - utils.define(snapdragon, 'parse', function(str, options) { - var parsed = Snapdragon.prototype.parse.call(this, str, options); - parsed.input = str; +"use strict"; +/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ - // escape unmatched brace/bracket/parens - var last = this.parser.stack.pop(); - if (last && this.options.strictErrors !== true) { - var open = last.nodes[0]; - var inner = last.nodes[1]; - if (last.type === 'bracket') { - if (inner.val.charAt(0) === '[') { - inner.val = '\\' + inner.val; - } - } else { - open.val = '\\' + open.val; - var sibling = open.parent.nodes[1]; - if (sibling.type === 'star') { - sibling.loose = true; - } - } - } - // add non-enumerable parser reference - utils.define(parsed, 'parser', this.parser); - return parsed; - }); +var isPlainObject = __webpack_require__(81064); - return snapdragon; +module.exports = function isExtendable(val) { + return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); }; -/** - * Create the key to use for memoization. The key is generated - * by iterating over the options and concatenating key-value pairs - * to the pattern string. - */ -utils.createKey = function(pattern, options) { - if (typeof options === 'undefined') { - return pattern; - } - var key = pattern; - for (var prop in options) { - if (options.hasOwnProperty(prop)) { - key += ';' + prop + '=' + String(options[prop]); - } - } - return key; -}; +/***/ }), -/** - * Cast `val` to an array - * @return {Array} +/***/ 69523: +/***/ (function(module) { + +"use strict"; +/*! + * repeat-element + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Licensed under the MIT license. */ -utils.arrayify = function(val) { - if (typeof val === 'string') return [val]; - return val ? (Array.isArray(val) ? val : [val]) : []; -}; -/** - * Return true if `val` is a non-empty string - */ -utils.isString = function(val) { - return typeof val === 'string'; -}; +module.exports = function repeat(ele, num) { + var arr = new Array(num); -/** - * Return true if `val` is a non-empty string - */ + for (var i = 0; i < num; i++) { + arr[i] = ele; + } -utils.isRegex = function(val) { - return utils.typeOf(val) === 'regexp'; + return arr; }; -/** - * Return true if `val` is a non-empty string - */ -utils.isObject = function(val) { - return utils.typeOf(val) === 'object'; -}; +/***/ }), -/** - * Escape regex characters in the given string +/***/ 6332: +/***/ (function(module) { + +"use strict"; +/*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. */ -utils.escapeRegex = function(str) { - return str.replace(/[-[\]{}()^$|*+?.\\/\s]/g, '\\$&'); -}; + /** - * Combines duplicate characters in the provided `input` string. - * @param {String} `input` - * @returns {String} + * Results cache */ -utils.combineDupes = function(input, patterns) { - patterns = utils.arrayify(patterns).join('|').split('|'); - patterns = patterns.map(function(s) { - return s.replace(/\\?([+*\\/])/g, '\\$1'); - }); - var substr = patterns.join('|'); - var regex = new RegExp('(' + substr + ')(?=\\1)', 'g'); - return input.replace(regex, ''); -}; +var res = ''; +var cache; /** - * Returns true if the given `str` has special characters + * Expose `repeat` */ -utils.hasSpecialChars = function(str) { - return /(?:(?:(^|\/)[!.])|[*?+()|[\]{}]|[+@]\()/.test(str); -}; +module.exports = repeat; /** - * Normalize slashes in the given filepath. + * Repeat the given `string` the specified `number` + * of times. * - * @param {String} `filepath` - * @return {String} + * **Example:** + * + * ```js + * var repeat = require('repeat-string'); + * repeat('A', 5); + * //=> AAAAA + * ``` + * + * @param {String} `string` The string to repeat + * @param {Number} `number` The number of times to repeat the string + * @return {String} Repeated string + * @api public */ -utils.toPosixPath = function(str) { - return str.replace(/\\+/g, '/'); -}; - -/** - * Strip backslashes before special characters in a string. - * - * @param {String} `str` - * @return {String} - */ - -utils.unescape = function(str) { - return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, '')); -}; +function repeat(str, num) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } -/** - * Strip the drive letter from a windows filepath - * @param {String} `fp` - * @return {String} - */ + // cover common, quick use cases + if (num === 1) return str; + if (num === 2) return str + str; -utils.stripDrive = function(fp) { - return utils.isWindows() ? fp.replace(/^[a-z]:[\\/]+?/i, '/') : fp; -}; + var max = str.length * num; + if (cache !== str || typeof cache === 'undefined') { + cache = str; + res = ''; + } else if (res.length >= max) { + return res.substr(0, max); + } -/** - * Strip the prefix from a filepath - * @param {String} `fp` - * @return {String} - */ + while (max > res.length && num > 1) { + if (num & 1) { + res += str; + } -utils.stripPrefix = function(str) { - if (str.charAt(0) === '.' && (str.charAt(1) === '/' || str.charAt(1) === '\\')) { - return str.slice(2); + num >>= 1; + str += str; } - return str; -}; - -/** - * Returns true if `str` is a common character that doesn't need - * to be processed to be used for matching. - * @param {String} `str` - * @return {Boolean} - */ -utils.isSimpleChar = function(str) { - return str.trim() === '' || str === '.'; -}; + res += str; + res = res.substr(0, max); + return res; +} -/** - * Returns true if the given str is an escaped or - * unescaped path character - */ -utils.isSlash = function(str) { - return str === '/' || str === '\\/' || str === '\\' || str === '\\\\'; -}; +/***/ }), -/** - * Returns a function that returns true if the given - * pattern matches or contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ +/***/ 25622: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -utils.matchPath = function(pattern, options) { - return (options && options.contains) - ? utils.containsPattern(pattern, options) - : utils.equalsPattern(pattern, options); -}; +var util = __webpack_require__(10265); +var types = __webpack_require__(40432); +var sets = __webpack_require__(28135); +var positions = __webpack_require__(54771); -/** - * Returns true if the given (original) filepath or unixified path are equal - * to the given pattern. - */ -utils._equals = function(filepath, unixPath, pattern) { - return pattern === filepath || pattern === unixPath; -}; +module.exports = function(regexpStr) { + var i = 0, l, c, + start = { type: types.ROOT, stack: []}, -/** - * Returns true if the given (original) filepath or unixified path contain - * the given pattern. - */ + // Keep track of last clause/group and stack. + lastGroup = start, + last = start.stack, + groupStack = []; -utils._contains = function(filepath, unixPath, pattern) { - return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1; -}; -/** - * Returns a function that returns true if the given - * pattern is the same as a given `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ + var repeatErr = function(i) { + util.error(regexpStr, 'Nothing to repeat at column ' + (i - 1)); + }; -utils.equalsPattern = function(pattern, options) { - var unixify = utils.unixify(options); - options = options || {}; + // Decode a few escaped characters. + var str = util.strToChars(regexpStr); + l = str.length; - return function fn(filepath) { - var equal = utils._equals(filepath, unixify(filepath), pattern); - if (equal === true || options.nocase !== true) { - return equal; - } - var lower = filepath.toLowerCase(); - return utils._equals(lower, unixify(lower), pattern); - }; -}; + // Iterate through each character in string. + while (i < l) { + c = str[i++]; -/** - * Returns a function that returns true if the given - * pattern contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ + switch (c) { + // Handle escaped characters, inclues a few sets. + case '\\': + c = str[i++]; -utils.containsPattern = function(pattern, options) { - var unixify = utils.unixify(options); - options = options || {}; + switch (c) { + case 'b': + last.push(positions.wordBoundary()); + break; - return function(filepath) { - var contains = utils._contains(filepath, unixify(filepath), pattern); - if (contains === true || options.nocase !== true) { - return contains; - } - var lower = filepath.toLowerCase(); - return utils._contains(lower, unixify(lower), pattern); - }; -}; + case 'B': + last.push(positions.nonWordBoundary()); + break; -/** - * Returns a function that returns true if the given - * regex matches the `filename` of a file path. - * - * @param {RegExp} `re` Matching regex - * @return {Function} - */ + case 'w': + last.push(sets.words()); + break; -utils.matchBasename = function(re) { - return function(filepath) { - return re.test(filepath) || re.test(path.basename(filepath)); - }; -}; + case 'W': + last.push(sets.notWords()); + break; -/** - * Returns the given value unchanced. - * @return {any} - */ + case 'd': + last.push(sets.ints()); + break; -utils.identity = function(val) { - return val; -}; + case 'D': + last.push(sets.notInts()); + break; -/** - * Determines the filepath to return based on the provided options. - * @return {any} - */ + case 's': + last.push(sets.whitespace()); + break; -utils.value = function(str, unixify, options) { - if (options && options.unixify === false) { - return str; - } - if (options && typeof options.unixify === 'function') { - return options.unixify(str); - } - return unixify(str); -}; + case 'S': + last.push(sets.notWhitespace()); + break; -/** - * Returns a function that normalizes slashes in a string to forward - * slashes, strips `./` from beginning of paths, and optionally unescapes - * special characters. - * @return {Function} - */ + default: + // Check if c is integer. + // In which case it's a reference. + if (/\d/.test(c)) { + last.push({ type: types.REFERENCE, value: parseInt(c, 10) }); -utils.unixify = function(options) { - var opts = options || {}; - return function(filepath) { - if (opts.stripPrefix !== false) { - filepath = utils.stripPrefix(filepath); - } - if (opts.unescape === true) { - filepath = utils.unescape(filepath); - } - if (opts.unixify === true || utils.isWindows()) { - filepath = utils.toPosixPath(filepath); - } - return filepath; - }; -}; + // Escaped character. + } else { + last.push({ type: types.CHAR, value: c.charCodeAt(0) }); + } + } + break; -/***/ }), -/***/ 18918: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Positionals. + case '^': + last.push(positions.begin()); + break; -"use strict"; -/*! - * define-property - * - * Copyright (c) 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ + case '$': + last.push(positions.end()); + break; + // Handle custom sets. + case '[': + // Check if this class is 'anti' i.e. [^abc]. + var not; + if (str[i] === '^') { + not = true; + i++; + } else { + not = false; + } -var isobject = __webpack_require__(96667); -var isDescriptor = __webpack_require__(44133); -var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) - ? Reflect.defineProperty - : Object.defineProperty; + // Get all the characters in class. + var classTokens = util.tokenizeClass(str.slice(i), regexpStr); -module.exports = function defineProperty(obj, key, val) { - if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) { - throw new TypeError('expected an object, function, or array'); - } + // Increase index by length of class. + i += classTokens[1]; + last.push({ + type: types.SET, + set: classTokens[0], + not: not, + }); - if (typeof key !== 'string') { - throw new TypeError('expected "key" to be a string'); - } + break; - if (isDescriptor(val)) { - define(obj, key, val); - return obj; - } - define(obj, key, { - configurable: true, - enumerable: false, - writable: true, - value: val - }); + // Class of any character except \n. + case '.': + last.push(sets.anyChar()); + break; - return obj; -}; + // Push group onto stack. + case '(': + // Create group. + var group = { + type: types.GROUP, + stack: [], + remember: true, + }; -/***/ }), + c = str[i]; -/***/ 69148: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // If if this is a special kind of group. + if (c === '?') { + c = str[i + 1]; + i += 2; -"use strict"; + // Match if followed by. + if (c === '=') { + group.followedBy = true; + // Match if not followed by. + } else if (c === '!') { + group.notFollowedBy = true; -var isExtendable = __webpack_require__(61781); -var assignSymbols = __webpack_require__(64353); + } else if (c !== ':') { + util.error(regexpStr, + 'Invalid group, character \'' + c + + '\' after \'?\' at column ' + (i - 1)); + } -module.exports = Object.assign || function(obj/*, objects*/) { - if (obj === null || typeof obj === 'undefined') { - throw new TypeError('Cannot convert undefined or null to object'); - } - if (!isObject(obj)) { - obj = {}; - } - for (var i = 1; i < arguments.length; i++) { - var val = arguments[i]; - if (isString(val)) { - val = toObject(val); - } - if (isObject(val)) { - assign(obj, val); - assignSymbols(obj, val); - } - } - return obj; -}; + group.remember = false; + } -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} + // Insert subgroup into current group stack. + last.push(group); -function isString(val) { - return (val && typeof val === 'string'); -} + // Remember the current group for when the group closes. + groupStack.push(lastGroup); -function toObject(str) { - var obj = {}; - for (var i in str) { - obj[i] = str[i]; - } - return obj; -} + // Make this new group the current group. + lastGroup = group; + last = group.stack; + break; -function isObject(val) { - return (val && typeof val === 'object') || isExtendable(val); -} -/** - * Returns true if the given `key` is an own property of `obj`. - */ + // Pop group out of stack. + case ')': + if (groupStack.length === 0) { + util.error(regexpStr, 'Unmatched ) at column ' + (i - 1)); + } + lastGroup = groupStack.pop(); -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} + // Check if this group has a PIPE. + // To get back the correct last stack. + last = lastGroup.options ? + lastGroup.options[lastGroup.options.length - 1] : lastGroup.stack; + break; -function isEnum(obj, key) { - return Object.prototype.propertyIsEnumerable.call(obj, key); -} + // Use pipe character to give more choices. + case '|': + // Create array where options are if this is the first PIPE + // in this clause. + if (!lastGroup.options) { + lastGroup.options = [lastGroup.stack]; + delete lastGroup.stack; + } -/***/ }), + // Create a new stack and add to options for rest of clause. + var stack = []; + lastGroup.options.push(stack); + last = stack; + break; -/***/ 61781: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; -/*! - * is-extendable - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ + // Repetition. + // For every repetition, remove last element from last stack + // then insert back a RANGE object. + // This design is chosen because there could be more than + // one repetition symbols in a regex i.e. `a?+{2,3}`. + case '{': + var rs = /^(\d+)(,(\d+)?)?\}/.exec(str.slice(i)), min, max; + if (rs !== null) { + if (last.length === 0) { + repeatErr(i); + } + min = parseInt(rs[1], 10); + max = rs[2] ? rs[3] ? parseInt(rs[3], 10) : Infinity : min; + i += rs[0].length; + last.push({ + type: types.REPETITION, + min: min, + max: max, + value: last.pop(), + }); + } else { + last.push({ + type: types.CHAR, + value: 123, + }); + } + break; + case '?': + if (last.length === 0) { + repeatErr(i); + } + last.push({ + type: types.REPETITION, + min: 0, + max: 1, + value: last.pop(), + }); + break; -var isPlainObject = __webpack_require__(81064); + case '+': + if (last.length === 0) { + repeatErr(i); + } + last.push({ + type: types.REPETITION, + min: 1, + max: Infinity, + value: last.pop(), + }); + break; -module.exports = function isExtendable(val) { - return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); -}; + case '*': + if (last.length === 0) { + repeatErr(i); + } + last.push({ + type: types.REPETITION, + min: 0, + max: Infinity, + value: last.pop(), + }); + break; -/***/ }), + // Default is a character that is not `\[](){}?+*^$`. + default: + last.push({ + type: types.CHAR, + value: c.charCodeAt(0), + }); + } -/***/ 8025: -/***/ (function(module, exports) { + } -/*! - * is-windows - * - * Copyright © 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ - -(function(factory) { - if (exports && typeof exports === 'object' && "object" !== 'undefined') { - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { - define([], factory); - } else if (typeof window !== 'undefined') { - window.isWindows = factory(); - } else if (typeof global !== 'undefined') { - global.isWindows = factory(); - } else if (typeof self !== 'undefined') { - self.isWindows = factory(); - } else { - this.isWindows = factory(); + // Check if any groups have not been closed. + if (groupStack.length !== 0) { + util.error(regexpStr, 'Unterminated group'); } -})(function() { - 'use strict'; - return function isWindows() { - return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)); - }; -}); + return start; +}; -/***/ }), +module.exports.types = types; -/***/ 42556: -/***/ (function(module) { -var toString = Object.prototype.toString; +/***/ }), -module.exports = function kindOf(val) { - if (val === void 0) return 'undefined'; - if (val === null) return 'null'; +/***/ 54771: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - var type = typeof val; - if (type === 'boolean') return 'boolean'; - if (type === 'string') return 'string'; - if (type === 'number') return 'number'; - if (type === 'symbol') return 'symbol'; - if (type === 'function') { - return isGeneratorFn(val) ? 'generatorfunction' : 'function'; - } +var types = __webpack_require__(40432); - if (isArray(val)) return 'array'; - if (isBuffer(val)) return 'buffer'; - if (isArguments(val)) return 'arguments'; - if (isDate(val)) return 'date'; - if (isError(val)) return 'error'; - if (isRegexp(val)) return 'regexp'; +exports.wordBoundary = function() { + return { type: types.POSITION, value: 'b' }; +}; - switch (ctorName(val)) { - case 'Symbol': return 'symbol'; - case 'Promise': return 'promise'; +exports.nonWordBoundary = function() { + return { type: types.POSITION, value: 'B' }; +}; - // Set, Map, WeakSet, WeakMap - case 'WeakMap': return 'weakmap'; - case 'WeakSet': return 'weakset'; - case 'Map': return 'map'; - case 'Set': return 'set'; +exports.begin = function() { + return { type: types.POSITION, value: '^' }; +}; - // 8-bit typed arrays - case 'Int8Array': return 'int8array'; - case 'Uint8Array': return 'uint8array'; - case 'Uint8ClampedArray': return 'uint8clampedarray'; +exports.end = function() { + return { type: types.POSITION, value: '$' }; +}; - // 16-bit typed arrays - case 'Int16Array': return 'int16array'; - case 'Uint16Array': return 'uint16array'; - // 32-bit typed arrays - case 'Int32Array': return 'int32array'; - case 'Uint32Array': return 'uint32array'; - case 'Float32Array': return 'float32array'; - case 'Float64Array': return 'float64array'; - } +/***/ }), - if (isGeneratorObj(val)) { - return 'generator'; - } +/***/ 28135: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // Non-plain objects - type = toString.call(val); - switch (type) { - case '[object Object]': return 'object'; - // iterators - case '[object Map Iterator]': return 'mapiterator'; - case '[object Set Iterator]': return 'setiterator'; - case '[object String Iterator]': return 'stringiterator'; - case '[object Array Iterator]': return 'arrayiterator'; - } +var types = __webpack_require__(40432); - // other - return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); +var INTS = function() { + return [{ type: types.RANGE , from: 48, to: 57 }]; }; -function ctorName(val) { - return typeof val.constructor === 'function' ? val.constructor.name : null; -} +var WORDS = function() { + return [ + { type: types.CHAR, value: 95 }, + { type: types.RANGE, from: 97, to: 122 }, + { type: types.RANGE, from: 65, to: 90 } + ].concat(INTS()); +}; -function isArray(val) { - if (Array.isArray) return Array.isArray(val); - return val instanceof Array; -} +var WHITESPACE = function() { + return [ + { type: types.CHAR, value: 9 }, + { type: types.CHAR, value: 10 }, + { type: types.CHAR, value: 11 }, + { type: types.CHAR, value: 12 }, + { type: types.CHAR, value: 13 }, + { type: types.CHAR, value: 32 }, + { type: types.CHAR, value: 160 }, + { type: types.CHAR, value: 5760 }, + { type: types.CHAR, value: 6158 }, + { type: types.CHAR, value: 8192 }, + { type: types.CHAR, value: 8193 }, + { type: types.CHAR, value: 8194 }, + { type: types.CHAR, value: 8195 }, + { type: types.CHAR, value: 8196 }, + { type: types.CHAR, value: 8197 }, + { type: types.CHAR, value: 8198 }, + { type: types.CHAR, value: 8199 }, + { type: types.CHAR, value: 8200 }, + { type: types.CHAR, value: 8201 }, + { type: types.CHAR, value: 8202 }, + { type: types.CHAR, value: 8232 }, + { type: types.CHAR, value: 8233 }, + { type: types.CHAR, value: 8239 }, + { type: types.CHAR, value: 8287 }, + { type: types.CHAR, value: 12288 }, + { type: types.CHAR, value: 65279 } + ]; +}; -function isError(val) { - return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); -} +var NOTANYCHAR = function() { + return [ + { type: types.CHAR, value: 10 }, + { type: types.CHAR, value: 13 }, + { type: types.CHAR, value: 8232 }, + { type: types.CHAR, value: 8233 }, + ]; +}; -function isDate(val) { - if (val instanceof Date) return true; - return typeof val.toDateString === 'function' - && typeof val.getDate === 'function' - && typeof val.setDate === 'function'; -} +// Predefined class objects. +exports.words = function() { + return { type: types.SET, set: WORDS(), not: false }; +}; -function isRegexp(val) { - if (val instanceof RegExp) return true; - return typeof val.flags === 'string' - && typeof val.ignoreCase === 'boolean' - && typeof val.multiline === 'boolean' - && typeof val.global === 'boolean'; -} +exports.notWords = function() { + return { type: types.SET, set: WORDS(), not: true }; +}; -function isGeneratorFn(name, val) { - return ctorName(name) === 'GeneratorFunction'; -} +exports.ints = function() { + return { type: types.SET, set: INTS(), not: false }; +}; -function isGeneratorObj(val) { - return typeof val.throw === 'function' - && typeof val.return === 'function' - && typeof val.next === 'function'; -} +exports.notInts = function() { + return { type: types.SET, set: INTS(), not: true }; +}; -function isArguments(val) { - try { - if (typeof val.length === 'number' && typeof val.callee === 'function') { - return true; - } - } catch (err) { - if (err.message.indexOf('callee') !== -1) { - return true; - } - } - return false; -} +exports.whitespace = function() { + return { type: types.SET, set: WHITESPACE(), not: false }; +}; -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ +exports.notWhitespace = function() { + return { type: types.SET, set: WHITESPACE(), not: true }; +}; -function isBuffer(val) { - if (val.constructor && typeof val.constructor.isBuffer === 'function') { - return val.constructor.isBuffer(val); - } - return false; -} +exports.anyChar = function() { + return { type: types.SET, set: NOTANYCHAR(), not: true }; +}; /***/ }), -/***/ 31368: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; - +/***/ 40432: +/***/ (function(module) { -var typeOf = __webpack_require__(48865); -var copyDescriptor = __webpack_require__(3605); -var define = __webpack_require__(5477); +module.exports = { + ROOT : 0, + GROUP : 1, + POSITION : 2, + SET : 3, + RANGE : 4, + REPETITION : 5, + REFERENCE : 6, + CHAR : 7, +}; -/** - * Copy static properties, prototype properties, and descriptors from one object to another. - * - * ```js - * function App() {} - * var proto = App.prototype; - * App.prototype.set = function() {}; - * App.prototype.get = function() {}; - * - * var obj = {}; - * copy(obj, proto); - * ``` - * @param {Object} `receiver` - * @param {Object} `provider` - * @param {String|Array} `omit` One or more properties to omit - * @return {Object} - * @api public - */ -function copy(receiver, provider, omit) { - if (!isObject(receiver)) { - throw new TypeError('expected receiving object to be an object.'); - } - if (!isObject(provider)) { - throw new TypeError('expected providing object to be an object.'); - } +/***/ }), - var props = nativeKeys(provider); - var keys = Object.keys(provider); - var len = props.length; - omit = arrayify(omit); +/***/ 10265: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - while (len--) { - var key = props[len]; +var types = __webpack_require__(40432); +var sets = __webpack_require__(28135); - if (has(keys, key)) { - define(receiver, key, provider[key]); - } else if (!(key in receiver) && !has(omit, key)) { - copyDescriptor(receiver, provider, key); - } - } -}; -/** - * Return true if the given value is an object or function - */ +// All of these are private and only used by randexp. +// It's assumed that they will always be called with the correct input. -function isObject(val) { - return typeOf(val) === 'object' || typeof val === 'function'; -} +var CTRL = '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?'; +var SLSH = { '0': 0, 't': 9, 'n': 10, 'v': 11, 'f': 12, 'r': 13 }; /** - * Returns true if an array has any of the given elements, or an - * object has any of the give keys. - * - * ```js - * has(['a', 'b', 'c'], 'c'); - * //=> true - * - * has(['a', 'b', 'c'], ['c', 'z']); - * //=> true + * Finds character representations in str and convert all to + * their respective characters * - * has({a: 'b', c: 'd'}, ['c', 'z']); - * //=> true - * ``` - * @param {Object} `obj` - * @param {String|Array} `val` - * @return {Boolean} + * @param {String} str + * @return {String} */ - -function has(obj, val) { - val = arrayify(val); - var len = val.length; - - if (isObject(obj)) { - for (var key in obj) { - if (val.indexOf(key) > -1) { - return true; - } +exports.strToChars = function(str) { + /* jshint maxlen: false */ + var chars_regex = /(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z\[\\\]\^?])|([0tnvfr]))/g; + str = str.replace(chars_regex, function(s, b, lbs, a16, b16, c8, dctrl, eslsh) { + if (lbs) { + return s; } - var keys = nativeKeys(obj); - return has(keys, val); - } - - if (Array.isArray(obj)) { - var arr = obj; - while (len--) { - if (arr.indexOf(val[len]) > -1) { - return true; - } - } - return false; - } + var code = b ? 8 : + a16 ? parseInt(a16, 16) : + b16 ? parseInt(b16, 16) : + c8 ? parseInt(c8, 8) : + dctrl ? CTRL.indexOf(dctrl) : + SLSH[eslsh]; - throw new TypeError('expected an array or object.'); -} + var c = String.fromCharCode(code); -/** - * Cast the given value to an array. - * - * ```js - * arrayify('foo'); - * //=> ['foo'] - * - * arrayify(['foo']); - * //=> ['foo'] - * ``` - * - * @param {String|Array} `val` - * @return {Array} - */ + // Escape special regex characters. + if (/[\[\]{}\^$.|?*+()]/.test(c)) { + c = '\\' + c; + } -function arrayify(val) { - return val ? (Array.isArray(val) ? val : [val]) : []; -} + return c; + }); -/** - * Returns true if a value has a `contructor` - * - * ```js - * hasConstructor({}); - * //=> true - * - * hasConstructor(Object.create(null)); - * //=> false - * ``` - * @param {Object} `value` - * @return {Boolean} - */ + return str; +}; -function hasConstructor(val) { - return isObject(val) && typeof val.constructor !== 'undefined'; -} /** - * Get the native `ownPropertyNames` from the constructor of the - * given `object`. An empty array is returned if the object does - * not have a constructor. - * - * ```js - * nativeKeys({a: 'b', b: 'c', c: 'd'}) - * //=> ['a', 'b', 'c'] - * - * nativeKeys(function(){}) - * //=> ['length', 'caller'] - * ``` + * turns class into tokens + * reads str until it encounters a ] not preceeded by a \ * - * @param {Object} `obj` Object that has a `constructor`. - * @return {Array} Array of keys. - */ - -function nativeKeys(val) { - if (!hasConstructor(val)) return []; - return Object.getOwnPropertyNames(val); -} - -/** - * Expose `copy` - */ - -module.exports = copy; - -/** - * Expose `copy.has` for tests + * @param {String} str + * @param {String} regexpStr + * @return {Array., Number>} */ +exports.tokenizeClass = function(str, regexpStr) { + /* jshint maxlen: false */ + var tokens = []; + var regexp = /\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?(.)/g; + var rs, c; -module.exports.has = has; + while ((rs = regexp.exec(str)) != null) { + if (rs[1]) { + tokens.push(sets.words()); -/***/ }), + } else if (rs[2]) { + tokens.push(sets.ints()); -/***/ 59248: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + } else if (rs[3]) { + tokens.push(sets.whitespace()); -"use strict"; -/*! - * object-visit - * - * Copyright (c) 2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ + } else if (rs[4]) { + tokens.push(sets.notWords()); + } else if (rs[5]) { + tokens.push(sets.notInts()); + } else if (rs[6]) { + tokens.push(sets.notWhitespace()); -var isObject = __webpack_require__(96667); + } else if (rs[7]) { + tokens.push({ + type: types.RANGE, + from: (rs[8] || rs[9]).charCodeAt(0), + to: rs[10].charCodeAt(0), + }); -module.exports = function visit(thisArg, method, target, val) { - if (!isObject(thisArg) && typeof thisArg !== 'function') { - throw new Error('object-visit expects `thisArg` to be an object.'); - } + } else if (c = rs[12]) { + tokens.push({ + type: types.CHAR, + value: c.charCodeAt(0), + }); - if (typeof method !== 'string') { - throw new Error('object-visit expects `method` name to be a string'); + } else { + return [tokens, regexp.lastIndex]; + } } - if (typeof thisArg[method] !== 'function') { - return thisArg; - } + exports.error(regexpStr, 'Unterminated character class'); +}; - var args = [].slice.call(arguments, 3); - target = target || {}; - for (var key in target) { - var arr = [key, target[key]].concat(args); - thisArg[method].apply(thisArg, arr); - } - return thisArg; +/** + * Shortcut to throw errors. + * + * @param {String} regexp + * @param {String} msg + */ +exports.error = function(regexp, msg) { + throw new SyntaxError('Invalid regular expression: /' + regexp + '/: ' + msg); }; /***/ }), -/***/ 38509: +/***/ 71217: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; -/*! - * object.pick - * - * Copyright (c) 2014-2015 Jon Schlinkert, contributors. - * Licensed under the MIT License - */ - - - -var isObject = __webpack_require__(96667); - -module.exports = function pick(obj, keys) { - if (!isObject(obj) && typeof obj !== 'function') { - return {}; - } - - var res = {}; - if (typeof keys === 'string') { - if (keys in obj) { - res[keys] = obj[keys]; - } - return res; - } - - var len = keys.length; - var idx = -1; +var parse = __webpack_require__(25622); +var types = parse.types; - while (++idx < len) { - var key = keys[idx]; - if (key in obj) { - res[key] = obj[key]; - } - } - return res; +module.exports = function (re, opts) { + if (!opts) opts = {}; + var replimit = opts.limit === undefined ? 25 : opts.limit; + + if (isRegExp(re)) re = re.source; + else if (typeof re !== 'string') re = String(re); + + try { re = parse(re) } + catch (err) { return false } + + var reps = 0; + return (function walk (node, starHeight) { + if (node.type === types.REPETITION) { + starHeight ++; + reps ++; + if (starHeight > 1) return false; + if (reps > replimit) return false; + } + + if (node.options) { + for (var i = 0, len = node.options.length; i < len; i++) { + var ok = walk({ stack: node.options[i] }, starHeight); + if (!ok) return false; + } + } + var stack = node.stack || (node.value && node.value.stack); + if (!stack) return true; + + for (var i = 0; i < stack.length; i++) { + var ok = walk(stack[i], starHeight); + if (!ok) return false; + } + + return true; + })(re, 0); }; - -/***/ }), - -/***/ 27255: -/***/ (function(module) { - -/*! - * pascalcase - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -function pascalcase(str) { - if (typeof str !== 'string') { - throw new TypeError('expected a string.'); - } - str = str.replace(/([A-Z])/g, ' $1'); - if (str.length === 1) { return str.toUpperCase(); } - str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase(); - str = str.charAt(0).toUpperCase() + str.slice(1); - return str.replace(/[\W_]+(\w|$)/g, function (_, ch) { - return ch.toUpperCase(); - }); +function isRegExp (x) { + return {}.toString.call(x) === '[object RegExp]'; } -module.exports = pascalcase; - /***/ }), -/***/ 88412: -/***/ (function(module) { +/***/ 85841: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* +Copyright (c) 2014, Yahoo! Inc. All rights reserved. +Copyrights licensed under the New BSD License. +See the accompanying LICENSE file for terms. +*/ -/** - * POSIX character classes - */ - -module.exports = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' -}; +var randomBytes = __webpack_require__(79822); -/***/ }), +// Generate an internal UID to make the regexp pattern harder to guess. +var UID_LENGTH = 16; +var UID = generateUID(); +var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|U|I)-' + UID + '-(\\d+)__@"', 'g'); -/***/ 58404: -/***/ (function(module) { +var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g; +var IS_PURE_FUNCTION = /function.*?\(/; +var IS_ARROW_FUNCTION = /.*?=>.*?/; +var UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g; -"use strict"; +var RESERVED_SYMBOLS = ['*', 'async']; +// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their +// Unicode char counterparts which are safe to use in JavaScript strings. +var ESCAPED_CHARS = { + '<' : '\\u003C', + '>' : '\\u003E', + '/' : '\\u002F', + '\u2028': '\\u2028', + '\u2029': '\\u2029' +}; -if (typeof process === 'undefined' || - !process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = { nextTick: nextTick }; -} else { - module.exports = process +function escapeUnsafeChars(unsafeChar) { + return ESCAPED_CHARS[unsafeChar]; } -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); - } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; +function generateUID() { + var bytes = randomBytes(UID_LENGTH); + var result = ''; + for(var i=0; i - * https://github.com/rvagg/prr - * License: MIT - */ + var functions = []; + var regexps = []; + var dates = []; + var maps = []; + var sets = []; + var undefs = []; + var infinities= []; -(function (name, context, definition) { - if ( true && module.exports) - module.exports = definition() - else - context[name] = definition() -})('prr', this, function() { + // Returns placeholders for functions and regexps (identified by index) + // which are later replaced by their string representation. + function replacer(key, value) { - var setProperty = typeof Object.defineProperty == 'function' - ? function (obj, key, options) { - Object.defineProperty(obj, key, options) - return obj + // For nested function + if(options.ignoreFunction){ + deleteFunctions(value); } - : function (obj, key, options) { // < es5 - obj[key] = options.value - return obj + + if (!value && value !== undefined) { + return value; } - , makeOptions = function (value, options) { - var oo = typeof options == 'object' - , os = !oo && typeof options == 'string' - , op = function (p) { - return oo - ? !!options[p] - : os - ? options.indexOf(p[0]) > -1 - : false + // If the value is an object w/ a toJSON method, toJSON is called before + // the replacer runs, so we use this[key] to get the non-toJSONed value. + var origValue = this[key]; + var type = typeof origValue; + + if (type === 'object') { + if(origValue instanceof RegExp) { + return '@__R-' + UID + '-' + (regexps.push(origValue) - 1) + '__@'; } - return { - enumerable : op('enumerable') - , configurable : op('configurable') - , writable : op('writable') - , value : value + if(origValue instanceof Date) { + return '@__D-' + UID + '-' + (dates.push(origValue) - 1) + '__@'; + } + + if(origValue instanceof Map) { + return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@'; + } + + if(origValue instanceof Set) { + return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@'; + } } - } - , prr = function (obj, key, value, options) { - var k + if (type === 'function') { + return '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@'; + } - options = makeOptions(value, options) + if (type === 'undefined') { + return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@'; + } - if (typeof key == 'object') { - for (k in key) { - if (Object.hasOwnProperty.call(key, k)) { - options.value = key[k] - setProperty(obj, k, options) - } - } - return obj + if (type === 'number' && !isNaN(origValue) && !isFinite(origValue)) { + return '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@'; } - return setProperty(obj, key, options) + return value; + } + + function serializeFunc(fn) { + var serializedFn = fn.toString(); + if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) { + throw new TypeError('Serializing native function: ' + fn.name); } - return prr -}) + // pure functions, example: {key: function() {}} + if(IS_PURE_FUNCTION.test(serializedFn)) { + return serializedFn; + } -/***/ }), + // arrow functions, example: arg1 => arg1+5 + if(IS_ARROW_FUNCTION.test(serializedFn)) { + return serializedFn; + } -/***/ 79822: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + var argsStartsAt = serializedFn.indexOf('('); + var def = serializedFn.substr(0, argsStartsAt) + .trim() + .split(' ') + .filter(function(val) { return val.length > 0 }); -module.exports = __webpack_require__(76417).randomBytes + var nonReservedSymbols = def.filter(function(val) { + return RESERVED_SYMBOLS.indexOf(val) === -1 + }); + // enhanced literal objects, example: {key() {}} + if(nonReservedSymbols.length > 0) { + return (def.indexOf('async') > -1 ? 'async ' : '') + 'function' + + (def.join('').indexOf('*') > -1 ? '*' : '') + + serializedFn.substr(argsStartsAt); + } -/***/ }), + // arrow functions + return serializedFn; + } -/***/ 42770: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Check if the parameter is function + if (options.ignoreFunction && typeof obj === "function") { + obj = undefined; + } + // Protects against `JSON.stringify()` returning `undefined`, by serializing + // to the literal string: "undefined". + if (obj === undefined) { + return String(obj); + } -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + var str; -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. + // Creates a JSON string representation of the value. + // NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args. + if (options.isJSON && !options.space) { + str = JSON.stringify(obj); + } else { + str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space); + } + + // Protects against `JSON.stringify()` returning `undefined`, by serializing + // to the literal string: "undefined". + if (typeof str !== 'string') { + return String(str); + } + // Replace unsafe HTML and invalid JavaScript line terminator chars with + // their safe Unicode char counterpart. This _must_ happen before the + // regexps and functions are serialized and added back to the string. + if (options.unsafe !== true) { + str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars); + } + if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && undefs.length === 0 && infinities.length === 0) { + return str; + } -/**/ + // Replaces all occurrences of function, regexp, date, map and set placeholders in the + // JSON string with their string representations. If the original value can + // not be found, then `undefined` is used. + return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) { + // The placeholder may not be preceded by a backslash. This is to prevent + // replacing things like `"a\"@__R--0__@"` and thus outputting + // invalid JS. + if (backSlash) { + return match; + } -var pna = __webpack_require__(58404); -/**/ + if (type === 'D') { + return "new Date(\"" + dates[valueIndex].toISOString() + "\")"; + } -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ + if (type === 'R') { + return "new RegExp(" + serialize(regexps[valueIndex].source) + ", \"" + regexps[valueIndex].flags + "\")"; + } -module.exports = Duplex; + if (type === 'M') { + return "new Map(" + serialize(Array.from(maps[valueIndex].entries()), options) + ")"; + } -/**/ -var util = Object.create(__webpack_require__(78334)); -util.inherits = __webpack_require__(2989); -/**/ + if (type === 'S') { + return "new Set(" + serialize(Array.from(sets[valueIndex].values()), options) + ")"; + } -var Readable = __webpack_require__(79341); -var Writable = __webpack_require__(78063); + if (type === 'U') { + return 'undefined' + } -util.inherits(Duplex, Readable); + if (type === 'I') { + return infinities[valueIndex]; + } -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } + var fn = functions[valueIndex]; + + return serializeFunc(fn); + }); } -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); +/***/ }), - if (options && options.readable === false) this.readable = false; +/***/ 34857: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (options && options.writable === false) this.writable = false; +"use strict"; +/*! + * set-value + * + * Copyright (c) 2014-2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - this.once('end', onend); -} -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); +var split = __webpack_require__(33218); +var extend = __webpack_require__(28727); +var isPlainObject = __webpack_require__(81064); +var isObject = __webpack_require__(18493); -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; +module.exports = function(obj, prop, val) { + if (!isObject(obj)) { + return obj; + } - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} + if (Array.isArray(prop)) { + prop = [].concat.apply([], prop).join('.'); + } -function onEndNT(self) { - self.end(); -} + if (typeof prop !== 'string') { + return obj; + } -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; + var keys = split(prop, {sep: '.', brackets: true}).filter(isValidKey); + var len = keys.length; + var idx = -1; + var current = obj; + + while (++idx < len) { + var key = keys[idx]; + if (idx !== len - 1) { + if (!isObject(current[key])) { + current[key] = {}; + } + current = current[key]; + continue; } - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; + if (isPlainObject(current[key]) && isPlainObject(val)) { + current[key] = extend({}, current[key], val); + } else { + current[key] = val; + } } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - pna.nextTick(cb, err); + return obj; }; -/***/ }), - -/***/ 60143: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +function isValidKey(key) { + return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'; +} -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. +/***/ }), +/***/ 12579: +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -module.exports = PassThrough; -var Transform = __webpack_require__(62826); +var isObject = __webpack_require__(96667); +var define = __webpack_require__(88599); +var utils = __webpack_require__(82071); +var ownNames; -/**/ -var util = Object.create(__webpack_require__(78334)); -util.inherits = __webpack_require__(2989); -/**/ +/** + * Create a new AST `Node` with the given `val` and `type`. + * + * ```js + * var node = new Node('*', 'Star'); + * var node = new Node({type: 'star', val: '*'}); + * ``` + * @name Node + * @param {String|Object} `val` Pass a matched substring, or an object to merge onto the node. + * @param {String} `type` The node type to use when `val` is a string. + * @return {Object} node instance + * @api public + */ -util.inherits(PassThrough, Transform); +function Node(val, type, parent) { + if (typeof type !== 'string') { + parent = type; + type = null; + } -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); + define(this, 'parent', parent); + define(this, 'isNode', true); + define(this, 'expect', null); - Transform.call(this, options); + if (typeof type !== 'string' && isObject(val)) { + lazyKeys(); + var keys = Object.keys(val); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (ownNames.indexOf(key) === -1) { + this[key] = val[key]; + } + } + } else { + this.type = type; + this.val = val; + } } -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; +/** + * Returns true if the given value is a node. + * + * ```js + * var Node = require('snapdragon-node'); + * var node = new Node({type: 'foo'}); + * console.log(Node.isNode(node)); //=> true + * console.log(Node.isNode({})); //=> false + * ``` + * @param {Object} `node` + * @returns {Boolean} + * @api public + */ -/***/ }), +Node.isNode = function(node) { + return utils.isNode(node); +}; -/***/ 79341: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/** + * Define a non-enumberable property on the node instance. + * Useful for adding properties that shouldn't be extended + * or visible during debugging. + * + * ```js + * var node = new Node(); + * node.define('foo', 'something non-enumerable'); + * ``` + * @param {String} `name` + * @param {any} `val` + * @return {Object} returns the node instance + * @api public + */ -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +Node.prototype.define = function(name, val) { + define(this, name, val); + return this; +}; +/** + * Returns true if `node.val` is an empty string, or `node.nodes` does + * not contain any non-empty text nodes. + * + * ```js + * var node = new Node({type: 'text'}); + * node.isEmpty(); //=> true + * node.val = 'foo'; + * node.isEmpty(); //=> false + * ``` + * @param {Function} `fn` (optional) Filter function that is called on `node` and/or child nodes. `isEmpty` will return false immediately when the filter function returns false on any nodes. + * @return {Boolean} + * @api public + */ +Node.prototype.isEmpty = function(fn) { + return utils.isEmpty(this, fn); +}; -/**/ +/** + * Given node `foo` and node `bar`, push node `bar` onto `foo.nodes`, and + * set `foo` as `bar.parent`. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * foo.push(bar); + * ``` + * @param {Object} `node` + * @return {Number} Returns the length of `node.nodes` + * @api public + */ -var pna = __webpack_require__(58404); -/**/ +Node.prototype.push = function(node) { + assert(Node.isNode(node), 'expected node to be an instance of Node'); + define(node, 'parent', this); -module.exports = Readable; + this.nodes = this.nodes || []; + return this.nodes.push(node); +}; -/**/ -var isArray = __webpack_require__(21352); -/**/ +/** + * Given node `foo` and node `bar`, unshift node `bar` onto `foo.nodes`, and + * set `foo` as `bar.parent`. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * foo.unshift(bar); + * ``` + * @param {Object} `node` + * @return {Number} Returns the length of `node.nodes` + * @api public + */ -/**/ -var Duplex; -/**/ +Node.prototype.unshift = function(node) { + assert(Node.isNode(node), 'expected node to be an instance of Node'); + define(node, 'parent', this); -Readable.ReadableState = ReadableState; + this.nodes = this.nodes || []; + return this.nodes.unshift(node); +}; -/**/ -var EE = __webpack_require__(28614).EventEmitter; +/** + * Pop a node from `node.nodes`. + * + * ```js + * var node = new Node({type: 'foo'}); + * node.push(new Node({type: 'a'})); + * node.push(new Node({type: 'b'})); + * node.push(new Node({type: 'c'})); + * node.push(new Node({type: 'd'})); + * console.log(node.nodes.length); + * //=> 4 + * node.pop(); + * console.log(node.nodes.length); + * //=> 3 + * ``` + * @return {Number} Returns the popped `node` + * @api public + */ -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; +Node.prototype.pop = function() { + return this.nodes && this.nodes.pop(); }; -/**/ - -/**/ -var Stream = __webpack_require__(1065); -/**/ -/**/ +/** + * Shift a node from `node.nodes`. + * + * ```js + * var node = new Node({type: 'foo'}); + * node.push(new Node({type: 'a'})); + * node.push(new Node({type: 'b'})); + * node.push(new Node({type: 'c'})); + * node.push(new Node({type: 'd'})); + * console.log(node.nodes.length); + * //=> 4 + * node.shift(); + * console.log(node.nodes.length); + * //=> 3 + * ``` + * @return {Object} Returns the shifted `node` + * @api public + */ -var Buffer = __webpack_require__(96788).Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} +Node.prototype.shift = function() { + return this.nodes && this.nodes.shift(); +}; -/**/ +/** + * Remove `node` from `node.nodes`. + * + * ```js + * node.remove(childNode); + * ``` + * @param {Object} `node` + * @return {Object} Returns the removed node. + * @api public + */ -/**/ -var util = Object.create(__webpack_require__(78334)); -util.inherits = __webpack_require__(2989); -/**/ +Node.prototype.remove = function(node) { + assert(Node.isNode(node), 'expected node to be an instance of Node'); + this.nodes = this.nodes || []; + var idx = node.index; + if (idx !== -1) { + node.index = -1; + return this.nodes.splice(idx, 1); + } + return null; +}; -/**/ -var debugUtil = __webpack_require__(31669); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ +/** + * Get the first child node from `node.nodes` that matches the given `type`. + * If `type` is a number, the child node at that index is returned. + * + * ```js + * var child = node.find(1); //<= index of the node to get + * var child = node.find('foo'); //<= node.type of a child node + * var child = node.find(/^(foo|bar)$/); //<= regex to match node.type + * var child = node.find(['foo', 'bar']); //<= array of node.type(s) + * ``` + * @param {String} `type` + * @return {Object} Returns a child node or undefined. + * @api public + */ -var BufferList = __webpack_require__(28878); -var destroyImpl = __webpack_require__(87915); -var StringDecoder; +Node.prototype.find = function(type) { + return utils.findNode(this.nodes, type); +}; -util.inherits(Readable, Stream); +/** + * Return true if the node is the given `type`. + * + * ```js + * var node = new Node({type: 'bar'}); + * cosole.log(node.isType('foo')); // false + * cosole.log(node.isType(/^(foo|bar)$/)); // true + * cosole.log(node.isType(['foo', 'bar'])); // true + * ``` + * @param {String} `type` + * @return {Boolean} + * @api public + */ -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; +Node.prototype.isType = function(type) { + return utils.isType(this, type); +}; -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); +/** + * Return true if the `node.nodes` has the given `type`. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * foo.push(bar); + * + * cosole.log(foo.hasType('qux')); // false + * cosole.log(foo.hasType(/^(qux|bar)$/)); // true + * cosole.log(foo.hasType(['qux', 'bar'])); // true + * ``` + * @param {String} `type` + * @return {Boolean} + * @api public + */ - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} +Node.prototype.hasType = function(type) { + return utils.hasType(this, type); +}; -function ReadableState(options, stream) { - Duplex = Duplex || __webpack_require__(42770); +/** + * Get the siblings array, or `null` if it doesn't exist. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * var baz = new Node({type: 'baz'}); + * foo.push(bar); + * foo.push(baz); + * + * console.log(bar.siblings.length) // 2 + * console.log(baz.siblings.length) // 2 + * ``` + * @return {Array} + * @api public + */ - options = options || {}; +Object.defineProperty(Node.prototype, 'siblings', { + set: function() { + throw new Error('node.siblings is a getter and cannot be defined'); + }, + get: function() { + return this.parent ? this.parent.nodes : null; + } +}); - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; +/** + * Get the node's current index from `node.parent.nodes`. + * This should always be correct, even when the parent adds nodes. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * var baz = new Node({type: 'baz'}); + * var qux = new Node({type: 'qux'}); + * foo.push(bar); + * foo.push(baz); + * foo.unshift(qux); + * + * console.log(bar.index) // 1 + * console.log(baz.index) // 2 + * console.log(qux.index) // 0 + * ``` + * @return {Number} + * @api public + */ - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; +Object.defineProperty(Node.prototype, 'index', { + set: function(index) { + define(this, 'idx', index); + }, + get: function() { + if (!Array.isArray(this.siblings)) { + return -1; + } + var tok = this.idx !== -1 ? this.siblings[this.idx] : null; + if (tok !== this) { + this.idx = this.siblings.indexOf(this); + } + return this.idx; + } +}); - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; +/** + * Get the previous node from the siblings array or `null`. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * var baz = new Node({type: 'baz'}); + * foo.push(bar); + * foo.push(baz); + * + * console.log(baz.prev.type) // 'bar' + * ``` + * @return {Object} + * @api public + */ - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; +Object.defineProperty(Node.prototype, 'prev', { + set: function() { + throw new Error('node.prev is a getter and cannot be defined'); + }, + get: function() { + if (Array.isArray(this.siblings)) { + return this.siblings[this.index - 1] || this.parent.prev; + } + return null; + } +}); - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; +/** + * Get the siblings array, or `null` if it doesn't exist. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * var baz = new Node({type: 'baz'}); + * foo.push(bar); + * foo.push(baz); + * + * console.log(bar.siblings.length) // 2 + * console.log(baz.siblings.length) // 2 + * ``` + * @return {Object} + * @api public + */ - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = __webpack_require__(7395)/* .StringDecoder */ .s; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; +Object.defineProperty(Node.prototype, 'next', { + set: function() { + throw new Error('node.next is a getter and cannot be defined'); + }, + get: function() { + if (Array.isArray(this.siblings)) { + return this.siblings[this.index + 1] || this.parent.next; + } + return null; } -} - -function Readable(options) { - Duplex = Duplex || __webpack_require__(42770); - - if (!(this instanceof Readable)) return new Readable(options); +}); - this._readableState = new ReadableState(options, this); +/** + * Get the first node from `node.nodes`. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * var baz = new Node({type: 'baz'}); + * var qux = new Node({type: 'qux'}); + * foo.push(bar); + * foo.push(baz); + * foo.push(qux); + * + * console.log(foo.first.type) // 'bar' + * ``` + * @return {Object} The first node, or undefiend + * @api public + */ - // legacy - this.readable = true; +Object.defineProperty(Node.prototype, 'first', { + get: function() { + return this.nodes ? this.nodes[0] : null; + } +}); - if (options) { - if (typeof options.read === 'function') this._read = options.read; +/** + * Get the last node from `node.nodes`. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * var baz = new Node({type: 'baz'}); + * var qux = new Node({type: 'qux'}); + * foo.push(bar); + * foo.push(baz); + * foo.push(qux); + * + * console.log(foo.last.type) // 'qux' + * ``` + * @return {Object} The last node, or undefiend + * @api public + */ - if (typeof options.destroy === 'function') this._destroy = options.destroy; +Object.defineProperty(Node.prototype, 'last', { + get: function() { + return this.nodes ? utils.last(this.nodes) : null; } +}); - Stream.call(this); -} +/** + * Get the last node from `node.nodes`. + * + * ```js + * var foo = new Node({type: 'foo'}); + * var bar = new Node({type: 'bar'}); + * var baz = new Node({type: 'baz'}); + * var qux = new Node({type: 'qux'}); + * foo.push(bar); + * foo.push(baz); + * foo.push(qux); + * + * console.log(foo.last.type) // 'qux' + * ``` + * @return {Object} The last node, or undefiend + * @api public + */ -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; +Object.defineProperty(Node.prototype, 'scope', { + get: function() { + if (this.isScope !== true) { + return this.parent ? this.parent.scope : this; } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; + return this; } }); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; +/** + * Get own property names from Node prototype, but only the + * first time `Node` is instantiated + */ - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; +function lazyKeys() { + if (!ownNames) { + ownNames = Object.getOwnPropertyNames(Node.prototype); } +} - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; +/** + * Simplified assertion. Throws an error is `val` is falsey. + */ -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; +function assert(val, message) { + if (!val) throw new Error(message); +} -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } +/** + * Expose `Node` + */ - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } +exports = module.exports = Node; - return needMoreData(state); -} -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); +/***/ }), - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} +/***/ 88599: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} +"use strict"; +/*! + * define-property + * + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = __webpack_require__(7395)/* .StringDecoder */ .s; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; +var isDescriptor = __webpack_require__(44133); -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; +module.exports = function defineProperty(obj, prop, val) { + if (typeof obj !== 'object' && typeof obj !== 'function') { + throw new TypeError('expected an object or function.'); } - return n; -} -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + if (typeof prop !== 'string') { + throw new TypeError('expected `prop` to be a string.'); } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; + + if (isDescriptor(val) && ('set' in val || 'get' in val)) { + return Object.defineProperty(obj, prop, val); } - return state.length; -} -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; + return Object.defineProperty(obj, prop, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); +}; - if (n !== 0) state.emittedReadable = false; - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } +/***/ }), - n = howMuchToRead(n, state); +/***/ 82071: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } +"use strict"; - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); +var typeOf = __webpack_require__(48865); +var utils = module.exports; - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } +/** + * Returns true if the given value is a node. + * + * ```js + * var Node = require('snapdragon-node'); + * var node = new Node({type: 'foo'}); + * console.log(utils.isNode(node)); //=> true + * console.log(utils.isNode({})); //=> false + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @returns {Boolean} + * @api public + */ - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } +utils.isNode = function(node) { + return typeOf(node) === 'object' && node.isNode === true; +}; - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; +/** + * Emit an empty string for the given `node`. + * + * ```js + * // do nothing for beginning-of-string + * snapdragon.compiler.set('bos', utils.noop); + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @returns {undefined} + * @api public + */ - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } +utils.noop = function(node) { + append(this, '', node); +}; - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; +/** + * Appdend `node.val` to `compiler.output`, exactly as it was created + * by the parser. + * + * ```js + * snapdragon.compiler.set('text', utils.identity); + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @returns {undefined} + * @api public + */ - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } +utils.identity = function(node) { + append(this, node.val, node); +}; - if (ret !== null) this.emit('data', ret); +/** + * Previously named `.emit`, this method appends the given `val` + * to `compiler.output` for the given node. Useful when you know + * what value should be appended advance, regardless of the actual + * value of `node.val`. + * + * ```js + * snapdragon.compiler + * .set('i', function(node) { + * this.mapVisit(node); + * }) + * .set('i.open', utils.append('')) + * .set('i.close', utils.append('')) + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @returns {Function} Returns a compiler middleware function. + * @api public + */ - return ret; +utils.append = function(val) { + return function(node) { + append(this, val, node); + }; }; -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} +/** + * Used in compiler middleware, this onverts an AST node into + * an empty `text` node and deletes `node.nodes` if it exists. + * The advantage of this method is that, as opposed to completely + * removing the node, indices will not need to be re-calculated + * in sibling nodes, and nothing is appended to the output. + * + * ```js + * utils.toNoop(node); + * // convert `node.nodes` to the given value instead of deleting it + * utils.toNoop(node, []); + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {Array} `nodes` Optionally pass a new `nodes` value, to replace the existing `node.nodes` array. + * @api public + */ -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); +utils.toNoop = function(node, nodes) { + if (nodes) { + node.nodes = nodes; + } else { + delete node.nodes; + node.type = 'text'; + node.val = ''; } -} +}; -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} +/** + * Visit `node` with the given `fn`. The built-in `.visit` method in snapdragon + * automatically calls registered compilers, this allows you to pass a visitor + * function. + * + * ```js + * snapdragon.compiler.set('i', function(node) { + * utils.visit(node, function(childNode) { + * // do stuff with "childNode" + * return childNode; + * }); + * }); + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {Function} `fn` + * @return {Object} returns the node after recursively visiting all child nodes. + * @api public + */ -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); +utils.visit = function(node, fn) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + assert(isFunction(fn), 'expected a visitor function'); + fn(node); + return node.nodes ? utils.mapVisit(node, fn) : node; }; -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; +/** + * Map [visit](#visit) the given `fn` over `node.nodes`. This is called by + * [visit](#visit), use this method if you do not want `fn` to be called on + * the first node. + * + * ```js + * snapdragon.compiler.set('i', function(node) { + * utils.mapVisit(node, function(childNode) { + * // do stuff with "childNode" + * return childNode; + * }); + * }); + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {Object} `options` + * @param {Function} `fn` + * @return {Object} returns the node + * @api public + */ - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; +utils.mapVisit = function(node, fn) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + assert(isArray(node.nodes), 'expected node.nodes to be an array'); + assert(isFunction(fn), 'expected a visitor function'); + + for (var i = 0; i < node.nodes.length; i++) { + utils.visit(node.nodes[i], fn); } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + return node; +}; - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; +/** + * Unshift an `*.open` node onto `node.nodes`. + * + * ```js + * var Node = require('snapdragon-node'); + * snapdragon.parser.set('brace', function(node) { + * var match = this.match(/^{/); + * if (match) { + * var parent = new Node({type: 'brace'}); + * utils.addOpen(parent, Node); + * console.log(parent.nodes[0]): + * // { type: 'brace.open', val: '' }; + * + * // push the parent "brace" node onto the stack + * this.push(parent); + * + * // return the parent node, so it's also added to the AST + * return brace; + * } + * }); + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. + * @param {Function} `filter` Optionaly specify a filter function to exclude the node. + * @return {Object} Returns the created opening node. + * @api public + */ - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); +utils.addOpen = function(node, Node, val, filter) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + assert(isFunction(Node), 'expected Node to be a constructor function'); - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } + if (typeof val === 'function') { + filter = val; + val = ''; } - function onend() { - debug('onend'); - dest.end(); + if (typeof filter === 'function' && !filter(node)) return; + var open = new Node({ type: node.type + '.open', val: val}); + var unshift = node.unshift || node.unshiftNode; + if (typeof unshift === 'function') { + unshift.call(node, open); + } else { + utils.unshiftNode(node, open); } + return open; +}; - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; +/** + * Push a `*.close` node onto `node.nodes`. + * + * ```js + * var Node = require('snapdragon-node'); + * snapdragon.parser.set('brace', function(node) { + * var match = this.match(/^}/); + * if (match) { + * var parent = this.parent(); + * if (parent.type !== 'brace') { + * throw new Error('missing opening: ' + '}'); + * } + * + * utils.addClose(parent, Node); + * console.log(parent.nodes[parent.nodes.length - 1]): + * // { type: 'brace.close', val: '' }; + * + * // no need to return a node, since the parent + * // was already added to the AST + * return; + * } + * }); + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. + * @param {Function} `filter` Optionaly specify a filter function to exclude the node. + * @return {Object} Returns the created closing node. + * @api public + */ - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } +utils.addClose = function(node, Node, val, filter) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + assert(isFunction(Node), 'expected Node to be a constructor function'); - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } + if (typeof val === 'function') { + filter = val; + val = ''; } - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + if (typeof filter === 'function' && !filter(node)) return; + var close = new Node({ type: node.type + '.close', val: val}); + var push = node.push || node.pushNode; + if (typeof push === 'function') { + push.call(node, close); + } else { + utils.pushNode(node, close); } + return close; +}; - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); +/** + * Wraps the given `node` with `*.open` and `*.close` nodes. + * + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. + * @param {Function} `filter` Optionaly specify a filter function to exclude the node. + * @return {Object} Returns the node + * @api public + */ - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); +utils.wrapNodes = function(node, Node, filter) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + assert(isFunction(Node), 'expected Node to be a constructor function'); - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } + utils.addOpen(node, Node, filter); + utils.addClose(node, Node, filter); + return node; +}; - // tell the dest that it's being piped to - dest.emit('pipe', src); +/** + * Push the given `node` onto `parent.nodes`, and set `parent` as `node.parent. + * + * ```js + * var parent = new Node({type: 'foo'}); + * var node = new Node({type: 'bar'}); + * utils.pushNode(parent, node); + * console.log(parent.nodes[0].type) // 'bar' + * console.log(node.parent.type) // 'foo' + * ``` + * @param {Object} `parent` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Object} Returns the child node + * @api public + */ - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } +utils.pushNode = function(parent, node) { + assert(utils.isNode(parent), 'expected parent node to be an instance of Node'); + assert(utils.isNode(node), 'expected node to be an instance of Node'); - return dest; + node.define('parent', parent); + parent.nodes = parent.nodes || []; + parent.nodes.push(node); + return node; }; -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; +/** + * Unshift `node` onto `parent.nodes`, and set `parent` as `node.parent. + * + * ```js + * var parent = new Node({type: 'foo'}); + * var node = new Node({type: 'bar'}); + * utils.unshiftNode(parent, node); + * console.log(parent.nodes[0].type) // 'bar' + * console.log(node.parent.type) // 'foo' + * ``` + * @param {Object} `parent` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {undefined} + * @api public + */ - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; +utils.unshiftNode = function(parent, node) { + assert(utils.isNode(parent), 'expected parent node to be an instance of Node'); + assert(utils.isNode(node), 'expected node to be an instance of Node'); - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; + node.define('parent', parent); + parent.nodes = parent.nodes || []; + parent.nodes.unshift(node); +}; - if (!dest) dest = state.pipes; +/** + * Pop the last `node` off of `parent.nodes`. The advantage of + * using this method is that it checks for `node.nodes` and works + * with any version of `snapdragon-node`. + * + * ```js + * var parent = new Node({type: 'foo'}); + * utils.pushNode(parent, new Node({type: 'foo'})); + * utils.pushNode(parent, new Node({type: 'bar'})); + * utils.pushNode(parent, new Node({type: 'baz'})); + * console.log(parent.nodes.length); //=> 3 + * utils.popNode(parent); + * console.log(parent.nodes.length); //=> 2 + * ``` + * @param {Object} `parent` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Number|Undefined} Returns the length of `node.nodes` or undefined. + * @api public + */ - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; +utils.popNode = function(node) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + if (typeof node.pop === 'function') { + return node.pop(); } + return node.nodes && node.nodes.pop(); +}; - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +/** + * Shift the first `node` off of `parent.nodes`. The advantage of + * using this method is that it checks for `node.nodes` and works + * with any version of `snapdragon-node`. + * + * ```js + * var parent = new Node({type: 'foo'}); + * utils.pushNode(parent, new Node({type: 'foo'})); + * utils.pushNode(parent, new Node({type: 'bar'})); + * utils.pushNode(parent, new Node({type: 'baz'})); + * console.log(parent.nodes.length); //=> 3 + * utils.shiftNode(parent); + * console.log(parent.nodes.length); //=> 2 + * ``` + * @param {Object} `parent` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Number|Undefined} Returns the length of `node.nodes` or undefined. + * @api public + */ - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; +utils.shiftNode = function(node) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + if (typeof node.shift === 'function') { + return node.shift(); } + return node.nodes && node.nodes.shift(); +}; - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; +/** + * Remove the specified `node` from `parent.nodes`. + * + * ```js + * var parent = new Node({type: 'abc'}); + * var foo = new Node({type: 'foo'}); + * utils.pushNode(parent, foo); + * utils.pushNode(parent, new Node({type: 'bar'})); + * utils.pushNode(parent, new Node({type: 'baz'})); + * console.log(parent.nodes.length); //=> 3 + * utils.removeNode(parent, foo); + * console.log(parent.nodes.length); //=> 2 + * ``` + * @param {Object} `parent` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Object|undefined} Returns the removed node, if successful, or undefined if it does not exist on `parent.nodes`. + * @api public + */ - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; +utils.removeNode = function(parent, node) { + assert(utils.isNode(parent), 'expected parent.node to be an instance of Node'); + assert(utils.isNode(node), 'expected node to be an instance of Node'); - dest.emit('unpipe', this, unpipeInfo); + if (!parent.nodes) { + return null; + } - return this; + if (typeof parent.remove === 'function') { + return parent.remove(node); + } + + var idx = parent.nodes.indexOf(node); + if (idx !== -1) { + return parent.nodes.splice(idx, 1); + } }; -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); +/** + * Returns true if `node.type` matches the given `type`. Throws a + * `TypeError` if `node` is not an instance of `Node`. + * + * ```js + * var Node = require('snapdragon-node'); + * var node = new Node({type: 'foo'}); + * console.log(utils.isType(node, 'foo')); // false + * console.log(utils.isType(node, 'bar')); // true + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {String} `type` + * @return {Boolean} + * @api public + */ - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); +utils.isType = function(node, type) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + switch (typeOf(type)) { + case 'array': + var types = type.slice(); + for (var i = 0; i < types.length; i++) { + if (utils.isType(node, types[i])) { + return true; + } } + return false; + case 'string': + return node.type === type; + case 'regexp': + return type.test(node.type); + default: { + throw new TypeError('expected "type" to be an array, string or regexp'); } } - - return res; }; -Readable.prototype.addListener = Readable.prototype.on; -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} +/** + * Returns true if the given `node` has the given `type` in `node.nodes`. + * Throws a `TypeError` if `node` is not an instance of `Node`. + * + * ```js + * var Node = require('snapdragon-node'); + * var node = new Node({ + * type: 'foo', + * nodes: [ + * new Node({type: 'bar'}), + * new Node({type: 'baz'}) + * ] + * }); + * console.log(utils.hasType(node, 'xyz')); // false + * console.log(utils.hasType(node, 'baz')); // true + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {String} `type` + * @return {Boolean} + * @api public + */ -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); +utils.hasType = function(node, type) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + if (!Array.isArray(node.nodes)) return false; + for (var i = 0; i < node.nodes.length; i++) { + if (utils.isType(node.nodes[i], type)) { + return true; + } } - return this; + return false; }; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} +/** + * Returns the first node from `node.nodes` of the given `type` + * + * ```js + * var node = new Node({ + * type: 'foo', + * nodes: [ + * new Node({type: 'text', val: 'abc'}), + * new Node({type: 'text', val: 'xyz'}) + * ] + * }); + * + * var textNode = utils.firstOfType(node.nodes, 'text'); + * console.log(textNode.val); + * //=> 'abc' + * ``` + * @param {Array} `nodes` + * @param {String} `type` + * @return {Object|undefined} Returns the first matching node or undefined. + * @api public + */ -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); +utils.firstOfType = function(nodes, type) { + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + if (utils.isType(node, type)) { + return node; + } } +}; - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} +/** + * Returns the node at the specified index, or the first node of the + * given `type` from `node.nodes`. + * + * ```js + * var node = new Node({ + * type: 'foo', + * nodes: [ + * new Node({type: 'text', val: 'abc'}), + * new Node({type: 'text', val: 'xyz'}) + * ] + * }); + * + * var nodeOne = utils.findNode(node.nodes, 'text'); + * console.log(nodeOne.val); + * //=> 'abc' + * + * var nodeTwo = utils.findNode(node.nodes, 1); + * console.log(nodeTwo.val); + * //=> 'xyz' + * ``` + * + * @param {Array} `nodes` + * @param {String|Number} `type` Node type or index. + * @return {Object} Returns a node or undefined. + * @api public + */ -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); +utils.findNode = function(nodes, type) { + if (!Array.isArray(nodes)) { + return null; } - return this; + if (typeof type === 'number') { + return nodes[type]; + } + return utils.firstOfType(nodes, type); }; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } +/** + * Returns true if the given node is an "*.open" node. + * + * ```js + * var Node = require('snapdragon-node'); + * var brace = new Node({type: 'brace'}); + * var open = new Node({type: 'brace.open'}); + * var close = new Node({type: 'brace.close'}); + * + * console.log(utils.isOpen(brace)); // false + * console.log(utils.isOpen(open)); // true + * console.log(utils.isOpen(close)); // false + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Boolean} + * @api public + */ - _this.push(null); - }); +utils.isOpen = function(node) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + return node.type.slice(-5) === '.open'; +}; - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); +/** + * Returns true if the given node is a "*.close" node. + * + * ```js + * var Node = require('snapdragon-node'); + * var brace = new Node({type: 'brace'}); + * var open = new Node({type: 'brace.open'}); + * var close = new Node({type: 'brace.close'}); + * + * console.log(utils.isClose(brace)); // false + * console.log(utils.isClose(open)); // false + * console.log(utils.isClose(close)); // true + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Boolean} + * @api public + */ - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; +utils.isClose = function(node) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + return node.type.slice(-6) === '.close'; +}; - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); +/** + * Returns true if `node.nodes` **has** an `.open` node + * + * ```js + * var Node = require('snapdragon-node'); + * var brace = new Node({ + * type: 'brace', + * nodes: [] + * }); + * + * var open = new Node({type: 'brace.open'}); + * console.log(utils.hasOpen(brace)); // false + * + * brace.pushNode(open); + * console.log(utils.hasOpen(brace)); // true + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Boolean} + * @api public + */ - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } +utils.hasOpen = function(node) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + var first = node.first || node.nodes ? node.nodes[0] : null; + if (utils.isNode(first)) { + return first.type === node.type + '.open'; } + return false; +}; - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); +/** + * Returns true if `node.nodes` **has** a `.close` node + * + * ```js + * var Node = require('snapdragon-node'); + * var brace = new Node({ + * type: 'brace', + * nodes: [] + * }); + * + * var close = new Node({type: 'brace.close'}); + * console.log(utils.hasClose(brace)); // false + * + * brace.pushNode(close); + * console.log(utils.hasClose(brace)); // true + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Boolean} + * @api public + */ + +utils.hasClose = function(node) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + var last = node.last || node.nodes ? node.nodes[node.nodes.length - 1] : null; + if (utils.isNode(last)) { + return last.type === node.type + '.close'; } + return false; +}; - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; +/** + * Returns true if `node.nodes` has both `.open` and `.close` nodes + * + * ```js + * var Node = require('snapdragon-node'); + * var brace = new Node({ + * type: 'brace', + * nodes: [] + * }); + * + * var open = new Node({type: 'brace.open'}); + * var close = new Node({type: 'brace.close'}); + * console.log(utils.hasOpen(brace)); // false + * console.log(utils.hasClose(brace)); // false + * + * brace.pushNode(open); + * brace.pushNode(close); + * console.log(utils.hasOpen(brace)); // true + * console.log(utils.hasClose(brace)); // true + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Boolean} + * @api public + */ - return this; +utils.hasOpenAndClose = function(node) { + return utils.hasOpen(node) && utils.hasClose(node); }; -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); +/** + * Push the given `node` onto the `state.inside` array for the + * given type. This array is used as a specialized "stack" for + * only the given `node.type`. + * + * ```js + * var state = { inside: {}}; + * var node = new Node({type: 'brace'}); + * utils.addType(state, node); + * console.log(state.inside); + * //=> { brace: [{type: 'brace'}] } + * ``` + * @param {Object} `state` The `compiler.state` object or custom state object. + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Array} Returns the `state.inside` stack for the given type. + * @api public + */ -// exposed for testing purposes only. -Readable._fromList = fromList; +utils.addType = function(state, node) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + assert(isObject(state), 'expected state to be an object'); -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; + var type = node.parent + ? node.parent.type + : node.type.replace(/\.open$/, ''); - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); + if (!state.hasOwnProperty('inside')) { + state.inside = {}; + } + if (!state.inside.hasOwnProperty(type)) { + state.inside[type] = []; } - return ret; -} + var arr = state.inside[type]; + arr.push(node); + return arr; +}; -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} +/** + * Remove the given `node` from the `state.inside` array for the + * given type. This array is used as a specialized "stack" for + * only the given `node.type`. + * + * ```js + * var state = { inside: {}}; + * var node = new Node({type: 'brace'}); + * utils.addType(state, node); + * console.log(state.inside); + * //=> { brace: [{type: 'brace'}] } + * utils.removeType(state, node); + * //=> { brace: [] } + * ``` + * @param {Object} `state` The `compiler.state` object or custom state object. + * @param {Object} `node` Instance of [snapdragon-node][] + * @return {Array} Returns the `state.inside` stack for the given type. + * @api public + */ -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; +utils.removeType = function(state, node) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + assert(isObject(state), 'expected state to be an object'); + + var type = node.parent + ? node.parent.type + : node.type.replace(/\.close$/, ''); + + if (state.inside.hasOwnProperty(type)) { + return state.inside[type].pop(); } - list.length -= c; - return ret; -} +}; -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); +/** + * Returns true if `node.val` is an empty string, or `node.nodes` does + * not contain any non-empty text nodes. + * + * ```js + * var node = new Node({type: 'text'}); + * utils.isEmpty(node); //=> true + * node.val = 'foo'; + * utils.isEmpty(node); //=> false + * ``` + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {Function} `fn` + * @return {Boolean} + * @api public + */ - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} +utils.isEmpty = function(node, fn) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); + if (!Array.isArray(node.nodes)) { + if (node.type !== 'text') { + return true; + } + if (typeof fn === 'function') { + return fn(node, node.parent); + } + return !utils.trim(node.val); } -} -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; + for (var i = 0; i < node.nodes.length; i++) { + var child = node.nodes[i]; + if (utils.isOpen(child) || utils.isClose(child)) { + continue; + } + if (!utils.isEmpty(child, fn)) { + return false; + } } - return -1; -} -/***/ }), + return true; +}; -/***/ 62826: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/** + * Returns true if the `state.inside` stack for the given type exists + * and has one or more nodes on it. + * + * ```js + * var state = { inside: {}}; + * var node = new Node({type: 'brace'}); + * console.log(utils.isInsideType(state, 'brace')); //=> false + * utils.addType(state, node); + * console.log(utils.isInsideType(state, 'brace')); //=> true + * utils.removeType(state, node); + * console.log(utils.isInsideType(state, 'brace')); //=> false + * ``` + * @param {Object} `state` + * @param {String} `type` + * @return {Boolean} + * @api public + */ -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +utils.isInsideType = function(state, type) { + assert(isObject(state), 'expected state to be an object'); + assert(isString(type), 'expected type to be a string'); -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. + if (!state.hasOwnProperty('inside')) { + return false; + } + if (!state.inside.hasOwnProperty(type)) { + return false; + } + return state.inside[type].length > 0; +}; -module.exports = Transform; +/** + * Returns true if `node` is either a child or grand-child of the given `type`, + * or `state.inside[type]` is a non-empty array. + * + * ```js + * var state = { inside: {}}; + * var node = new Node({type: 'brace'}); + * var open = new Node({type: 'brace.open'}); + * console.log(utils.isInside(state, open, 'brace')); //=> false + * utils.pushNode(node, open); + * console.log(utils.isInside(state, open, 'brace')); //=> true + * ``` + * @param {Object} `state` Either the `compiler.state` object, if it exists, or a user-supplied state object. + * @param {Object} `node` Instance of [snapdragon-node][] + * @param {String} `type` The `node.type` to check for. + * @return {Boolean} + * @api public + */ -var Duplex = __webpack_require__(42770); +utils.isInside = function(state, node, type) { + assert(utils.isNode(node), 'expected node to be an instance of Node'); + assert(isObject(state), 'expected state to be an object'); -/**/ -var util = Object.create(__webpack_require__(78334)); -util.inherits = __webpack_require__(2989); -/**/ + if (Array.isArray(type)) { + for (var i = 0; i < type.length; i++) { + if (utils.isInside(state, node, type[i])) { + return true; + } + } + return false; + } -util.inherits(Transform, Duplex); + var parent = node.parent; + if (typeof type === 'string') { + return (parent && parent.type === type) || utils.isInsideType(state, type); + } -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; + if (typeOf(type) === 'regexp') { + if (parent && parent.type && type.test(parent.type)) { + return true; + } - var cb = ts.writecb; + var keys = Object.keys(state.inside); + var len = keys.length; + var idx = -1; + while (++idx < len) { + var key = keys[idx]; + var val = state.inside[key]; - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); + if (Array.isArray(val) && val.length !== 0 && type.test(key)) { + return true; + } + } } + return false; +}; - ts.writechunk = null; - ts.writecb = null; +/** + * Get the last `n` element from the given `array`. Used for getting + * a node from `node.nodes.` + * + * @param {Array} `array` + * @param {Number} `n` + * @return {undefined} + * @api public + */ - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); +utils.last = function(arr, n) { + return arr[arr.length - (n || 1)]; +}; - cb(er); +/** + * Cast the given `val` to an array. + * + * ```js + * console.log(utils.arrayify('')); + * //=> [] + * console.log(utils.arrayify('foo')); + * //=> ['foo'] + * console.log(utils.arrayify(['foo'])); + * //=> ['foo'] + * ``` + * @param {any} `val` + * @return {Array} + * @api public + */ - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); +utils.arrayify = function(val) { + if (typeof val === 'string' && val !== '') { + return [val]; } -} + if (!Array.isArray(val)) { + return []; + } + return val; +}; -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); +/** + * Convert the given `val` to a string by joining with `,`. Useful + * for creating a cheerio/CSS/DOM-style selector from a list of strings. + * + * @param {any} `val` + * @return {Array} + * @api public + */ - Duplex.call(this, options); +utils.stringify = function(val) { + return utils.arrayify(val).join(','); +}; - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; +/** + * Ensure that the given value is a string and call `.trim()` on it, + * or return an empty string. + * + * @param {String} `str` + * @return {String} + * @api public + */ - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; +utils.trim = function(str) { + return typeof str === 'string' ? str.trim() : ''; +}; - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; +/** + * Return true if val is an object + */ - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; +function isObject(val) { + return typeOf(val) === 'object'; +} - if (typeof options.flush === 'function') this._flush = options.flush; - } +/** + * Return true if val is a string + */ - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); +function isString(val) { + return typeof val === 'string'; } -function prefinish() { - var _this = this; +/** + * Return true if val is a function + */ - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } +function isFunction(val) { + return typeof val === 'function'; } -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; +/** + * Return true if val is an array + */ -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; +function isArray(val) { + return Array.isArray(val); +} -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; +/** + * Shim to ensure the `.append` methods work with any version of snapdragon + */ - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; +function append(compiler, val, node) { + if (typeof compiler.append !== 'function') { + return compiler.emit(val, node); } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + return compiler.append(val, node); +} - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); +/** + * Simplified assertion. Throws an error is `val` is falsey. + */ - return stream.push(null); +function assert(val, message) { + if (!val) throw new Error(message); } + /***/ }), -/***/ 78063: +/***/ 79285: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. +var Base = __webpack_require__(87263); +var define = __webpack_require__(5477); +var Compiler = __webpack_require__(33003); +var Parser = __webpack_require__(35573); +var utils = __webpack_require__(622); +var regexCache = {}; +var cache = {}; +/** + * Create a new instance of `Snapdragon` with the given `options`. + * + * ```js + * var snapdragon = new Snapdragon(); + * ``` + * + * @param {Object} `options` + * @api public + */ -/**/ +function Snapdragon(options) { + Base.call(this, null, options); + this.options = utils.extend({source: 'string'}, this.options); + this.compiler = new Compiler(this.options); + this.parser = new Parser(this.options); -var pna = __webpack_require__(58404); -/**/ + Object.defineProperty(this, 'compilers', { + get: function() { + return this.compiler.compilers; + } + }); -module.exports = Writable; + Object.defineProperty(this, 'parsers', { + get: function() { + return this.parser.parsers; + } + }); -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; + Object.defineProperty(this, 'regex', { + get: function() { + return this.parser.regex; + } + }); } -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; +/** + * Inherit Base + */ - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ +Base.extend(Snapdragon); -/**/ -var Duplex; -/**/ +/** + * Add a parser to `snapdragon.parsers` for capturing the given `type` using + * the specified regex or parser function. A function is useful if you need + * to customize how the token is created and/or have access to the parser + * instance to check options, etc. + * + * ```js + * snapdragon + * .capture('slash', /^\//) + * .capture('dot', function() { + * var pos = this.position(); + * var m = this.match(/^\./); + * if (!m) return; + * return pos({ + * type: 'dot', + * val: m[0] + * }); + * }); + * ``` + * @param {String} `type` + * @param {RegExp|Function} `regex` + * @return {Object} Returns the parser instance for chaining + * @api public + */ -Writable.WritableState = WritableState; +Snapdragon.prototype.capture = function() { + return this.parser.capture.apply(this.parser, arguments); +}; -/**/ -var util = Object.create(__webpack_require__(78334)); -util.inherits = __webpack_require__(2989); -/**/ +/** + * Register a plugin `fn`. + * + * ```js + * var snapdragon = new Snapdgragon([options]); + * snapdragon.use(function() { + * console.log(this); //<= snapdragon instance + * console.log(this.parser); //<= parser instance + * console.log(this.compiler); //<= compiler instance + * }); + * ``` + * @param {Object} `fn` + * @api public + */ -/**/ -var internalUtil = { - deprecate: __webpack_require__(92262) +Snapdragon.prototype.use = function(fn) { + fn.call(this, this); + return this; }; -/**/ -/**/ -var Stream = __webpack_require__(1065); -/**/ +/** + * Parse the given `str`. + * + * ```js + * var snapdragon = new Snapdgragon([options]); + * // register parsers + * snapdragon.parser.use(function() {}); + * + * // parse + * var ast = snapdragon.parse('foo/bar'); + * console.log(ast); + * ``` + * @param {String} `str` + * @param {Object} `options` Set `options.sourcemap` to true to enable source maps. + * @return {Object} Returns an AST. + * @api public + */ -/**/ +Snapdragon.prototype.parse = function(str, options) { + this.options = utils.extend({}, this.options, options); + var parsed = this.parser.parse(str, this.options); -var Buffer = __webpack_require__(96788).Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} + // add non-enumerable parser reference + define(parsed, 'parser', this.parser); + return parsed; +}; -/**/ +/** + * Compile the given `AST`. + * + * ```js + * var snapdragon = new Snapdgragon([options]); + * // register plugins + * snapdragon.use(function() {}); + * // register parser plugins + * snapdragon.parser.use(function() {}); + * // register compiler plugins + * snapdragon.compiler.use(function() {}); + * + * // parse + * var ast = snapdragon.parse('foo/bar'); + * + * // compile + * var res = snapdragon.compile(ast); + * console.log(res.output); + * ``` + * @param {Object} `ast` + * @param {Object} `options` + * @return {Object} Returns an object with an `output` property with the rendered string. + * @api public + */ -var destroyImpl = __webpack_require__(87915); +Snapdragon.prototype.compile = function(ast, options) { + this.options = utils.extend({}, this.options, options); + var compiled = this.compiler.compile(ast, this.options); -util.inherits(Writable, Stream); + // add non-enumerable compiler reference + define(compiled, 'compiler', this.compiler); + return compiled; +}; -function nop() {} +/** + * Expose `Snapdragon` + */ -function WritableState(options, stream) { - Duplex = Duplex || __webpack_require__(42770); +module.exports = Snapdragon; - options = options || {}; +/** + * Expose `Parser` and `Compiler` + */ - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; +module.exports.Compiler = Compiler; +module.exports.Parser = Parser; - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; +/***/ }), - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; +/***/ 33003: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; +"use strict"; - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - // if _final has been called - this.finalCalled = false; +var use = __webpack_require__(77709); +var define = __webpack_require__(5477); +var debug = __webpack_require__(31185)('snapdragon:compiler'); +var utils = __webpack_require__(622); - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; +/** + * Create a new `Compiler` with the given `options`. + * @param {Object} `options` + */ - // has it been destroyed - this.destroyed = false; +function Compiler(options, state) { + debug('initializing', __filename); + this.options = utils.extend({source: 'string'}, options); + this.state = state || {}; + this.compilers = {}; + this.output = ''; + this.set('eos', function(node) { + return this.emit(node.val, node); + }); + this.set('noop', function(node) { + return this.emit(node.val, node); + }); + this.set('bos', function(node) { + return this.emit(node.val, node); + }); + use(this); +} - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; +/** + * Prototype methods + */ - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; +Compiler.prototype = { - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; + /** + * Throw an error message with details including the cursor position. + * @param {String} `msg` Message to use in the Error. + */ - // a flag to see when we're in the middle of a write. - this.writing = false; + error: function(msg, node) { + var pos = node.position || {start: {column: 0}}; + var message = this.options.source + ' column:' + pos.start.column + ': ' + msg; - // when true all writes will be buffered until .uncork() call - this.corked = 0; + var err = new Error(message); + err.reason = msg; + err.column = pos.start.column; + err.source = this.pattern; - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; + if (this.options.silent) { + this.errors.push(err); + } else { + throw err; + } + }, - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; + /** + * Define a non-enumberable property on the `Compiler` instance. + * + * ```js + * compiler.define('foo', 'bar'); + * ``` + * @name .define + * @param {String} `key` propery name + * @param {any} `val` property value + * @return {Object} Returns the Compiler instance for chaining. + * @api public + */ - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; + define: function(key, val) { + define(this, key, val); + return this; + }, - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; + /** + * Emit `node.val` + */ - // the amount that is being written when _write is called. - this.writelen = 0; + emit: function(str, node) { + this.output += str; + return str; + }, - this.bufferedRequest = null; - this.lastBufferedRequest = null; + /** + * Add a compiler `fn` with the given `name` + */ - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; + set: function(name, fn) { + this.compilers[name] = fn; + return this; + }, - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; + /** + * Get compiler `name`. + */ - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; + get: function(name) { + return this.compilers[name]; + }, - // count buffered requests - this.bufferedRequestCount = 0; + /** + * Get the previous AST node. + */ - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} + prev: function(n) { + return this.ast.nodes[this.idx - (n || 1)] || { type: 'bos', val: '' }; + }, -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; + /** + * Get the next AST node. + */ -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); + next: function(n) { + return this.ast.nodes[this.idx + (n || 1)] || { type: 'eos', val: '' }; + }, -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; + /** + * Visit `node`. + */ - return object && object._writableState instanceof WritableState; + visit: function(node, nodes, i) { + var fn = this.compilers[node.type]; + this.idx = i; + + if (typeof fn !== 'function') { + throw this.error('compiler "' + node.type + '" is not registered', node); } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} + return fn.call(this, node, nodes, i); + }, -function Writable(options) { - Duplex = Duplex || __webpack_require__(42770); + /** + * Map visit over array of `nodes`. + */ - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. + mapVisit: function(nodes) { + if (!Array.isArray(nodes)) { + throw new TypeError('expected an array'); + } + var len = nodes.length; + var idx = -1; + while (++idx < len) { + this.visit(nodes[idx], nodes, idx); + } + return this; + }, - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } + /** + * Compile `ast`. + */ - this._writableState = new WritableState(options, this); + compile: function(ast, options) { + var opts = utils.extend({}, this.options, options); + this.ast = ast; + this.parsingErrors = this.ast.errors; + this.output = ''; - // legacy. - this.writable = true; + // source map support + if (opts.sourcemap) { + var sourcemaps = __webpack_require__(59657); + sourcemaps(this); + this.mapVisit(this.ast.nodes); + this.applySourceMaps(); + this.map = opts.sourcemap === 'generator' ? this.map : this.map.toJSON(); + return this; + } - if (options) { - if (typeof options.write === 'function') this._write = options.write; + this.mapVisit(this.ast.nodes); + return this; + } +}; - if (typeof options.writev === 'function') this._writev = options.writev; +/** + * Expose `Compiler` + */ - if (typeof options.destroy === 'function') this._destroy = options.destroy; +module.exports = Compiler; - if (typeof options.final === 'function') this._final = options.final; - } - Stream.call(this); -} +/***/ }), -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; +/***/ 35573: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} +"use strict"; -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} +var use = __webpack_require__(77709); +var util = __webpack_require__(31669); +var Cache = __webpack_require__(4337); +var define = __webpack_require__(5477); +var debug = __webpack_require__(31185)('snapdragon:parser'); +var Position = __webpack_require__(7974); +var utils = __webpack_require__(622); -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); +/** + * Create a new `Parser` with the given `input` and `options`. + * @param {String} `input` + * @param {Object} `options` + * @api public + */ - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } +function Parser(options) { + debug('initializing', __filename); + this.options = utils.extend({source: 'string'}, options); + this.init(this.options); + use(this); +} - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } +/** + * Prototype methods + */ - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; +Parser.prototype = { + constructor: Parser, - if (typeof cb !== 'function') cb = nop; + init: function(options) { + this.orig = ''; + this.input = ''; + this.parsed = ''; - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } + this.column = 1; + this.line = 1; - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; + this.regex = new Cache(); + this.errors = this.errors || []; + this.parsers = this.parsers || {}; + this.types = this.types || []; + this.sets = this.sets || {}; + this.fns = this.fns || []; + this.currentType = 'root'; - state.corked++; -}; + var pos = this.position(); + this.bos = pos({type: 'bos', val: ''}); -Writable.prototype.uncork = function () { - var state = this._writableState; + this.ast = { + type: 'root', + errors: this.errors, + nodes: [this.bos] + }; - if (state.corked) { - state.corked--; + define(this.bos, 'parent', this.ast); + this.nodes = [this.ast]; - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; + this.count = 0; + this.setCount = 0; + this.stack = []; + }, -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; + /** + * Throw a formatted error with the cursor column and `msg`. + * @param {String} `msg` Message to use in the Error. + */ -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} + error: function(msg, node) { + var pos = node.position || {start: {column: 0, line: 0}}; + var line = pos.start.line; + var column = pos.start.column; + var source = this.options.source; -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); + var message = source + ' : ' + msg; + var err = new Error(message); + err.source = source; + err.reason = msg; + err.pos = pos; -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; + if (this.options.silent) { + this.errors.push(err); + } else { + throw err; } - } - var len = state.objectMode ? 1 : chunk.length; + }, - state.length += len; + /** + * Define a non-enumberable property on the `Parser` instance. + * + * ```js + * parser.define('foo', 'bar'); + * ``` + * @name .define + * @param {String} `key` propery name + * @param {any} `val` property value + * @return {Object} Returns the Parser instance for chaining. + * @api public + */ - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; + define: function(key, val) { + define(this, key, val); + return this; + }, - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null + /** + * Mark position and patch `node.position`. + */ + + position: function() { + var start = { line: this.line, column: this.column }; + var self = this; + + return function(node) { + define(node, 'position', new Position(start, self)); + return node; }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; + }, + + /** + * Set parser `name` with the given `fn` + * @param {String} `name` + * @param {Function} `fn` + * @api public + */ + + set: function(type, fn) { + if (this.types.indexOf(type) === -1) { + this.types.push(type); } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } + this.parsers[type] = fn.bind(this); + return this; + }, - return ret; -} + /** + * Get parser `name` + * @param {String} `name` + * @api public + */ -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} + get: function(name) { + return this.parsers[name]; + }, -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; + /** + * Push a `token` onto the `type` stack. + * + * @param {String} `type` + * @return {Object} `token` + * @api public + */ - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} + push: function(type, token) { + this.sets[type] = this.sets[type] || []; + this.count++; + this.stack.push(token); + return this.sets[type].push(token); + }, -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} + /** + * Pop a token off of the `type` stack + * @param {String} `type` + * @returns {Object} Returns a token + * @api public + */ -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; + pop: function(type) { + this.sets[type] = this.sets[type] || []; + this.count--; + this.stack.pop(); + return this.sets[type].pop(); + }, - onwriteStateUpdate(state); + /** + * Return true if inside a `stack` node. Types are `braces`, `parens` or `brackets`. + * + * @param {String} `type` + * @return {Boolean} + * @api public + */ - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); + isInside: function(type) { + this.sets[type] = this.sets[type] || []; + return this.sets[type].length > 0; + }, - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } + /** + * Return true if `node` is the given `type`. + * + * ```js + * parser.isType(node, 'brace'); + * ``` + * @param {Object} `node` + * @param {String} `type` + * @return {Boolean} + * @api public + */ - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} + isType: function(node, type) { + return node && node.type === type; + }, -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} + /** + * Get the previous AST node + * @return {Object} + */ -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} + prev: function(n) { + return this.stack.length > 0 + ? utils.last(this.stack, n) + : utils.last(this.nodes, n); + }, -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; + /** + * Update line and column based on `str`. + */ - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; + consume: function(len) { + this.input = this.input.substr(len); + }, - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; + /** + * Update column based on `str`. + */ - doWrite(stream, state, true, state.length, buffer, '', holder.finish); + updatePosition: function(str, len) { + var lines = str.match(/\n/g); + if (lines) this.line += lines.length; + var i = str.lastIndexOf('\n'); + this.column = ~i ? len - i : this.column + len; + this.parsed += str; + this.consume(len); + }, - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); + /** + * Match `regex`, return captures, and update the cursor position by `match[0]` length. + * @param {RegExp} `regex` + * @return {Object} + */ + + match: function(regex) { + var m = regex.exec(this.input); + if (m) { + this.updatePosition(m[0], m[0].length); + return m; } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; + }, - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } + /** + * Capture `type` with the given regex. + * @param {String} `type` + * @param {RegExp} `regex` + * @return {Function} + */ + + capture: function(type, regex) { + if (typeof regex === 'function') { + return this.set.apply(this, arguments); } - if (entry === null) state.lastBufferedRequest = null; - } + this.regex.set(type, regex); + this.set(type, function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(regex); + if (!m || !m[0]) return; - state.bufferedRequest = entry; - state.bufferProcessing = false; -} + var prev = this.prev(); + var node = pos({ + type: type, + val: m[0], + parsed: parsed, + rest: this.input + }); -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; + if (m[1]) { + node.inner = m[1]; + } -Writable.prototype._writev = null; + define(node, 'inside', this.stack.length > 0); + define(node, 'parent', prev); + prev.nodes.push(node); + }.bind(this)); + return this; + }, -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; + /** + * Create a parser with open and close for parens, + * brackets or braces + */ - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } + capturePair: function(type, openRegex, closeRegex, fn) { + this.sets[type] = this.sets[type] || []; - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + /** + * Open + */ - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } + this.set(type + '.open', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(openRegex); + if (!m || !m[0]) return; - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; + var val = m[0]; + this.setCount++; + this.specialChars = true; + var open = pos({ + type: type + '.open', + val: val, + rest: this.input + }); -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} + if (typeof m[1] !== 'undefined') { + open.inner = m[1]; + } -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} + var prev = this.prev(); + var node = pos({ + type: type, + nodes: [open] + }); -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} + define(node, 'rest', this.input); + define(node, 'parsed', parsed); + define(node, 'prefix', m[1]); + define(node, 'parent', prev); + define(open, 'parent', node); -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } + if (typeof fn === 'function') { + fn.call(this, open, node); + } - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); + this.push(type, node); + prev.nodes.push(node); + }); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; + /** + * Close + */ -/***/ }), + this.set(type + '.close', function() { + var pos = this.position(); + var m = this.match(closeRegex); + if (!m || !m[0]) return; -/***/ 28878: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + var parent = this.pop(type); + var node = pos({ + type: type + '.close', + rest: this.input, + suffix: m[1], + val: m[0] + }); -"use strict"; + if (!this.isType(parent, type)) { + if (this.options.strict) { + throw new Error('missing opening "' + type + '"'); + } + this.setCount--; + node.escaped = true; + return node; + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (node.suffix === '\\') { + parent.escaped = true; + node.escaped = true; + } -var Buffer = __webpack_require__(96788).Buffer; -var util = __webpack_require__(31669); + parent.nodes.push(node); + define(node, 'parent', parent); + }); -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} + return this; + }, -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); + /** + * Capture end-of-string + */ - this.head = null; - this.tail = null; - this.length = 0; - } + eos: function() { + var pos = this.position(); + if (this.input) return; + var prev = this.prev(); - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; + while (prev.type !== 'root' && !prev.visited) { + if (this.options.strict === true) { + throw new SyntaxError('invalid syntax:' + util.inspect(prev, null, 2)); + } - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; + if (!hasDelims(prev)) { + prev.parent.escaped = true; + prev.escaped = true; + } - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; + visit(prev, function(node) { + if (!hasDelims(node.parent)) { + node.parent.escaped = true; + node.escaped = true; + } + }); - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; + prev = prev.parent; + } - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; + var tok = pos({ + type: 'eos', + val: this.append || '' + }); - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; + define(tok, 'parent', this.ast); + return tok; + }, - return BufferList; -}(); + /** + * Run parsers to advance the cursor position + */ -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} + next: function() { + var parsed = this.parsed; + var len = this.types.length; + var idx = -1; + var tok; -/***/ }), + while (++idx < len) { + if ((tok = this.parsers[this.types[idx]].call(this))) { + define(tok, 'rest', this.input); + define(tok, 'parsed', parsed); + this.last = tok; + return tok; + } + } + }, -/***/ 87915: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** + * Parse the given string. + * @return {Array} + */ -"use strict"; + parse: function(input) { + if (typeof input !== 'string') { + throw new TypeError('expected a string'); + } + this.init(this.options); + this.orig = input; + this.input = input; + var self = this; -/**/ + function parse() { + // check input before calling `.next()` + input = self.input; -var pna = __webpack_require__(58404); -/**/ + // get the next AST ndoe + var node = self.next(); + if (node) { + var prev = self.prev(); + if (prev) { + define(node, 'parent', prev); + if (prev.nodes) { + prev.nodes.push(node); + } + } -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; + if (self.sets.hasOwnProperty(prev.type)) { + self.currentType = prev.type; + } + } - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; + // if we got here but input is not changed, throw an error + if (self.input && input === self.input) { + throw new Error('no parsers registered for: "' + self.input.slice(0, 5) + '"'); + } + } - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); + while (this.input) parse(); + if (this.stack.length && this.options.strict) { + var node = this.stack.pop(); + throw this.error('missing opening ' + node.type + ': "' + this.orig + '"'); } - return this; - } - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks + var eos = this.eos(); + var tok = this.prev(); + if (tok.type !== 'eos') { + this.ast.nodes.push(eos); + } - if (this._readableState) { - this._readableState.destroyed = true; + return this.ast; } +}; - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; +/** + * Visit `node` with the given `fn` + */ + +function visit(node, fn) { + if (!node.visited) { + define(node, 'visited', true); + return node.nodes ? mapVisit(node.nodes, fn) : fn(node); } + return node; +} - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); +/** + * Map visit over array of `nodes`. + */ - return this; +function mapVisit(nodes, fn) { + var len = nodes.length; + var idx = -1; + while (++idx < len) { + visit(nodes[idx], fn); + } } -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } +function hasOpen(node) { + return node.nodes && node.nodes[0].type === (node.type + '.open'); +} - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } +function hasClose(node) { + return node.nodes && utils.last(node.nodes).type === (node.type + '.close'); } -function emitErrorNT(self, err) { - self.emit('error', err); +function hasDelims(node) { + return hasOpen(node) && hasClose(node); } -module.exports = { - destroy: destroy, - undestroy: undestroy -}; +/** + * Expose `Parser` + */ + +module.exports = Parser; + /***/ }), -/***/ 1065: +/***/ 7974: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -module.exports = __webpack_require__(92413); +"use strict"; + + +var define = __webpack_require__(5477); + +/** + * Store position for a node + */ + +module.exports = function Position(start, parser) { + this.start = start; + this.end = { line: parser.line, column: parser.column }; + define(this, 'content', parser.orig); + define(this, 'source', parser.options.source); +}; /***/ }), -/***/ 96788: +/***/ 59657: /***/ (function(module, exports, __webpack_require__) { -/* eslint-disable node/no-deprecated-api */ -var buffer = __webpack_require__(64293) -var Buffer = buffer.Buffer +"use strict"; -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} +var fs = __webpack_require__(35747); +var path = __webpack_require__(85622); +var define = __webpack_require__(5477); +var utils = __webpack_require__(622); -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) +/** + * Expose `mixin()`. + * This code is based on `source-maps-support.js` in reworkcss/css + * https://github.com/reworkcss/css/blob/master/lib/stringify/source-map-support.js + * Copyright (c) 2012 TJ Holowaychuk + */ -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} +module.exports = mixin; -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} +/** + * Mixin source map support into `compiler`. + * + * @param {Object} `compiler` + * @api public + */ -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} +function mixin(compiler) { + define(compiler, '_comment', compiler.comment); + compiler.map = new utils.SourceMap.SourceMapGenerator(); + compiler.position = { line: 1, column: 1 }; + compiler.content = {}; + compiler.files = {}; -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') + for (var key in exports) { + define(compiler, key, exports[key]); } - return buffer.SlowBuffer(size) } +/** + * Update position. + * + * @param {String} str + */ -/***/ }), +exports.updatePosition = function(str) { + var lines = str.match(/\n/g); + if (lines) this.position.line += lines.length; + var i = str.lastIndexOf('\n'); + this.position.column = ~i ? str.length - i : this.position.column + str.length; +}; -/***/ 7395: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/** + * Emit `str` with `position`. + * + * @param {String} str + * @param {Object} [pos] + * @return {String} + */ -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +exports.emit = function(str, node) { + var position = node.position || {}; + var source = position.source; + if (source) { + if (position.filepath) { + source = utils.unixify(position.filepath); + } + this.map.addMapping({ + source: source, + generated: { + line: this.position.line, + column: Math.max(this.position.column - 1, 0) + }, + original: { + line: position.start.line, + column: position.start.column - 1 + } + }); + if (position.content) { + this.addContent(source, position); + } + if (position.filepath) { + this.addFile(source, position); + } -/**/ + this.updatePosition(str); + this.output += str; + } + return str; +}; -var Buffer = __webpack_require__(96788).Buffer; -/**/ +/** + * Adds a file to the source map output if it has not already been added + * @param {String} `file` + * @param {Object} `pos` + */ -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } +exports.addFile = function(file, position) { + if (typeof position.content !== 'string') return; + if (Object.prototype.hasOwnProperty.call(this.files, file)) return; + this.files[file] = position.content; }; -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.s = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; +/** + * Adds a content source to the source map output if it has not already been added + * @param {String} `source` + * @param {Object} `position` + */ -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; +exports.addContent = function(source, position) { + if (typeof position.content !== 'string') return; + if (Object.prototype.hasOwnProperty.call(this.content, source)) return; + this.map.setSourceContent(source, position.content); }; -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} +/** + * Applies any original source maps to the output and embeds the source file + * contents in the source map. + */ -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} +exports.applySourceMaps = function() { + Object.keys(this.files).forEach(function(file) { + var content = this.files[file]; + this.map.setSourceContent(file, content); -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); + if (this.options.inputSourcemaps === true) { + var originalMap = utils.sourceMapResolve.resolveSync(content, file, fs.readFileSync); + if (originalMap) { + var map = new utils.SourceMap.SourceMapConsumer(originalMap.map); + var relativeTo = originalMap.sourcesRelativeTo; + this.map.applySourceMap(map, file, utils.unixify(path.dirname(relativeTo))); } } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} + }, this); +}; -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} +/** + * Process comments, drops sourceMap comments. + * @param {Object} node + */ -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; +exports.comment = function(node) { + if (/^# sourceMappingURL=/.test(node.comment)) { + return this.emit('', node.position); } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} - -/***/ }), - -/***/ 68193: -/***/ (function(module, exports, __webpack_require__) { - -var Stream = __webpack_require__(92413); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = __webpack_require__(79341); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = __webpack_require__(78063); - exports.Duplex = __webpack_require__(42770); - exports.Transform = __webpack_require__(62826); - exports.PassThrough = __webpack_require__(60143); -} + return this._comment(node); +}; /***/ }), -/***/ 30931: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 622: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -var extend = __webpack_require__(39700); -var safe = __webpack_require__(71217); - /** - * The main export is a function that takes a `pattern` string and an `options` object. - * - * ```js - & var not = require('regex-not'); - & console.log(not('foo')); - & //=> /^(?:(?!^(?:foo)$).)*$/ - * ``` - * - * @param {String} `pattern` - * @param {Object} `options` - * @return {RegExp} Converts the given `pattern` to a regex using the specified `options`. - * @api public + * Module dependencies */ -function toRegex(pattern, options) { - return new RegExp(toRegex.create(pattern, options)); -} +exports.extend = __webpack_require__(28727); +exports.SourceMap = __webpack_require__(96241); +exports.sourceMapResolve = __webpack_require__(10227); /** - * Create a regex-compatible string from the given `pattern` and `options`. - * - * ```js - & var not = require('regex-not'); - & console.log(not.create('foo')); - & //=> '^(?:(?!^(?:foo)$).)*$' - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {String} - * @api public + * Convert backslash in the given string to forward slashes */ -toRegex.create = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - - var opts = extend({}, options); - if (opts.contains === true) { - opts.strictNegate = false; - } +exports.unixify = function(fp) { + return fp.split(/\\+/).join('/'); +}; - var open = opts.strictOpen !== false ? '^' : ''; - var close = opts.strictClose !== false ? '$' : ''; - var endChar = opts.endChar ? opts.endChar : '+'; - var str = pattern; +/** + * Return true if `val` is a non-empty string + * + * @param {String} `str` + * @return {Boolean} + */ - if (opts.strictNegate === false) { - str = '(?:(?!(?:' + pattern + ')).)' + endChar; - } else { - str = '(?:(?!^(?:' + pattern + ')$).)' + endChar; - } +exports.isString = function(str) { + return str && typeof str === 'string'; +}; - var res = open + str + close; - if (opts.safe === true && safe(res) === false) { - throw new Error('potentially unsafe regular expression: ' + res); - } +/** + * Cast `val` to an array + * @return {Array} + */ - return res; +exports.arrayify = function(val) { + if (typeof val === 'string') return [val]; + return val ? (Array.isArray(val) ? val : [val]) : []; }; /** - * Expose `toRegex` + * Get the last `n` element from the given `array` + * @param {Array} `array` + * @return {*} */ -module.exports = toRegex; +exports.last = function(arr, n) { + return arr[arr.length - (n || 1)]; +}; /***/ }), -/***/ 39700: +/***/ 56609: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; - - -var isExtendable = __webpack_require__(93295); -var assignSymbols = __webpack_require__(64353); - -module.exports = Object.assign || function(obj/*, objects*/) { - if (obj === null || typeof obj === 'undefined') { - throw new TypeError('Cannot convert undefined or null to object'); - } - if (!isObject(obj)) { - obj = {}; - } - for (var i = 1; i < arguments.length; i++) { - var val = arguments[i]; - if (isString(val)) { - val = toObject(val); - } - if (isObject(val)) { - assign(obj, val); - assignSymbols(obj, val); - } - } - return obj; -}; +var decodeUriComponent = __webpack_require__(95748) -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } +function customDecodeUriComponent(string) { + // `decodeUriComponent` turns `+` into ` `, but that's not wanted. + return decodeUriComponent(string.replace(/\+/g, "%2B")) } -function isString(val) { - return (val && typeof val === 'string'); -} +module.exports = customDecodeUriComponent -function toObject(str) { - var obj = {}; - for (var i in str) { - obj[i] = str[i]; - } - return obj; -} -function isObject(val) { - return (val && typeof val === 'object') || isExtendable(val); -} +/***/ }), -/** - * Returns true if the given `key` is an own property of `obj`. - */ +/***/ 89825: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} +var url = __webpack_require__(78835) -function isEnum(obj, key) { - return Object.prototype.propertyIsEnumerable.call(obj, key); +function resolveUrl(/* ...urls */) { + return Array.prototype.reduce.call(arguments, function(resolved, nextUrl) { + return url.resolve(resolved, nextUrl) + }) } +module.exports = resolveUrl + /***/ }), -/***/ 93295: +/***/ 10227: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; -/*! - * is-extendable - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - +var sourceMappingURL = __webpack_require__(21707) +var resolveUrl = __webpack_require__(89825) +var decodeUriComponent = __webpack_require__(56609) +var urix = __webpack_require__(67806) +var atob = __webpack_require__(83327) -var isPlainObject = __webpack_require__(81064); -module.exports = function isExtendable(val) { - return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); -}; +function callbackAsync(callback, error, result) { + setImmediate(function() { callback(error, result) }) +} -/***/ }), +function parseMapToJSON(string, data) { + try { + return JSON.parse(string.replace(/^\)\]\}'/, "")) + } catch (error) { + error.sourceMapData = data + throw error + } +} -/***/ 69523: -/***/ (function(module) { +function readSync(read, url, data) { + var readUrl = decodeUriComponent(url) + try { + return String(read(readUrl)) + } catch (error) { + error.sourceMapData = data + throw error + } +} -"use strict"; -/*! - * repeat-element - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Licensed under the MIT license. - */ - -module.exports = function repeat(ele, num) { - var arr = new Array(num); - - for (var i = 0; i < num; i++) { - arr[i] = ele; +function resolveSourceMap(code, codeUrl, read, callback) { + var mapData + try { + mapData = resolveSourceMapHelper(code, codeUrl) + } catch (error) { + return callbackAsync(callback, error) } + if (!mapData || mapData.map) { + return callbackAsync(callback, null, mapData) + } + var readUrl = decodeUriComponent(mapData.url) + read(readUrl, function(error, result) { + if (error) { + error.sourceMapData = mapData + return callback(error) + } + mapData.map = String(result) + try { + mapData.map = parseMapToJSON(mapData.map, mapData) + } catch (error) { + return callback(error) + } + callback(null, mapData) + }) +} - return arr; -}; - - -/***/ }), - -/***/ 6332: -/***/ (function(module) { - -"use strict"; -/*! - * repeat-string - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -/** - * Results cache - */ +function resolveSourceMapSync(code, codeUrl, read) { + var mapData = resolveSourceMapHelper(code, codeUrl) + if (!mapData || mapData.map) { + return mapData + } + mapData.map = readSync(read, mapData.url, mapData) + mapData.map = parseMapToJSON(mapData.map, mapData) + return mapData +} -var res = ''; -var cache; +var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/ /** - * Expose `repeat` + * The media type for JSON text is application/json. + * + * {@link https://tools.ietf.org/html/rfc8259#section-11 | IANA Considerations } + * + * `text/json` is non-standard media type */ - -module.exports = repeat; +var jsonMimeTypeRegex = /^(?:application|text)\/json$/ /** - * Repeat the given `string` the specified `number` - * of times. - * - * **Example:** - * - * ```js - * var repeat = require('repeat-string'); - * repeat('A', 5); - * //=> AAAAA - * ``` + * JSON text exchanged between systems that are not part of a closed ecosystem + * MUST be encoded using UTF-8. * - * @param {String} `string` The string to repeat - * @param {Number} `number` The number of times to repeat the string - * @return {String} Repeated string - * @api public + * {@link https://tools.ietf.org/html/rfc8259#section-8.1 | Character Encoding} */ +var jsonCharacterEncoding = "utf-8" -function repeat(str, num) { - if (typeof str !== 'string') { - throw new TypeError('expected a string'); +function base64ToBuf(b64) { + var binStr = atob(b64) + var len = binStr.length + var arr = new Uint8Array(len) + for (var i = 0; i < len; i++) { + arr[i] = binStr.charCodeAt(i) } + return arr +} - // cover common, quick use cases - if (num === 1) return str; - if (num === 2) return str + str; +function decodeBase64String(b64) { + if (typeof TextDecoder === "undefined" || typeof Uint8Array === "undefined") { + return atob(b64) + } + var buf = base64ToBuf(b64); + // Note: `decoder.decode` method will throw a `DOMException` with the + // `"EncodingError"` value when an coding error is found. + var decoder = new TextDecoder(jsonCharacterEncoding, {fatal: true}) + return decoder.decode(buf); +} - var max = str.length * num; - if (cache !== str || typeof cache === 'undefined') { - cache = str; - res = ''; - } else if (res.length >= max) { - return res.substr(0, max); +function resolveSourceMapHelper(code, codeUrl) { + codeUrl = urix(codeUrl) + + var url = sourceMappingURL.getFrom(code) + if (!url) { + return null } - while (max > res.length && num > 1) { - if (num & 1) { - res += str; + var dataUri = url.match(dataUriRegex) + if (dataUri) { + var mimeType = dataUri[1] || "text/plain" + var lastParameter = dataUri[2] || "" + var encoded = dataUri[3] || "" + var data = { + sourceMappingURL: url, + url: null, + sourcesRelativeTo: codeUrl, + map: encoded } - - num >>= 1; - str += str; + if (!jsonMimeTypeRegex.test(mimeType)) { + var error = new Error("Unuseful data uri mime type: " + mimeType) + error.sourceMapData = data + throw error + } + try { + data.map = parseMapToJSON( + lastParameter === ";base64" ? decodeBase64String(encoded) : decodeURIComponent(encoded), + data + ) + } catch (error) { + error.sourceMapData = data + throw error + } + return data } - res += str; - res = res.substr(0, max); - return res; + var mapUrl = resolveUrl(codeUrl, url) + return { + sourceMappingURL: url, + url: mapUrl, + sourcesRelativeTo: mapUrl, + map: null + } } -/***/ }), -/***/ 25622: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +function resolveSources(map, mapUrl, read, options, callback) { + if (typeof options === "function") { + callback = options + options = {} + } + var pending = map.sources ? map.sources.length : 0 + var result = { + sourcesResolved: [], + sourcesContent: [] + } -var util = __webpack_require__(10265); -var types = __webpack_require__(40432); -var sets = __webpack_require__(28135); -var positions = __webpack_require__(54771); + if (pending === 0) { + callbackAsync(callback, null, result) + return + } + var done = function() { + pending-- + if (pending === 0) { + callback(null, result) + } + } -module.exports = function(regexpStr) { - var i = 0, l, c, - start = { type: types.ROOT, stack: []}, + resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) { + result.sourcesResolved[index] = fullUrl + if (typeof sourceContent === "string") { + result.sourcesContent[index] = sourceContent + callbackAsync(done, null) + } else { + var readUrl = decodeUriComponent(fullUrl) + read(readUrl, function(error, source) { + result.sourcesContent[index] = error ? error : String(source) + done() + }) + } + }) +} - // Keep track of last clause/group and stack. - lastGroup = start, - last = start.stack, - groupStack = []; +function resolveSourcesSync(map, mapUrl, read, options) { + var result = { + sourcesResolved: [], + sourcesContent: [] + } + if (!map.sources || map.sources.length === 0) { + return result + } - var repeatErr = function(i) { - util.error(regexpStr, 'Nothing to repeat at column ' + (i - 1)); - }; + resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) { + result.sourcesResolved[index] = fullUrl + if (read !== null) { + if (typeof sourceContent === "string") { + result.sourcesContent[index] = sourceContent + } else { + var readUrl = decodeUriComponent(fullUrl) + try { + result.sourcesContent[index] = String(read(readUrl)) + } catch (error) { + result.sourcesContent[index] = error + } + } + } + }) - // Decode a few escaped characters. - var str = util.strToChars(regexpStr); - l = str.length; + return result +} - // Iterate through each character in string. - while (i < l) { - c = str[i++]; +var endingSlash = /\/?$/ - switch (c) { - // Handle escaped characters, inclues a few sets. - case '\\': - c = str[i++]; +function resolveSourcesHelper(map, mapUrl, options, fn) { + options = options || {} + mapUrl = urix(mapUrl) + var fullUrl + var sourceContent + var sourceRoot + for (var index = 0, len = map.sources.length; index < len; index++) { + sourceRoot = null + if (typeof options.sourceRoot === "string") { + sourceRoot = options.sourceRoot + } else if (typeof map.sourceRoot === "string" && options.sourceRoot !== false) { + sourceRoot = map.sourceRoot + } + // If the sourceRoot is the empty string, it is equivalent to not setting + // the property at all. + if (sourceRoot === null || sourceRoot === '') { + fullUrl = resolveUrl(mapUrl, map.sources[index]) + } else { + // Make sure that the sourceRoot ends with a slash, so that `/scripts/subdir` becomes + // `/scripts/subdir/`, not `/scripts/`. Pointing to a file as source root + // does not make sense. + fullUrl = resolveUrl(mapUrl, sourceRoot.replace(endingSlash, "/"), map.sources[index]) + } + sourceContent = (map.sourcesContent || [])[index] + fn(fullUrl, sourceContent, index) + } +} - switch (c) { - case 'b': - last.push(positions.wordBoundary()); - break; - case 'B': - last.push(positions.nonWordBoundary()); - break; - case 'w': - last.push(sets.words()); - break; +function resolve(code, codeUrl, read, options, callback) { + if (typeof options === "function") { + callback = options + options = {} + } + if (code === null) { + var mapUrl = codeUrl + var data = { + sourceMappingURL: null, + url: mapUrl, + sourcesRelativeTo: mapUrl, + map: null + } + var readUrl = decodeUriComponent(mapUrl) + read(readUrl, function(error, result) { + if (error) { + error.sourceMapData = data + return callback(error) + } + data.map = String(result) + try { + data.map = parseMapToJSON(data.map, data) + } catch (error) { + return callback(error) + } + _resolveSources(data) + }) + } else { + resolveSourceMap(code, codeUrl, read, function(error, mapData) { + if (error) { + return callback(error) + } + if (!mapData) { + return callback(null, null) + } + _resolveSources(mapData) + }) + } - case 'W': - last.push(sets.notWords()); - break; + function _resolveSources(mapData) { + resolveSources(mapData.map, mapData.sourcesRelativeTo, read, options, function(error, result) { + if (error) { + return callback(error) + } + mapData.sourcesResolved = result.sourcesResolved + mapData.sourcesContent = result.sourcesContent + callback(null, mapData) + }) + } +} - case 'd': - last.push(sets.ints()); - break; +function resolveSync(code, codeUrl, read, options) { + var mapData + if (code === null) { + var mapUrl = codeUrl + mapData = { + sourceMappingURL: null, + url: mapUrl, + sourcesRelativeTo: mapUrl, + map: null + } + mapData.map = readSync(read, mapUrl, mapData) + mapData.map = parseMapToJSON(mapData.map, mapData) + } else { + mapData = resolveSourceMapSync(code, codeUrl, read) + if (!mapData) { + return null + } + } + var result = resolveSourcesSync(mapData.map, mapData.sourcesRelativeTo, read, options) + mapData.sourcesResolved = result.sourcesResolved + mapData.sourcesContent = result.sourcesContent + return mapData +} - case 'D': - last.push(sets.notInts()); - break; - case 's': - last.push(sets.whitespace()); - break; - case 'S': - last.push(sets.notWhitespace()); - break; +module.exports = { + resolveSourceMap: resolveSourceMap, + resolveSourceMapSync: resolveSourceMapSync, + resolveSources: resolveSources, + resolveSourcesSync: resolveSourcesSync, + resolve: resolve, + resolveSync: resolveSync, + parseMapToJSON: parseMapToJSON +} - default: - // Check if c is integer. - // In which case it's a reference. - if (/\d/.test(c)) { - last.push({ type: types.REFERENCE, value: parseInt(c, 10) }); - // Escaped character. - } else { - last.push({ type: types.CHAR, value: c.charCodeAt(0) }); - } - } +/***/ }), - break; +/***/ 21707: +/***/ (function(module) { +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) - // Positionals. - case '^': - last.push(positions.begin()); - break; +void (function(root, factory) { + if (typeof define === "function" && define.amd) { + define(factory) + } else if (true) { + module.exports = factory() + } else {} +}(this, function() { - case '$': - last.push(positions.end()); - break; + var innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/ + var regex = RegExp( + "(?:" + + "/\\*" + + "(?:\\s*\r?\n(?://)?)?" + + "(?:" + innerRegex.source + ")" + + "\\s*" + + "\\*/" + + "|" + + "//(?:" + innerRegex.source + ")" + + ")" + + "\\s*" + ) - // Handle custom sets. - case '[': - // Check if this class is 'anti' i.e. [^abc]. - var not; - if (str[i] === '^') { - not = true; - i++; - } else { - not = false; - } + return { - // Get all the characters in class. - var classTokens = util.tokenizeClass(str.slice(i), regexpStr); + regex: regex, + _innerRegex: innerRegex, - // Increase index by length of class. - i += classTokens[1]; - last.push({ - type: types.SET, - set: classTokens[0], - not: not, - }); + getFrom: function(code) { + var match = code.match(regex) + return (match ? match[1] || match[2] || "" : null) + }, - break; + existsIn: function(code) { + return regex.test(code) + }, + removeFrom: function(code) { + return code.replace(regex, "") + }, - // Class of any character except \n. - case '.': - last.push(sets.anyChar()); - break; + insertBefore: function(code, string) { + var match = code.match(regex) + if (match) { + return code.slice(0, match.index) + string + code.slice(match.index) + } else { + return code + string + } + } + } +})); - // Push group onto stack. - case '(': - // Create group. - var group = { - type: types.GROUP, - stack: [], - remember: true, - }; - c = str[i]; +/***/ }), - // If if this is a special kind of group. - if (c === '?') { - c = str[i + 1]; - i += 2; +/***/ 33218: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // Match if followed by. - if (c === '=') { - group.followedBy = true; +"use strict"; +/*! + * split-string + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ - // Match if not followed by. - } else if (c === '!') { - group.notFollowedBy = true; - } else if (c !== ':') { - util.error(regexpStr, - 'Invalid group, character \'' + c + - '\' after \'?\' at column ' + (i - 1)); - } - group.remember = false; - } +var extend = __webpack_require__(66889); - // Insert subgroup into current group stack. - last.push(group); +module.exports = function(str, options, fn) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } - // Remember the current group for when the group closes. - groupStack.push(lastGroup); + if (typeof options === 'function') { + fn = options; + options = null; + } - // Make this new group the current group. - lastGroup = group; - last = group.stack; - break; + // allow separator to be defined as a string + if (typeof options === 'string') { + options = { sep: options }; + } + var opts = extend({sep: '.'}, options); + var quotes = opts.quotes || ['"', "'", '`']; + var brackets; - // Pop group out of stack. - case ')': - if (groupStack.length === 0) { - util.error(regexpStr, 'Unmatched ) at column ' + (i - 1)); - } - lastGroup = groupStack.pop(); + if (opts.brackets === true) { + brackets = { + '<': '>', + '(': ')', + '[': ']', + '{': '}' + }; + } else if (opts.brackets) { + brackets = opts.brackets; + } - // Check if this group has a PIPE. - // To get back the correct last stack. - last = lastGroup.options ? - lastGroup.options[lastGroup.options.length - 1] : lastGroup.stack; - break; + var tokens = []; + var stack = []; + var arr = ['']; + var sep = opts.sep; + var len = str.length; + var idx = -1; + var closeIdx; + function expected() { + if (brackets && stack.length) { + return brackets[stack[stack.length - 1]]; + } + } - // Use pipe character to give more choices. - case '|': - // Create array where options are if this is the first PIPE - // in this clause. - if (!lastGroup.options) { - lastGroup.options = [lastGroup.stack]; - delete lastGroup.stack; - } + while (++idx < len) { + var ch = str[idx]; + var next = str[idx + 1]; + var tok = { val: ch, idx: idx, arr: arr, str: str }; + tokens.push(tok); - // Create a new stack and add to options for rest of clause. - var stack = []; - lastGroup.options.push(stack); - last = stack; - break; + if (ch === '\\') { + tok.val = keepEscaping(opts, str, idx) === true ? (ch + next) : next; + tok.escaped = true; + if (typeof fn === 'function') { + fn(tok); + } + arr[arr.length - 1] += tok.val; + idx++; + continue; + } + if (brackets && brackets[ch]) { + stack.push(ch); + var e = expected(); + var i = idx + 1; - // Repetition. - // For every repetition, remove last element from last stack - // then insert back a RANGE object. - // This design is chosen because there could be more than - // one repetition symbols in a regex i.e. `a?+{2,3}`. - case '{': - var rs = /^(\d+)(,(\d+)?)?\}/.exec(str.slice(i)), min, max; - if (rs !== null) { - if (last.length === 0) { - repeatErr(i); + if (str.indexOf(e, i + 1) !== -1) { + while (stack.length && i < len) { + var s = str[++i]; + if (s === '\\') { + s++; + continue; } - min = parseInt(rs[1], 10); - max = rs[2] ? rs[3] ? parseInt(rs[3], 10) : Infinity : min; - i += rs[0].length; - last.push({ - type: types.REPETITION, - min: min, - max: max, - value: last.pop(), - }); - } else { - last.push({ - type: types.CHAR, - value: 123, - }); - } - break; + if (quotes.indexOf(s) !== -1) { + i = getClosingQuote(str, s, i + 1); + continue; + } - case '?': - if (last.length === 0) { - repeatErr(i); - } - last.push({ - type: types.REPETITION, - min: 0, - max: 1, - value: last.pop(), - }); - break; + e = expected(); + if (stack.length && str.indexOf(e, i + 1) === -1) { + break; + } - case '+': - if (last.length === 0) { - repeatErr(i); - } - last.push({ - type: types.REPETITION, - min: 1, - max: Infinity, - value: last.pop(), - }); - break; + if (brackets[s]) { + stack.push(s); + continue; + } - case '*': - if (last.length === 0) { - repeatErr(i); + if (e === s) { + stack.pop(); + } } - last.push({ - type: types.REPETITION, - min: 0, - max: Infinity, - value: last.pop(), - }); - break; + } + closeIdx = i; + if (closeIdx === -1) { + arr[arr.length - 1] += ch; + continue; + } - // Default is a character that is not `\[](){}?+*^$`. - default: - last.push({ - type: types.CHAR, - value: c.charCodeAt(0), - }); + ch = str.slice(idx, closeIdx + 1); + tok.val = ch; + tok.idx = idx = closeIdx; } - } - - // Check if any groups have not been closed. - if (groupStack.length !== 0) { - util.error(regexpStr, 'Unterminated group'); - } - - return start; -}; + if (quotes.indexOf(ch) !== -1) { + closeIdx = getClosingQuote(str, ch, idx + 1); + if (closeIdx === -1) { + arr[arr.length - 1] += ch; + continue; + } -module.exports.types = types; + if (keepQuotes(ch, opts) === true) { + ch = str.slice(idx, closeIdx + 1); + } else { + ch = str.slice(idx + 1, closeIdx); + } + tok.val = ch; + tok.idx = idx = closeIdx; + } -/***/ }), + if (typeof fn === 'function') { + fn(tok, tokens); + ch = tok.val; + idx = tok.idx; + } -/***/ 54771: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + if (tok.val === sep && tok.split !== false) { + arr.push(''); + continue; + } -var types = __webpack_require__(40432); + arr[arr.length - 1] += tok.val; + } -exports.wordBoundary = function() { - return { type: types.POSITION, value: 'b' }; + return arr; }; -exports.nonWordBoundary = function() { - return { type: types.POSITION, value: 'B' }; -}; +function getClosingQuote(str, ch, i, brackets) { + var idx = str.indexOf(ch, i); + if (str.charAt(idx - 1) === '\\') { + return getClosingQuote(str, ch, idx + 1); + } + return idx; +} -exports.begin = function() { - return { type: types.POSITION, value: '^' }; -}; +function keepQuotes(ch, opts) { + if (opts.keepDoubleQuotes === true && ch === '"') return true; + if (opts.keepSingleQuotes === true && ch === "'") return true; + return opts.keepQuotes; +} -exports.end = function() { - return { type: types.POSITION, value: '$' }; -}; +function keepEscaping(opts, str, idx) { + if (typeof opts.keepEscaping === 'function') { + return opts.keepEscaping(str, idx); + } + return opts.keepEscaping === true || str[idx + 1] === '\\'; +} /***/ }), -/***/ 28135: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -var types = __webpack_require__(40432); +/***/ 66889: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var INTS = function() { - return [{ type: types.RANGE , from: 48, to: 57 }]; -}; +"use strict"; -var WORDS = function() { - return [ - { type: types.CHAR, value: 95 }, - { type: types.RANGE, from: 97, to: 122 }, - { type: types.RANGE, from: 65, to: 90 } - ].concat(INTS()); -}; -var WHITESPACE = function() { - return [ - { type: types.CHAR, value: 9 }, - { type: types.CHAR, value: 10 }, - { type: types.CHAR, value: 11 }, - { type: types.CHAR, value: 12 }, - { type: types.CHAR, value: 13 }, - { type: types.CHAR, value: 32 }, - { type: types.CHAR, value: 160 }, - { type: types.CHAR, value: 5760 }, - { type: types.CHAR, value: 6158 }, - { type: types.CHAR, value: 8192 }, - { type: types.CHAR, value: 8193 }, - { type: types.CHAR, value: 8194 }, - { type: types.CHAR, value: 8195 }, - { type: types.CHAR, value: 8196 }, - { type: types.CHAR, value: 8197 }, - { type: types.CHAR, value: 8198 }, - { type: types.CHAR, value: 8199 }, - { type: types.CHAR, value: 8200 }, - { type: types.CHAR, value: 8201 }, - { type: types.CHAR, value: 8202 }, - { type: types.CHAR, value: 8232 }, - { type: types.CHAR, value: 8233 }, - { type: types.CHAR, value: 8239 }, - { type: types.CHAR, value: 8287 }, - { type: types.CHAR, value: 12288 }, - { type: types.CHAR, value: 65279 } - ]; -}; +var isExtendable = __webpack_require__(28730); +var assignSymbols = __webpack_require__(64353); -var NOTANYCHAR = function() { - return [ - { type: types.CHAR, value: 10 }, - { type: types.CHAR, value: 13 }, - { type: types.CHAR, value: 8232 }, - { type: types.CHAR, value: 8233 }, - ]; +module.exports = Object.assign || function(obj/*, objects*/) { + if (obj === null || typeof obj === 'undefined') { + throw new TypeError('Cannot convert undefined or null to object'); + } + if (!isObject(obj)) { + obj = {}; + } + for (var i = 1; i < arguments.length; i++) { + var val = arguments[i]; + if (isString(val)) { + val = toObject(val); + } + if (isObject(val)) { + assign(obj, val); + assignSymbols(obj, val); + } + } + return obj; }; -// Predefined class objects. -exports.words = function() { - return { type: types.SET, set: WORDS(), not: false }; -}; +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} -exports.notWords = function() { - return { type: types.SET, set: WORDS(), not: true }; -}; +function isString(val) { + return (val && typeof val === 'string'); +} -exports.ints = function() { - return { type: types.SET, set: INTS(), not: false }; -}; +function toObject(str) { + var obj = {}; + for (var i in str) { + obj[i] = str[i]; + } + return obj; +} -exports.notInts = function() { - return { type: types.SET, set: INTS(), not: true }; -}; +function isObject(val) { + return (val && typeof val === 'object') || isExtendable(val); +} -exports.whitespace = function() { - return { type: types.SET, set: WHITESPACE(), not: false }; -}; +/** + * Returns true if the given `key` is an own property of `obj`. + */ -exports.notWhitespace = function() { - return { type: types.SET, set: WHITESPACE(), not: true }; -}; +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} -exports.anyChar = function() { - return { type: types.SET, set: NOTANYCHAR(), not: true }; -}; +function isEnum(obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); +} /***/ }), -/***/ 40432: -/***/ (function(module) { +/***/ 28730: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -module.exports = { - ROOT : 0, - GROUP : 1, - POSITION : 2, - SET : 3, - RANGE : 4, - REPETITION : 5, - REFERENCE : 6, - CHAR : 7, +"use strict"; +/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + + + +var isPlainObject = __webpack_require__(81064); + +module.exports = function isExtendable(val) { + return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); }; /***/ }), -/***/ 10265: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ 69457: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var types = __webpack_require__(40432); -var sets = __webpack_require__(28135); +"use strict"; +/*! + * static-extend + * + * Copyright (c) 2016, Jon Schlinkert. + * Licensed under the MIT License. + */ -// All of these are private and only used by randexp. -// It's assumed that they will always be called with the correct input. -var CTRL = '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?'; -var SLSH = { '0': 0, 't': 9, 'n': 10, 'v': 11, 'f': 12, 'r': 13 }; +var copy = __webpack_require__(31368); +var define = __webpack_require__(5477); +var util = __webpack_require__(31669); /** - * Finds character representations in str and convert all to - * their respective characters + * Returns a function for extending the static properties, + * prototype properties, and descriptors from the `Parent` + * constructor onto `Child` constructors. * - * @param {String} str - * @return {String} + * ```js + * var extend = require('static-extend'); + * Parent.extend = extend(Parent); + * + * // optionally pass a custom merge function as the second arg + * Parent.extend = extend(Parent, function(Child) { + * Child.prototype.mixin = function(key, val) { + * Child.prototype[key] = val; + * }; + * }); + * + * // extend "child" constructors + * Parent.extend(Child); + * + * // optionally define prototype methods as the second arg + * Parent.extend(Child, { + * foo: function() {}, + * bar: function() {} + * }); + * ``` + * @param {Function} `Parent` Parent ctor + * @param {Function} `extendFn` Optional extend function for handling any necessary custom merging. Useful when updating methods that require a specific prototype. + * @param {Function} `Child` Child ctor + * @param {Object} `proto` Optionally pass additional prototype properties to inherit. + * @return {Object} + * @api public */ -exports.strToChars = function(str) { - /* jshint maxlen: false */ - var chars_regex = /(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z\[\\\]\^?])|([0tnvfr]))/g; - str = str.replace(chars_regex, function(s, b, lbs, a16, b16, c8, dctrl, eslsh) { - if (lbs) { - return s; + +function extend(Parent, extendFn) { + if (typeof Parent !== 'function') { + throw new TypeError('expected Parent to be a function.'); + } + + return function(Ctor, proto) { + if (typeof Ctor !== 'function') { + throw new TypeError('expected Ctor to be a function.'); } - var code = b ? 8 : - a16 ? parseInt(a16, 16) : - b16 ? parseInt(b16, 16) : - c8 ? parseInt(c8, 8) : - dctrl ? CTRL.indexOf(dctrl) : - SLSH[eslsh]; + util.inherits(Ctor, Parent); + copy(Ctor, Parent); - var c = String.fromCharCode(code); + // proto can be null or a plain object + if (typeof proto === 'object') { + var obj = Object.create(proto); - // Escape special regex characters. - if (/[\[\]{}\^$.|?*+()]/.test(c)) { - c = '\\' + c; + for (var k in obj) { + Ctor.prototype[k] = obj[k]; + } } - return c; - }); + // keep a reference to the parent prototype + define(Ctor.prototype, '_parent_', { + configurable: true, + set: function() {}, + get: function() { + return Parent.prototype; + } + }); - return str; -}; + if (typeof extendFn === 'function') { + extendFn(Ctor, Parent); + } + Ctor.extend = extend(Ctor, extendFn); + }; +}; /** - * turns class into tokens - * reads str until it encounters a ] not preceeded by a \ - * - * @param {String} str - * @param {String} regexpStr - * @return {Array., Number>} + * Expose `extend` */ -exports.tokenizeClass = function(str, regexpStr) { - /* jshint maxlen: false */ - var tokens = []; - var regexp = /\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?(.)/g; - var rs, c; +module.exports = extend; - while ((rs = regexp.exec(str)) != null) { - if (rs[1]) { - tokens.push(sets.words()); - - } else if (rs[2]) { - tokens.push(sets.ints()); - } else if (rs[3]) { - tokens.push(sets.whitespace()); +/***/ }), - } else if (rs[4]) { - tokens.push(sets.notWords()); +/***/ 27836: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - } else if (rs[5]) { - tokens.push(sets.notInts()); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - } else if (rs[6]) { - tokens.push(sets.notWhitespace()); - } else if (rs[7]) { - tokens.push({ - type: types.RANGE, - from: (rs[8] || rs[9]).charCodeAt(0), - to: rs[10].charCodeAt(0), - }); +const Hook = __webpack_require__(12233); +const HookCodeFactory = __webpack_require__(64288); - } else if (c = rs[12]) { - tokens.push({ - type: types.CHAR, - value: c.charCodeAt(0), - }); +class AsyncParallelBailHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, onDone }) { + let code = ""; + code += `var _results = new Array(${this.options.taps.length});\n`; + code += "var _checkDone = () => {\n"; + code += "for(var i = 0; i < _results.length; i++) {\n"; + code += "var item = _results[i];\n"; + code += "if(item === undefined) return false;\n"; + code += "if(item.result !== undefined) {\n"; + code += onResult("item.result"); + code += "return true;\n"; + code += "}\n"; + code += "if(item.error) {\n"; + code += onError("item.error"); + code += "return true;\n"; + code += "}\n"; + code += "}\n"; + code += "return false;\n"; + code += "}\n"; + code += this.callTapsParallel({ + onError: (i, err, done, doneBreak) => { + let code = ""; + code += `if(${i} < _results.length && ((_results.length = ${i + + 1}), (_results[${i}] = { error: ${err} }), _checkDone())) {\n`; + code += doneBreak(true); + code += "} else {\n"; + code += done(); + code += "}\n"; + return code; + }, + onResult: (i, result, done, doneBreak) => { + let code = ""; + code += `if(${i} < _results.length && (${result} !== undefined && (_results.length = ${i + + 1}), (_results[${i}] = { result: ${result} }), _checkDone())) {\n`; + code += doneBreak(true); + code += "} else {\n"; + code += done(); + code += "}\n"; + return code; + }, + onTap: (i, run, done, doneBreak) => { + let code = ""; + if (i > 0) { + code += `if(${i} >= _results.length) {\n`; + code += done(); + code += "} else {\n"; + } + code += run(); + if (i > 0) code += "}\n"; + return code; + }, + onDone + }); + return code; + } +} - } else { - return [tokens, regexp.lastIndex]; - } - } +const factory = new AsyncParallelBailHookCodeFactory(); - exports.error(regexpStr, 'Unterminated character class'); -}; +class AsyncParallelBailHook extends Hook { + compile(options) { + factory.setup(this, options); + return factory.create(options); + } +} +Object.defineProperties(AsyncParallelBailHook.prototype, { + _call: { value: undefined, configurable: true, writable: true } +}); -/** - * Shortcut to throw errors. - * - * @param {String} regexp - * @param {String} msg - */ -exports.error = function(regexp, msg) { - throw new SyntaxError('Invalid regular expression: /' + regexp + '/: ' + msg); -}; +module.exports = AsyncParallelBailHook; /***/ }), -/***/ 71217: +/***/ 14616: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var parse = __webpack_require__(25622); -var types = parse.types; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -module.exports = function (re, opts) { - if (!opts) opts = {}; - var replimit = opts.limit === undefined ? 25 : opts.limit; - - if (isRegExp(re)) re = re.source; - else if (typeof re !== 'string') re = String(re); - - try { re = parse(re) } - catch (err) { return false } - - var reps = 0; - return (function walk (node, starHeight) { - if (node.type === types.REPETITION) { - starHeight ++; - reps ++; - if (starHeight > 1) return false; - if (reps > replimit) return false; - } - - if (node.options) { - for (var i = 0, len = node.options.length; i < len; i++) { - var ok = walk({ stack: node.options[i] }, starHeight); - if (!ok) return false; - } - } - var stack = node.stack || (node.value && node.value.stack); - if (!stack) return true; - - for (var i = 0; i < stack.length; i++) { - var ok = walk(stack[i], starHeight); - if (!ok) return false; - } - - return true; - })(re, 0); -}; -function isRegExp (x) { - return {}.toString.call(x) === '[object RegExp]'; +const Hook = __webpack_require__(12233); +const HookCodeFactory = __webpack_require__(64288); + +class AsyncParallelHookCodeFactory extends HookCodeFactory { + content({ onError, onDone }) { + return this.callTapsParallel({ + onError: (i, err, done, doneBreak) => onError(err) + doneBreak(true), + onDone + }); + } +} + +const factory = new AsyncParallelHookCodeFactory(); + +class AsyncParallelHook extends Hook { + compile(options) { + factory.setup(this, options); + return factory.create(options); + } } +Object.defineProperties(AsyncParallelHook.prototype, { + _call: { value: undefined, configurable: true, writable: true } +}); + +module.exports = AsyncParallelHook; + /***/ }), -/***/ 85841: +/***/ 89674: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* -Copyright (c) 2014, Yahoo! Inc. All rights reserved. -Copyrights licensed under the New BSD License. -See the accompanying LICENSE file for terms. + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra */ +const Hook = __webpack_require__(12233); +const HookCodeFactory = __webpack_require__(64288); -var randomBytes = __webpack_require__(79822); - -// Generate an internal UID to make the regexp pattern harder to guess. -var UID_LENGTH = 16; -var UID = generateUID(); -var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|U|I)-' + UID + '-(\\d+)__@"', 'g'); - -var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g; -var IS_PURE_FUNCTION = /function.*?\(/; -var IS_ARROW_FUNCTION = /.*?=>.*?/; -var UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g; - -var RESERVED_SYMBOLS = ['*', 'async']; - -// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their -// Unicode char counterparts which are safe to use in JavaScript strings. -var ESCAPED_CHARS = { - '<' : '\\u003C', - '>' : '\\u003E', - '/' : '\\u002F', - '\u2028': '\\u2028', - '\u2029': '\\u2029' -}; - -function escapeUnsafeChars(unsafeChar) { - return ESCAPED_CHARS[unsafeChar]; +class AsyncSeriesBailHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, resultReturns, onDone }) { + return this.callTapsSeries({ + onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), + onResult: (i, result, next) => + `if(${result} !== undefined) {\n${onResult( + result + )};\n} else {\n${next()}}\n`, + resultReturns, + onDone + }); + } } -function generateUID() { - var bytes = randomBytes(UID_LENGTH); - var result = ''; - for(var i=0; i onError(err) + doneBreak(true), + onDone + }); + } +} - if(origValue instanceof Map) { - return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@'; - } +const factory = new AsyncSeriesHookCodeFactory(); - if(origValue instanceof Set) { - return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@'; - } - } +class AsyncSeriesHook extends Hook { + compile(options) { + factory.setup(this, options); + return factory.create(options); + } +} - if (type === 'function') { - return '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@'; - } +Object.defineProperties(AsyncSeriesHook.prototype, { + _call: { value: undefined, configurable: true, writable: true } +}); - if (type === 'undefined') { - return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@'; - } +module.exports = AsyncSeriesHook; - if (type === 'number' && !isNaN(origValue) && !isFinite(origValue)) { - return '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@'; - } - return value; - } +/***/ }), - function serializeFunc(fn) { - var serializedFn = fn.toString(); - if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) { - throw new TypeError('Serializing native function: ' + fn.name); - } +/***/ 14568: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // pure functions, example: {key: function() {}} - if(IS_PURE_FUNCTION.test(serializedFn)) { - return serializedFn; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // arrow functions, example: arg1 => arg1+5 - if(IS_ARROW_FUNCTION.test(serializedFn)) { - return serializedFn; - } - var argsStartsAt = serializedFn.indexOf('('); - var def = serializedFn.substr(0, argsStartsAt) - .trim() - .split(' ') - .filter(function(val) { return val.length > 0 }); +const Hook = __webpack_require__(12233); +const HookCodeFactory = __webpack_require__(64288); - var nonReservedSymbols = def.filter(function(val) { - return RESERVED_SYMBOLS.indexOf(val) === -1 - }); +class AsyncSeriesWaterfallHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, onDone }) { + return this.callTapsSeries({ + onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), + onResult: (i, result, next) => { + let code = ""; + code += `if(${result} !== undefined) {\n`; + code += `${this._args[0]} = ${result};\n`; + code += `}\n`; + code += next(); + return code; + }, + onDone: () => onResult(this._args[0]) + }); + } +} - // enhanced literal objects, example: {key() {}} - if(nonReservedSymbols.length > 0) { - return (def.indexOf('async') > -1 ? 'async ' : '') + 'function' - + (def.join('').indexOf('*') > -1 ? '*' : '') - + serializedFn.substr(argsStartsAt); - } +const factory = new AsyncSeriesWaterfallHookCodeFactory(); - // arrow functions - return serializedFn; - } +class AsyncSeriesWaterfallHook extends Hook { + constructor(args) { + super(args); + if (args.length < 1) + throw new Error("Waterfall hooks must have at least one argument"); + } - // Check if the parameter is function - if (options.ignoreFunction && typeof obj === "function") { - obj = undefined; - } - // Protects against `JSON.stringify()` returning `undefined`, by serializing - // to the literal string: "undefined". - if (obj === undefined) { - return String(obj); - } + compile(options) { + factory.setup(this, options); + return factory.create(options); + } +} - var str; +Object.defineProperties(AsyncSeriesWaterfallHook.prototype, { + _call: { value: undefined, configurable: true, writable: true } +}); - // Creates a JSON string representation of the value. - // NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args. - if (options.isJSON && !options.space) { - str = JSON.stringify(obj); - } else { - str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space); - } +module.exports = AsyncSeriesWaterfallHook; - // Protects against `JSON.stringify()` returning `undefined`, by serializing - // to the literal string: "undefined". - if (typeof str !== 'string') { - return String(str); - } - // Replace unsafe HTML and invalid JavaScript line terminator chars with - // their safe Unicode char counterpart. This _must_ happen before the - // regexps and functions are serialized and added back to the string. - if (options.unsafe !== true) { - str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars); - } +/***/ }), - if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && undefs.length === 0 && infinities.length === 0) { - return str; - } +/***/ 12233: +/***/ (function(module) { - // Replaces all occurrences of function, regexp, date, map and set placeholders in the - // JSON string with their string representations. If the original value can - // not be found, then `undefined` is used. - return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) { - // The placeholder may not be preceded by a backslash. This is to prevent - // replacing things like `"a\"@__R--0__@"` and thus outputting - // invalid JS. - if (backSlash) { - return match; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (type === 'D') { - return "new Date(\"" + dates[valueIndex].toISOString() + "\")"; - } - if (type === 'R') { - return "new RegExp(" + serialize(regexps[valueIndex].source) + ", \"" + regexps[valueIndex].flags + "\")"; - } +class Hook { + constructor(args) { + if (!Array.isArray(args)) args = []; + this._args = args; + this.taps = []; + this.interceptors = []; + this.call = this._call; + this.promise = this._promise; + this.callAsync = this._callAsync; + this._x = undefined; + } - if (type === 'M') { - return "new Map(" + serialize(Array.from(maps[valueIndex].entries()), options) + ")"; - } + compile(options) { + throw new Error("Abstract: should be overriden"); + } - if (type === 'S') { - return "new Set(" + serialize(Array.from(sets[valueIndex].values()), options) + ")"; - } + _createCall(type) { + return this.compile({ + taps: this.taps, + interceptors: this.interceptors, + args: this._args, + type: type + }); + } - if (type === 'U') { - return 'undefined' - } - - if (type === 'I') { - return infinities[valueIndex]; - } - - var fn = functions[valueIndex]; - - return serializeFunc(fn); - }); -} - - -/***/ }), + tap(options, fn) { + if (typeof options === "string") options = { name: options }; + if (typeof options !== "object" || options === null) + throw new Error( + "Invalid arguments to tap(options: Object, fn: function)" + ); + options = Object.assign({ type: "sync", fn: fn }, options); + if (typeof options.name !== "string" || options.name === "") + throw new Error("Missing name for tap"); + options = this._runRegisterInterceptors(options); + this._insert(options); + } -/***/ 34857: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + tapAsync(options, fn) { + if (typeof options === "string") options = { name: options }; + if (typeof options !== "object" || options === null) + throw new Error( + "Invalid arguments to tapAsync(options: Object, fn: function)" + ); + options = Object.assign({ type: "async", fn: fn }, options); + if (typeof options.name !== "string" || options.name === "") + throw new Error("Missing name for tapAsync"); + options = this._runRegisterInterceptors(options); + this._insert(options); + } -"use strict"; -/*! - * set-value - * - * Copyright (c) 2014-2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ + tapPromise(options, fn) { + if (typeof options === "string") options = { name: options }; + if (typeof options !== "object" || options === null) + throw new Error( + "Invalid arguments to tapPromise(options: Object, fn: function)" + ); + options = Object.assign({ type: "promise", fn: fn }, options); + if (typeof options.name !== "string" || options.name === "") + throw new Error("Missing name for tapPromise"); + options = this._runRegisterInterceptors(options); + this._insert(options); + } + _runRegisterInterceptors(options) { + for (const interceptor of this.interceptors) { + if (interceptor.register) { + const newOptions = interceptor.register(options); + if (newOptions !== undefined) options = newOptions; + } + } + return options; + } + withOptions(options) { + const mergeOptions = opt => + Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt); -var split = __webpack_require__(33218); -var extend = __webpack_require__(28727); -var isPlainObject = __webpack_require__(81064); -var isObject = __webpack_require__(18493); + // Prevent creating endless prototype chains + options = Object.assign({}, options, this._withOptions); + const base = this._withOptionsBase || this; + const newHook = Object.create(base); -module.exports = function(obj, prop, val) { - if (!isObject(obj)) { - return obj; - } + (newHook.tapAsync = (opt, fn) => base.tapAsync(mergeOptions(opt), fn)), + (newHook.tap = (opt, fn) => base.tap(mergeOptions(opt), fn)); + newHook.tapPromise = (opt, fn) => base.tapPromise(mergeOptions(opt), fn); + newHook._withOptions = options; + newHook._withOptionsBase = base; + return newHook; + } - if (Array.isArray(prop)) { - prop = [].concat.apply([], prop).join('.'); - } + isUsed() { + return this.taps.length > 0 || this.interceptors.length > 0; + } - if (typeof prop !== 'string') { - return obj; - } + intercept(interceptor) { + this._resetCompilation(); + this.interceptors.push(Object.assign({}, interceptor)); + if (interceptor.register) { + for (let i = 0; i < this.taps.length; i++) + this.taps[i] = interceptor.register(this.taps[i]); + } + } - var keys = split(prop, {sep: '.', brackets: true}).filter(isValidKey); - var len = keys.length; - var idx = -1; - var current = obj; + _resetCompilation() { + this.call = this._call; + this.callAsync = this._callAsync; + this.promise = this._promise; + } - while (++idx < len) { - var key = keys[idx]; - if (idx !== len - 1) { - if (!isObject(current[key])) { - current[key] = {}; - } - current = current[key]; - continue; - } + _insert(item) { + this._resetCompilation(); + let before; + if (typeof item.before === "string") before = new Set([item.before]); + else if (Array.isArray(item.before)) { + before = new Set(item.before); + } + let stage = 0; + if (typeof item.stage === "number") stage = item.stage; + let i = this.taps.length; + while (i > 0) { + i--; + const x = this.taps[i]; + this.taps[i + 1] = x; + const xStage = x.stage || 0; + if (before) { + if (before.has(x.name)) { + before.delete(x.name); + continue; + } + if (before.size > 0) { + continue; + } + } + if (xStage > stage) { + continue; + } + i++; + break; + } + this.taps[i] = item; + } +} - if (isPlainObject(current[key]) && isPlainObject(val)) { - current[key] = extend({}, current[key], val); - } else { - current[key] = val; - } - } +function createCompileDelegate(name, type) { + return function lazyCompileHook(...args) { + this[name] = this._createCall(type); + return this[name](...args); + }; +} - return obj; -}; +Object.defineProperties(Hook.prototype, { + _call: { + value: createCompileDelegate("call", "sync"), + configurable: true, + writable: true + }, + _promise: { + value: createCompileDelegate("promise", "promise"), + configurable: true, + writable: true + }, + _callAsync: { + value: createCompileDelegate("callAsync", "async"), + configurable: true, + writable: true + } +}); -function isValidKey(key) { - return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'; -} +module.exports = Hook; /***/ }), -/***/ 12579: -/***/ (function(module, exports, __webpack_require__) { +/***/ 64288: +/***/ (function(module) { "use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -var isObject = __webpack_require__(96667); -var define = __webpack_require__(88599); -var utils = __webpack_require__(82071); -var ownNames; - -/** - * Create a new AST `Node` with the given `val` and `type`. - * - * ```js - * var node = new Node('*', 'Star'); - * var node = new Node({type: 'star', val: '*'}); - * ``` - * @name Node - * @param {String|Object} `val` Pass a matched substring, or an object to merge onto the node. - * @param {String} `type` The node type to use when `val` is a string. - * @return {Object} node instance - * @api public - */ - -function Node(val, type, parent) { - if (typeof type !== 'string') { - parent = type; - type = null; - } - - define(this, 'parent', parent); - define(this, 'isNode', true); - define(this, 'expect', null); +class HookCodeFactory { + constructor(config) { + this.config = config; + this.options = undefined; + this._args = undefined; + } - if (typeof type !== 'string' && isObject(val)) { - lazyKeys(); - var keys = Object.keys(val); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (ownNames.indexOf(key) === -1) { - this[key] = val[key]; - } - } - } else { - this.type = type; - this.val = val; - } -} + create(options) { + this.init(options); + let fn; + switch (this.options.type) { + case "sync": + fn = new Function( + this.args(), + '"use strict";\n' + + this.header() + + this.content({ + onError: err => `throw ${err};\n`, + onResult: result => `return ${result};\n`, + resultReturns: true, + onDone: () => "", + rethrowIfPossible: true + }) + ); + break; + case "async": + fn = new Function( + this.args({ + after: "_callback" + }), + '"use strict";\n' + + this.header() + + this.content({ + onError: err => `_callback(${err});\n`, + onResult: result => `_callback(null, ${result});\n`, + onDone: () => "_callback();\n" + }) + ); + break; + case "promise": + let errorHelperUsed = false; + const content = this.content({ + onError: err => { + errorHelperUsed = true; + return `_error(${err});\n`; + }, + onResult: result => `_resolve(${result});\n`, + onDone: () => "_resolve();\n" + }); + let code = ""; + code += '"use strict";\n'; + code += "return new Promise((_resolve, _reject) => {\n"; + if (errorHelperUsed) { + code += "var _sync = true;\n"; + code += "function _error(_err) {\n"; + code += "if(_sync)\n"; + code += "_resolve(Promise.resolve().then(() => { throw _err; }));\n"; + code += "else\n"; + code += "_reject(_err);\n"; + code += "};\n"; + } + code += this.header(); + code += content; + if (errorHelperUsed) { + code += "_sync = false;\n"; + } + code += "});\n"; + fn = new Function(this.args(), code); + break; + } + this.deinit(); + return fn; + } -/** - * Returns true if the given value is a node. - * - * ```js - * var Node = require('snapdragon-node'); - * var node = new Node({type: 'foo'}); - * console.log(Node.isNode(node)); //=> true - * console.log(Node.isNode({})); //=> false - * ``` - * @param {Object} `node` - * @returns {Boolean} - * @api public - */ + setup(instance, options) { + instance._x = options.taps.map(t => t.fn); + } -Node.isNode = function(node) { - return utils.isNode(node); -}; + /** + * @param {{ type: "sync" | "promise" | "async", taps: Array, interceptors: Array }} options + */ + init(options) { + this.options = options; + this._args = options.args.slice(); + } -/** - * Define a non-enumberable property on the node instance. - * Useful for adding properties that shouldn't be extended - * or visible during debugging. - * - * ```js - * var node = new Node(); - * node.define('foo', 'something non-enumerable'); - * ``` - * @param {String} `name` - * @param {any} `val` - * @return {Object} returns the node instance - * @api public - */ + deinit() { + this.options = undefined; + this._args = undefined; + } -Node.prototype.define = function(name, val) { - define(this, name, val); - return this; -}; + header() { + let code = ""; + if (this.needContext()) { + code += "var _context = {};\n"; + } else { + code += "var _context;\n"; + } + code += "var _x = this._x;\n"; + if (this.options.interceptors.length > 0) { + code += "var _taps = this.taps;\n"; + code += "var _interceptors = this.interceptors;\n"; + } + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.call) { + code += `${this.getInterceptor(i)}.call(${this.args({ + before: interceptor.context ? "_context" : undefined + })});\n`; + } + } + return code; + } -/** - * Returns true if `node.val` is an empty string, or `node.nodes` does - * not contain any non-empty text nodes. - * - * ```js - * var node = new Node({type: 'text'}); - * node.isEmpty(); //=> true - * node.val = 'foo'; - * node.isEmpty(); //=> false - * ``` - * @param {Function} `fn` (optional) Filter function that is called on `node` and/or child nodes. `isEmpty` will return false immediately when the filter function returns false on any nodes. - * @return {Boolean} - * @api public - */ + needContext() { + for (const tap of this.options.taps) if (tap.context) return true; + return false; + } -Node.prototype.isEmpty = function(fn) { - return utils.isEmpty(this, fn); -}; + callTap(tapIndex, { onError, onResult, onDone, rethrowIfPossible }) { + let code = ""; + let hasTapCached = false; + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.tap) { + if (!hasTapCached) { + code += `var _tap${tapIndex} = ${this.getTap(tapIndex)};\n`; + hasTapCached = true; + } + code += `${this.getInterceptor(i)}.tap(${ + interceptor.context ? "_context, " : "" + }_tap${tapIndex});\n`; + } + } + code += `var _fn${tapIndex} = ${this.getTapFn(tapIndex)};\n`; + const tap = this.options.taps[tapIndex]; + switch (tap.type) { + case "sync": + if (!rethrowIfPossible) { + code += `var _hasError${tapIndex} = false;\n`; + code += "try {\n"; + } + if (onResult) { + code += `var _result${tapIndex} = _fn${tapIndex}(${this.args({ + before: tap.context ? "_context" : undefined + })});\n`; + } else { + code += `_fn${tapIndex}(${this.args({ + before: tap.context ? "_context" : undefined + })});\n`; + } + if (!rethrowIfPossible) { + code += "} catch(_err) {\n"; + code += `_hasError${tapIndex} = true;\n`; + code += onError("_err"); + code += "}\n"; + code += `if(!_hasError${tapIndex}) {\n`; + } + if (onResult) { + code += onResult(`_result${tapIndex}`); + } + if (onDone) { + code += onDone(); + } + if (!rethrowIfPossible) { + code += "}\n"; + } + break; + case "async": + let cbCode = ""; + if (onResult) cbCode += `(_err${tapIndex}, _result${tapIndex}) => {\n`; + else cbCode += `_err${tapIndex} => {\n`; + cbCode += `if(_err${tapIndex}) {\n`; + cbCode += onError(`_err${tapIndex}`); + cbCode += "} else {\n"; + if (onResult) { + cbCode += onResult(`_result${tapIndex}`); + } + if (onDone) { + cbCode += onDone(); + } + cbCode += "}\n"; + cbCode += "}"; + code += `_fn${tapIndex}(${this.args({ + before: tap.context ? "_context" : undefined, + after: cbCode + })});\n`; + break; + case "promise": + code += `var _hasResult${tapIndex} = false;\n`; + code += `var _promise${tapIndex} = _fn${tapIndex}(${this.args({ + before: tap.context ? "_context" : undefined + })});\n`; + code += `if (!_promise${tapIndex} || !_promise${tapIndex}.then)\n`; + code += ` throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise${tapIndex} + ')');\n`; + code += `_promise${tapIndex}.then(_result${tapIndex} => {\n`; + code += `_hasResult${tapIndex} = true;\n`; + if (onResult) { + code += onResult(`_result${tapIndex}`); + } + if (onDone) { + code += onDone(); + } + code += `}, _err${tapIndex} => {\n`; + code += `if(_hasResult${tapIndex}) throw _err${tapIndex};\n`; + code += onError(`_err${tapIndex}`); + code += "});\n"; + break; + } + return code; + } -/** - * Given node `foo` and node `bar`, push node `bar` onto `foo.nodes`, and - * set `foo` as `bar.parent`. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * foo.push(bar); - * ``` - * @param {Object} `node` - * @return {Number} Returns the length of `node.nodes` - * @api public - */ + callTapsSeries({ + onError, + onResult, + resultReturns, + onDone, + doneReturns, + rethrowIfPossible + }) { + if (this.options.taps.length === 0) return onDone(); + const firstAsync = this.options.taps.findIndex(t => t.type !== "sync"); + const somethingReturns = resultReturns || doneReturns || false; + let code = ""; + let current = onDone; + for (let j = this.options.taps.length - 1; j >= 0; j--) { + const i = j; + const unroll = current !== onDone && this.options.taps[i].type !== "sync"; + if (unroll) { + code += `function _next${i}() {\n`; + code += current(); + code += `}\n`; + current = () => `${somethingReturns ? "return " : ""}_next${i}();\n`; + } + const done = current; + const doneBreak = skipDone => { + if (skipDone) return ""; + return onDone(); + }; + const content = this.callTap(i, { + onError: error => onError(i, error, done, doneBreak), + onResult: + onResult && + (result => { + return onResult(i, result, done, doneBreak); + }), + onDone: !onResult && done, + rethrowIfPossible: + rethrowIfPossible && (firstAsync < 0 || i < firstAsync) + }); + current = () => content; + } + code += current(); + return code; + } -Node.prototype.push = function(node) { - assert(Node.isNode(node), 'expected node to be an instance of Node'); - define(node, 'parent', this); + callTapsLooping({ onError, onDone, rethrowIfPossible }) { + if (this.options.taps.length === 0) return onDone(); + const syncOnly = this.options.taps.every(t => t.type === "sync"); + let code = ""; + if (!syncOnly) { + code += "var _looper = () => {\n"; + code += "var _loopAsync = false;\n"; + } + code += "var _loop;\n"; + code += "do {\n"; + code += "_loop = false;\n"; + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.loop) { + code += `${this.getInterceptor(i)}.loop(${this.args({ + before: interceptor.context ? "_context" : undefined + })});\n`; + } + } + code += this.callTapsSeries({ + onError, + onResult: (i, result, next, doneBreak) => { + let code = ""; + code += `if(${result} !== undefined) {\n`; + code += "_loop = true;\n"; + if (!syncOnly) code += "if(_loopAsync) _looper();\n"; + code += doneBreak(true); + code += `} else {\n`; + code += next(); + code += `}\n`; + return code; + }, + onDone: + onDone && + (() => { + let code = ""; + code += "if(!_loop) {\n"; + code += onDone(); + code += "}\n"; + return code; + }), + rethrowIfPossible: rethrowIfPossible && syncOnly + }); + code += "} while(_loop);\n"; + if (!syncOnly) { + code += "_loopAsync = true;\n"; + code += "};\n"; + code += "_looper();\n"; + } + return code; + } - this.nodes = this.nodes || []; - return this.nodes.push(node); -}; + callTapsParallel({ + onError, + onResult, + onDone, + rethrowIfPossible, + onTap = (i, run) => run() + }) { + if (this.options.taps.length <= 1) { + return this.callTapsSeries({ + onError, + onResult, + onDone, + rethrowIfPossible + }); + } + let code = ""; + code += "do {\n"; + code += `var _counter = ${this.options.taps.length};\n`; + if (onDone) { + code += "var _done = () => {\n"; + code += onDone(); + code += "};\n"; + } + for (let i = 0; i < this.options.taps.length; i++) { + const done = () => { + if (onDone) return "if(--_counter === 0) _done();\n"; + else return "--_counter;"; + }; + const doneBreak = skipDone => { + if (skipDone || !onDone) return "_counter = 0;\n"; + else return "_counter = 0;\n_done();\n"; + }; + code += "if(_counter <= 0) break;\n"; + code += onTap( + i, + () => + this.callTap(i, { + onError: error => { + let code = ""; + code += "if(_counter > 0) {\n"; + code += onError(i, error, done, doneBreak); + code += "}\n"; + return code; + }, + onResult: + onResult && + (result => { + let code = ""; + code += "if(_counter > 0) {\n"; + code += onResult(i, result, done, doneBreak); + code += "}\n"; + return code; + }), + onDone: + !onResult && + (() => { + return done(); + }), + rethrowIfPossible + }), + done, + doneBreak + ); + } + code += "} while(false);\n"; + return code; + } -/** - * Given node `foo` and node `bar`, unshift node `bar` onto `foo.nodes`, and - * set `foo` as `bar.parent`. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * foo.unshift(bar); - * ``` - * @param {Object} `node` - * @return {Number} Returns the length of `node.nodes` - * @api public - */ + args({ before, after } = {}) { + let allArgs = this._args; + if (before) allArgs = [before].concat(allArgs); + if (after) allArgs = allArgs.concat(after); + if (allArgs.length === 0) { + return ""; + } else { + return allArgs.join(", "); + } + } -Node.prototype.unshift = function(node) { - assert(Node.isNode(node), 'expected node to be an instance of Node'); - define(node, 'parent', this); + getTapFn(idx) { + return `_x[${idx}]`; + } - this.nodes = this.nodes || []; - return this.nodes.unshift(node); -}; + getTap(idx) { + return `_taps[${idx}]`; + } -/** - * Pop a node from `node.nodes`. - * - * ```js - * var node = new Node({type: 'foo'}); - * node.push(new Node({type: 'a'})); - * node.push(new Node({type: 'b'})); - * node.push(new Node({type: 'c'})); - * node.push(new Node({type: 'd'})); - * console.log(node.nodes.length); - * //=> 4 - * node.pop(); - * console.log(node.nodes.length); - * //=> 3 - * ``` - * @return {Number} Returns the popped `node` - * @api public - */ + getInterceptor(idx) { + return `_interceptors[${idx}]`; + } +} -Node.prototype.pop = function() { - return this.nodes && this.nodes.pop(); -}; +module.exports = HookCodeFactory; -/** - * Shift a node from `node.nodes`. - * - * ```js - * var node = new Node({type: 'foo'}); - * node.push(new Node({type: 'a'})); - * node.push(new Node({type: 'b'})); - * node.push(new Node({type: 'c'})); - * node.push(new Node({type: 'd'})); - * console.log(node.nodes.length); - * //=> 4 - * node.shift(); - * console.log(node.nodes.length); - * //=> 3 - * ``` - * @return {Object} Returns the shifted `node` - * @api public - */ -Node.prototype.shift = function() { - return this.nodes && this.nodes.shift(); -}; +/***/ }), -/** - * Remove `node` from `node.nodes`. - * - * ```js - * node.remove(childNode); - * ``` - * @param {Object} `node` - * @return {Object} Returns the removed node. - * @api public - */ +/***/ 35233: +/***/ (function(module) { -Node.prototype.remove = function(node) { - assert(Node.isNode(node), 'expected node to be an instance of Node'); - this.nodes = this.nodes || []; - var idx = node.index; - if (idx !== -1) { - node.index = -1; - return this.nodes.splice(idx, 1); - } - return null; -}; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -/** - * Get the first child node from `node.nodes` that matches the given `type`. - * If `type` is a number, the child node at that index is returned. - * - * ```js - * var child = node.find(1); //<= index of the node to get - * var child = node.find('foo'); //<= node.type of a child node - * var child = node.find(/^(foo|bar)$/); //<= regex to match node.type - * var child = node.find(['foo', 'bar']); //<= array of node.type(s) - * ``` - * @param {String} `type` - * @return {Object} Returns a child node or undefined. - * @api public - */ -Node.prototype.find = function(type) { - return utils.findNode(this.nodes, type); -}; +class HookMap { + constructor(factory) { + this._map = new Map(); + this._factory = factory; + this._interceptors = []; + } -/** - * Return true if the node is the given `type`. - * - * ```js - * var node = new Node({type: 'bar'}); - * cosole.log(node.isType('foo')); // false - * cosole.log(node.isType(/^(foo|bar)$/)); // true - * cosole.log(node.isType(['foo', 'bar'])); // true - * ``` - * @param {String} `type` - * @return {Boolean} - * @api public - */ + get(key) { + return this._map.get(key); + } -Node.prototype.isType = function(type) { - return utils.isType(this, type); -}; + for(key) { + const hook = this.get(key); + if (hook !== undefined) { + return hook; + } + let newHook = this._factory(key); + const interceptors = this._interceptors; + for (let i = 0; i < interceptors.length; i++) { + newHook = interceptors[i].factory(key, newHook); + } + this._map.set(key, newHook); + return newHook; + } -/** - * Return true if the `node.nodes` has the given `type`. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * foo.push(bar); - * - * cosole.log(foo.hasType('qux')); // false - * cosole.log(foo.hasType(/^(qux|bar)$/)); // true - * cosole.log(foo.hasType(['qux', 'bar'])); // true - * ``` - * @param {String} `type` - * @return {Boolean} - * @api public - */ + intercept(interceptor) { + this._interceptors.push( + Object.assign( + { + factory: (key, hook) => hook + }, + interceptor + ) + ); + } -Node.prototype.hasType = function(type) { - return utils.hasType(this, type); -}; + tap(key, options, fn) { + return this.for(key).tap(options, fn); + } -/** - * Get the siblings array, or `null` if it doesn't exist. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * var baz = new Node({type: 'baz'}); - * foo.push(bar); - * foo.push(baz); - * - * console.log(bar.siblings.length) // 2 - * console.log(baz.siblings.length) // 2 - * ``` - * @return {Array} - * @api public - */ + tapAsync(key, options, fn) { + return this.for(key).tapAsync(options, fn); + } -Object.defineProperty(Node.prototype, 'siblings', { - set: function() { - throw new Error('node.siblings is a getter and cannot be defined'); - }, - get: function() { - return this.parent ? this.parent.nodes : null; - } -}); + tapPromise(key, options, fn) { + return this.for(key).tapPromise(options, fn); + } +} -/** - * Get the node's current index from `node.parent.nodes`. - * This should always be correct, even when the parent adds nodes. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * var baz = new Node({type: 'baz'}); - * var qux = new Node({type: 'qux'}); - * foo.push(bar); - * foo.push(baz); - * foo.unshift(qux); - * - * console.log(bar.index) // 1 - * console.log(baz.index) // 2 - * console.log(qux.index) // 0 - * ``` - * @return {Number} - * @api public - */ +module.exports = HookMap; -Object.defineProperty(Node.prototype, 'index', { - set: function(index) { - define(this, 'idx', index); - }, - get: function() { - if (!Array.isArray(this.siblings)) { - return -1; - } - var tok = this.idx !== -1 ? this.siblings[this.idx] : null; - if (tok !== this) { - this.idx = this.siblings.indexOf(this); - } - return this.idx; - } -}); -/** - * Get the previous node from the siblings array or `null`. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * var baz = new Node({type: 'baz'}); - * foo.push(bar); - * foo.push(baz); - * - * console.log(baz.prev.type) // 'bar' - * ``` - * @return {Object} - * @api public - */ +/***/ }), -Object.defineProperty(Node.prototype, 'prev', { - set: function() { - throw new Error('node.prev is a getter and cannot be defined'); - }, - get: function() { - if (Array.isArray(this.siblings)) { - return this.siblings[this.index - 1] || this.parent.prev; - } - return null; - } -}); +/***/ 93607: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -/** - * Get the siblings array, or `null` if it doesn't exist. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * var baz = new Node({type: 'baz'}); - * foo.push(bar); - * foo.push(baz); - * - * console.log(bar.siblings.length) // 2 - * console.log(baz.siblings.length) // 2 - * ``` - * @return {Object} - * @api public - */ +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -Object.defineProperty(Node.prototype, 'next', { - set: function() { - throw new Error('node.next is a getter and cannot be defined'); - }, - get: function() { - if (Array.isArray(this.siblings)) { - return this.siblings[this.index + 1] || this.parent.next; - } - return null; - } -}); -/** - * Get the first node from `node.nodes`. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * var baz = new Node({type: 'baz'}); - * var qux = new Node({type: 'qux'}); - * foo.push(bar); - * foo.push(baz); - * foo.push(qux); - * - * console.log(foo.first.type) // 'bar' - * ``` - * @return {Object} The first node, or undefiend - * @api public - */ +const Hook = __webpack_require__(12233); -Object.defineProperty(Node.prototype, 'first', { - get: function() { - return this.nodes ? this.nodes[0] : null; - } -}); - -/** - * Get the last node from `node.nodes`. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * var baz = new Node({type: 'baz'}); - * var qux = new Node({type: 'qux'}); - * foo.push(bar); - * foo.push(baz); - * foo.push(qux); - * - * console.log(foo.last.type) // 'qux' - * ``` - * @return {Object} The last node, or undefiend - * @api public - */ - -Object.defineProperty(Node.prototype, 'last', { - get: function() { - return this.nodes ? utils.last(this.nodes) : null; - } -}); +class MultiHook { + constructor(hooks) { + this.hooks = hooks; + } -/** - * Get the last node from `node.nodes`. - * - * ```js - * var foo = new Node({type: 'foo'}); - * var bar = new Node({type: 'bar'}); - * var baz = new Node({type: 'baz'}); - * var qux = new Node({type: 'qux'}); - * foo.push(bar); - * foo.push(baz); - * foo.push(qux); - * - * console.log(foo.last.type) // 'qux' - * ``` - * @return {Object} The last node, or undefiend - * @api public - */ + tap(options, fn) { + for (const hook of this.hooks) { + hook.tap(options, fn); + } + } -Object.defineProperty(Node.prototype, 'scope', { - get: function() { - if (this.isScope !== true) { - return this.parent ? this.parent.scope : this; - } - return this; - } -}); + tapAsync(options, fn) { + for (const hook of this.hooks) { + hook.tapAsync(options, fn); + } + } -/** - * Get own property names from Node prototype, but only the - * first time `Node` is instantiated - */ + tapPromise(options, fn) { + for (const hook of this.hooks) { + hook.tapPromise(options, fn); + } + } -function lazyKeys() { - if (!ownNames) { - ownNames = Object.getOwnPropertyNames(Node.prototype); - } -} + isUsed() { + for (const hook of this.hooks) { + if (hook.isUsed()) return true; + } + return false; + } -/** - * Simplified assertion. Throws an error is `val` is falsey. - */ + intercept(interceptor) { + for (const hook of this.hooks) { + hook.intercept(interceptor); + } + } -function assert(val, message) { - if (!val) throw new Error(message); + withOptions(options) { + return new MultiHook(this.hooks.map(h => h.withOptions(options))); + } } -/** - * Expose `Node` - */ - -exports = module.exports = Node; +module.exports = MultiHook; /***/ }), -/***/ 88599: +/***/ 16477: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/*! - * define-property - * - * Copyright (c) 2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +const Hook = __webpack_require__(12233); +const HookCodeFactory = __webpack_require__(64288); -var isDescriptor = __webpack_require__(44133); +class SyncBailHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, resultReturns, onDone, rethrowIfPossible }) { + return this.callTapsSeries({ + onError: (i, err) => onError(err), + onResult: (i, result, next) => + `if(${result} !== undefined) {\n${onResult( + result + )};\n} else {\n${next()}}\n`, + resultReturns, + onDone, + rethrowIfPossible + }); + } +} -module.exports = function defineProperty(obj, prop, val) { - if (typeof obj !== 'object' && typeof obj !== 'function') { - throw new TypeError('expected an object or function.'); - } +const factory = new SyncBailHookCodeFactory(); - if (typeof prop !== 'string') { - throw new TypeError('expected `prop` to be a string.'); - } +class SyncBailHook extends Hook { + tapAsync() { + throw new Error("tapAsync is not supported on a SyncBailHook"); + } - if (isDescriptor(val) && ('set' in val || 'get' in val)) { - return Object.defineProperty(obj, prop, val); - } + tapPromise() { + throw new Error("tapPromise is not supported on a SyncBailHook"); + } - return Object.defineProperty(obj, prop, { - configurable: true, - enumerable: false, - writable: true, - value: val - }); -}; + compile(options) { + factory.setup(this, options); + return factory.create(options); + } +} + +module.exports = SyncBailHook; /***/ }), -/***/ 82071: +/***/ 77633: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -var typeOf = __webpack_require__(48865); -var utils = module.exports; +const Hook = __webpack_require__(12233); +const HookCodeFactory = __webpack_require__(64288); -/** - * Returns true if the given value is a node. - * - * ```js - * var Node = require('snapdragon-node'); - * var node = new Node({type: 'foo'}); - * console.log(utils.isNode(node)); //=> true - * console.log(utils.isNode({})); //=> false - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @returns {Boolean} - * @api public - */ +class SyncHookCodeFactory extends HookCodeFactory { + content({ onError, onDone, rethrowIfPossible }) { + return this.callTapsSeries({ + onError: (i, err) => onError(err), + onDone, + rethrowIfPossible + }); + } +} -utils.isNode = function(node) { - return typeOf(node) === 'object' && node.isNode === true; -}; +const factory = new SyncHookCodeFactory(); -/** - * Emit an empty string for the given `node`. - * - * ```js - * // do nothing for beginning-of-string - * snapdragon.compiler.set('bos', utils.noop); - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @returns {undefined} - * @api public - */ +class SyncHook extends Hook { + tapAsync() { + throw new Error("tapAsync is not supported on a SyncHook"); + } -utils.noop = function(node) { - append(this, '', node); -}; + tapPromise() { + throw new Error("tapPromise is not supported on a SyncHook"); + } -/** - * Appdend `node.val` to `compiler.output`, exactly as it was created - * by the parser. - * - * ```js - * snapdragon.compiler.set('text', utils.identity); - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @returns {undefined} - * @api public - */ + compile(options) { + factory.setup(this, options); + return factory.create(options); + } +} -utils.identity = function(node) { - append(this, node.val, node); -}; +module.exports = SyncHook; -/** - * Previously named `.emit`, this method appends the given `val` - * to `compiler.output` for the given node. Useful when you know - * what value should be appended advance, regardless of the actual - * value of `node.val`. - * - * ```js - * snapdragon.compiler - * .set('i', function(node) { - * this.mapVisit(node); - * }) - * .set('i.open', utils.append('')) - * .set('i.close', utils.append('')) - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @returns {Function} Returns a compiler middleware function. - * @api public - */ -utils.append = function(val) { - return function(node) { - append(this, val, node); - }; -}; +/***/ }), -/** - * Used in compiler middleware, this onverts an AST node into - * an empty `text` node and deletes `node.nodes` if it exists. - * The advantage of this method is that, as opposed to completely - * removing the node, indices will not need to be re-calculated - * in sibling nodes, and nothing is appended to the output. - * - * ```js - * utils.toNoop(node); - * // convert `node.nodes` to the given value instead of deleting it - * utils.toNoop(node, []); - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {Array} `nodes` Optionally pass a new `nodes` value, to replace the existing `node.nodes` array. - * @api public - */ +/***/ 13608: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -utils.toNoop = function(node, nodes) { - if (nodes) { - node.nodes = nodes; - } else { - delete node.nodes; - node.type = 'text'; - node.val = ''; - } -}; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -/** - * Visit `node` with the given `fn`. The built-in `.visit` method in snapdragon - * automatically calls registered compilers, this allows you to pass a visitor - * function. - * - * ```js - * snapdragon.compiler.set('i', function(node) { - * utils.visit(node, function(childNode) { - * // do stuff with "childNode" - * return childNode; - * }); - * }); - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {Function} `fn` - * @return {Object} returns the node after recursively visiting all child nodes. - * @api public - */ -utils.visit = function(node, fn) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - assert(isFunction(fn), 'expected a visitor function'); - fn(node); - return node.nodes ? utils.mapVisit(node, fn) : node; -}; +const Hook = __webpack_require__(12233); +const HookCodeFactory = __webpack_require__(64288); -/** - * Map [visit](#visit) the given `fn` over `node.nodes`. This is called by - * [visit](#visit), use this method if you do not want `fn` to be called on - * the first node. - * - * ```js - * snapdragon.compiler.set('i', function(node) { - * utils.mapVisit(node, function(childNode) { - * // do stuff with "childNode" - * return childNode; - * }); - * }); - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {Object} `options` - * @param {Function} `fn` - * @return {Object} returns the node - * @api public - */ +class SyncLoopHookCodeFactory extends HookCodeFactory { + content({ onError, onDone, rethrowIfPossible }) { + return this.callTapsLooping({ + onError: (i, err) => onError(err), + onDone, + rethrowIfPossible + }); + } +} -utils.mapVisit = function(node, fn) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - assert(isArray(node.nodes), 'expected node.nodes to be an array'); - assert(isFunction(fn), 'expected a visitor function'); +const factory = new SyncLoopHookCodeFactory(); - for (var i = 0; i < node.nodes.length; i++) { - utils.visit(node.nodes[i], fn); - } - return node; -}; +class SyncLoopHook extends Hook { + tapAsync() { + throw new Error("tapAsync is not supported on a SyncLoopHook"); + } -/** - * Unshift an `*.open` node onto `node.nodes`. - * - * ```js - * var Node = require('snapdragon-node'); - * snapdragon.parser.set('brace', function(node) { - * var match = this.match(/^{/); - * if (match) { - * var parent = new Node({type: 'brace'}); - * utils.addOpen(parent, Node); - * console.log(parent.nodes[0]): - * // { type: 'brace.open', val: '' }; - * - * // push the parent "brace" node onto the stack - * this.push(parent); - * - * // return the parent node, so it's also added to the AST - * return brace; - * } - * }); - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. - * @param {Function} `filter` Optionaly specify a filter function to exclude the node. - * @return {Object} Returns the created opening node. - * @api public - */ + tapPromise() { + throw new Error("tapPromise is not supported on a SyncLoopHook"); + } -utils.addOpen = function(node, Node, val, filter) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - assert(isFunction(Node), 'expected Node to be a constructor function'); + compile(options) { + factory.setup(this, options); + return factory.create(options); + } +} - if (typeof val === 'function') { - filter = val; - val = ''; - } +module.exports = SyncLoopHook; - if (typeof filter === 'function' && !filter(node)) return; - var open = new Node({ type: node.type + '.open', val: val}); - var unshift = node.unshift || node.unshiftNode; - if (typeof unshift === 'function') { - unshift.call(node, open); - } else { - utils.unshiftNode(node, open); - } - return open; -}; -/** - * Push a `*.close` node onto `node.nodes`. - * - * ```js - * var Node = require('snapdragon-node'); - * snapdragon.parser.set('brace', function(node) { - * var match = this.match(/^}/); - * if (match) { - * var parent = this.parent(); - * if (parent.type !== 'brace') { - * throw new Error('missing opening: ' + '}'); - * } - * - * utils.addClose(parent, Node); - * console.log(parent.nodes[parent.nodes.length - 1]): - * // { type: 'brace.close', val: '' }; - * - * // no need to return a node, since the parent - * // was already added to the AST - * return; - * } - * }); - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. - * @param {Function} `filter` Optionaly specify a filter function to exclude the node. - * @return {Object} Returns the created closing node. - * @api public - */ +/***/ }), -utils.addClose = function(node, Node, val, filter) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - assert(isFunction(Node), 'expected Node to be a constructor function'); +/***/ 6548: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (typeof val === 'function') { - filter = val; - val = ''; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (typeof filter === 'function' && !filter(node)) return; - var close = new Node({ type: node.type + '.close', val: val}); - var push = node.push || node.pushNode; - if (typeof push === 'function') { - push.call(node, close); - } else { - utils.pushNode(node, close); - } - return close; -}; -/** - * Wraps the given `node` with `*.open` and `*.close` nodes. - * - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. - * @param {Function} `filter` Optionaly specify a filter function to exclude the node. - * @return {Object} Returns the node - * @api public - */ +const Hook = __webpack_require__(12233); +const HookCodeFactory = __webpack_require__(64288); -utils.wrapNodes = function(node, Node, filter) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - assert(isFunction(Node), 'expected Node to be a constructor function'); +class SyncWaterfallHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, resultReturns, rethrowIfPossible }) { + return this.callTapsSeries({ + onError: (i, err) => onError(err), + onResult: (i, result, next) => { + let code = ""; + code += `if(${result} !== undefined) {\n`; + code += `${this._args[0]} = ${result};\n`; + code += `}\n`; + code += next(); + return code; + }, + onDone: () => onResult(this._args[0]), + doneReturns: resultReturns, + rethrowIfPossible + }); + } +} - utils.addOpen(node, Node, filter); - utils.addClose(node, Node, filter); - return node; -}; +const factory = new SyncWaterfallHookCodeFactory(); -/** - * Push the given `node` onto `parent.nodes`, and set `parent` as `node.parent. - * - * ```js - * var parent = new Node({type: 'foo'}); - * var node = new Node({type: 'bar'}); - * utils.pushNode(parent, node); - * console.log(parent.nodes[0].type) // 'bar' - * console.log(node.parent.type) // 'foo' - * ``` - * @param {Object} `parent` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Object} Returns the child node - * @api public - */ +class SyncWaterfallHook extends Hook { + constructor(args) { + super(args); + if (args.length < 1) + throw new Error("Waterfall hooks must have at least one argument"); + } -utils.pushNode = function(parent, node) { - assert(utils.isNode(parent), 'expected parent node to be an instance of Node'); - assert(utils.isNode(node), 'expected node to be an instance of Node'); + tapAsync() { + throw new Error("tapAsync is not supported on a SyncWaterfallHook"); + } - node.define('parent', parent); - parent.nodes = parent.nodes || []; - parent.nodes.push(node); - return node; -}; + tapPromise() { + throw new Error("tapPromise is not supported on a SyncWaterfallHook"); + } -/** - * Unshift `node` onto `parent.nodes`, and set `parent` as `node.parent. - * - * ```js - * var parent = new Node({type: 'foo'}); - * var node = new Node({type: 'bar'}); - * utils.unshiftNode(parent, node); - * console.log(parent.nodes[0].type) // 'bar' - * console.log(node.parent.type) // 'foo' - * ``` - * @param {Object} `parent` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {undefined} - * @api public - */ + compile(options) { + factory.setup(this, options); + return factory.create(options); + } +} -utils.unshiftNode = function(parent, node) { - assert(utils.isNode(parent), 'expected parent node to be an instance of Node'); - assert(utils.isNode(node), 'expected node to be an instance of Node'); +module.exports = SyncWaterfallHook; - node.define('parent', parent); - parent.nodes = parent.nodes || []; - parent.nodes.unshift(node); -}; -/** - * Pop the last `node` off of `parent.nodes`. The advantage of - * using this method is that it checks for `node.nodes` and works - * with any version of `snapdragon-node`. - * - * ```js - * var parent = new Node({type: 'foo'}); - * utils.pushNode(parent, new Node({type: 'foo'})); - * utils.pushNode(parent, new Node({type: 'bar'})); - * utils.pushNode(parent, new Node({type: 'baz'})); - * console.log(parent.nodes.length); //=> 3 - * utils.popNode(parent); - * console.log(parent.nodes.length); //=> 2 - * ``` - * @param {Object} `parent` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Number|Undefined} Returns the length of `node.nodes` or undefined. - * @api public - */ +/***/ }), -utils.popNode = function(node) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - if (typeof node.pop === 'function') { - return node.pop(); - } - return node.nodes && node.nodes.pop(); -}; +/***/ 72693: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -/** - * Shift the first `node` off of `parent.nodes`. The advantage of - * using this method is that it checks for `node.nodes` and works - * with any version of `snapdragon-node`. - * - * ```js - * var parent = new Node({type: 'foo'}); - * utils.pushNode(parent, new Node({type: 'foo'})); - * utils.pushNode(parent, new Node({type: 'bar'})); - * utils.pushNode(parent, new Node({type: 'baz'})); - * console.log(parent.nodes.length); //=> 3 - * utils.shiftNode(parent); - * console.log(parent.nodes.length); //=> 2 - * ``` - * @param {Object} `parent` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Number|Undefined} Returns the length of `node.nodes` or undefined. - * @api public - */ +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -utils.shiftNode = function(node) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - if (typeof node.shift === 'function') { - return node.shift(); - } - return node.nodes && node.nodes.shift(); + +const util = __webpack_require__(31669); +const SyncBailHook = __webpack_require__(16477); + +function Tapable() { + this._pluginCompat = new SyncBailHook(["options"]); + this._pluginCompat.tap( + { + name: "Tapable camelCase", + stage: 100 + }, + options => { + options.names.add( + options.name.replace(/[- ]([a-z])/g, (str, ch) => ch.toUpperCase()) + ); + } + ); + this._pluginCompat.tap( + { + name: "Tapable this.hooks", + stage: 200 + }, + options => { + let hook; + for (const name of options.names) { + hook = this.hooks[name]; + if (hook !== undefined) { + break; + } + } + if (hook !== undefined) { + const tapOpt = { + name: options.fn.name || "unnamed compat plugin", + stage: options.stage || 0 + }; + if (options.async) hook.tapAsync(tapOpt, options.fn); + else hook.tap(tapOpt, options.fn); + return true; + } + } + ); +} +module.exports = Tapable; + +Tapable.addCompatLayer = function addCompatLayer(instance) { + Tapable.call(instance); + instance.plugin = Tapable.prototype.plugin; + instance.apply = Tapable.prototype.apply; }; -/** - * Remove the specified `node` from `parent.nodes`. - * - * ```js - * var parent = new Node({type: 'abc'}); - * var foo = new Node({type: 'foo'}); - * utils.pushNode(parent, foo); - * utils.pushNode(parent, new Node({type: 'bar'})); - * utils.pushNode(parent, new Node({type: 'baz'})); - * console.log(parent.nodes.length); //=> 3 - * utils.removeNode(parent, foo); - * console.log(parent.nodes.length); //=> 2 - * ``` - * @param {Object} `parent` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Object|undefined} Returns the removed node, if successful, or undefined if it does not exist on `parent.nodes`. - * @api public - */ +Tapable.prototype.plugin = util.deprecate(function plugin(name, fn) { + if (Array.isArray(name)) { + name.forEach(function(name) { + this.plugin(name, fn); + }, this); + return; + } + const result = this._pluginCompat.call({ + name: name, + fn: fn, + names: new Set([name]) + }); + if (!result) { + throw new Error( + `Plugin could not be registered at '${name}'. Hook was not found.\n` + + "BREAKING CHANGE: There need to exist a hook at 'this.hooks'. " + + "To create a compatibility layer for this hook, hook into 'this._pluginCompat'." + ); + } +}, "Tapable.plugin is deprecated. Use new API on `.hooks` instead"); -utils.removeNode = function(parent, node) { - assert(utils.isNode(parent), 'expected parent.node to be an instance of Node'); - assert(utils.isNode(node), 'expected node to be an instance of Node'); +Tapable.prototype.apply = util.deprecate(function apply() { + for (var i = 0; i < arguments.length; i++) { + arguments[i].apply(this); + } +}, "Tapable.apply is deprecated. Call apply on the plugin directly instead"); - if (!parent.nodes) { - return null; - } - if (typeof parent.remove === 'function') { - return parent.remove(node); - } +/***/ }), - var idx = parent.nodes.indexOf(node); - if (idx !== -1) { - return parent.nodes.splice(idx, 1); - } -}; +/***/ 92402: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -/** - * Returns true if `node.type` matches the given `type`. Throws a - * `TypeError` if `node` is not an instance of `Node`. - * - * ```js - * var Node = require('snapdragon-node'); - * var node = new Node({type: 'foo'}); - * console.log(utils.isType(node, 'foo')); // false - * console.log(utils.isType(node, 'bar')); // true - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {String} `type` - * @return {Boolean} - * @api public - */ +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -utils.isType = function(node, type) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - switch (typeOf(type)) { - case 'array': - var types = type.slice(); - for (var i = 0; i < types.length; i++) { - if (utils.isType(node, types[i])) { - return true; - } - } - return false; - case 'string': - return node.type === type; - case 'regexp': - return type.test(node.type); - default: { - throw new TypeError('expected "type" to be an array, string or regexp'); - } - } -}; -/** - * Returns true if the given `node` has the given `type` in `node.nodes`. - * Throws a `TypeError` if `node` is not an instance of `Node`. - * - * ```js - * var Node = require('snapdragon-node'); - * var node = new Node({ - * type: 'foo', - * nodes: [ - * new Node({type: 'bar'}), - * new Node({type: 'baz'}) - * ] - * }); - * console.log(utils.hasType(node, 'xyz')); // false - * console.log(utils.hasType(node, 'baz')); // true - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {String} `type` - * @return {Boolean} - * @api public - */ +exports.__esModule = true; +exports.Tapable = __webpack_require__(72693); +exports.SyncHook = __webpack_require__(77633); +exports.SyncBailHook = __webpack_require__(16477); +exports.SyncWaterfallHook = __webpack_require__(6548); +exports.SyncLoopHook = __webpack_require__(13608); +exports.AsyncParallelHook = __webpack_require__(14616); +exports.AsyncParallelBailHook = __webpack_require__(27836); +exports.AsyncSeriesHook = __webpack_require__(55328); +exports.AsyncSeriesBailHook = __webpack_require__(89674); +exports.AsyncSeriesWaterfallHook = __webpack_require__(14568); +exports.HookMap = __webpack_require__(35233); +exports.MultiHook = __webpack_require__(93607); -utils.hasType = function(node, type) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - if (!Array.isArray(node.nodes)) return false; - for (var i = 0; i < node.nodes.length; i++) { - if (utils.isType(node.nodes[i], type)) { - return true; - } - } - return false; -}; -/** - * Returns the first node from `node.nodes` of the given `type` - * - * ```js - * var node = new Node({ - * type: 'foo', - * nodes: [ - * new Node({type: 'text', val: 'abc'}), - * new Node({type: 'text', val: 'xyz'}) - * ] - * }); - * - * var textNode = utils.firstOfType(node.nodes, 'text'); - * console.log(textNode.val); - * //=> 'abc' - * ``` - * @param {Array} `nodes` - * @param {String} `type` - * @return {Object|undefined} Returns the first matching node or undefined. - * @api public - */ +/***/ }), -utils.firstOfType = function(nodes, type) { - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - if (utils.isType(node, type)) { - return node; - } - } -}; +/***/ 16326: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -/** - * Returns the node at the specified index, or the first node of the - * given `type` from `node.nodes`. - * - * ```js - * var node = new Node({ - * type: 'foo', - * nodes: [ - * new Node({type: 'text', val: 'abc'}), - * new Node({type: 'text', val: 'xyz'}) - * ] - * }); - * - * var nodeOne = utils.findNode(node.nodes, 'text'); - * console.log(nodeOne.val); - * //=> 'abc' - * - * var nodeTwo = utils.findNode(node.nodes, 1); - * console.log(nodeTwo.val); - * //=> 'xyz' - * ``` - * - * @param {Array} `nodes` - * @param {String|Number} `type` Node type or index. - * @return {Object} Returns a node or undefined. - * @api public - */ +"use strict"; -utils.findNode = function(nodes, type) { - if (!Array.isArray(nodes)) { - return null; - } - if (typeof type === 'number') { - return nodes[type]; - } - return utils.firstOfType(nodes, type); -}; -/** - * Returns true if the given node is an "*.open" node. - * - * ```js - * var Node = require('snapdragon-node'); - * var brace = new Node({type: 'brace'}); - * var open = new Node({type: 'brace.open'}); - * var close = new Node({type: 'brace.close'}); - * - * console.log(utils.isOpen(brace)); // false - * console.log(utils.isOpen(open)); // true - * console.log(utils.isOpen(close)); // false - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Boolean} - * @api public - */ +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.default = void 0; -utils.isOpen = function(node) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - return node.type.slice(-5) === '.open'; -}; +var _os = _interopRequireDefault(__webpack_require__(12087)); -/** - * Returns true if the given node is a "*.close" node. - * - * ```js - * var Node = require('snapdragon-node'); - * var brace = new Node({type: 'brace'}); - * var open = new Node({type: 'brace.open'}); - * var close = new Node({type: 'brace.close'}); - * - * console.log(utils.isClose(brace)); // false - * console.log(utils.isClose(open)); // false - * console.log(utils.isClose(close)); // true - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Boolean} - * @api public - */ +var _cacache = _interopRequireDefault(__webpack_require__(36801)); -utils.isClose = function(node) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - return node.type.slice(-6) === '.close'; -}; +var _findCacheDir = _interopRequireDefault(__webpack_require__(61844)); -/** - * Returns true if `node.nodes` **has** an `.open` node - * - * ```js - * var Node = require('snapdragon-node'); - * var brace = new Node({ - * type: 'brace', - * nodes: [] - * }); - * - * var open = new Node({type: 'brace.open'}); - * console.log(utils.hasOpen(brace)); // false - * - * brace.pushNode(open); - * console.log(utils.hasOpen(brace)); // true - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Boolean} - * @api public - */ +var _workerFarm = _interopRequireDefault(__webpack_require__(18921)); -utils.hasOpen = function(node) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - var first = node.first || node.nodes ? node.nodes[0] : null; - if (utils.isNode(first)) { - return first.type === node.type + '.open'; - } - return false; -}; +var _serializeJavascript = _interopRequireDefault(__webpack_require__(85841)); -/** - * Returns true if `node.nodes` **has** a `.close` node - * - * ```js - * var Node = require('snapdragon-node'); - * var brace = new Node({ - * type: 'brace', - * nodes: [] - * }); - * - * var close = new Node({type: 'brace.close'}); - * console.log(utils.hasClose(brace)); // false - * - * brace.pushNode(close); - * console.log(utils.hasClose(brace)); // true - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Boolean} - * @api public - */ +var _isWsl = _interopRequireDefault(__webpack_require__(47543)); -utils.hasClose = function(node) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - var last = node.last || node.nodes ? node.nodes[node.nodes.length - 1] : null; - if (utils.isNode(last)) { - return last.type === node.type + '.close'; +var _minify = _interopRequireDefault(__webpack_require__(30787)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const worker = __webpack_require__.ab + "worker.js"; + +class TaskRunner { + constructor(options = {}) { + const { + cache, + parallel + } = options; + this.cacheDir = cache === true ? (0, _findCacheDir.default)({ + name: 'terser-webpack-plugin' + }) || _os.default.tmpdir() : cache; // In some cases cpus() returns undefined + // https://github.com/nodejs/node/issues/19022 + + const cpus = _os.default.cpus() || { + length: 1 + }; // WSL sometimes freezes, error seems to be on the WSL side + // https://github.com/webpack-contrib/terser-webpack-plugin/issues/21 + + this.maxConcurrentWorkers = _isWsl.default ? 1 : parallel === true ? cpus.length - 1 : Math.min(Number(parallel) || 0, cpus.length - 1); } - return false; -}; -/** - * Returns true if `node.nodes` has both `.open` and `.close` nodes - * - * ```js - * var Node = require('snapdragon-node'); - * var brace = new Node({ - * type: 'brace', - * nodes: [] - * }); - * - * var open = new Node({type: 'brace.open'}); - * var close = new Node({type: 'brace.close'}); - * console.log(utils.hasOpen(brace)); // false - * console.log(utils.hasClose(brace)); // false - * - * brace.pushNode(open); - * brace.pushNode(close); - * console.log(utils.hasOpen(brace)); // true - * console.log(utils.hasClose(brace)); // true - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Boolean} - * @api public - */ - -utils.hasOpenAndClose = function(node) { - return utils.hasOpen(node) && utils.hasClose(node); -}; - -/** - * Push the given `node` onto the `state.inside` array for the - * given type. This array is used as a specialized "stack" for - * only the given `node.type`. - * - * ```js - * var state = { inside: {}}; - * var node = new Node({type: 'brace'}); - * utils.addType(state, node); - * console.log(state.inside); - * //=> { brace: [{type: 'brace'}] } - * ``` - * @param {Object} `state` The `compiler.state` object or custom state object. - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Array} Returns the `state.inside` stack for the given type. - * @api public - */ - -utils.addType = function(state, node) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - assert(isObject(state), 'expected state to be an object'); - - var type = node.parent - ? node.parent.type - : node.type.replace(/\.open$/, ''); + run(tasks, callback) { + /* istanbul ignore if */ + if (!tasks.length) { + callback(null, []); + return; + } - if (!state.hasOwnProperty('inside')) { - state.inside = {}; - } - if (!state.inside.hasOwnProperty(type)) { - state.inside[type] = []; - } + if (this.maxConcurrentWorkers > 1) { + const workerOptions = process.platform === 'win32' ? { + maxConcurrentWorkers: this.maxConcurrentWorkers, + maxConcurrentCallsPerWorker: 1 + } : { + maxConcurrentWorkers: this.maxConcurrentWorkers + }; + this.workers = (0, _workerFarm.default)(workerOptions, __webpack_require__.ab + "worker.js"); - var arr = state.inside[type]; - arr.push(node); - return arr; -}; + this.boundWorkers = (options, cb) => { + try { + this.workers((0, _serializeJavascript.default)(options), cb); + } catch (error) { + // worker-farm can fail with ENOMEM or something else + cb(error); + } + }; + } else { + this.boundWorkers = (options, cb) => { + try { + cb(null, (0, _minify.default)(options)); + } catch (error) { + cb(error); + } + }; + } -/** - * Remove the given `node` from the `state.inside` array for the - * given type. This array is used as a specialized "stack" for - * only the given `node.type`. - * - * ```js - * var state = { inside: {}}; - * var node = new Node({type: 'brace'}); - * utils.addType(state, node); - * console.log(state.inside); - * //=> { brace: [{type: 'brace'}] } - * utils.removeType(state, node); - * //=> { brace: [] } - * ``` - * @param {Object} `state` The `compiler.state` object or custom state object. - * @param {Object} `node` Instance of [snapdragon-node][] - * @return {Array} Returns the `state.inside` stack for the given type. - * @api public - */ + let toRun = tasks.length; + const results = []; -utils.removeType = function(state, node) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - assert(isObject(state), 'expected state to be an object'); + const step = (index, data) => { + toRun -= 1; + results[index] = data; - var type = node.parent - ? node.parent.type - : node.type.replace(/\.close$/, ''); + if (!toRun) { + callback(null, results); + } + }; - if (state.inside.hasOwnProperty(type)) { - return state.inside[type].pop(); - } -}; + tasks.forEach((task, index) => { + const enqueue = () => { + this.boundWorkers(task, (error, data) => { + const result = error ? { + error + } : data; -/** - * Returns true if `node.val` is an empty string, or `node.nodes` does - * not contain any non-empty text nodes. - * - * ```js - * var node = new Node({type: 'text'}); - * utils.isEmpty(node); //=> true - * node.val = 'foo'; - * utils.isEmpty(node); //=> false - * ``` - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {Function} `fn` - * @return {Boolean} - * @api public - */ + const done = () => step(index, result); -utils.isEmpty = function(node, fn) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); + if (this.cacheDir && !result.error) { + _cacache.default.put(this.cacheDir, (0, _serializeJavascript.default)(task.cacheKeys), JSON.stringify(data)).then(done, done); + } else { + done(); + } + }); + }; - if (!Array.isArray(node.nodes)) { - if (node.type !== 'text') { - return true; - } - if (typeof fn === 'function') { - return fn(node, node.parent); - } - return !utils.trim(node.val); + if (this.cacheDir) { + _cacache.default.get(this.cacheDir, (0, _serializeJavascript.default)(task.cacheKeys)).then(({ + data + }) => step(index, JSON.parse(data)), enqueue); + } else { + enqueue(); + } + }); } - for (var i = 0; i < node.nodes.length; i++) { - var child = node.nodes[i]; - if (utils.isOpen(child) || utils.isClose(child)) { - continue; - } - if (!utils.isEmpty(child, fn)) { - return false; + exit() { + if (this.workers) { + _workerFarm.default.end(this.workers); } } - return true; -}; - -/** - * Returns true if the `state.inside` stack for the given type exists - * and has one or more nodes on it. - * - * ```js - * var state = { inside: {}}; - * var node = new Node({type: 'brace'}); - * console.log(utils.isInsideType(state, 'brace')); //=> false - * utils.addType(state, node); - * console.log(utils.isInsideType(state, 'brace')); //=> true - * utils.removeType(state, node); - * console.log(utils.isInsideType(state, 'brace')); //=> false - * ``` - * @param {Object} `state` - * @param {String} `type` - * @return {Boolean} - * @api public - */ +} -utils.isInsideType = function(state, type) { - assert(isObject(state), 'expected state to be an object'); - assert(isString(type), 'expected type to be a string'); +exports.default = TaskRunner; - if (!state.hasOwnProperty('inside')) { - return false; - } +/***/ }), - if (!state.inside.hasOwnProperty(type)) { - return false; - } +/***/ 89301: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - return state.inside[type].length > 0; -}; +"use strict"; -/** - * Returns true if `node` is either a child or grand-child of the given `type`, - * or `state.inside[type]` is a non-empty array. - * - * ```js - * var state = { inside: {}}; - * var node = new Node({type: 'brace'}); - * var open = new Node({type: 'brace.open'}); - * console.log(utils.isInside(state, open, 'brace')); //=> false - * utils.pushNode(node, open); - * console.log(utils.isInside(state, open, 'brace')); //=> true - * ``` - * @param {Object} `state` Either the `compiler.state` object, if it exists, or a user-supplied state object. - * @param {Object} `node` Instance of [snapdragon-node][] - * @param {String} `type` The `node.type` to check for. - * @return {Boolean} - * @api public - */ -utils.isInside = function(state, node, type) { - assert(utils.isNode(node), 'expected node to be an instance of Node'); - assert(isObject(state), 'expected state to be an object'); +const plugin = __webpack_require__(43884); - if (Array.isArray(type)) { - for (var i = 0; i < type.length; i++) { - if (utils.isInside(state, node, type[i])) { - return true; - } - } - return false; - } +module.exports = plugin.default; - var parent = node.parent; - if (typeof type === 'string') { - return (parent && parent.type === type) || utils.isInsideType(state, type); - } +/***/ }), - if (typeOf(type) === 'regexp') { - if (parent && parent.type && type.test(parent.type)) { - return true; - } +/***/ 43884: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - var keys = Object.keys(state.inside); - var len = keys.length; - var idx = -1; - while (++idx < len) { - var key = keys[idx]; - var val = state.inside[key]; +"use strict"; - if (Array.isArray(val) && val.length !== 0 && type.test(key)) { - return true; - } - } - } - return false; -}; -/** - * Get the last `n` element from the given `array`. Used for getting - * a node from `node.nodes.` - * - * @param {Array} `array` - * @param {Number} `n` - * @return {undefined} - * @api public - */ +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.default = void 0; -utils.last = function(arr, n) { - return arr[arr.length - (n || 1)]; -}; +var _crypto = _interopRequireDefault(__webpack_require__(76417)); -/** - * Cast the given `val` to an array. - * - * ```js - * console.log(utils.arrayify('')); - * //=> [] - * console.log(utils.arrayify('foo')); - * //=> ['foo'] - * console.log(utils.arrayify(['foo'])); - * //=> ['foo'] - * ``` - * @param {any} `val` - * @return {Array} - * @api public - */ +var _path = _interopRequireDefault(__webpack_require__(85622)); -utils.arrayify = function(val) { - if (typeof val === 'string' && val !== '') { - return [val]; - } - if (!Array.isArray(val)) { - return []; - } - return val; -}; +var _sourceMap = __webpack_require__(96241); -/** - * Convert the given `val` to a string by joining with `,`. Useful - * for creating a cheerio/CSS/DOM-style selector from a list of strings. - * - * @param {any} `val` - * @return {Array} - * @api public - */ +var _webpackSources = __webpack_require__(53665); -utils.stringify = function(val) { - return utils.arrayify(val).join(','); -}; +var _RequestShortener = _interopRequireDefault(__webpack_require__(54254)); -/** - * Ensure that the given value is a string and call `.trim()` on it, - * or return an empty string. - * - * @param {String} `str` - * @return {String} - * @api public - */ +var _ModuleFilenameHelpers = _interopRequireDefault(__webpack_require__(71474)); -utils.trim = function(str) { - return typeof str === 'string' ? str.trim() : ''; -}; +var _schemaUtils = _interopRequireDefault(__webpack_require__(33225)); -/** - * Return true if val is an object - */ +var _serializeJavascript = _interopRequireDefault(__webpack_require__(85841)); -function isObject(val) { - return typeOf(val) === 'object'; -} +var _package = _interopRequireDefault(__webpack_require__(92203)); -/** - * Return true if val is a string - */ +var _options = _interopRequireDefault(__webpack_require__(11840)); -function isString(val) { - return typeof val === 'string'; -} +var _TaskRunner = _interopRequireDefault(__webpack_require__(16326)); -/** - * Return true if val is a function - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function isFunction(val) { - return typeof val === 'function'; -} +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -/** - * Return true if val is an array - */ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } -function isArray(val) { - return Array.isArray(val); -} +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -/** - * Shim to ensure the `.append` methods work with any version of snapdragon - */ +const warningRegex = /\[.+:([0-9]+),([0-9]+)\]/; -function append(compiler, val, node) { - if (typeof compiler.append !== 'function') { - return compiler.emit(val, node); +class TerserPlugin { + constructor(options = {}) { + (0, _schemaUtils.default)(_options.default, options, 'Terser Plugin'); + const { + minify, + terserOptions = {}, + test = /\.m?js(\?.*)?$/i, + chunkFilter = () => true, + warningsFilter = () => true, + extractComments = false, + sourceMap = false, + cache = false, + cacheKeys = defaultCacheKeys => defaultCacheKeys, + parallel = false, + include, + exclude + } = options; + this.options = { + test, + chunkFilter, + warningsFilter, + extractComments, + sourceMap, + cache, + cacheKeys, + parallel, + include, + exclude, + minify, + terserOptions: _objectSpread({ + output: { + comments: extractComments ? false : /^\**!|@preserve|@license|@cc_on/i + } + }, terserOptions) + }; } - return compiler.append(val, node); -} -/** - * Simplified assertion. Throws an error is `val` is falsey. - */ + static isSourceMap(input) { + // All required options for `new SourceMapConsumer(...options)` + // https://github.com/mozilla/source-map#new-sourcemapconsumerrawsourcemap + return Boolean(input && input.version && input.sources && Array.isArray(input.sources) && typeof input.mappings === 'string'); + } -function assert(val, message) { - if (!val) throw new Error(message); -} + static buildSourceMap(inputSourceMap) { + if (!inputSourceMap || !TerserPlugin.isSourceMap(inputSourceMap)) { + return null; + } + return new _sourceMap.SourceMapConsumer(inputSourceMap); + } -/***/ }), + static buildError(err, file, sourceMap, requestShortener) { + // Handling error which should have line, col, filename and message + if (err.line) { + const original = sourceMap && sourceMap.originalPositionFor({ + line: err.line, + column: err.col + }); -/***/ 79285: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if (original && original.source && requestShortener) { + return new Error(`${file} from Terser\n${err.message} [${requestShortener.shorten(original.source)}:${original.line},${original.column}][${file}:${err.line},${err.col}]`); + } -"use strict"; + return new Error(`${file} from Terser\n${err.message} [${file}:${err.line},${err.col}]`); + } else if (err.stack) { + return new Error(`${file} from Terser\n${err.stack}`); + } + return new Error(`${file} from Terser\n${err.message}`); + } -var Base = __webpack_require__(87263); -var define = __webpack_require__(5477); -var Compiler = __webpack_require__(33003); -var Parser = __webpack_require__(35573); -var utils = __webpack_require__(622); -var regexCache = {}; -var cache = {}; + static buildWarning(warning, file, sourceMap, requestShortener, warningsFilter) { + let warningMessage = warning; + let locationMessage = ''; + let source = null; -/** - * Create a new instance of `Snapdragon` with the given `options`. - * - * ```js - * var snapdragon = new Snapdragon(); - * ``` - * - * @param {Object} `options` - * @api public - */ + if (sourceMap) { + const match = warningRegex.exec(warning); -function Snapdragon(options) { - Base.call(this, null, options); - this.options = utils.extend({source: 'string'}, this.options); - this.compiler = new Compiler(this.options); - this.parser = new Parser(this.options); + if (match) { + const line = +match[1]; + const column = +match[2]; + const original = sourceMap.originalPositionFor({ + line, + column + }); - Object.defineProperty(this, 'compilers', { - get: function() { - return this.compiler.compilers; + if (original && original.source && original.source !== file && requestShortener) { + ({ + source + } = original); + warningMessage = `${warningMessage.replace(warningRegex, '')}`; + locationMessage = `[${requestShortener.shorten(original.source)}:${original.line},${original.column}]`; + } + } } - }); - - Object.defineProperty(this, 'parsers', { - get: function() { - return this.parser.parsers; - } - }); - Object.defineProperty(this, 'regex', { - get: function() { - return this.parser.regex; + if (warningsFilter && !warningsFilter(warning, source)) { + return null; } - }); -} - -/** - * Inherit Base - */ - -Base.extend(Snapdragon); - -/** - * Add a parser to `snapdragon.parsers` for capturing the given `type` using - * the specified regex or parser function. A function is useful if you need - * to customize how the token is created and/or have access to the parser - * instance to check options, etc. - * - * ```js - * snapdragon - * .capture('slash', /^\//) - * .capture('dot', function() { - * var pos = this.position(); - * var m = this.match(/^\./); - * if (!m) return; - * return pos({ - * type: 'dot', - * val: m[0] - * }); - * }); - * ``` - * @param {String} `type` - * @param {RegExp|Function} `regex` - * @return {Object} Returns the parser instance for chaining - * @api public - */ -Snapdragon.prototype.capture = function() { - return this.parser.capture.apply(this.parser, arguments); -}; + return `Terser Plugin: ${warningMessage}${locationMessage}`; + } -/** - * Register a plugin `fn`. - * - * ```js - * var snapdragon = new Snapdgragon([options]); - * snapdragon.use(function() { - * console.log(this); //<= snapdragon instance - * console.log(this.parser); //<= parser instance - * console.log(this.compiler); //<= compiler instance - * }); - * ``` - * @param {Object} `fn` - * @api public - */ + apply(compiler) { + const buildModuleFn = moduleArg => { + // to get detailed location info about errors + moduleArg.useSourceMap = true; + }; -Snapdragon.prototype.use = function(fn) { - fn.call(this, this); - return this; -}; + const optimizeFn = (compilation, chunks, callback) => { + const taskRunner = new _TaskRunner.default({ + cache: this.options.cache, + parallel: this.options.parallel + }); + const processedAssets = new WeakSet(); + const tasks = []; + const { + chunkFilter + } = this.options; + Array.from(chunks).filter(chunk => chunkFilter && chunkFilter(chunk)).reduce((acc, chunk) => acc.concat(chunk.files || []), []).concat(compilation.additionalChunkAssets || []).filter(_ModuleFilenameHelpers.default.matchObject.bind(null, this.options)).forEach(file => { + let inputSourceMap; + const asset = compilation.assets[file]; -/** - * Parse the given `str`. - * - * ```js - * var snapdragon = new Snapdgragon([options]); - * // register parsers - * snapdragon.parser.use(function() {}); - * - * // parse - * var ast = snapdragon.parse('foo/bar'); - * console.log(ast); - * ``` - * @param {String} `str` - * @param {Object} `options` Set `options.sourcemap` to true to enable source maps. - * @return {Object} Returns an AST. - * @api public - */ + if (processedAssets.has(asset)) { + return; + } -Snapdragon.prototype.parse = function(str, options) { - this.options = utils.extend({}, this.options, options); - var parsed = this.parser.parse(str, this.options); + try { + let input; - // add non-enumerable parser reference - define(parsed, 'parser', this.parser); - return parsed; -}; + if (this.options.sourceMap && asset.sourceAndMap) { + const { + source, + map + } = asset.sourceAndMap(); + input = source; -/** - * Compile the given `AST`. - * - * ```js - * var snapdragon = new Snapdgragon([options]); - * // register plugins - * snapdragon.use(function() {}); - * // register parser plugins - * snapdragon.parser.use(function() {}); - * // register compiler plugins - * snapdragon.compiler.use(function() {}); - * - * // parse - * var ast = snapdragon.parse('foo/bar'); - * - * // compile - * var res = snapdragon.compile(ast); - * console.log(res.output); - * ``` - * @param {Object} `ast` - * @param {Object} `options` - * @return {Object} Returns an object with an `output` property with the rendered string. - * @api public - */ + if (TerserPlugin.isSourceMap(map)) { + inputSourceMap = map; + } else { + inputSourceMap = map; + compilation.warnings.push(new Error(`${file} contains invalid source map`)); + } + } else { + input = asset.source(); + inputSourceMap = null; + } // Handling comment extraction -Snapdragon.prototype.compile = function(ast, options) { - this.options = utils.extend({}, this.options, options); - var compiled = this.compiler.compile(ast, this.options); - // add non-enumerable compiler reference - define(compiled, 'compiler', this.compiler); - return compiled; -}; + let commentsFile = false; -/** - * Expose `Snapdragon` - */ + if (this.options.extractComments) { + commentsFile = this.options.extractComments.filename || `${file}.LICENSE`; -module.exports = Snapdragon; + if (typeof commentsFile === 'function') { + commentsFile = commentsFile(file); + } + } -/** - * Expose `Parser` and `Compiler` - */ + const task = { + file, + input, + inputSourceMap, + commentsFile, + extractComments: this.options.extractComments, + terserOptions: this.options.terserOptions, + minify: this.options.minify + }; -module.exports.Compiler = Compiler; -module.exports.Parser = Parser; + if (this.options.cache) { + const defaultCacheKeys = { + terser: _package.default.version, + node_version: process.version, + // eslint-disable-next-line global-require + 'terser-webpack-plugin': __webpack_require__(9122)/* .version */ .i8, + 'terser-webpack-plugin-options': this.options, + hash: _crypto.default.createHash('md4').update(input).digest('hex') + }; + task.cacheKeys = this.options.cacheKeys(defaultCacheKeys, file); + } + tasks.push(task); + } catch (error) { + compilation.errors.push(TerserPlugin.buildError(error, file, TerserPlugin.buildSourceMap(inputSourceMap), new _RequestShortener.default(compiler.context))); + } + }); + taskRunner.run(tasks, (tasksError, results) => { + if (tasksError) { + compilation.errors.push(tasksError); + return; + } -/***/ }), + results.forEach((data, index) => { + const { + file, + input, + inputSourceMap, + commentsFile + } = tasks[index]; + const { + error, + map, + code, + warnings + } = data; + let { + extractedComments + } = data; + let sourceMap = null; -/***/ 33003: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if (error || warnings && warnings.length > 0) { + sourceMap = TerserPlugin.buildSourceMap(inputSourceMap); + } // Handling results + // Error case: add errors, and go to next file -"use strict"; + if (error) { + compilation.errors.push(TerserPlugin.buildError(error, file, sourceMap, new _RequestShortener.default(compiler.context))); + return; + } -var use = __webpack_require__(77709); -var define = __webpack_require__(5477); -var debug = __webpack_require__(31185)('snapdragon:compiler'); -var utils = __webpack_require__(622); + let outputSource; -/** - * Create a new `Compiler` with the given `options`. - * @param {Object} `options` - */ + if (map) { + outputSource = new _webpackSources.SourceMapSource(code, file, JSON.parse(map), input, inputSourceMap, true); + } else { + outputSource = new _webpackSources.RawSource(code); + } // Write extracted comments to commentsFile -function Compiler(options, state) { - debug('initializing', __filename); - this.options = utils.extend({source: 'string'}, options); - this.state = state || {}; - this.compilers = {}; - this.output = ''; - this.set('eos', function(node) { - return this.emit(node.val, node); - }); - this.set('noop', function(node) { - return this.emit(node.val, node); - }); - this.set('bos', function(node) { - return this.emit(node.val, node); - }); - use(this); -} -/** - * Prototype methods - */ + if (commentsFile && extractedComments && extractedComments.length > 0) { + if (commentsFile in compilation.assets) { + const commentsFileSource = compilation.assets[commentsFile].source(); + extractedComments = extractedComments.filter(comment => !commentsFileSource.includes(comment)); + } -Compiler.prototype = { + if (extractedComments.length > 0) { + // Add a banner to the original file + if (this.options.extractComments.banner !== false) { + let banner = this.options.extractComments.banner || `For license information please see ${_path.default.posix.basename(commentsFile)}`; - /** - * Throw an error message with details including the cursor position. - * @param {String} `msg` Message to use in the Error. - */ + if (typeof banner === 'function') { + banner = banner(commentsFile); + } - error: function(msg, node) { - var pos = node.position || {start: {column: 0}}; - var message = this.options.source + ' column:' + pos.start.column + ': ' + msg; + if (banner) { + outputSource = new _webpackSources.ConcatSource(`/*! ${banner} */\n`, outputSource); + } + } - var err = new Error(message); - err.reason = msg; - err.column = pos.start.column; - err.source = this.pattern; + const commentsSource = new _webpackSources.RawSource(`${extractedComments.join('\n\n')}\n`); - if (this.options.silent) { - this.errors.push(err); - } else { - throw err; - } - }, + if (commentsFile in compilation.assets) { + // commentsFile already exists, append new comments... + if (compilation.assets[commentsFile] instanceof _webpackSources.ConcatSource) { + compilation.assets[commentsFile].add('\n'); + compilation.assets[commentsFile].add(commentsSource); + } else { + compilation.assets[commentsFile] = new _webpackSources.ConcatSource(compilation.assets[commentsFile], '\n', commentsSource); + } + } else { + compilation.assets[commentsFile] = commentsSource; + } + } + } // Updating assets - /** - * Define a non-enumberable property on the `Compiler` instance. - * - * ```js - * compiler.define('foo', 'bar'); - * ``` - * @name .define - * @param {String} `key` propery name - * @param {any} `val` property value - * @return {Object} Returns the Compiler instance for chaining. - * @api public - */ - define: function(key, val) { - define(this, key, val); - return this; - }, + processedAssets.add(compilation.assets[file] = outputSource); // Handling warnings - /** - * Emit `node.val` - */ + if (warnings && warnings.length > 0) { + warnings.forEach(warning => { + const builtWarning = TerserPlugin.buildWarning(warning, file, sourceMap, new _RequestShortener.default(compiler.context), this.options.warningsFilter); - emit: function(str, node) { - this.output += str; - return str; - }, + if (builtWarning) { + compilation.warnings.push(builtWarning); + } + }); + } + }); + taskRunner.exit(); + callback(); + }); + }; - /** - * Add a compiler `fn` with the given `name` - */ + const plugin = { + name: this.constructor.name + }; + compiler.hooks.compilation.tap(plugin, compilation => { + if (this.options.sourceMap) { + compilation.hooks.buildModule.tap(plugin, buildModuleFn); + } - set: function(name, fn) { - this.compilers[name] = fn; - return this; - }, + const { + mainTemplate, + chunkTemplate + } = compilation; // Regenerate `contenthash` for minified assets - /** - * Get compiler `name`. - */ + for (const template of [mainTemplate, chunkTemplate]) { + template.hooks.hashForChunk.tap(plugin, hash => { + const data = (0, _serializeJavascript.default)({ + terser: _package.default.version, + terserOptions: this.options.terserOptions + }); + hash.update('TerserPlugin'); + hash.update(data); + }); + } - get: function(name) { - return this.compilers[name]; - }, + compilation.hooks.optimizeChunkAssets.tapAsync(plugin, optimizeFn.bind(this, compilation)); + }); + } - /** - * Get the previous AST node. - */ +} - prev: function(n) { - return this.ast.nodes[this.idx - (n || 1)] || { type: 'bos', val: '' }; - }, +var _default = TerserPlugin; +exports.default = _default; - /** - * Get the next AST node. - */ +/***/ }), - next: function(n) { - return this.ast.nodes[this.idx + (n || 1)] || { type: 'eos', val: '' }; - }, +/***/ 30787: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - /** - * Visit `node`. - */ +"use strict"; - visit: function(node, nodes, i) { - var fn = this.compilers[node.type]; - this.idx = i; - if (typeof fn !== 'function') { - throw this.error('compiler "' + node.type + '" is not registered', node); - } - return fn.call(this, node, nodes, i); - }, +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.default = void 0; - /** - * Map visit over array of `nodes`. - */ +var _terser = __webpack_require__(54775); - mapVisit: function(nodes) { - if (!Array.isArray(nodes)) { - throw new TypeError('expected an array'); - } - var len = nodes.length; - var idx = -1; - while (++idx < len) { - this.visit(nodes[idx], nodes, idx); - } - return this; - }, +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - /** - * Compile `ast`. - */ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - compile: function(ast, options) { - var opts = utils.extend({}, this.options, options); - this.ast = ast; - this.parsingErrors = this.ast.errors; - this.output = ''; +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - // source map support - if (opts.sourcemap) { - var sourcemaps = __webpack_require__(59657); - sourcemaps(this); - this.mapVisit(this.ast.nodes); - this.applySourceMaps(); - this.map = opts.sourcemap === 'generator' ? this.map : this.map.toJSON(); - return this; - } +const buildTerserOptions = ({ + ecma, + warnings, + parse = {}, + compress = {}, + mangle, + module, + output, + toplevel, + nameCache, + ie8, - this.mapVisit(this.ast.nodes); - return this; - } -}; + /* eslint-disable camelcase */ + keep_classnames, + keep_fnames, -/** - * Expose `Compiler` - */ + /* eslint-enable camelcase */ + safari10 +} = {}) => ({ + ecma, + warnings, + parse: _objectSpread({}, parse), + compress: typeof compress === 'boolean' ? compress : _objectSpread({}, compress), + // eslint-disable-next-line no-nested-ternary + mangle: mangle == null ? true : typeof mangle === 'boolean' ? mangle : _objectSpread({}, mangle), + output: _objectSpread({ + shebang: true, + comments: false, + beautify: false, + semicolons: true + }, output), + module, + // Ignoring sourceMap from options + sourceMap: null, + toplevel, + nameCache, + ie8, + keep_classnames, + keep_fnames, + safari10 +}); -module.exports = Compiler; - - -/***/ }), - -/***/ 35573: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; +const buildComments = (options, terserOptions, extractedComments) => { + const condition = {}; + const commentsOpts = terserOptions.output.comments; // Use /^\**!|@preserve|@license|@cc_on/i RegExp + if (typeof options.extractComments === 'boolean') { + condition.preserve = commentsOpts; + condition.extract = /^\**!|@preserve|@license|@cc_on/i; + } else if (typeof options.extractComments === 'string' || options.extractComments instanceof RegExp) { + // extractComments specifies the extract condition and commentsOpts specifies the preserve condition + condition.preserve = commentsOpts; + condition.extract = options.extractComments; + } else if (typeof options.extractComments === 'function') { + condition.preserve = commentsOpts; + condition.extract = options.extractComments; + } else if (Object.prototype.hasOwnProperty.call(options.extractComments, 'condition')) { + // Extract condition is given in extractComments.condition + condition.preserve = commentsOpts; + condition.extract = options.extractComments.condition; + } else { + // No extract condition is given. Extract comments that match commentsOpts instead of preserving them + condition.preserve = false; + condition.extract = commentsOpts; + } // Ensure that both conditions are functions -var use = __webpack_require__(77709); -var util = __webpack_require__(31669); -var Cache = __webpack_require__(4337); -var define = __webpack_require__(5477); -var debug = __webpack_require__(31185)('snapdragon:parser'); -var Position = __webpack_require__(7974); -var utils = __webpack_require__(622); -/** - * Create a new `Parser` with the given `input` and `options`. - * @param {String} `input` - * @param {Object} `options` - * @api public - */ + ['preserve', 'extract'].forEach(key => { + let regexStr; + let regex; -function Parser(options) { - debug('initializing', __filename); - this.options = utils.extend({source: 'string'}, options); - this.init(this.options); - use(this); -} + switch (typeof condition[key]) { + case 'boolean': + condition[key] = condition[key] ? () => true : () => false; + break; -/** - * Prototype methods - */ + case 'function': + break; -Parser.prototype = { - constructor: Parser, + case 'string': + if (condition[key] === 'all') { + condition[key] = () => true; - init: function(options) { - this.orig = ''; - this.input = ''; - this.parsed = ''; + break; + } - this.column = 1; - this.line = 1; + if (condition[key] === 'some') { + condition[key] = (astNode, comment) => { + return comment.type === 'comment2' && /^\**!|@preserve|@license|@cc_on/i.test(comment.value); + }; - this.regex = new Cache(); - this.errors = this.errors || []; - this.parsers = this.parsers || {}; - this.types = this.types || []; - this.sets = this.sets || {}; - this.fns = this.fns || []; - this.currentType = 'root'; + break; + } - var pos = this.position(); - this.bos = pos({type: 'bos', val: ''}); + regexStr = condition[key]; - this.ast = { - type: 'root', - errors: this.errors, - nodes: [this.bos] - }; + condition[key] = (astNode, comment) => { + return new RegExp(regexStr).test(comment.value); + }; - define(this.bos, 'parent', this.ast); - this.nodes = [this.ast]; + break; - this.count = 0; - this.setCount = 0; - this.stack = []; - }, + default: + regex = condition[key]; - /** - * Throw a formatted error with the cursor column and `msg`. - * @param {String} `msg` Message to use in the Error. - */ + condition[key] = (astNode, comment) => regex.test(comment.value); - error: function(msg, node) { - var pos = node.position || {start: {column: 0, line: 0}}; - var line = pos.start.line; - var column = pos.start.column; - var source = this.options.source; + } + }); // Redefine the comments function to extract and preserve + // comments according to the two conditions - var message = source + ' : ' + msg; - var err = new Error(message); - err.source = source; - err.reason = msg; - err.pos = pos; + return (astNode, comment) => { + if (condition.extract(astNode, comment)) { + const commentText = comment.type === 'comment2' ? `/*${comment.value}*/` : `//${comment.value}`; // Don't include duplicate comments - if (this.options.silent) { - this.errors.push(err); - } else { - throw err; + if (!extractedComments.includes(commentText)) { + extractedComments.push(commentText); + } } - }, - /** - * Define a non-enumberable property on the `Parser` instance. - * - * ```js - * parser.define('foo', 'bar'); - * ``` - * @name .define - * @param {String} `key` propery name - * @param {any} `val` property value - * @return {Object} Returns the Parser instance for chaining. - * @api public - */ + return condition.preserve(astNode, comment); + }; +}; - define: function(key, val) { - define(this, key, val); - return this; - }, +const minify = options => { + const { + file, + input, + inputSourceMap, + extractComments, + minify: minifyFn + } = options; - /** - * Mark position and patch `node.position`. - */ + if (minifyFn) { + return minifyFn({ + [file]: input + }, inputSourceMap); + } // Copy terser options - position: function() { - var start = { line: this.line, column: this.column }; - var self = this; - return function(node) { - define(node, 'position', new Position(start, self)); - return node; - }; - }, + const terserOptions = buildTerserOptions(options.terserOptions); // Let terser generate a SourceMap - /** - * Set parser `name` with the given `fn` - * @param {String} `name` - * @param {Function} `fn` - * @api public - */ + if (inputSourceMap) { + terserOptions.sourceMap = true; + } - set: function(type, fn) { - if (this.types.indexOf(type) === -1) { - this.types.push(type); - } - this.parsers[type] = fn.bind(this); - return this; - }, + const extractedComments = []; - /** - * Get parser `name` - * @param {String} `name` - * @api public - */ + if (extractComments) { + terserOptions.output.comments = buildComments(options, terserOptions, extractedComments); + } - get: function(name) { - return this.parsers[name]; - }, + const { + error, + map, + code, + warnings + } = (0, _terser.minify)({ + [file]: input + }, terserOptions); + return { + error, + map, + code, + warnings, + extractedComments + }; +}; - /** - * Push a `token` onto the `type` stack. - * - * @param {String} `type` - * @return {Object} `token` - * @api public - */ +var _default = minify; +exports.default = _default; - push: function(type, token) { - this.sets[type] = this.sets[type] || []; - this.count++; - this.stack.push(token); - return this.sets[type].push(token); - }, +/***/ }), - /** - * Pop a token off of the `type` stack - * @param {String} `type` - * @returns {Object} Returns a token - * @api public - */ +/***/ 71708: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - pop: function(type) { - this.sets[type] = this.sets[type] || []; - this.count--; - this.stack.pop(); - return this.sets[type].pop(); - }, +"use strict"; +/*! + * to-object-path + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ - /** - * Return true if inside a `stack` node. Types are `braces`, `parens` or `brackets`. - * - * @param {String} `type` - * @return {Boolean} - * @api public - */ - isInside: function(type) { - this.sets[type] = this.sets[type] || []; - return this.sets[type].length > 0; - }, - /** - * Return true if `node` is the given `type`. - * - * ```js - * parser.isType(node, 'brace'); - * ``` - * @param {Object} `node` - * @param {String} `type` - * @return {Boolean} - * @api public - */ +var typeOf = __webpack_require__(48865); - isType: function(node, type) { - return node && node.type === type; - }, +module.exports = function toPath(args) { + if (typeOf(args) !== 'arguments') { + args = arguments; + } + return filter(args).join('.'); +}; - /** - * Get the previous AST node - * @return {Object} - */ +function filter(arr) { + var len = arr.length; + var idx = -1; + var res = []; - prev: function(n) { - return this.stack.length > 0 - ? utils.last(this.stack, n) - : utils.last(this.nodes, n); - }, + while (++idx < len) { + var ele = arr[idx]; + if (typeOf(ele) === 'arguments' || Array.isArray(ele)) { + res.push.apply(res, filter(ele)); + } else if (typeof ele === 'string') { + res.push(ele); + } + } + return res; +} - /** - * Update line and column based on `str`. - */ - consume: function(len) { - this.input = this.input.substr(len); - }, +/***/ }), - /** - * Update column based on `str`. - */ +/***/ 51279: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - updatePosition: function(str, len) { - var lines = str.match(/\n/g); - if (lines) this.line += lines.length; - var i = str.lastIndexOf('\n'); - this.column = ~i ? len - i : this.column + len; - this.parsed += str; - this.consume(len); - }, +"use strict"; - /** - * Match `regex`, return captures, and update the cursor position by `match[0]` length. - * @param {RegExp} `regex` - * @return {Object} - */ - match: function(regex) { - var m = regex.exec(this.input); - if (m) { - this.updatePosition(m[0], m[0].length); - return m; - } - }, +var safe = __webpack_require__(71217); +var define = __webpack_require__(74998); +var extend = __webpack_require__(99793); +var not = __webpack_require__(30931); +var MAX_LENGTH = 1024 * 64; - /** - * Capture `type` with the given regex. - * @param {String} `type` - * @param {RegExp} `regex` - * @return {Function} - */ +/** + * Session cache + */ - capture: function(type, regex) { - if (typeof regex === 'function') { - return this.set.apply(this, arguments); - } +var cache = {}; - this.regex.set(type, regex); - this.set(type, function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(regex); - if (!m || !m[0]) return; +/** + * Create a regular expression from the given `pattern` string. + * + * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ - var prev = this.prev(); - var node = pos({ - type: type, - val: m[0], - parsed: parsed, - rest: this.input - }); +module.exports = function(patterns, options) { + if (!Array.isArray(patterns)) { + return makeRe(patterns, options); + } + return makeRe(patterns.join('|'), options); +}; - if (m[1]) { - node.inner = m[1]; - } +/** + * Create a regular expression from the given `pattern` string. + * + * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ - define(node, 'inside', this.stack.length > 0); - define(node, 'parent', prev); - prev.nodes.push(node); - }.bind(this)); - return this; - }, +function makeRe(pattern, options) { + if (pattern instanceof RegExp) { + return pattern; + } - /** - * Create a parser with open and close for parens, - * brackets or braces - */ + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } - capturePair: function(type, openRegex, closeRegex, fn) { - this.sets[type] = this.sets[type] || []; + if (pattern.length > MAX_LENGTH) { + throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); + } - /** - * Open - */ + var key = pattern; + // do this before shallow cloning options, it's a lot faster + if (!options || (options && options.cache !== false)) { + key = createKey(pattern, options); - this.set(type + '.open', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(openRegex); - if (!m || !m[0]) return; + if (cache.hasOwnProperty(key)) { + return cache[key]; + } + } - var val = m[0]; - this.setCount++; - this.specialChars = true; - var open = pos({ - type: type + '.open', - val: val, - rest: this.input - }); + var opts = extend({}, options); + if (opts.contains === true) { + if (opts.negate === true) { + opts.strictNegate = false; + } else { + opts.strict = false; + } + } - if (typeof m[1] !== 'undefined') { - open.inner = m[1]; - } + if (opts.strict === false) { + opts.strictOpen = false; + opts.strictClose = false; + } - var prev = this.prev(); - var node = pos({ - type: type, - nodes: [open] - }); + var open = opts.strictOpen !== false ? '^' : ''; + var close = opts.strictClose !== false ? '$' : ''; + var flags = opts.flags || ''; + var regex; - define(node, 'rest', this.input); - define(node, 'parsed', parsed); - define(node, 'prefix', m[1]); - define(node, 'parent', prev); - define(open, 'parent', node); + if (opts.nocase === true && !/i/.test(flags)) { + flags += 'i'; + } - if (typeof fn === 'function') { - fn.call(this, open, node); - } + try { + if (opts.negate || typeof opts.strictNegate === 'boolean') { + pattern = not.create(pattern, opts); + } - this.push(type, node); - prev.nodes.push(node); - }); + var str = open + '(?:' + pattern + ')' + close; + regex = new RegExp(str, flags); - /** - * Close - */ + if (opts.safe === true && safe(regex) === false) { + throw new Error('potentially unsafe regular expression: ' + regex.source); + } - this.set(type + '.close', function() { - var pos = this.position(); - var m = this.match(closeRegex); - if (!m || !m[0]) return; + } catch (err) { + if (opts.strictErrors === true || opts.safe === true) { + err.key = key; + err.pattern = pattern; + err.originalOptions = options; + err.createdOptions = opts; + throw err; + } - var parent = this.pop(type); - var node = pos({ - type: type + '.close', - rest: this.input, - suffix: m[1], - val: m[0] - }); - - if (!this.isType(parent, type)) { - if (this.options.strict) { - throw new Error('missing opening "' + type + '"'); - } - - this.setCount--; - node.escaped = true; - return node; - } - - if (node.suffix === '\\') { - parent.escaped = true; - node.escaped = true; - } - - parent.nodes.push(node); - define(node, 'parent', parent); - }); - - return this; - }, - - /** - * Capture end-of-string - */ - - eos: function() { - var pos = this.position(); - if (this.input) return; - var prev = this.prev(); - - while (prev.type !== 'root' && !prev.visited) { - if (this.options.strict === true) { - throw new SyntaxError('invalid syntax:' + util.inspect(prev, null, 2)); - } - - if (!hasDelims(prev)) { - prev.parent.escaped = true; - prev.escaped = true; - } - - visit(prev, function(node) { - if (!hasDelims(node.parent)) { - node.parent.escaped = true; - node.escaped = true; - } - }); - - prev = prev.parent; - } - - var tok = pos({ - type: 'eos', - val: this.append || '' - }); - - define(tok, 'parent', this.ast); - return tok; - }, - - /** - * Run parsers to advance the cursor position - */ - - next: function() { - var parsed = this.parsed; - var len = this.types.length; - var idx = -1; - var tok; - - while (++idx < len) { - if ((tok = this.parsers[this.types[idx]].call(this))) { - define(tok, 'rest', this.input); - define(tok, 'parsed', parsed); - this.last = tok; - return tok; - } - } - }, - - /** - * Parse the given string. - * @return {Array} - */ - - parse: function(input) { - if (typeof input !== 'string') { - throw new TypeError('expected a string'); - } - - this.init(this.options); - this.orig = input; - this.input = input; - var self = this; - - function parse() { - // check input before calling `.next()` - input = self.input; - - // get the next AST ndoe - var node = self.next(); - if (node) { - var prev = self.prev(); - if (prev) { - define(node, 'parent', prev); - if (prev.nodes) { - prev.nodes.push(node); - } - } - - if (self.sets.hasOwnProperty(prev.type)) { - self.currentType = prev.type; - } - } - - // if we got here but input is not changed, throw an error - if (self.input && input === self.input) { - throw new Error('no parsers registered for: "' + self.input.slice(0, 5) + '"'); - } - } - - while (this.input) parse(); - if (this.stack.length && this.options.strict) { - var node = this.stack.pop(); - throw this.error('missing opening ' + node.type + ': "' + this.orig + '"'); - } - - var eos = this.eos(); - var tok = this.prev(); - if (tok.type !== 'eos') { - this.ast.nodes.push(eos); + try { + regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$'); + } catch (err) { + regex = /.^/; //<= match nothing } + } - return this.ast; + if (opts.cache !== false) { + memoize(regex, key, pattern, opts); } -}; + return regex; +} /** - * Visit `node` with the given `fn` + * Memoize generated regex. This can result in dramatic speed improvements + * and simplify debugging by adding options and pattern to the regex. It can be + * disabled by passing setting `options.cache` to false. */ -function visit(node, fn) { - if (!node.visited) { - define(node, 'visited', true); - return node.nodes ? mapVisit(node.nodes, fn) : fn(node); - } - return node; +function memoize(regex, key, pattern, options) { + define(regex, 'cached', true); + define(regex, 'pattern', pattern); + define(regex, 'options', options); + define(regex, 'key', key); + cache[key] = regex; } /** - * Map visit over array of `nodes`. + * Create the key to use for memoization. The key is generated + * by iterating over the options and concatenating key-value pairs + * to the pattern string. */ -function mapVisit(nodes, fn) { - var len = nodes.length; - var idx = -1; - while (++idx < len) { - visit(nodes[idx], fn); +function createKey(pattern, options) { + if (!options) return pattern; + var key = pattern; + for (var prop in options) { + if (options.hasOwnProperty(prop)) { + key += ';' + prop + '=' + String(options[prop]); + } } -} - -function hasOpen(node) { - return node.nodes && node.nodes[0].type === (node.type + '.open'); -} - -function hasClose(node) { - return node.nodes && utils.last(node.nodes).type === (node.type + '.close'); -} - -function hasDelims(node) { - return hasOpen(node) && hasClose(node); + return key; } /** - * Expose `Parser` + * Expose `makeRe` */ -module.exports = Parser; +module.exports.makeRe = makeRe; /***/ }), -/***/ 7974: +/***/ 74998: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; - - -var define = __webpack_require__(5477); - -/** - * Store position for a node +/*! + * define-property + * + * Copyright (c) 2015-2018, Jon Schlinkert. + * Released under the MIT License. */ -module.exports = function Position(start, parser) { - this.start = start; - this.end = { line: parser.line, column: parser.column }; - define(this, 'content', parser.orig); - define(this, 'source', parser.options.source); -}; - - -/***/ }), - -/***/ 59657: -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +var isobject = __webpack_require__(96667); +var isDescriptor = __webpack_require__(44133); +var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) + ? Reflect.defineProperty + : Object.defineProperty; -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var define = __webpack_require__(5477); -var utils = __webpack_require__(622); +module.exports = function defineProperty(obj, key, val) { + if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) { + throw new TypeError('expected an object, function, or array'); + } -/** - * Expose `mixin()`. - * This code is based on `source-maps-support.js` in reworkcss/css - * https://github.com/reworkcss/css/blob/master/lib/stringify/source-map-support.js - * Copyright (c) 2012 TJ Holowaychuk - */ + if (typeof key !== 'string') { + throw new TypeError('expected "key" to be a string'); + } -module.exports = mixin; + if (isDescriptor(val)) { + define(obj, key, val); + return obj; + } -/** - * Mixin source map support into `compiler`. - * - * @param {Object} `compiler` - * @api public - */ + define(obj, key, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); -function mixin(compiler) { - define(compiler, '_comment', compiler.comment); - compiler.map = new utils.SourceMap.SourceMapGenerator(); - compiler.position = { line: 1, column: 1 }; - compiler.content = {}; - compiler.files = {}; + return obj; +}; - for (var key in exports) { - define(compiler, key, exports[key]); - } -} -/** - * Update position. - * - * @param {String} str - */ +/***/ }), -exports.updatePosition = function(str) { - var lines = str.match(/\n/g); - if (lines) this.position.line += lines.length; - var i = str.lastIndexOf('\n'); - this.position.column = ~i ? str.length - i : this.position.column + str.length; -}; +/***/ 99793: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -/** - * Emit `str` with `position`. - * - * @param {String} str - * @param {Object} [pos] - * @return {String} - */ +"use strict"; -exports.emit = function(str, node) { - var position = node.position || {}; - var source = position.source; - if (source) { - if (position.filepath) { - source = utils.unixify(position.filepath); - } - this.map.addMapping({ - source: source, - generated: { - line: this.position.line, - column: Math.max(this.position.column - 1, 0) - }, - original: { - line: position.start.line, - column: position.start.column - 1 - } - }); +var isExtendable = __webpack_require__(78947); +var assignSymbols = __webpack_require__(64353); - if (position.content) { - this.addContent(source, position); +module.exports = Object.assign || function(obj/*, objects*/) { + if (obj === null || typeof obj === 'undefined') { + throw new TypeError('Cannot convert undefined or null to object'); + } + if (!isObject(obj)) { + obj = {}; + } + for (var i = 1; i < arguments.length; i++) { + var val = arguments[i]; + if (isString(val)) { + val = toObject(val); } - if (position.filepath) { - this.addFile(source, position); + if (isObject(val)) { + assign(obj, val); + assignSymbols(obj, val); } - - this.updatePosition(str); - this.output += str; } - return str; + return obj; }; -/** - * Adds a file to the source map output if it has not already been added - * @param {String} `file` - * @param {Object} `pos` - */ +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} -exports.addFile = function(file, position) { - if (typeof position.content !== 'string') return; - if (Object.prototype.hasOwnProperty.call(this.files, file)) return; - this.files[file] = position.content; -}; +function isString(val) { + return (val && typeof val === 'string'); +} -/** - * Adds a content source to the source map output if it has not already been added - * @param {String} `source` - * @param {Object} `position` - */ +function toObject(str) { + var obj = {}; + for (var i in str) { + obj[i] = str[i]; + } + return obj; +} -exports.addContent = function(source, position) { - if (typeof position.content !== 'string') return; - if (Object.prototype.hasOwnProperty.call(this.content, source)) return; - this.map.setSourceContent(source, position.content); -}; +function isObject(val) { + return (val && typeof val === 'object') || isExtendable(val); +} /** - * Applies any original source maps to the output and embeds the source file - * contents in the source map. + * Returns true if the given `key` is an own property of `obj`. */ -exports.applySourceMaps = function() { - Object.keys(this.files).forEach(function(file) { - var content = this.files[file]; - this.map.setSourceContent(file, content); - - if (this.options.inputSourcemaps === true) { - var originalMap = utils.sourceMapResolve.resolveSync(content, file, fs.readFileSync); - if (originalMap) { - var map = new utils.SourceMap.SourceMapConsumer(originalMap.map); - var relativeTo = originalMap.sourcesRelativeTo; - this.map.applySourceMap(map, file, utils.unixify(path.dirname(relativeTo))); - } - } - }, this); -}; - -/** - * Process comments, drops sourceMap comments. - * @param {Object} node - */ +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} -exports.comment = function(node) { - if (/^# sourceMappingURL=/.test(node.comment)) { - return this.emit('', node.position); - } - return this._comment(node); -}; +function isEnum(obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); +} /***/ }), -/***/ 622: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ 78947: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; - - -/** - * Module dependencies - */ - -exports.extend = __webpack_require__(28727); -exports.SourceMap = __webpack_require__(96241); -exports.sourceMapResolve = __webpack_require__(10227); - -/** - * Convert backslash in the given string to forward slashes - */ - -exports.unixify = function(fp) { - return fp.split(/\\+/).join('/'); -}; - -/** - * Return true if `val` is a non-empty string +/*! + * is-extendable * - * @param {String} `str` - * @return {Boolean} + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. */ -exports.isString = function(str) { - return str && typeof str === 'string'; -}; - -/** - * Cast `val` to an array - * @return {Array} - */ -exports.arrayify = function(val) { - if (typeof val === 'string') return [val]; - return val ? (Array.isArray(val) ? val : [val]) : []; -}; -/** - * Get the last `n` element from the given `array` - * @param {Array} `array` - * @return {*} - */ +var isPlainObject = __webpack_require__(81064); -exports.last = function(arr, n) { - return arr[arr.length - (n || 1)]; +module.exports = function isExtendable(val) { + return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); }; /***/ }), -/***/ 56609: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -var decodeUriComponent = __webpack_require__(95748) - -function customDecodeUriComponent(string) { - // `decodeUriComponent` turns `+` into ` `, but that's not wanted. - return decodeUriComponent(string.replace(/\+/g, "%2B")) -} - -module.exports = customDecodeUriComponent - - -/***/ }), - -/***/ 89825: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -var url = __webpack_require__(78835) - -function resolveUrl(/* ...urls */) { - return Array.prototype.reduce.call(arguments, function(resolved, nextUrl) { - return url.resolve(resolved, nextUrl) - }) -} - -module.exports = resolveUrl - - -/***/ }), - -/***/ 10227: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -var sourceMappingURL = __webpack_require__(21707) - -var resolveUrl = __webpack_require__(89825) -var decodeUriComponent = __webpack_require__(56609) -var urix = __webpack_require__(67806) -var atob = __webpack_require__(83327) - - +/***/ 29859: +/***/ (function(module) { -function callbackAsync(callback, error, result) { - setImmediate(function() { callback(error, result) }) -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function (m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + }; + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + } + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); -function parseMapToJSON(string, data) { - try { - return JSON.parse(string.replace(/^\)\]\}'/, "")) - } catch (error) { - error.sourceMapData = data - throw error - } -} -function readSync(read, url, data) { - var readUrl = decodeUriComponent(url) - try { - return String(read(readUrl)) - } catch (error) { - error.sourceMapData = data - throw error - } -} +/***/ }), +/***/ 7716: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -function resolveSourceMap(code, codeUrl, read, callback) { - var mapData - try { - mapData = resolveSourceMapHelper(code, codeUrl) - } catch (error) { - return callbackAsync(callback, error) + +var isObject = __webpack_require__(18493); +var union = __webpack_require__(69123); +var get = __webpack_require__(89304); +var set = __webpack_require__(34857); + +module.exports = function unionValue(obj, prop, value) { + if (!isObject(obj)) { + throw new TypeError('union-value expects the first argument to be an object.'); } - if (!mapData || mapData.map) { - return callbackAsync(callback, null, mapData) + + if (typeof prop !== 'string') { + throw new TypeError('union-value expects `prop` to be a string.'); } - var readUrl = decodeUriComponent(mapData.url) - read(readUrl, function(error, result) { - if (error) { - error.sourceMapData = mapData - return callback(error) - } - mapData.map = String(result) - try { - mapData.map = parseMapToJSON(mapData.map, mapData) - } catch (error) { - return callback(error) - } - callback(null, mapData) - }) -} -function resolveSourceMapSync(code, codeUrl, read) { - var mapData = resolveSourceMapHelper(code, codeUrl) - if (!mapData || mapData.map) { - return mapData + var arr = arrayify(get(obj, prop)); + set(obj, prop, union(arr, arrayify(value))); + return obj; +}; + +function arrayify(val) { + if (val === null || typeof val === 'undefined') { + return []; } - mapData.map = readSync(read, mapData.url, mapData) - mapData.map = parseMapToJSON(mapData.map, mapData) - return mapData + if (Array.isArray(val)) { + return val; + } + return [val]; } -var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/ -/** - * The media type for JSON text is application/json. - * - * {@link https://tools.ietf.org/html/rfc8259#section-11 | IANA Considerations } - * - * `text/json` is non-standard media type - */ -var jsonMimeTypeRegex = /^(?:application|text)\/json$/ +/***/ }), -/** - * JSON text exchanged between systems that are not part of a closed ecosystem - * MUST be encoded using UTF-8. +/***/ 5834: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/*! + * unset-value * - * {@link https://tools.ietf.org/html/rfc8259#section-8.1 | Character Encoding} + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. */ -var jsonCharacterEncoding = "utf-8" -function base64ToBuf(b64) { - var binStr = atob(b64) - var len = binStr.length - var arr = new Uint8Array(len) - for (var i = 0; i < len; i++) { - arr[i] = binStr.charCodeAt(i) - } - return arr -} -function decodeBase64String(b64) { - if (typeof TextDecoder === "undefined" || typeof Uint8Array === "undefined") { - return atob(b64) - } - var buf = base64ToBuf(b64); - // Note: `decoder.decode` method will throw a `DOMException` with the - // `"EncodingError"` value when an coding error is found. - var decoder = new TextDecoder(jsonCharacterEncoding, {fatal: true}) - return decoder.decode(buf); -} -function resolveSourceMapHelper(code, codeUrl) { - codeUrl = urix(codeUrl) +var isObject = __webpack_require__(96667); +var has = __webpack_require__(77735); - var url = sourceMappingURL.getFrom(code) - if (!url) { - return null +module.exports = function unset(obj, prop) { + if (!isObject(obj)) { + throw new TypeError('expected an object.'); + } + if (obj.hasOwnProperty(prop)) { + delete obj[prop]; + return true; } - var dataUri = url.match(dataUriRegex) - if (dataUri) { - var mimeType = dataUri[1] || "text/plain" - var lastParameter = dataUri[2] || "" - var encoded = dataUri[3] || "" - var data = { - sourceMappingURL: url, - url: null, - sourcesRelativeTo: codeUrl, - map: encoded - } - if (!jsonMimeTypeRegex.test(mimeType)) { - var error = new Error("Unuseful data uri mime type: " + mimeType) - error.sourceMapData = data - throw error - } - try { - data.map = parseMapToJSON( - lastParameter === ";base64" ? decodeBase64String(encoded) : decodeURIComponent(encoded), - data - ) - } catch (error) { - error.sourceMapData = data - throw error + if (has(obj, prop)) { + var segs = prop.split('.'); + var last = segs.pop(); + while (segs.length && segs[segs.length - 1].slice(-1) === '\\') { + last = segs.pop().slice(0, -1) + '.' + last; } - return data + while (segs.length) obj = obj[prop = segs.shift()]; + return (delete obj[last]); } + return true; +}; - var mapUrl = resolveUrl(codeUrl, url) - return { - sourceMappingURL: url, - url: mapUrl, - sourcesRelativeTo: mapUrl, - map: null - } -} +/***/ }), +/***/ 77735: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -function resolveSources(map, mapUrl, read, options, callback) { - if (typeof options === "function") { - callback = options - options = {} - } - var pending = map.sources ? map.sources.length : 0 - var result = { - sourcesResolved: [], - sourcesContent: [] - } +"use strict"; +/*! + * has-value + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ - if (pending === 0) { - callbackAsync(callback, null, result) - return - } - var done = function() { - pending-- - if (pending === 0) { - callback(null, result) - } - } - resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) { - result.sourcesResolved[index] = fullUrl - if (typeof sourceContent === "string") { - result.sourcesContent[index] = sourceContent - callbackAsync(done, null) - } else { - var readUrl = decodeUriComponent(fullUrl) - read(readUrl, function(error, source) { - result.sourcesContent[index] = error ? error : String(source) - done() - }) - } - }) -} +var isObject = __webpack_require__(78037); +var hasValues = __webpack_require__(38719); +var get = __webpack_require__(89304); -function resolveSourcesSync(map, mapUrl, read, options) { - var result = { - sourcesResolved: [], - sourcesContent: [] +module.exports = function(obj, prop, noZero) { + if (isObject(obj)) { + return hasValues(get(obj, prop), noZero); } + return hasValues(obj, prop); +}; - if (!map.sources || map.sources.length === 0) { - return result - } - resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) { - result.sourcesResolved[index] = fullUrl - if (read !== null) { - if (typeof sourceContent === "string") { - result.sourcesContent[index] = sourceContent - } else { - var readUrl = decodeUriComponent(fullUrl) - try { - result.sourcesContent[index] = String(read(readUrl)) - } catch (error) { - result.sourcesContent[index] = error - } - } - } - }) +/***/ }), - return result -} +/***/ 78037: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var endingSlash = /\/?$/ +"use strict"; +/*! + * isobject + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ -function resolveSourcesHelper(map, mapUrl, options, fn) { - options = options || {} - mapUrl = urix(mapUrl) - var fullUrl - var sourceContent - var sourceRoot - for (var index = 0, len = map.sources.length; index < len; index++) { - sourceRoot = null - if (typeof options.sourceRoot === "string") { - sourceRoot = options.sourceRoot - } else if (typeof map.sourceRoot === "string" && options.sourceRoot !== false) { - sourceRoot = map.sourceRoot - } - // If the sourceRoot is the empty string, it is equivalent to not setting - // the property at all. - if (sourceRoot === null || sourceRoot === '') { - fullUrl = resolveUrl(mapUrl, map.sources[index]) - } else { - // Make sure that the sourceRoot ends with a slash, so that `/scripts/subdir` becomes - // `/scripts/subdir/`, not `/scripts/`. Pointing to a file as source root - // does not make sense. - fullUrl = resolveUrl(mapUrl, sourceRoot.replace(endingSlash, "/"), map.sources[index]) - } - sourceContent = (map.sourcesContent || [])[index] - fn(fullUrl, sourceContent, index) - } -} +var isArray = __webpack_require__(21352); -function resolve(code, codeUrl, read, options, callback) { - if (typeof options === "function") { - callback = options - options = {} - } - if (code === null) { - var mapUrl = codeUrl - var data = { - sourceMappingURL: null, - url: mapUrl, - sourcesRelativeTo: mapUrl, - map: null - } - var readUrl = decodeUriComponent(mapUrl) - read(readUrl, function(error, result) { - if (error) { - error.sourceMapData = data - return callback(error) - } - data.map = String(result) - try { - data.map = parseMapToJSON(data.map, data) - } catch (error) { - return callback(error) - } - _resolveSources(data) - }) - } else { - resolveSourceMap(code, codeUrl, read, function(error, mapData) { - if (error) { - return callback(error) - } - if (!mapData) { - return callback(null, null) - } - _resolveSources(mapData) - }) +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && isArray(val) === false; +}; + + +/***/ }), + +/***/ 38719: +/***/ (function(module) { + +"use strict"; +/*! + * has-values + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +module.exports = function hasValue(o, noZero) { + if (o === null || o === undefined) { + return false; } - function _resolveSources(mapData) { - resolveSources(mapData.map, mapData.sourcesRelativeTo, read, options, function(error, result) { - if (error) { - return callback(error) - } - mapData.sourcesResolved = result.sourcesResolved - mapData.sourcesContent = result.sourcesContent - callback(null, mapData) - }) + if (typeof o === 'boolean') { + return true; } -} -function resolveSync(code, codeUrl, read, options) { - var mapData - if (code === null) { - var mapUrl = codeUrl - mapData = { - sourceMappingURL: null, - url: mapUrl, - sourcesRelativeTo: mapUrl, - map: null - } - mapData.map = readSync(read, mapUrl, mapData) - mapData.map = parseMapToJSON(mapData.map, mapData) - } else { - mapData = resolveSourceMapSync(code, codeUrl, read) - if (!mapData) { - return null + if (typeof o === 'number') { + if (o === 0 && noZero === true) { + return false; } + return true; } - var result = resolveSourcesSync(mapData.map, mapData.sourcesRelativeTo, read, options) - mapData.sourcesResolved = result.sourcesResolved - mapData.sourcesContent = result.sourcesContent - return mapData -} - + if (o.length !== undefined) { + return o.length !== 0; + } -module.exports = { - resolveSourceMap: resolveSourceMap, - resolveSourceMapSync: resolveSourceMapSync, - resolveSources: resolveSources, - resolveSourcesSync: resolveSourcesSync, - resolve: resolve, - resolveSync: resolveSync, - parseMapToJSON: parseMapToJSON -} + for (var key in o) { + if (o.hasOwnProperty(key)) { + return true; + } + } + return false; +}; /***/ }), -/***/ 21707: -/***/ (function(module) { - -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -void (function(root, factory) { - if (typeof define === "function" && define.amd) { - define(factory) - } else if (true) { - module.exports = factory() - } else {} -}(this, function() { +/***/ 94007: +/***/ (function(__unused_webpack_module, exports) { - var innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/ +/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +(function (global, factory) { + true ? factory(exports) : + 0; +}(this, (function (exports) { 'use strict'; - var regex = RegExp( - "(?:" + - "/\\*" + - "(?:\\s*\r?\n(?://)?)?" + - "(?:" + innerRegex.source + ")" + - "\\s*" + - "\\*/" + - "|" + - "//(?:" + innerRegex.source + ")" + - ")" + - "\\s*" - ) +function merge() { + for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { + sets[_key] = arguments[_key]; + } - return { + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} - regex: regex, - _innerRegex: innerRegex, +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); - getFrom: function(code) { - var match = code.match(regex) - return (match ? match[1] || match[2] || "" : null) - }, +var IRI_PROTOCOL = buildExps(true); - existsIn: function(code) { - return regex.test(code) - }, +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; - removeFrom: function(code) { - return code.replace(regex, "") - }, + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); - insertBefore: function(code, string) { - var match = code.match(regex) - if (match) { - return code.slice(0, match.index) + string + code.slice(match.index) - } else { - return code + string + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; } } + + return _arr; } -})); + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); -/***/ }), -/***/ 33218: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; -/*! - * split-string - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ -var extend = __webpack_require__(66889); -module.exports = function(str, options, fn) { - if (typeof str !== 'string') { - throw new TypeError('expected a string'); - } - if (typeof options === 'function') { - fn = options; - options = null; - } - // allow separator to be defined as a string - if (typeof options === 'string') { - options = { sep: options }; - } - var opts = extend({sep: '.'}, options); - var quotes = opts.quotes || ['"', "'", '`']; - var brackets; - if (opts.brackets === true) { - brackets = { - '<': '>', - '(': ')', - '[': ']', - '{': '}' - }; - } else if (opts.brackets) { - brackets = opts.brackets; - } - var tokens = []; - var stack = []; - var arr = ['']; - var sep = opts.sep; - var len = str.length; - var idx = -1; - var closeIdx; +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - function expected() { - if (brackets && stack.length) { - return brackets[stack[stack.length - 1]]; - } + return arr2; + } else { + return Array.from(arr); } +}; - while (++idx < len) { - var ch = str[idx]; - var next = str[idx + 1]; - var tok = { val: ch, idx: idx, arr: arr, str: str }; - tokens.push(tok); +/** Highest positive signed 32-bit float value */ - if (ch === '\\') { - tok.val = keepEscaping(opts, str, idx) === true ? (ch + next) : next; - tok.escaped = true; - if (typeof fn === 'function') { - fn(tok); - } - arr[arr.length - 1] += tok.val; - idx++; - continue; - } +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - if (brackets && brackets[ch]) { - stack.push(ch); - var e = expected(); - var i = idx + 1; +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' - if (str.indexOf(e, i + 1) !== -1) { - while (stack.length && i < len) { - var s = str[++i]; - if (s === '\\') { - s++; - continue; - } +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - if (quotes.indexOf(s) !== -1) { - i = getClosingQuote(str, s, i + 1); - continue; - } +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; - e = expected(); - if (stack.length && str.indexOf(e, i + 1) === -1) { - break; - } +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; - if (brackets[s]) { - stack.push(s); - continue; - } - - if (e === s) { - stack.pop(); - } - } - } - - closeIdx = i; - if (closeIdx === -1) { - arr[arr.length - 1] += ch; - continue; - } - - ch = str.slice(idx, closeIdx + 1); - tok.val = ch; - tok.idx = idx = closeIdx; - } - - if (quotes.indexOf(ch) !== -1) { - closeIdx = getClosingQuote(str, ch, idx + 1); - if (closeIdx === -1) { - arr[arr.length - 1] += ch; - continue; - } - - if (keepQuotes(ch, opts) === true) { - ch = str.slice(idx, closeIdx + 1); - } else { - ch = str.slice(idx + 1, closeIdx); - } - - tok.val = ch; - tok.idx = idx = closeIdx; - } - - if (typeof fn === 'function') { - fn(tok, tokens); - ch = tok.val; - idx = tok.idx; - } - - if (tok.val === sep && tok.split !== false) { - arr.push(''); - continue; - } - - arr[arr.length - 1] += tok.val; - } - - return arr; -}; +/*--------------------------------------------------------------------------*/ -function getClosingQuote(str, ch, i, brackets) { - var idx = str.indexOf(ch, i); - if (str.charAt(idx - 1) === '\\') { - return getClosingQuote(str, ch, idx + 1); - } - return idx; +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); } -function keepQuotes(ch, opts) { - if (opts.keepDoubleQuotes === true && ch === '"') return true; - if (opts.keepSingleQuotes === true && ch === "'") return true; - return opts.keepQuotes; +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; } -function keepEscaping(opts, str, idx) { - if (typeof opts.keepEscaping === 'function') { - return opts.keepEscaping(str, idx); - } - return opts.keepEscaping === true || str[idx + 1] === '\\'; +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; } +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} -/***/ }), - -/***/ 66889: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; - - -var isExtendable = __webpack_require__(28730); -var assignSymbols = __webpack_require__(64353); - -module.exports = Object.assign || function(obj/*, objects*/) { - if (obj === null || typeof obj === 'undefined') { - throw new TypeError('Cannot convert undefined or null to object'); - } - if (!isObject(obj)) { - obj = {}; - } - for (var i = 1; i < arguments.length; i++) { - var val = arguments[i]; - if (isString(val)) { - val = toObject(val); - } - if (isObject(val)) { - assign(obj, val); - assignSymbols(obj, val); - } - } - return obj; +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); }; -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} - -function isString(val) { - return (val && typeof val === 'string'); -} +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; -function toObject(str) { - var obj = {}; - for (var i in str) { - obj[i] = str[i]; - } - return obj; -} +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; -function isObject(val) { - return (val && typeof val === 'object') || isExtendable(val); -} +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; /** - * Returns true if the given `key` is an own property of `obj`. + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. -function isEnum(obj, key) { - return Object.prototype.propertyIsEnumerable.call(obj, key); -} + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } -/***/ }), + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. -/***/ 28730: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ -"use strict"; -/*! - * is-extendable - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { + if (index >= inputLength) { + error$1('invalid-input'); + } + var digit = basicToDigit(input.charCodeAt(index++)); -var isPlainObject = __webpack_require__(81064); + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } -module.exports = function isExtendable(val) { - return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); -}; + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (digit < t) { + break; + } -/***/ }), + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } -/***/ 69457: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + w *= baseMinusT; + } -"use strict"; -/*! - * static-extend - * - * Copyright (c) 2016, Jon Schlinkert. - * Licensed under the MIT License. - */ + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } + n += floor(i / out); + i %= out; + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } -var copy = __webpack_require__(31368); -var define = __webpack_require__(5477); -var util = __webpack_require__(31669); + return String.fromCodePoint.apply(String, output); +}; /** - * Returns a function for extending the static properties, - * prototype properties, and descriptors from the `Parent` - * constructor onto `Child` constructors. - * - * ```js - * var extend = require('static-extend'); - * Parent.extend = extend(Parent); - * - * // optionally pass a custom merge function as the second arg - * Parent.extend = extend(Parent, function(Child) { - * Child.prototype.mixin = function(key, val) { - * Child.prototype[key] = val; - * }; - * }); - * - * // extend "child" constructors - * Parent.extend(Child); - * - * // optionally define prototype methods as the second arg - * Parent.extend(Child, { - * foo: function() {}, - * bar: function() {} - * }); - * ``` - * @param {Function} `Parent` Parent ctor - * @param {Function} `extendFn` Optional extend function for handling any necessary custom merging. Useful when updating methods that require a specific prototype. - * @param {Function} `Child` Child ctor - * @param {Object} `proto` Optionally pass additional prototype properties to inherit. - * @return {Object} - * @api public + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. */ +var encode = function encode(input) { + var output = []; -function extend(Parent, extendFn) { - if (typeof Parent !== 'function') { - throw new TypeError('expected Parent to be a function.'); - } - - return function(Ctor, proto) { - if (typeof Ctor !== 'function') { - throw new TypeError('expected Ctor to be a function.'); - } - - util.inherits(Ctor, Parent); - copy(Ctor, Parent); - - // proto can be null or a plain object - if (typeof proto === 'object') { - var obj = Object.create(proto); + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); - for (var k in obj) { - Ctor.prototype[k] = obj[k]; - } - } + // Cache the length. + var inputLength = input.length; - // keep a reference to the parent prototype - define(Ctor.prototype, '_parent_', { - configurable: true, - set: function() {}, - get: function() { - return Parent.prototype; - } - }); + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; - if (typeof extendFn === 'function') { - extendFn(Ctor, Parent); - } + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; - Ctor.extend = extend(Ctor, extendFn); - }; -}; + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; -/** - * Expose `extend` - */ + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } -module.exports = extend; + var basicLength = output.length; + var handledCPCount = basicLength; + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. -/***/ }), + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } -/***/ 27836: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Main encoding loop: + while (handledCPCount < inputLength) { -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } -class AsyncParallelBailHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, onDone }) { - let code = ""; - code += `var _results = new Array(${this.options.taps.length});\n`; - code += "var _checkDone = () => {\n"; - code += "for(var i = 0; i < _results.length; i++) {\n"; - code += "var item = _results[i];\n"; - code += "if(item === undefined) return false;\n"; - code += "if(item.result !== undefined) {\n"; - code += onResult("item.result"); - code += "return true;\n"; - code += "}\n"; - code += "if(item.error) {\n"; - code += onError("item.error"); - code += "return true;\n"; - code += "}\n"; - code += "}\n"; - code += "return false;\n"; - code += "}\n"; - code += this.callTapsParallel({ - onError: (i, err, done, doneBreak) => { - let code = ""; - code += `if(${i} < _results.length && ((_results.length = ${i + - 1}), (_results[${i}] = { error: ${err} }), _checkDone())) {\n`; - code += doneBreak(true); - code += "} else {\n"; - code += done(); - code += "}\n"; - return code; - }, - onResult: (i, result, done, doneBreak) => { - let code = ""; - code += `if(${i} < _results.length && (${result} !== undefined && (_results.length = ${i + - 1}), (_results[${i}] = { result: ${result} }), _checkDone())) {\n`; - code += doneBreak(true); - code += "} else {\n"; - code += done(); - code += "}\n"; - return code; - }, - onTap: (i, run, done, doneBreak) => { - let code = ""; - if (i > 0) { - code += `if(${i} >= _results.length) {\n`; - code += done(); - code += "} else {\n"; + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); } - code += run(); - if (i > 0) code += "}\n"; - return code; - }, - onDone - }); - return code; - } -} - -const factory = new AsyncParallelBailHookCodeFactory(); - -class AsyncParallelBailHook extends Hook { - compile(options) { - factory.setup(this, options); - return factory.create(options); - } -} - -Object.defineProperties(AsyncParallelBailHook.prototype, { - _call: { value: undefined, configurable: true, writable: true } -}); - -module.exports = AsyncParallelBailHook; - - -/***/ }), + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } -/***/ 14616: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + delta += (m - n) * handledCPCountPlusOne; + n = m; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; -class AsyncParallelHookCodeFactory extends HookCodeFactory { - content({ onError, onDone }) { - return this.callTapsParallel({ - onError: (i, err, done, doneBreak) => onError(err) + doneBreak(true), - onDone - }); - } -} + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } -const factory = new AsyncParallelHookCodeFactory(); + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } -class AsyncParallelHook extends Hook { - compile(options) { - factory.setup(this, options); - return factory.create(options); + ++delta; + ++n; } -} - -Object.defineProperties(AsyncParallelHook.prototype, { - _call: { value: undefined, configurable: true, writable: true } -}); - -module.exports = AsyncParallelHook; - - -/***/ }), + return output.join(''); +}; -/***/ 89674: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; +/*--------------------------------------------------------------------------*/ -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; -class AsyncSeriesBailHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, resultReturns, onDone }) { - return this.callTapsSeries({ - onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), - onResult: (i, result, next) => - `if(${result} !== undefined) {\n${onResult( - result - )};\n} else {\n${next()}}\n`, - resultReturns, - onDone - }); - } +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; } - -const factory = new AsyncSeriesBailHookCodeFactory(); - -class AsyncSeriesBailHook extends Hook { - compile(options) { - factory.setup(this, options); - return factory.create(options); - } +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; } - -Object.defineProperties(AsyncSeriesBailHook.prototype, { - _call: { value: undefined, configurable: true, writable: true } -}); - -module.exports = AsyncSeriesBailHook; - - -/***/ }), - -/***/ 55328: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); - -class AsyncSeriesHookCodeFactory extends HookCodeFactory { - content({ onError, onDone }) { - return this.callTapsSeries({ - onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), - onDone - }); - } +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; } -const factory = new AsyncSeriesHookCodeFactory(); - -class AsyncSeriesHook extends Hook { - compile(options) { - factory.setup(this, options); - return factory.create(options); - } +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; } +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; -Object.defineProperties(AsyncSeriesHook.prototype, { - _call: { value: undefined, configurable: true, writable: true } -}); - -module.exports = AsyncSeriesHook; - - -/***/ }), - -/***/ 14568: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); + var _matches = slicedToArray(matches, 2), + address = _matches[1]; -class AsyncSeriesWaterfallHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, onDone }) { - return this.callTapsSeries({ - onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), - onResult: (i, result, next) => { - let code = ""; - code += `if(${result} !== undefined) {\n`; - code += `${this._args[0]} = ${result};\n`; - code += `}\n`; - code += next(); - return code; - }, - onDone: () => onResult(this._args[0]) - }); - } + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } } +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; -const factory = new AsyncSeriesWaterfallHookCodeFactory(); + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; -class AsyncSeriesWaterfallHook extends Hook { - constructor(args) { - super(args); - if (args.length < 1) - throw new Error("Waterfall hooks must have at least one argument"); - } + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; - compile(options) { - factory.setup(this, options); - return factory.create(options); - } + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } } +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; -Object.defineProperties(AsyncSeriesWaterfallHook.prototype, { - _call: { value: undefined, configurable: true, writable: true } -}); - -module.exports = AsyncSeriesWaterfallHook; - - -/***/ }), - -/***/ 12233: -/***/ (function(module) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -class Hook { - constructor(args) { - if (!Array.isArray(args)) args = []; - this._args = args; - this.taps = []; - this.interceptors = []; - this.call = this._call; - this.promise = this._promise; - this.callAsync = this._callAsync; - this._x = undefined; - } - - compile(options) { - throw new Error("Abstract: should be overriden"); - } - - _createCall(type) { - return this.compile({ - taps: this.taps, - interceptors: this.interceptors, - args: this._args, - type: type - }); - } - - tap(options, fn) { - if (typeof options === "string") options = { name: options }; - if (typeof options !== "object" || options === null) - throw new Error( - "Invalid arguments to tap(options: Object, fn: function)" - ); - options = Object.assign({ type: "sync", fn: fn }, options); - if (typeof options.name !== "string" || options.name === "") - throw new Error("Missing name for tap"); - options = this._runRegisterInterceptors(options); - this._insert(options); - } - - tapAsync(options, fn) { - if (typeof options === "string") options = { name: options }; - if (typeof options !== "object" || options === null) - throw new Error( - "Invalid arguments to tapAsync(options: Object, fn: function)" - ); - options = Object.assign({ type: "async", fn: fn }, options); - if (typeof options.name !== "string" || options.name === "") - throw new Error("Missing name for tapAsync"); - options = this._runRegisterInterceptors(options); - this._insert(options); - } - - tapPromise(options, fn) { - if (typeof options === "string") options = { name: options }; - if (typeof options !== "object" || options === null) - throw new Error( - "Invalid arguments to tapPromise(options: Object, fn: function)" - ); - options = Object.assign({ type: "promise", fn: fn }, options); - if (typeof options.name !== "string" || options.name === "") - throw new Error("Missing name for tapPromise"); - options = this._runRegisterInterceptors(options); - this._insert(options); - } - - _runRegisterInterceptors(options) { - for (const interceptor of this.interceptors) { - if (interceptor.register) { - const newOptions = interceptor.register(options); - if (newOptions !== undefined) options = newOptions; - } - } - return options; - } + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} - withOptions(options) { - const mergeOptions = opt => - Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt); +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number") { + uriTokens.push(":"); + uriTokens.push(components.port.toString(10)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} - // Prevent creating endless prototype chains - options = Object.assign({}, options, this._withOptions); - const base = this._withOptionsBase || this; - const newHook = Object.create(base); +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} - (newHook.tapAsync = (opt, fn) => base.tapAsync(mergeOptions(opt), fn)), - (newHook.tap = (opt, fn) => base.tap(mergeOptions(opt), fn)); - newHook.tapPromise = (opt, fn) => base.tapPromise(mergeOptions(opt), fn); - newHook._withOptions = options; - newHook._withOptionsBase = base; - return newHook; - } +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - isUsed() { - return this.taps.length > 0 || this.interceptors.length > 0; - } + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 - intercept(interceptor) { - this._resetCompilation(); - this.interceptors.push(Object.assign({}, interceptor)); - if (interceptor.register) { - for (let i = 0; i < this.taps.length; i++) - this.taps[i] = interceptor.register(this.taps[i]); - } - } + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} - _resetCompilation() { - this.call = this._call; - this.callAsync = this._callAsync; - this.promise = this._promise; - } +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; - _insert(item) { - this._resetCompilation(); - let before; - if (typeof item.before === "string") before = new Set([item.before]); - else if (Array.isArray(item.before)) { - before = new Set(item.before); - } - let stage = 0; - if (typeof item.stage === "number") stage = item.stage; - let i = this.taps.length; - while (i > 0) { - i--; - const x = this.taps[i]; - this.taps[i + 1] = x; - const xStage = x.stage || 0; - if (before) { - if (before.has(x.name)) { - before.delete(x.name); - continue; - } - if (before.size > 0) { - continue; - } - } - if (xStage > stage) { - continue; - } - i++; - break; - } - this.taps[i] = item; - } + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; } -function createCompileDelegate(name, type) { - return function lazyCompileHook(...args) { - this[name] = this._createCall(type); - return this[name](...args); - }; +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); } -Object.defineProperties(Hook.prototype, { - _call: { - value: createCompileDelegate("call", "sync"), - configurable: true, - writable: true - }, - _promise: { - value: createCompileDelegate("promise", "promise"), - configurable: true, - writable: true - }, - _callAsync: { - value: createCompileDelegate("callAsync", "async"), - configurable: true, - writable: true - } -}); - -module.exports = Hook; - +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} -/***/ }), +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} -/***/ 64288: -/***/ (function(module) { +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + //normalize the default port + if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; -class HookCodeFactory { - constructor(config) { - this.config = config; - this.options = undefined; - this._args = undefined; - } +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; - create(options) { - this.init(options); - let fn; - switch (this.options.type) { - case "sync": - fn = new Function( - this.args(), - '"use strict";\n' + - this.header() + - this.content({ - onError: err => `throw ${err};\n`, - onResult: result => `return ${result};\n`, - resultReturns: true, - onDone: () => "", - rethrowIfPossible: true - }) - ); - break; - case "async": - fn = new Function( - this.args({ - after: "_callback" - }), - '"use strict";\n' + - this.header() + - this.content({ - onError: err => `_callback(${err});\n`, - onResult: result => `_callback(null, ${result});\n`, - onDone: () => "_callback();\n" - }) - ); - break; - case "promise": - let errorHelperUsed = false; - const content = this.content({ - onError: err => { - errorHelperUsed = true; - return `_error(${err});\n`; - }, - onResult: result => `_resolve(${result});\n`, - onDone: () => "_resolve();\n" - }); - let code = ""; - code += '"use strict";\n'; - code += "return new Promise((_resolve, _reject) => {\n"; - if (errorHelperUsed) { - code += "var _sync = true;\n"; - code += "function _error(_err) {\n"; - code += "if(_sync)\n"; - code += "_resolve(Promise.resolve().then(() => { throw _err; }));\n"; - code += "else\n"; - code += "_reject(_err);\n"; - code += "};\n"; - } - code += this.header(); - code += content; - if (errorHelperUsed) { - code += "_sync = false;\n"; - } - code += "});\n"; - fn = new Function(this.args(), code); - break; - } - this.deinit(); - return fn; - } - - setup(instance, options) { - instance._x = options.taps.map(t => t.fn); - } +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$2 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; - /** - * @param {{ type: "sync" | "promise" | "async", taps: Array, interceptors: Array }} options - */ - init(options) { - this.options = options; - this._args = options.args.slice(); - } +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$3 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; - deinit() { - this.options = undefined; - this._args = undefined; - } +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$4 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } +}; - header() { - let code = ""; - if (this.needContext()) { - code += "var _context = {};\n"; - } else { - code += "var _context;\n"; - } - code += "var _x = this._x;\n"; - if (this.options.interceptors.length > 0) { - code += "var _taps = this.taps;\n"; - code += "var _interceptors = this.interceptors;\n"; - } - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.call) { - code += `${this.getInterceptor(i)}.call(${this.args({ - before: interceptor.context ? "_context" : undefined - })});\n`; - } - } - return code; - } +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; - needContext() { - for (const tap of this.options.taps) if (tap.context) return true; - return false; - } +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; - callTap(tapIndex, { onError, onResult, onDone, rethrowIfPossible }) { - let code = ""; - let hasTapCached = false; - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.tap) { - if (!hasTapCached) { - code += `var _tap${tapIndex} = ${this.getTap(tapIndex)};\n`; - hasTapCached = true; - } - code += `${this.getInterceptor(i)}.tap(${ - interceptor.context ? "_context, " : "" - }_tap${tapIndex});\n`; - } - } - code += `var _fn${tapIndex} = ${this.getTapFn(tapIndex)};\n`; - const tap = this.options.taps[tapIndex]; - switch (tap.type) { - case "sync": - if (!rethrowIfPossible) { - code += `var _hasError${tapIndex} = false;\n`; - code += "try {\n"; - } - if (onResult) { - code += `var _result${tapIndex} = _fn${tapIndex}(${this.args({ - before: tap.context ? "_context" : undefined - })});\n`; - } else { - code += `_fn${tapIndex}(${this.args({ - before: tap.context ? "_context" : undefined - })});\n`; - } - if (!rethrowIfPossible) { - code += "} catch(_err) {\n"; - code += `_hasError${tapIndex} = true;\n`; - code += onError("_err"); - code += "}\n"; - code += `if(!_hasError${tapIndex}) {\n`; - } - if (onResult) { - code += onResult(`_result${tapIndex}`); - } - if (onDone) { - code += onDone(); - } - if (!rethrowIfPossible) { - code += "}\n"; - } - break; - case "async": - let cbCode = ""; - if (onResult) cbCode += `(_err${tapIndex}, _result${tapIndex}) => {\n`; - else cbCode += `_err${tapIndex} => {\n`; - cbCode += `if(_err${tapIndex}) {\n`; - cbCode += onError(`_err${tapIndex}`); - cbCode += "} else {\n"; - if (onResult) { - cbCode += onResult(`_result${tapIndex}`); - } - if (onDone) { - cbCode += onDone(); - } - cbCode += "}\n"; - cbCode += "}"; - code += `_fn${tapIndex}(${this.args({ - before: tap.context ? "_context" : undefined, - after: cbCode - })});\n`; - break; - case "promise": - code += `var _hasResult${tapIndex} = false;\n`; - code += `var _promise${tapIndex} = _fn${tapIndex}(${this.args({ - before: tap.context ? "_context" : undefined - })});\n`; - code += `if (!_promise${tapIndex} || !_promise${tapIndex}.then)\n`; - code += ` throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise${tapIndex} + ')');\n`; - code += `_promise${tapIndex}.then(_result${tapIndex} => {\n`; - code += `_hasResult${tapIndex} = true;\n`; - if (onResult) { - code += onResult(`_result${tapIndex}`); - } - if (onDone) { - code += onDone(); - } - code += `}, _err${tapIndex} => {\n`; - code += `if(_hasResult${tapIndex}) throw _err${tapIndex};\n`; - code += onError(`_err${tapIndex}`); - code += "});\n"; - break; - } - return code; - } +Object.defineProperty(exports, '__esModule', { value: true }); - callTapsSeries({ - onError, - onResult, - resultReturns, - onDone, - doneReturns, - rethrowIfPossible - }) { - if (this.options.taps.length === 0) return onDone(); - const firstAsync = this.options.taps.findIndex(t => t.type !== "sync"); - const somethingReturns = resultReturns || doneReturns || false; - let code = ""; - let current = onDone; - for (let j = this.options.taps.length - 1; j >= 0; j--) { - const i = j; - const unroll = current !== onDone && this.options.taps[i].type !== "sync"; - if (unroll) { - code += `function _next${i}() {\n`; - code += current(); - code += `}\n`; - current = () => `${somethingReturns ? "return " : ""}_next${i}();\n`; - } - const done = current; - const doneBreak = skipDone => { - if (skipDone) return ""; - return onDone(); - }; - const content = this.callTap(i, { - onError: error => onError(i, error, done, doneBreak), - onResult: - onResult && - (result => { - return onResult(i, result, done, doneBreak); - }), - onDone: !onResult && done, - rethrowIfPossible: - rethrowIfPossible && (firstAsync < 0 || i < firstAsync) - }); - current = () => content; - } - code += current(); - return code; - } +}))); +//# sourceMappingURL=uri.all.js.map - callTapsLooping({ onError, onDone, rethrowIfPossible }) { - if (this.options.taps.length === 0) return onDone(); - const syncOnly = this.options.taps.every(t => t.type === "sync"); - let code = ""; - if (!syncOnly) { - code += "var _looper = () => {\n"; - code += "var _loopAsync = false;\n"; - } - code += "var _loop;\n"; - code += "do {\n"; - code += "_loop = false;\n"; - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.loop) { - code += `${this.getInterceptor(i)}.loop(${this.args({ - before: interceptor.context ? "_context" : undefined - })});\n`; - } - } - code += this.callTapsSeries({ - onError, - onResult: (i, result, next, doneBreak) => { - let code = ""; - code += `if(${result} !== undefined) {\n`; - code += "_loop = true;\n"; - if (!syncOnly) code += "if(_loopAsync) _looper();\n"; - code += doneBreak(true); - code += `} else {\n`; - code += next(); - code += `}\n`; - return code; - }, - onDone: - onDone && - (() => { - let code = ""; - code += "if(!_loop) {\n"; - code += onDone(); - code += "}\n"; - return code; - }), - rethrowIfPossible: rethrowIfPossible && syncOnly - }); - code += "} while(_loop);\n"; - if (!syncOnly) { - code += "_loopAsync = true;\n"; - code += "};\n"; - code += "_looper();\n"; - } - return code; - } - callTapsParallel({ - onError, - onResult, - onDone, - rethrowIfPossible, - onTap = (i, run) => run() - }) { - if (this.options.taps.length <= 1) { - return this.callTapsSeries({ - onError, - onResult, - onDone, - rethrowIfPossible - }); - } - let code = ""; - code += "do {\n"; - code += `var _counter = ${this.options.taps.length};\n`; - if (onDone) { - code += "var _done = () => {\n"; - code += onDone(); - code += "};\n"; - } - for (let i = 0; i < this.options.taps.length; i++) { - const done = () => { - if (onDone) return "if(--_counter === 0) _done();\n"; - else return "--_counter;"; - }; - const doneBreak = skipDone => { - if (skipDone || !onDone) return "_counter = 0;\n"; - else return "_counter = 0;\n_done();\n"; - }; - code += "if(_counter <= 0) break;\n"; - code += onTap( - i, - () => - this.callTap(i, { - onError: error => { - let code = ""; - code += "if(_counter > 0) {\n"; - code += onError(i, error, done, doneBreak); - code += "}\n"; - return code; - }, - onResult: - onResult && - (result => { - let code = ""; - code += "if(_counter > 0) {\n"; - code += onResult(i, result, done, doneBreak); - code += "}\n"; - return code; - }), - onDone: - !onResult && - (() => { - return done(); - }), - rethrowIfPossible - }), - done, - doneBreak - ); - } - code += "} while(false);\n"; - return code; - } +/***/ }), - args({ before, after } = {}) { - let allArgs = this._args; - if (before) allArgs = [before].concat(allArgs); - if (after) allArgs = allArgs.concat(after); - if (allArgs.length === 0) { - return ""; - } else { - return allArgs.join(", "); - } - } - - getTapFn(idx) { - return `_x[${idx}]`; - } - - getTap(idx) { - return `_taps[${idx}]`; - } - - getInterceptor(idx) { - return `_interceptors[${idx}]`; - } -} +/***/ 67806: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -module.exports = HookCodeFactory; +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var path = __webpack_require__(85622) + +"use strict" + +function urix(aPath) { + if (path.sep === "\\") { + return aPath + .replace(/\\/g, "/") + .replace(/^[a-z]:\/?/i, "/") + } + return aPath +} + +module.exports = urix /***/ }), -/***/ 35233: +/***/ 77709: /***/ (function(module) { "use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +/*! + * use + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ -class HookMap { - constructor(factory) { - this._map = new Map(); - this._factory = factory; - this._interceptors = []; - } - get(key) { - return this._map.get(key); - } +module.exports = function base(app, options) { + if (!isObject(app) && typeof app !== 'function') { + throw new TypeError('expected an object or function'); + } - for(key) { - const hook = this.get(key); - if (hook !== undefined) { - return hook; - } - let newHook = this._factory(key); - const interceptors = this._interceptors; - for (let i = 0; i < interceptors.length; i++) { - newHook = interceptors[i].factory(key, newHook); - } - this._map.set(key, newHook); - return newHook; - } + var opts = isObject(options) ? options : {}; + var prop = typeof opts.prop === 'string' ? opts.prop : 'fns'; + if (!Array.isArray(app[prop])) { + define(app, prop, []); + } - intercept(interceptor) { - this._interceptors.push( - Object.assign( - { - factory: (key, hook) => hook - }, - interceptor - ) - ); - } + /** + * Define a plugin function to be passed to use. The only + * parameter exposed to the plugin is `app`, the object or function. + * passed to `use(app)`. `app` is also exposed as `this` in plugins. + * + * Additionally, **if a plugin returns a function, the function will + * be pushed onto the `fns` array**, allowing the plugin to be + * called at a later point by the `run` method. + * + * ```js + * var use = require('use'); + * + * // define a plugin + * function foo(app) { + * // do stuff + * } + * + * var app = function(){}; + * use(app); + * + * // register plugins + * app.use(foo); + * app.use(bar); + * app.use(baz); + * ``` + * @name .use + * @param {Function} `fn` plugin function to call + * @api public + */ - tap(key, options, fn) { - return this.for(key).tap(options, fn); - } + define(app, 'use', use); - tapAsync(key, options, fn) { - return this.for(key).tapAsync(options, fn); - } + /** + * Run all plugins on `fns`. Any plugin that returns a function + * when called by `use` is pushed onto the `fns` array. + * + * ```js + * var config = {}; + * app.run(config); + * ``` + * @name .run + * @param {Object} `value` Object to be modified by plugins. + * @return {Object} Returns the object passed to `run` + * @api public + */ - tapPromise(key, options, fn) { - return this.for(key).tapPromise(options, fn); - } -} + define(app, 'run', function(val) { + if (!isObject(val)) return; -module.exports = HookMap; + if (!val.use || !val.run) { + define(val, prop, val[prop] || []); + define(val, 'use', use); + } + if (!val[prop] || val[prop].indexOf(base) === -1) { + val.use(base); + } -/***/ }), + var self = this || app; + var fns = self[prop]; + var len = fns.length; + var idx = -1; -/***/ 93607: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + while (++idx < len) { + val.use(fns[idx]); + } + return val; + }); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + /** + * Call plugin `fn`. If a function is returned push it into the + * `fns` array to be called by the `run` method. + */ + function use(type, fn, options) { + var offset = 1; -const Hook = __webpack_require__(12233); + if (typeof type === 'string' || Array.isArray(type)) { + fn = wrap(type, fn); + offset++; + } else { + options = fn; + fn = type; + } -class MultiHook { - constructor(hooks) { - this.hooks = hooks; - } + if (typeof fn !== 'function') { + throw new TypeError('expected a function'); + } - tap(options, fn) { - for (const hook of this.hooks) { - hook.tap(options, fn); - } - } + var self = this || app; + var fns = self[prop]; - tapAsync(options, fn) { - for (const hook of this.hooks) { - hook.tapAsync(options, fn); - } - } + var args = [].slice.call(arguments, offset); + args.unshift(self); - tapPromise(options, fn) { - for (const hook of this.hooks) { - hook.tapPromise(options, fn); - } - } + if (typeof opts.hook === 'function') { + opts.hook.apply(self, args); + } - isUsed() { - for (const hook of this.hooks) { - if (hook.isUsed()) return true; - } - return false; - } + var val = fn.apply(self, args); + if (typeof val === 'function' && fns.indexOf(val) === -1) { + fns.push(val); + } + return self; + } - intercept(interceptor) { - for (const hook of this.hooks) { - hook.intercept(interceptor); - } - } + /** + * Wrap a named plugin function so that it's only called on objects of the + * given `type` + * + * @param {String} `type` + * @param {Function} `fn` Plugin function + * @return {Function} + */ - withOptions(options) { - return new MultiHook(this.hooks.map(h => h.withOptions(options))); - } + function wrap(type, fn) { + return function plugin() { + return this.type === type ? fn.apply(this, arguments) : plugin; + }; + } + + return app; +}; + +function isObject(val) { + return val && typeof val === 'object' && !Array.isArray(val); } -module.exports = MultiHook; +function define(obj, key, val) { + Object.defineProperty(obj, key, { + configurable: true, + writable: true, + value: val + }); +} /***/ }), -/***/ 16477: +/***/ 92262: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); -class SyncBailHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, resultReturns, onDone, rethrowIfPossible }) { - return this.callTapsSeries({ - onError: (i, err) => onError(err), - onResult: (i, result, next) => - `if(${result} !== undefined) {\n${onResult( - result - )};\n} else {\n${next()}}\n`, - resultReturns, - onDone, - rethrowIfPossible - }); - } -} +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ -const factory = new SyncBailHookCodeFactory(); +module.exports = __webpack_require__(31669).deprecate; -class SyncBailHook extends Hook { - tapAsync() { - throw new Error("tapAsync is not supported on a SyncBailHook"); - } - tapPromise() { - throw new Error("tapPromise is not supported on a SyncBailHook"); - } +/***/ }), - compile(options) { - factory.setup(this, options); - return factory.create(options); - } -} +/***/ 24059: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -module.exports = SyncBailHook; +module.exports = __webpack_require__(47257); /***/ }), -/***/ 77633: +/***/ 71118: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -47740,237 +47357,255 @@ module.exports = SyncBailHook; */ -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); +const ConstDependency = __webpack_require__(71101); +const ParserHelpers = __webpack_require__(23999); -class SyncHookCodeFactory extends HookCodeFactory { - content({ onError, onDone, rethrowIfPossible }) { - return this.callTapsSeries({ - onError: (i, err) => onError(err), - onDone, - rethrowIfPossible - }); - } -} +const NullFactory = __webpack_require__(40438); -const factory = new SyncHookCodeFactory(); +/* eslint-disable camelcase */ +const REPLACEMENTS = { + __webpack_require__: "__webpack_require__", + __webpack_public_path__: "__webpack_require__.p", + __webpack_modules__: "__webpack_require__.m", + __webpack_chunk_load__: "__webpack_require__.e", + __non_webpack_require__: "require", + __webpack_nonce__: "__webpack_require__.nc", + "require.onError": "__webpack_require__.oe" +}; +const NO_WEBPACK_REQUIRE = { + __non_webpack_require__: true +}; +const REPLACEMENT_TYPES = { + __webpack_public_path__: "string", + __webpack_require__: "function", + __webpack_modules__: "object", + __webpack_chunk_load__: "function", + __webpack_nonce__: "string" +}; +/* eslint-enable camelcase */ -class SyncHook extends Hook { - tapAsync() { - throw new Error("tapAsync is not supported on a SyncHook"); - } +class APIPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "APIPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(ConstDependency, new NullFactory()); + compilation.dependencyTemplates.set( + ConstDependency, + new ConstDependency.Template() + ); - tapPromise() { - throw new Error("tapPromise is not supported on a SyncHook"); - } + const handler = parser => { + Object.keys(REPLACEMENTS).forEach(key => { + parser.hooks.expression + .for(key) + .tap( + "APIPlugin", + NO_WEBPACK_REQUIRE[key] + ? ParserHelpers.toConstantDependency( + parser, + REPLACEMENTS[key] + ) + : ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + REPLACEMENTS[key] + ) + ); + const type = REPLACEMENT_TYPES[key]; + if (type) { + parser.hooks.evaluateTypeof + .for(key) + .tap("APIPlugin", ParserHelpers.evaluateToString(type)); + } + }); + }; - compile(options) { - factory.setup(this, options); - return factory.create(options); + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("APIPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("APIPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/esm") + .tap("APIPlugin", handler); + } + ); } } -module.exports = SyncHook; +module.exports = APIPlugin; /***/ }), -/***/ 13608: +/***/ 36104: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); +const WebpackError = __webpack_require__(97391); +const CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/; -class SyncLoopHookCodeFactory extends HookCodeFactory { - content({ onError, onDone, rethrowIfPossible }) { - return this.callTapsLooping({ - onError: (i, err) => onError(err), - onDone, - rethrowIfPossible - }); - } +/** + * @param {string=} method method name + * @returns {string} message + */ +function createMessage(method) { + return `Abstract method${method ? " " + method : ""}. Must be overridden.`; } -const factory = new SyncLoopHookCodeFactory(); - -class SyncLoopHook extends Hook { - tapAsync() { - throw new Error("tapAsync is not supported on a SyncLoopHook"); - } +/** + * @constructor + */ +function Message() { + this.stack = undefined; + Error.captureStackTrace(this); + /** @type {RegExpMatchArray} */ + const match = this.stack.split("\n")[3].match(CURRENT_METHOD_REGEXP); - tapPromise() { - throw new Error("tapPromise is not supported on a SyncLoopHook"); - } + this.message = match && match[1] ? createMessage(match[1]) : createMessage(); +} - compile(options) { - factory.setup(this, options); - return factory.create(options); +/** + * Error for abstract method + * @example + * class FooClass { + * abstractMethod() { + * throw new AbstractMethodError(); // error message: Abstract method FooClass.abstractMethod. Must be overriden. + * } + * } + * + */ +class AbstractMethodError extends WebpackError { + constructor() { + super(new Message().message); + this.name = "AbstractMethodError"; } } -module.exports = SyncLoopHook; +module.exports = AbstractMethodError; /***/ }), -/***/ 6548: +/***/ 9701: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ -const Hook = __webpack_require__(12233); -const HookCodeFactory = __webpack_require__(64288); -class SyncWaterfallHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, resultReturns, rethrowIfPossible }) { - return this.callTapsSeries({ - onError: (i, err) => onError(err), - onResult: (i, result, next) => { - let code = ""; - code += `if(${result} !== undefined) {\n`; - code += `${this._args[0]} = ${result};\n`; - code += `}\n`; - code += next(); - return code; - }, - onDone: () => onResult(this._args[0]), - doneReturns: resultReturns, - rethrowIfPossible - }); - } -} -const factory = new SyncWaterfallHookCodeFactory(); +const { ConcatSource } = __webpack_require__(53665); +const Template = __webpack_require__(96066); -class SyncWaterfallHook extends Hook { - constructor(args) { - super(args); - if (args.length < 1) - throw new Error("Waterfall hooks must have at least one argument"); - } +/** @typedef {import("./Compilation")} Compilation */ - tapAsync() { - throw new Error("tapAsync is not supported on a SyncWaterfallHook"); - } - - tapPromise() { - throw new Error("tapPromise is not supported on a SyncWaterfallHook"); - } +/** + * @typedef {Object} AmdMainTemplatePluginOptions + * @param {string=} name the library name + * @property {boolean=} requireAsWrapper + */ - compile(options) { - factory.setup(this, options); - return factory.create(options); +class AmdMainTemplatePlugin { + /** + * @param {AmdMainTemplatePluginOptions} options the plugin options + */ + constructor(options) { + if (!options || typeof options === "string") { + this.name = options; + this.requireAsWrapper = false; + } else { + this.name = options.name; + this.requireAsWrapper = options.requireAsWrapper; + } } -} - -module.exports = SyncWaterfallHook; - -/***/ }), - -/***/ 72693: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** + * @param {Compilation} compilation the compilation instance + * @returns {void} + */ + apply(compilation) { + const { mainTemplate, chunkTemplate } = compilation; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + const onRenderWithEntry = (source, chunk, hash) => { + const externals = chunk.getModules().filter(m => m.external); + const externalsDepsArray = JSON.stringify( + externals.map(m => + typeof m.request === "object" ? m.request.amd : m.request + ) + ); + const externalsArguments = externals + .map( + m => `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(`${m.id}`)}__` + ) + .join(", "); + if (this.requireAsWrapper) { + return new ConcatSource( + `require(${externalsDepsArray}, function(${externalsArguments}) { return `, + source, + "});" + ); + } else if (this.name) { + const name = mainTemplate.getAssetPath(this.name, { + hash, + chunk + }); -const util = __webpack_require__(31669); -const SyncBailHook = __webpack_require__(16477); + return new ConcatSource( + `define(${JSON.stringify( + name + )}, ${externalsDepsArray}, function(${externalsArguments}) { return `, + source, + "});" + ); + } else if (externalsArguments) { + return new ConcatSource( + `define(${externalsDepsArray}, function(${externalsArguments}) { return `, + source, + "});" + ); + } else { + return new ConcatSource("define(function() { return ", source, "});"); + } + }; -function Tapable() { - this._pluginCompat = new SyncBailHook(["options"]); - this._pluginCompat.tap( - { - name: "Tapable camelCase", - stage: 100 - }, - options => { - options.names.add( - options.name.replace(/[- ]([a-z])/g, (str, ch) => ch.toUpperCase()) + for (const template of [mainTemplate, chunkTemplate]) { + template.hooks.renderWithEntry.tap( + "AmdMainTemplatePlugin", + onRenderWithEntry ); } - ); - this._pluginCompat.tap( - { - name: "Tapable this.hooks", - stage: 200 - }, - options => { - let hook; - for (const name of options.names) { - hook = this.hooks[name]; - if (hook !== undefined) { - break; - } - } - if (hook !== undefined) { - const tapOpt = { - name: options.fn.name || "unnamed compat plugin", - stage: options.stage || 0 - }; - if (options.async) hook.tapAsync(tapOpt, options.fn); - else hook.tap(tapOpt, options.fn); - return true; - } - } - ); -} -module.exports = Tapable; -Tapable.addCompatLayer = function addCompatLayer(instance) { - Tapable.call(instance); - instance.plugin = Tapable.prototype.plugin; - instance.apply = Tapable.prototype.apply; -}; + mainTemplate.hooks.globalHashPaths.tap("AmdMainTemplatePlugin", paths => { + if (this.name) { + paths.push(this.name); + } + return paths; + }); -Tapable.prototype.plugin = util.deprecate(function plugin(name, fn) { - if (Array.isArray(name)) { - name.forEach(function(name) { - this.plugin(name, fn); - }, this); - return; - } - const result = this._pluginCompat.call({ - name: name, - fn: fn, - names: new Set([name]) - }); - if (!result) { - throw new Error( - `Plugin could not be registered at '${name}'. Hook was not found.\n` + - "BREAKING CHANGE: There need to exist a hook at 'this.hooks'. " + - "To create a compatibility layer for this hook, hook into 'this._pluginCompat'." - ); + mainTemplate.hooks.hash.tap("AmdMainTemplatePlugin", hash => { + hash.update("exports amd"); + if (this.name) { + hash.update(this.name); + } + }); } -}, "Tapable.plugin is deprecated. Use new API on `.hooks` instead"); +} -Tapable.prototype.apply = util.deprecate(function apply() { - for (var i = 0; i < arguments.length; i++) { - arguments[i].apply(this); - } -}, "Tapable.apply is deprecated. Call apply on the plugin directly instead"); +module.exports = AmdMainTemplatePlugin; /***/ }), -/***/ 92402: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ 22814: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -47979,3122 +47614,2486 @@ Tapable.prototype.apply = util.deprecate(function apply() { */ -exports.__esModule = true; -exports.Tapable = __webpack_require__(72693); -exports.SyncHook = __webpack_require__(77633); -exports.SyncBailHook = __webpack_require__(16477); -exports.SyncWaterfallHook = __webpack_require__(6548); -exports.SyncLoopHook = __webpack_require__(13608); -exports.AsyncParallelHook = __webpack_require__(14616); -exports.AsyncParallelBailHook = __webpack_require__(27836); -exports.AsyncSeriesHook = __webpack_require__(55328); -exports.AsyncSeriesBailHook = __webpack_require__(89674); -exports.AsyncSeriesWaterfallHook = __webpack_require__(14568); -exports.HookMap = __webpack_require__(35233); -exports.MultiHook = __webpack_require__(93607); - +const DependenciesBlock = __webpack_require__(16071); -/***/ }), +/** @typedef {import("./ChunkGroup")} ChunkGroup */ +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("./util/createHash").Hash} Hash */ +/** @typedef {TODO} GroupOptions */ -/***/ 16326: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +module.exports = class AsyncDependenciesBlock extends DependenciesBlock { + /** + * @param {GroupOptions} groupOptions options for the group + * @param {Module} module the Module object + * @param {DependencyLocation=} loc the line of code + * @param {TODO=} request the request + */ + constructor(groupOptions, module, loc, request) { + super(); + if (typeof groupOptions === "string") { + groupOptions = { name: groupOptions }; + } else if (!groupOptions) { + groupOptions = { name: undefined }; + } + this.groupOptions = groupOptions; + /** @type {ChunkGroup=} */ + this.chunkGroup = undefined; + this.module = module; + this.loc = loc; + this.request = request; + /** @type {DependenciesBlock} */ + this.parent = undefined; + } -"use strict"; + /** + * @returns {string} The name of the chunk + */ + get chunkName() { + return this.groupOptions.name; + } + /** + * @param {string} value The new chunk name + * @returns {void} + */ + set chunkName(value) { + this.groupOptions.name = value; + } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.default = void 0; + /** + * @returns {never} this throws and should never be called + */ + get chunks() { + throw new Error("Moved to AsyncDependenciesBlock.chunkGroup"); + } -var _os = _interopRequireDefault(__webpack_require__(12087)); + /** + * @param {never} value setter value + * @returns {never} this is going to throw therefore we should throw type + * assertions by returning never + */ + set chunks(value) { + throw new Error("Moved to AsyncDependenciesBlock.chunkGroup"); + } -var _cacache = _interopRequireDefault(__webpack_require__(36801)); + /** + * @param {Hash} hash the hash used to track block changes, from "crypto" module + * @returns {void} + */ + updateHash(hash) { + hash.update(JSON.stringify(this.groupOptions)); + hash.update( + (this.chunkGroup && + this.chunkGroup.chunks + .map(chunk => { + return chunk.id !== null ? chunk.id : ""; + }) + .join(",")) || + "" + ); + super.updateHash(hash); + } -var _findCacheDir = _interopRequireDefault(__webpack_require__(61844)); + /** + * @returns {void} + */ + disconnect() { + this.chunkGroup = undefined; + super.disconnect(); + } -var _workerFarm = _interopRequireDefault(__webpack_require__(18921)); + /** + * @returns {void} + */ + unseal() { + this.chunkGroup = undefined; + super.unseal(); + } -var _serializeJavascript = _interopRequireDefault(__webpack_require__(85841)); + /** + * @returns {void} + */ + sortItems() { + super.sortItems(); + } +}; -var _isWsl = _interopRequireDefault(__webpack_require__(47543)); -var _minify = _interopRequireDefault(__webpack_require__(30787)); +/***/ }), -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ 67089: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -const worker = __webpack_require__.ab + "worker.js"; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Sean Larkin @thelarkinn +*/ -class TaskRunner { - constructor(options = {}) { - const { - cache, - parallel - } = options; - this.cacheDir = cache === true ? (0, _findCacheDir.default)({ - name: 'terser-webpack-plugin' - }) || _os.default.tmpdir() : cache; // In some cases cpus() returns undefined - // https://github.com/nodejs/node/issues/19022 - const cpus = _os.default.cpus() || { - length: 1 - }; // WSL sometimes freezes, error seems to be on the WSL side - // https://github.com/webpack-contrib/terser-webpack-plugin/issues/21 +const WebpackError = __webpack_require__(97391); - this.maxConcurrentWorkers = _isWsl.default ? 1 : parallel === true ? cpus.length - 1 : Math.min(Number(parallel) || 0, cpus.length - 1); - } +/** @typedef {import("./Module")} Module */ - run(tasks, callback) { - /* istanbul ignore if */ - if (!tasks.length) { - callback(null, []); - return; - } +class AsyncDependencyToInitialChunkError extends WebpackError { + /** + * Creates an instance of AsyncDependencyToInitialChunkError. + * @param {string} chunkName Name of Chunk + * @param {Module} module module tied to dependency + * @param {TODO} loc location of dependency + */ + constructor(chunkName, module, loc) { + super( + `It's not allowed to load an initial chunk on demand. The chunk name "${chunkName}" is already used by an entrypoint.` + ); - if (this.maxConcurrentWorkers > 1) { - const workerOptions = process.platform === 'win32' ? { - maxConcurrentWorkers: this.maxConcurrentWorkers, - maxConcurrentCallsPerWorker: 1 - } : { - maxConcurrentWorkers: this.maxConcurrentWorkers - }; - this.workers = (0, _workerFarm.default)(workerOptions, __webpack_require__.ab + "worker.js"); + this.name = "AsyncDependencyToInitialChunkError"; + this.module = module; + this.loc = loc; - this.boundWorkers = (options, cb) => { - try { - this.workers((0, _serializeJavascript.default)(options), cb); - } catch (error) { - // worker-farm can fail with ENOMEM or something else - cb(error); - } - }; - } else { - this.boundWorkers = (options, cb) => { - try { - cb(null, (0, _minify.default)(options)); - } catch (error) { - cb(error); - } - }; - } + Error.captureStackTrace(this, this.constructor); + } +} - let toRun = tasks.length; - const results = []; +module.exports = AsyncDependencyToInitialChunkError; - const step = (index, data) => { - toRun -= 1; - results[index] = data; - if (!toRun) { - callback(null, results); - } - }; +/***/ }), - tasks.forEach((task, index) => { - const enqueue = () => { - this.boundWorkers(task, (error, data) => { - const result = error ? { - error - } : data; +/***/ 51596: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - const done = () => step(index, result); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (this.cacheDir && !result.error) { - _cacache.default.put(this.cacheDir, (0, _serializeJavascript.default)(task.cacheKeys), JSON.stringify(data)).then(done, done); - } else { - done(); - } - }); - }; - if (this.cacheDir) { - _cacache.default.get(this.cacheDir, (0, _serializeJavascript.default)(task.cacheKeys)).then(({ - data - }) => step(index, JSON.parse(data)), enqueue); - } else { - enqueue(); - } - }); - } +const asyncLib = __webpack_require__(36386); +const PrefetchDependency = __webpack_require__(14237); +const NormalModule = __webpack_require__(25963); - exit() { - if (this.workers) { - _workerFarm.default.end(this.workers); - } - } +/** @typedef {import("./Compiler")} Compiler */ +class AutomaticPrefetchPlugin { + /** + * Apply the plugin + * @param {Compiler} compiler Webpack Compiler + * @returns {void} + */ + apply(compiler) { + compiler.hooks.compilation.tap( + "AutomaticPrefetchPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set( + PrefetchDependency, + normalModuleFactory + ); + } + ); + let lastModules = null; + compiler.hooks.afterCompile.tap("AutomaticPrefetchPlugin", compilation => { + lastModules = compilation.modules + .filter(m => m instanceof NormalModule) + .map((/** @type {NormalModule} */ m) => ({ + context: m.context, + request: m.request + })); + }); + compiler.hooks.make.tapAsync( + "AutomaticPrefetchPlugin", + (compilation, callback) => { + if (!lastModules) return callback(); + asyncLib.forEach( + lastModules, + (m, callback) => { + compilation.prefetch( + m.context || compiler.context, + new PrefetchDependency(m.request), + callback + ); + }, + callback + ); + } + ); + } } +module.exports = AutomaticPrefetchPlugin; -exports.default = TaskRunner; /***/ }), -/***/ 89301: +/***/ 4009: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ -const plugin = __webpack_require__(43884); - -module.exports = plugin.default; -/***/ }), +const { ConcatSource } = __webpack_require__(53665); +const ModuleFilenameHelpers = __webpack_require__(71474); +const Template = __webpack_require__(96066); -/***/ 43884: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(10171); -"use strict"; +/** @typedef {import("../declarations/plugins/BannerPlugin").BannerPluginArgument} BannerPluginArgument */ +/** @typedef {import("../declarations/plugins/BannerPlugin").BannerPluginOptions} BannerPluginOptions */ +const wrapComment = str => { + if (!str.includes("\n")) { + return Template.toComment(str); + } + return `/*!\n * ${str + .replace(/\*\//g, "* /") + .split("\n") + .join("\n * ")}\n */`; +}; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.default = void 0; +class BannerPlugin { + /** + * @param {BannerPluginArgument} options options object + */ + constructor(options) { + if (arguments.length > 1) { + throw new Error( + "BannerPlugin only takes one argument (pass an options object)" + ); + } -var _crypto = _interopRequireDefault(__webpack_require__(76417)); + validateOptions(schema, options, "Banner Plugin"); -var _path = _interopRequireDefault(__webpack_require__(85622)); + if (typeof options === "string" || typeof options === "function") { + options = { + banner: options + }; + } -var _sourceMap = __webpack_require__(96241); + /** @type {BannerPluginOptions} */ + this.options = options; -var _webpackSources = __webpack_require__(53665); + const bannerOption = options.banner; + if (typeof bannerOption === "function") { + const getBanner = bannerOption; + this.banner = this.options.raw + ? getBanner + : data => wrapComment(getBanner(data)); + } else { + const banner = this.options.raw + ? bannerOption + : wrapComment(bannerOption); + this.banner = () => banner; + } + } -var _RequestShortener = _interopRequireDefault(__webpack_require__(54254)); + apply(compiler) { + const options = this.options; + const banner = this.banner; + const matchObject = ModuleFilenameHelpers.matchObject.bind( + undefined, + options + ); -var _ModuleFilenameHelpers = _interopRequireDefault(__webpack_require__(71474)); + compiler.hooks.compilation.tap("BannerPlugin", compilation => { + compilation.hooks.optimizeChunkAssets.tap("BannerPlugin", chunks => { + for (const chunk of chunks) { + if (options.entryOnly && !chunk.canBeInitial()) { + continue; + } -var _schemaUtils = _interopRequireDefault(__webpack_require__(33225)); + for (const file of chunk.files) { + if (!matchObject(file)) { + continue; + } -var _serializeJavascript = _interopRequireDefault(__webpack_require__(85841)); + let query = ""; + let filename = file; + const hash = compilation.hash; + const querySplit = filename.indexOf("?"); -var _package = _interopRequireDefault(__webpack_require__(92203)); + if (querySplit >= 0) { + query = filename.substr(querySplit); + filename = filename.substr(0, querySplit); + } -var _options = _interopRequireDefault(__webpack_require__(11840)); + const lastSlashIndex = filename.lastIndexOf("/"); -var _TaskRunner = _interopRequireDefault(__webpack_require__(16326)); + const basename = + lastSlashIndex === -1 + ? filename + : filename.substr(lastSlashIndex + 1); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + const data = { + hash, + chunk, + filename, + basename, + query + }; -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + const comment = compilation.getPath(banner(data), data); -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + compilation.updateAsset( + file, + old => new ConcatSource(comment, "\n", old) + ); + } + } + }); + }); + } +} -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +module.exports = BannerPlugin; -const warningRegex = /\[.+:([0-9]+),([0-9]+)\]/; -class TerserPlugin { - constructor(options = {}) { - (0, _schemaUtils.default)(_options.default, options, 'Terser Plugin'); - const { - minify, - terserOptions = {}, - test = /\.m?js(\?.*)?$/i, - chunkFilter = () => true, - warningsFilter = () => true, - extractComments = false, - sourceMap = false, - cache = false, - cacheKeys = defaultCacheKeys => defaultCacheKeys, - parallel = false, - include, - exclude - } = options; - this.options = { - test, - chunkFilter, - warningsFilter, - extractComments, - sourceMap, - cache, - cacheKeys, - parallel, - include, - exclude, - minify, - terserOptions: _objectSpread({ - output: { - comments: extractComments ? false : /^\**!|@preserve|@license|@cc_on/i - } - }, terserOptions) - }; - } +/***/ }), - static isSourceMap(input) { - // All required options for `new SourceMapConsumer(...options)` - // https://github.com/mozilla/source-map#new-sourcemapconsumerrawsourcemap - return Boolean(input && input.version && input.sources && Array.isArray(input.sources) && typeof input.mappings === 'string'); - } +/***/ 96770: +/***/ (function(module) { - static buildSourceMap(inputSourceMap) { - if (!inputSourceMap || !TerserPlugin.isSourceMap(inputSourceMap)) { - return null; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - return new _sourceMap.SourceMapConsumer(inputSourceMap); - } - static buildError(err, file, sourceMap, requestShortener) { - // Handling error which should have line, col, filename and message - if (err.line) { - const original = sourceMap && sourceMap.originalPositionFor({ - line: err.line, - column: err.col - }); - if (original && original.source && requestShortener) { - return new Error(`${file} from Terser\n${err.message} [${requestShortener.shorten(original.source)}:${original.line},${original.column}][${file}:${err.line},${err.col}]`); - } +const TypeUnknown = 0; +const TypeNull = 1; +const TypeString = 2; +const TypeNumber = 3; +const TypeBoolean = 4; +const TypeRegExp = 5; +const TypeConditional = 6; +const TypeArray = 7; +const TypeConstArray = 8; +const TypeIdentifier = 9; +const TypeWrapped = 10; +const TypeTemplateString = 11; - return new Error(`${file} from Terser\n${err.message} [${file}:${err.line},${err.col}]`); - } else if (err.stack) { - return new Error(`${file} from Terser\n${err.stack}`); - } +class BasicEvaluatedExpression { + constructor() { + this.type = TypeUnknown; + this.range = null; + this.falsy = false; + this.truthy = false; + this.bool = null; + this.number = null; + this.regExp = null; + this.string = null; + this.quasis = null; + this.parts = null; + this.array = null; + this.items = null; + this.options = null; + this.prefix = null; + this.postfix = null; + this.wrappedInnerExpressions = null; + this.expression = null; + } - return new Error(`${file} from Terser\n${err.message}`); - } + isNull() { + return this.type === TypeNull; + } - static buildWarning(warning, file, sourceMap, requestShortener, warningsFilter) { - let warningMessage = warning; - let locationMessage = ''; - let source = null; + isString() { + return this.type === TypeString; + } - if (sourceMap) { - const match = warningRegex.exec(warning); + isNumber() { + return this.type === TypeNumber; + } - if (match) { - const line = +match[1]; - const column = +match[2]; - const original = sourceMap.originalPositionFor({ - line, - column - }); + isBoolean() { + return this.type === TypeBoolean; + } - if (original && original.source && original.source !== file && requestShortener) { - ({ - source - } = original); - warningMessage = `${warningMessage.replace(warningRegex, '')}`; - locationMessage = `[${requestShortener.shorten(original.source)}:${original.line},${original.column}]`; - } - } - } + isRegExp() { + return this.type === TypeRegExp; + } - if (warningsFilter && !warningsFilter(warning, source)) { - return null; - } + isConditional() { + return this.type === TypeConditional; + } - return `Terser Plugin: ${warningMessage}${locationMessage}`; - } + isArray() { + return this.type === TypeArray; + } - apply(compiler) { - const buildModuleFn = moduleArg => { - // to get detailed location info about errors - moduleArg.useSourceMap = true; - }; + isConstArray() { + return this.type === TypeConstArray; + } - const optimizeFn = (compilation, chunks, callback) => { - const taskRunner = new _TaskRunner.default({ - cache: this.options.cache, - parallel: this.options.parallel - }); - const processedAssets = new WeakSet(); - const tasks = []; - const { - chunkFilter - } = this.options; - Array.from(chunks).filter(chunk => chunkFilter && chunkFilter(chunk)).reduce((acc, chunk) => acc.concat(chunk.files || []), []).concat(compilation.additionalChunkAssets || []).filter(_ModuleFilenameHelpers.default.matchObject.bind(null, this.options)).forEach(file => { - let inputSourceMap; - const asset = compilation.assets[file]; + isIdentifier() { + return this.type === TypeIdentifier; + } - if (processedAssets.has(asset)) { - return; - } + isWrapped() { + return this.type === TypeWrapped; + } - try { - let input; + isTemplateString() { + return this.type === TypeTemplateString; + } - if (this.options.sourceMap && asset.sourceAndMap) { - const { - source, - map - } = asset.sourceAndMap(); - input = source; + isTruthy() { + return this.truthy; + } - if (TerserPlugin.isSourceMap(map)) { - inputSourceMap = map; - } else { - inputSourceMap = map; - compilation.warnings.push(new Error(`${file} contains invalid source map`)); - } - } else { - input = asset.source(); - inputSourceMap = null; - } // Handling comment extraction + isFalsy() { + return this.falsy; + } + asBool() { + if (this.truthy) return true; + if (this.falsy) return false; + if (this.isBoolean()) return this.bool; + if (this.isNull()) return false; + if (this.isString()) return this.string !== ""; + if (this.isNumber()) return this.number !== 0; + if (this.isRegExp()) return true; + if (this.isArray()) return true; + if (this.isConstArray()) return true; + if (this.isWrapped()) { + return (this.prefix && this.prefix.asBool()) || + (this.postfix && this.postfix.asBool()) + ? true + : undefined; + } + if (this.isTemplateString()) { + const str = this.asString(); + if (typeof str === "string") return str !== ""; + } + return undefined; + } - let commentsFile = false; + asString() { + if (this.isBoolean()) return `${this.bool}`; + if (this.isNull()) return "null"; + if (this.isString()) return this.string; + if (this.isNumber()) return `${this.number}`; + if (this.isRegExp()) return `${this.regExp}`; + if (this.isArray()) { + let array = []; + for (const item of this.items) { + const itemStr = item.asString(); + if (itemStr === undefined) return undefined; + array.push(itemStr); + } + return `${array}`; + } + if (this.isConstArray()) return `${this.array}`; + if (this.isTemplateString()) { + let str = ""; + for (const part of this.parts) { + const partStr = part.asString(); + if (partStr === undefined) return undefined; + str += partStr; + } + return str; + } + return undefined; + } - if (this.options.extractComments) { - commentsFile = this.options.extractComments.filename || `${file}.LICENSE`; + setString(string) { + this.type = TypeString; + this.string = string; + return this; + } - if (typeof commentsFile === 'function') { - commentsFile = commentsFile(file); - } - } + setNull() { + this.type = TypeNull; + return this; + } - const task = { - file, - input, - inputSourceMap, - commentsFile, - extractComments: this.options.extractComments, - terserOptions: this.options.terserOptions, - minify: this.options.minify - }; + setNumber(number) { + this.type = TypeNumber; + this.number = number; + return this; + } - if (this.options.cache) { - const defaultCacheKeys = { - terser: _package.default.version, - node_version: process.version, - // eslint-disable-next-line global-require - 'terser-webpack-plugin': __webpack_require__(9122)/* .version */ .i8, - 'terser-webpack-plugin-options': this.options, - hash: _crypto.default.createHash('md4').update(input).digest('hex') - }; - task.cacheKeys = this.options.cacheKeys(defaultCacheKeys, file); - } + setBoolean(bool) { + this.type = TypeBoolean; + this.bool = bool; + return this; + } - tasks.push(task); - } catch (error) { - compilation.errors.push(TerserPlugin.buildError(error, file, TerserPlugin.buildSourceMap(inputSourceMap), new _RequestShortener.default(compiler.context))); - } - }); - taskRunner.run(tasks, (tasksError, results) => { - if (tasksError) { - compilation.errors.push(tasksError); - return; - } + setRegExp(regExp) { + this.type = TypeRegExp; + this.regExp = regExp; + return this; + } - results.forEach((data, index) => { - const { - file, - input, - inputSourceMap, - commentsFile - } = tasks[index]; - const { - error, - map, - code, - warnings - } = data; - let { - extractedComments - } = data; - let sourceMap = null; + setIdentifier(identifier) { + this.type = TypeIdentifier; + this.identifier = identifier; + return this; + } - if (error || warnings && warnings.length > 0) { - sourceMap = TerserPlugin.buildSourceMap(inputSourceMap); - } // Handling results - // Error case: add errors, and go to next file + setWrapped(prefix, postfix, innerExpressions) { + this.type = TypeWrapped; + this.prefix = prefix; + this.postfix = postfix; + this.wrappedInnerExpressions = innerExpressions; + return this; + } + setOptions(options) { + this.type = TypeConditional; + this.options = options; + return this; + } - if (error) { - compilation.errors.push(TerserPlugin.buildError(error, file, sourceMap, new _RequestShortener.default(compiler.context))); - return; - } + addOptions(options) { + if (!this.options) { + this.type = TypeConditional; + this.options = []; + } + for (const item of options) { + this.options.push(item); + } + return this; + } - let outputSource; + setItems(items) { + this.type = TypeArray; + this.items = items; + return this; + } - if (map) { - outputSource = new _webpackSources.SourceMapSource(code, file, JSON.parse(map), input, inputSourceMap, true); - } else { - outputSource = new _webpackSources.RawSource(code); - } // Write extracted comments to commentsFile + setArray(array) { + this.type = TypeConstArray; + this.array = array; + return this; + } + setTemplateString(quasis, parts, kind) { + this.type = TypeTemplateString; + this.quasis = quasis; + this.parts = parts; + this.templateStringKind = kind; + return this; + } - if (commentsFile && extractedComments && extractedComments.length > 0) { - if (commentsFile in compilation.assets) { - const commentsFileSource = compilation.assets[commentsFile].source(); - extractedComments = extractedComments.filter(comment => !commentsFileSource.includes(comment)); - } + setTruthy() { + this.falsy = false; + this.truthy = true; + return this; + } - if (extractedComments.length > 0) { - // Add a banner to the original file - if (this.options.extractComments.banner !== false) { - let banner = this.options.extractComments.banner || `For license information please see ${_path.default.posix.basename(commentsFile)}`; + setFalsy() { + this.falsy = true; + this.truthy = false; + return this; + } - if (typeof banner === 'function') { - banner = banner(commentsFile); - } + setRange(range) { + this.range = range; + return this; + } - if (banner) { - outputSource = new _webpackSources.ConcatSource(`/*! ${banner} */\n`, outputSource); - } - } + setExpression(expression) { + this.expression = expression; + return this; + } +} - const commentsSource = new _webpackSources.RawSource(`${extractedComments.join('\n\n')}\n`); - - if (commentsFile in compilation.assets) { - // commentsFile already exists, append new comments... - if (compilation.assets[commentsFile] instanceof _webpackSources.ConcatSource) { - compilation.assets[commentsFile].add('\n'); - compilation.assets[commentsFile].add(commentsSource); - } else { - compilation.assets[commentsFile] = new _webpackSources.ConcatSource(compilation.assets[commentsFile], '\n', commentsSource); - } - } else { - compilation.assets[commentsFile] = commentsSource; - } - } - } // Updating assets - - - processedAssets.add(compilation.assets[file] = outputSource); // Handling warnings - - if (warnings && warnings.length > 0) { - warnings.forEach(warning => { - const builtWarning = TerserPlugin.buildWarning(warning, file, sourceMap, new _RequestShortener.default(compiler.context), this.options.warningsFilter); - - if (builtWarning) { - compilation.warnings.push(builtWarning); - } - }); - } - }); - taskRunner.exit(); - callback(); - }); - }; - - const plugin = { - name: this.constructor.name - }; - compiler.hooks.compilation.tap(plugin, compilation => { - if (this.options.sourceMap) { - compilation.hooks.buildModule.tap(plugin, buildModuleFn); - } - - const { - mainTemplate, - chunkTemplate - } = compilation; // Regenerate `contenthash` for minified assets - - for (const template of [mainTemplate, chunkTemplate]) { - template.hooks.hashForChunk.tap(plugin, hash => { - const data = (0, _serializeJavascript.default)({ - terser: _package.default.version, - terserOptions: this.options.terserOptions - }); - hash.update('TerserPlugin'); - hash.update(data); - }); - } - - compilation.hooks.optimizeChunkAssets.tapAsync(plugin, optimizeFn.bind(this, compilation)); - }); - } - -} +module.exports = BasicEvaluatedExpression; -var _default = TerserPlugin; -exports.default = _default; /***/ }), -/***/ 30787: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ 6465: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.default = void 0; - -var _terser = __webpack_require__(54775); - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -const buildTerserOptions = ({ - ecma, - warnings, - parse = {}, - compress = {}, - mangle, - module, - output, - toplevel, - nameCache, - ie8, - - /* eslint-disable camelcase */ - keep_classnames, - keep_fnames, - - /* eslint-enable camelcase */ - safari10 -} = {}) => ({ - ecma, - warnings, - parse: _objectSpread({}, parse), - compress: typeof compress === 'boolean' ? compress : _objectSpread({}, compress), - // eslint-disable-next-line no-nested-ternary - mangle: mangle == null ? true : typeof mangle === 'boolean' ? mangle : _objectSpread({}, mangle), - output: _objectSpread({ - shebang: true, - comments: false, - beautify: false, - semicolons: true - }, output), - module, - // Ignoring sourceMap from options - sourceMap: null, - toplevel, - nameCache, - ie8, - keep_classnames, - keep_fnames, - safari10 -}); - -const buildComments = (options, terserOptions, extractedComments) => { - const condition = {}; - const commentsOpts = terserOptions.output.comments; // Use /^\**!|@preserve|@license|@cc_on/i RegExp - - if (typeof options.extractComments === 'boolean') { - condition.preserve = commentsOpts; - condition.extract = /^\**!|@preserve|@license|@cc_on/i; - } else if (typeof options.extractComments === 'string' || options.extractComments instanceof RegExp) { - // extractComments specifies the extract condition and commentsOpts specifies the preserve condition - condition.preserve = commentsOpts; - condition.extract = options.extractComments; - } else if (typeof options.extractComments === 'function') { - condition.preserve = commentsOpts; - condition.extract = options.extractComments; - } else if (Object.prototype.hasOwnProperty.call(options.extractComments, 'condition')) { - // Extract condition is given in extractComments.condition - condition.preserve = commentsOpts; - condition.extract = options.extractComments.condition; - } else { - // No extract condition is given. Extract comments that match commentsOpts instead of preserving them - condition.preserve = false; - condition.extract = commentsOpts; - } // Ensure that both conditions are functions - +const asyncLib = __webpack_require__(36386); - ['preserve', 'extract'].forEach(key => { - let regexStr; - let regex; +class CachePlugin { + constructor(cache) { + this.cache = cache || {}; + this.FS_ACCURACY = 2000; + } - switch (typeof condition[key]) { - case 'boolean': - condition[key] = condition[key] ? () => true : () => false; - break; + apply(compiler) { + if (Array.isArray(compiler.compilers)) { + compiler.compilers.forEach((c, idx) => { + new CachePlugin((this.cache[idx] = this.cache[idx] || {})).apply(c); + }); + } else { + const registerCacheToCompiler = (compiler, cache) => { + compiler.hooks.thisCompilation.tap("CachePlugin", compilation => { + compilation.cache = cache; + compilation.hooks.childCompiler.tap( + "CachePlugin", + (childCompiler, compilerName, compilerIndex) => { + let childCache; + if (!cache.children) { + cache.children = {}; + } + if (!cache.children[compilerName]) { + cache.children[compilerName] = []; + } + if (cache.children[compilerName][compilerIndex]) { + childCache = cache.children[compilerName][compilerIndex]; + } else { + cache.children[compilerName].push((childCache = {})); + } + registerCacheToCompiler(childCompiler, childCache); + } + ); + }); + }; + registerCacheToCompiler(compiler, this.cache); + compiler.hooks.watchRun.tap("CachePlugin", () => { + this.watching = true; + }); + compiler.hooks.run.tapAsync("CachePlugin", (compiler, callback) => { + if (!compiler._lastCompilationFileDependencies) { + return callback(); + } + const fs = compiler.inputFileSystem; + const fileTs = (compiler.fileTimestamps = new Map()); + asyncLib.forEach( + compiler._lastCompilationFileDependencies, + (file, callback) => { + fs.stat(file, (err, stat) => { + if (err) { + if (err.code === "ENOENT") return callback(); + return callback(err); + } - case 'function': - break; + if (stat.mtime) this.applyMtime(+stat.mtime); - case 'string': - if (condition[key] === 'all') { - condition[key] = () => true; + fileTs.set(file, +stat.mtime || Infinity); - break; - } + callback(); + }); + }, + err => { + if (err) return callback(err); - if (condition[key] === 'some') { - condition[key] = (astNode, comment) => { - return comment.type === 'comment2' && /^\**!|@preserve|@license|@cc_on/i.test(comment.value); - }; + for (const [file, ts] of fileTs) { + fileTs.set(file, ts + this.FS_ACCURACY); + } - break; - } + callback(); + } + ); + }); + compiler.hooks.afterCompile.tap("CachePlugin", compilation => { + compilation.compiler._lastCompilationFileDependencies = + compilation.fileDependencies; + compilation.compiler._lastCompilationContextDependencies = + compilation.contextDependencies; + }); + } + } - regexStr = condition[key]; + /* istanbul ignore next */ + applyMtime(mtime) { + if (this.FS_ACCURACY > 1 && mtime % 2 !== 0) this.FS_ACCURACY = 1; + else if (this.FS_ACCURACY > 10 && mtime % 20 !== 0) this.FS_ACCURACY = 10; + else if (this.FS_ACCURACY > 100 && mtime % 200 !== 0) + this.FS_ACCURACY = 100; + else if (this.FS_ACCURACY > 1000 && mtime % 2000 !== 0) + this.FS_ACCURACY = 1000; + } +} +module.exports = CachePlugin; - condition[key] = (astNode, comment) => { - return new RegExp(regexStr).test(comment.value); - }; - break; +/***/ }), - default: - regex = condition[key]; +/***/ 8335: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - condition[key] = (astNode, comment) => regex.test(comment.value); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - } - }); // Redefine the comments function to extract and preserve - // comments according to the two conditions - return (astNode, comment) => { - if (condition.extract(astNode, comment)) { - const commentText = comment.type === 'comment2' ? `/*${comment.value}*/` : `//${comment.value}`; // Don't include duplicate comments +const WebpackError = __webpack_require__(97391); - if (!extractedComments.includes(commentText)) { - extractedComments.push(commentText); - } - } +/** @typedef {import("./Module")} Module */ - return condition.preserve(astNode, comment); - }; +/** + * @param {Module[]} modules the modules to be sorted + * @returns {Module[]} sorted version of original modules + */ +const sortModules = modules => { + return modules.slice().sort((a, b) => { + const aIdent = a.identifier(); + const bIdent = b.identifier(); + /* istanbul ignore next */ + if (aIdent < bIdent) return -1; + /* istanbul ignore next */ + if (aIdent > bIdent) return 1; + /* istanbul ignore next */ + return 0; + }); }; -const minify = options => { - const { - file, - input, - inputSourceMap, - extractComments, - minify: minifyFn - } = options; - - if (minifyFn) { - return minifyFn({ - [file]: input - }, inputSourceMap); - } // Copy terser options - +/** + * @param {Module[]} modules each module from throw + * @returns {string} each message from provided moduels + */ +const createModulesListMessage = modules => { + return modules + .map(m => { + let message = `* ${m.identifier()}`; + const validReasons = m.reasons.filter(reason => reason.module); - const terserOptions = buildTerserOptions(options.terserOptions); // Let terser generate a SourceMap + if (validReasons.length > 0) { + message += `\n Used by ${validReasons.length} module(s), i. e.`; + message += `\n ${validReasons[0].module.identifier()}`; + } + return message; + }) + .join("\n"); +}; - if (inputSourceMap) { - terserOptions.sourceMap = true; - } +class CaseSensitiveModulesWarning extends WebpackError { + /** + * Creates an instance of CaseSensitiveModulesWarning. + * @param {Module[]} modules modules that were detected + */ + constructor(modules) { + const sortedModules = sortModules(modules); + const modulesList = createModulesListMessage(sortedModules); + super(`There are multiple modules with names that only differ in casing. +This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. +Use equal casing. Compare these module identifiers: +${modulesList}`); - const extractedComments = []; + this.name = "CaseSensitiveModulesWarning"; + this.origin = this.module = sortedModules[0]; - if (extractComments) { - terserOptions.output.comments = buildComments(options, terserOptions, extractedComments); - } + Error.captureStackTrace(this, this.constructor); + } +} - const { - error, - map, - code, - warnings - } = (0, _terser.minify)({ - [file]: input - }, terserOptions); - return { - error, - map, - code, - warnings, - extractedComments - }; -}; +module.exports = CaseSensitiveModulesWarning; -var _default = minify; -exports.default = _default; /***/ }), -/***/ 71708: +/***/ 2919: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/*! - * to-object-path - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -var typeOf = __webpack_require__(48865); - -module.exports = function toPath(args) { - if (typeOf(args) !== 'arguments') { - args = arguments; - } - return filter(args).join('.'); -}; - -function filter(arr) { - var len = arr.length; - var idx = -1; - var res = []; +/* +MIT License http://www.opensource.org/licenses/mit-license.php +Author Tobias Koppers @sokra +*/ - while (++idx < len) { - var ele = arr[idx]; - if (typeOf(ele) === 'arguments' || Array.isArray(ele)) { - res.push.apply(res, filter(ele)); - } else if (typeof ele === 'string') { - res.push(ele); - } - } - return res; -} +const util = __webpack_require__(31669); +const SortableSet = __webpack_require__(50071); +const intersect = __webpack_require__(54262).intersect; +const GraphHelpers = __webpack_require__(32973); +const Entrypoint = __webpack_require__(71931); +let debugId = 1000; +const ERR_CHUNK_ENTRY = "Chunk.entry was removed. Use hasRuntime()"; +const ERR_CHUNK_INITIAL = + "Chunk.initial was removed. Use canBeInitial/isOnlyInitial()"; -/***/ }), +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./ChunkGroup")} ChunkGroup */ +/** @typedef {import("./ModuleReason")} ModuleReason */ +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("./util/createHash").Hash} Hash */ -/***/ 51279: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/** + * @typedef {Object} WithId an object who has an id property * + * @property {string | number} id the id of the object + */ -"use strict"; +/** + * Compare two Modules based on their ids for sorting + * @param {Module} a module + * @param {Module} b module + * @returns {-1|0|1} sort value + */ +// TODO use @callback +/** @typedef {(a: Module, b: Module) => -1|0|1} ModuleSortPredicate */ +/** @typedef {(m: Module) => boolean} ModuleFilterPredicate */ +/** @typedef {(c: Chunk) => boolean} ChunkFilterPredicate */ -var safe = __webpack_require__(71217); -var define = __webpack_require__(74998); -var extend = __webpack_require__(99793); -var not = __webpack_require__(30931); -var MAX_LENGTH = 1024 * 64; +const sortModuleById = (a, b) => { + if (a.id < b.id) return -1; + if (b.id < a.id) return 1; + return 0; +}; /** - * Session cache + * Compare two ChunkGroups based on their ids for sorting + * @param {ChunkGroup} a chunk group + * @param {ChunkGroup} b chunk group + * @returns {-1|0|1} sort value */ - -var cache = {}; +const sortChunkGroupById = (a, b) => { + if (a.id < b.id) return -1; + if (b.id < a.id) return 1; + return 0; +}; /** - * Create a regular expression from the given `pattern` string. - * - * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. - * @param {Object} `options` - * @return {RegExp} - * @api public + * Compare two Identifiables , based on their ids for sorting + * @param {Module} a first object with ident fn + * @param {Module} b second object with ident fn + * @returns {-1|0|1} The order number of the sort */ - -module.exports = function(patterns, options) { - if (!Array.isArray(patterns)) { - return makeRe(patterns, options); - } - return makeRe(patterns.join('|'), options); +const sortByIdentifier = (a, b) => { + if (a.identifier() > b.identifier()) return 1; + if (a.identifier() < b.identifier()) return -1; + return 0; }; /** - * Create a regular expression from the given `pattern` string. - * - * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. - * @param {Object} `options` - * @return {RegExp} - * @api public + * @returns {string} a concatenation of module identifiers sorted + * @param {SortableSet} set to pull module identifiers from */ - -function makeRe(pattern, options) { - if (pattern instanceof RegExp) { - return pattern; - } - - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - - if (pattern.length > MAX_LENGTH) { - throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); - } - - var key = pattern; - // do this before shallow cloning options, it's a lot faster - if (!options || (options && options.cache !== false)) { - key = createKey(pattern, options); - - if (cache.hasOwnProperty(key)) { - return cache[key]; - } - } - - var opts = extend({}, options); - if (opts.contains === true) { - if (opts.negate === true) { - opts.strictNegate = false; - } else { - opts.strict = false; - } - } - - if (opts.strict === false) { - opts.strictOpen = false; - opts.strictClose = false; - } - - var open = opts.strictOpen !== false ? '^' : ''; - var close = opts.strictClose !== false ? '$' : ''; - var flags = opts.flags || ''; - var regex; - - if (opts.nocase === true && !/i/.test(flags)) { - flags += 'i'; - } - - try { - if (opts.negate || typeof opts.strictNegate === 'boolean') { - pattern = not.create(pattern, opts); - } - - var str = open + '(?:' + pattern + ')' + close; - regex = new RegExp(str, flags); - - if (opts.safe === true && safe(regex) === false) { - throw new Error('potentially unsafe regular expression: ' + regex.source); - } - - } catch (err) { - if (opts.strictErrors === true || opts.safe === true) { - err.key = key; - err.pattern = pattern; - err.originalOptions = options; - err.createdOptions = opts; - throw err; - } - - try { - regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$'); - } catch (err) { - regex = /.^/; //<= match nothing - } - } - - if (opts.cache !== false) { - memoize(regex, key, pattern, opts); - } - return regex; -} +const getModulesIdent = set => { + set.sort(); + let str = ""; + for (const m of set) { + str += m.identifier() + "#"; + } + return str; +}; /** - * Memoize generated regex. This can result in dramatic speed improvements - * and simplify debugging by adding options and pattern to the regex. It can be - * disabled by passing setting `options.cache` to false. + * @template T + * @param {SortableSet} set the sortable set to convert to array + * @returns {Array} the array returned from Array.from(set) */ - -function memoize(regex, key, pattern, options) { - define(regex, 'cached', true); - define(regex, 'pattern', pattern); - define(regex, 'options', options); - define(regex, 'key', key); - cache[key] = regex; -} +const getArray = set => Array.from(set); /** - * Create the key to use for memoization. The key is generated - * by iterating over the options and concatenating key-value pairs - * to the pattern string. + * @param {SortableSet} set the sortable Set to get the count/size of + * @returns {number} the size of the modules */ - -function createKey(pattern, options) { - if (!options) return pattern; - var key = pattern; - for (var prop in options) { - if (options.hasOwnProperty(prop)) { - key += ';' + prop + '=' + String(options[prop]); - } - } - return key; -} +const getModulesSize = set => { + let size = 0; + for (const module of set) { + size += module.size(); + } + return size; +}; /** - * Expose `makeRe` + * A Chunk is a unit of encapsulation for Modules. + * Chunks are "rendered" into bundles that get emitted when the build completes. */ +class Chunk { + /** + * @param {string=} name of chunk being created, is optional (for subclasses) + */ + constructor(name) { + /** @type {number | null} */ + this.id = null; + /** @type {number[] | null} */ + this.ids = null; + /** @type {number} */ + this.debugId = debugId++; + /** @type {string} */ + this.name = name; + /** @type {boolean} */ + this.preventIntegration = false; + /** @type {Module=} */ + this.entryModule = undefined; + /** @private @type {SortableSet} */ + this._modules = new SortableSet(undefined, sortByIdentifier); + /** @type {string?} */ + this.filenameTemplate = undefined; + /** @private @type {SortableSet} */ + this._groups = new SortableSet(undefined, sortChunkGroupById); + /** @type {string[]} */ + this.files = []; + /** @type {boolean} */ + this.rendered = false; + /** @type {string=} */ + this.hash = undefined; + /** @type {Object} */ + this.contentHash = Object.create(null); + /** @type {string=} */ + this.renderedHash = undefined; + /** @type {string=} */ + this.chunkReason = undefined; + /** @type {boolean} */ + this.extraAsync = false; + this.removedModules = undefined; + } -module.exports.makeRe = makeRe; + /** + * @deprecated Chunk.entry has been deprecated. Please use .hasRuntime() instead + * @returns {never} Throws an error trying to access this property + */ + get entry() { + throw new Error(ERR_CHUNK_ENTRY); + } + /** + * @deprecated .entry has been deprecated. Please use .hasRuntime() instead + * @param {never} data The data that was attempting to be set + * @returns {never} Throws an error trying to access this property + */ + set entry(data) { + throw new Error(ERR_CHUNK_ENTRY); + } -/***/ }), + /** + * @deprecated Chunk.initial was removed. Use canBeInitial/isOnlyInitial() + * @returns {never} Throws an error trying to access this property + */ + get initial() { + throw new Error(ERR_CHUNK_INITIAL); + } -/***/ 74998: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** + * @deprecated Chunk.initial was removed. Use canBeInitial/isOnlyInitial() + * @param {never} data The data attempting to be set + * @returns {never} Throws an error trying to access this property + */ + set initial(data) { + throw new Error(ERR_CHUNK_INITIAL); + } -"use strict"; -/*! - * define-property - * - * Copyright (c) 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ + /** + * @returns {boolean} whether or not the Chunk will have a runtime + */ + hasRuntime() { + for (const chunkGroup of this._groups) { + if ( + chunkGroup.isInitial() && + chunkGroup instanceof Entrypoint && + chunkGroup.getRuntimeChunk() === this + ) { + return true; + } + } + return false; + } + /** + * @returns {boolean} whether or not this chunk can be an initial chunk + */ + canBeInitial() { + for (const chunkGroup of this._groups) { + if (chunkGroup.isInitial()) return true; + } + return false; + } + /** + * @returns {boolean} whether this chunk can only be an initial chunk + */ + isOnlyInitial() { + if (this._groups.size <= 0) return false; + for (const chunkGroup of this._groups) { + if (!chunkGroup.isInitial()) return false; + } + return true; + } -var isobject = __webpack_require__(96667); -var isDescriptor = __webpack_require__(44133); -var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) - ? Reflect.defineProperty - : Object.defineProperty; + /** + * @returns {boolean} if this chunk contains the entry module + */ + hasEntryModule() { + return !!this.entryModule; + } -module.exports = function defineProperty(obj, key, val) { - if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) { - throw new TypeError('expected an object, function, or array'); - } + /** + * @param {Module} module the module that will be added to this chunk. + * @returns {boolean} returns true if the chunk doesn't have the module and it was added + */ + addModule(module) { + if (!this._modules.has(module)) { + this._modules.add(module); + return true; + } + return false; + } - if (typeof key !== 'string') { - throw new TypeError('expected "key" to be a string'); - } + /** + * @param {Module} module the module that will be removed from this chunk + * @returns {boolean} returns true if chunk exists and is successfully deleted + */ + removeModule(module) { + if (this._modules.delete(module)) { + module.removeChunk(this); + return true; + } + return false; + } - if (isDescriptor(val)) { - define(obj, key, val); - return obj; - } + /** + * @param {Module[]} modules the new modules to be set + * @returns {void} set new modules to this chunk and return nothing + */ + setModules(modules) { + this._modules = new SortableSet(modules, sortByIdentifier); + } - define(obj, key, { - configurable: true, - enumerable: false, - writable: true, - value: val - }); + /** + * @returns {number} the amount of modules in chunk + */ + getNumberOfModules() { + return this._modules.size; + } - return obj; -}; + /** + * @returns {SortableSet} return the modules SortableSet for this chunk + */ + get modulesIterable() { + return this._modules; + } + /** + * @param {ChunkGroup} chunkGroup the chunkGroup the chunk is being added + * @returns {boolean} returns true if chunk is not apart of chunkGroup and is added successfully + */ + addGroup(chunkGroup) { + if (this._groups.has(chunkGroup)) return false; + this._groups.add(chunkGroup); + return true; + } -/***/ }), + /** + * @param {ChunkGroup} chunkGroup the chunkGroup the chunk is being removed from + * @returns {boolean} returns true if chunk does exist in chunkGroup and is removed + */ + removeGroup(chunkGroup) { + if (!this._groups.has(chunkGroup)) return false; + this._groups.delete(chunkGroup); + return true; + } -/***/ 99793: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** + * @param {ChunkGroup} chunkGroup the chunkGroup to check + * @returns {boolean} returns true if chunk has chunkGroup reference and exists in chunkGroup + */ + isInGroup(chunkGroup) { + return this._groups.has(chunkGroup); + } -"use strict"; + /** + * @returns {number} the amount of groups said chunk is in + */ + getNumberOfGroups() { + return this._groups.size; + } + /** + * @returns {SortableSet} the chunkGroups that said chunk is referenced in + */ + get groupsIterable() { + return this._groups; + } -var isExtendable = __webpack_require__(78947); -var assignSymbols = __webpack_require__(64353); + /** + * @param {Chunk} otherChunk the chunk to compare itself with + * @returns {-1|0|1} this is a comparitor function like sort and returns -1, 0, or 1 based on sort order + */ + compareTo(otherChunk) { + if (this.name && !otherChunk.name) return -1; + if (!this.name && otherChunk.name) return 1; + if (this.name < otherChunk.name) return -1; + if (this.name > otherChunk.name) return 1; + if (this._modules.size > otherChunk._modules.size) return -1; + if (this._modules.size < otherChunk._modules.size) return 1; + this._modules.sort(); + otherChunk._modules.sort(); + const a = this._modules[Symbol.iterator](); + const b = otherChunk._modules[Symbol.iterator](); + // eslint-disable-next-line no-constant-condition + while (true) { + const aItem = a.next(); + if (aItem.done) return 0; + const bItem = b.next(); + const aModuleIdentifier = aItem.value.identifier(); + const bModuleIdentifier = bItem.value.identifier(); + if (aModuleIdentifier < bModuleIdentifier) return -1; + if (aModuleIdentifier > bModuleIdentifier) return 1; + } + } -module.exports = Object.assign || function(obj/*, objects*/) { - if (obj === null || typeof obj === 'undefined') { - throw new TypeError('Cannot convert undefined or null to object'); - } - if (!isObject(obj)) { - obj = {}; - } - for (var i = 1; i < arguments.length; i++) { - var val = arguments[i]; - if (isString(val)) { - val = toObject(val); - } - if (isObject(val)) { - assign(obj, val); - assignSymbols(obj, val); - } - } - return obj; -}; + /** + * @param {Module} module Module to check + * @returns {boolean} returns true if module does exist in this chunk + */ + containsModule(module) { + return this._modules.has(module); + } -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} + /** + * @returns {Module[]} an array of modules (do not modify) + */ + getModules() { + return this._modules.getFromCache(getArray); + } -function isString(val) { - return (val && typeof val === 'string'); -} + getModulesIdent() { + return this._modules.getFromUnorderedCache(getModulesIdent); + } -function toObject(str) { - var obj = {}; - for (var i in str) { - obj[i] = str[i]; - } - return obj; -} + /** + * @param {string=} reason reason why chunk is removed + * @returns {void} + */ + remove(reason) { + // cleanup modules + // Array.from is used here to create a clone, because removeChunk modifies this._modules + for (const module of Array.from(this._modules)) { + module.removeChunk(this); + } + for (const chunkGroup of this._groups) { + chunkGroup.removeChunk(this); + } + } -function isObject(val) { - return (val && typeof val === 'object') || isExtendable(val); -} + /** + * + * @param {Module} module module to move + * @param {Chunk} otherChunk other chunk to move it to + * @returns {void} + */ + moveModule(module, otherChunk) { + GraphHelpers.disconnectChunkAndModule(this, module); + GraphHelpers.connectChunkAndModule(otherChunk, module); + module.rewriteChunkInReasons(this, [otherChunk]); + } -/** - * Returns true if the given `key` is an own property of `obj`. - */ + /** + * + * @param {Chunk} otherChunk the chunk to integrate with + * @param {string} reason reason why the module is being integrated + * @returns {boolean} returns true or false if integration succeeds or fails + */ + integrate(otherChunk, reason) { + if (!this.canBeIntegrated(otherChunk)) { + return false; + } -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} + // Pick a new name for the integrated chunk + if (this.name && otherChunk.name) { + if (this.hasEntryModule() === otherChunk.hasEntryModule()) { + // When both chunks have entry modules or none have one, use + // shortest name + if (this.name.length !== otherChunk.name.length) { + this.name = + this.name.length < otherChunk.name.length + ? this.name + : otherChunk.name; + } else { + this.name = this.name < otherChunk.name ? this.name : otherChunk.name; + } + } else if (otherChunk.hasEntryModule()) { + // Pick the name of the chunk with the entry module + this.name = otherChunk.name; + } + } else if (otherChunk.name) { + this.name = otherChunk.name; + } -function isEnum(obj, key) { - return Object.prototype.propertyIsEnumerable.call(obj, key); -} + // Array.from is used here to create a clone, because moveModule modifies otherChunk._modules + for (const module of Array.from(otherChunk._modules)) { + otherChunk.moveModule(module, this); + } + otherChunk._modules.clear(); + if (otherChunk.entryModule) { + this.entryModule = otherChunk.entryModule; + } -/***/ }), + for (const chunkGroup of otherChunk._groups) { + chunkGroup.replaceChunk(otherChunk, this); + this.addGroup(chunkGroup); + } + otherChunk._groups.clear(); -/***/ 78947: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + return true; + } -"use strict"; -/*! - * is-extendable - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ + /** + * @param {Chunk} newChunk the new chunk that will be split out of the current chunk + * @returns {void} + */ + split(newChunk) { + for (const chunkGroup of this._groups) { + chunkGroup.insertChunk(newChunk, this); + newChunk.addGroup(chunkGroup); + } + } + isEmpty() { + return this._modules.size === 0; + } + updateHash(hash) { + hash.update(`${this.id} `); + hash.update(this.ids ? this.ids.join(",") : ""); + hash.update(`${this.name || ""} `); + for (const m of this._modules) { + hash.update(m.hash); + } + } -var isPlainObject = __webpack_require__(81064); + canBeIntegrated(otherChunk) { + if (this.preventIntegration || otherChunk.preventIntegration) { + return false; + } -module.exports = function isExtendable(val) { - return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); -}; + /** + * @param {Chunk} a chunk + * @param {Chunk} b chunk + * @returns {boolean} true, if a is always available when b is reached + */ + const isAvailable = (a, b) => { + const queue = new Set(b.groupsIterable); + for (const chunkGroup of queue) { + if (a.isInGroup(chunkGroup)) continue; + if (chunkGroup.isInitial()) return false; + for (const parent of chunkGroup.parentsIterable) { + queue.add(parent); + } + } + return true; + }; + const selfHasRuntime = this.hasRuntime(); + const otherChunkHasRuntime = otherChunk.hasRuntime(); -/***/ }), + if (selfHasRuntime !== otherChunkHasRuntime) { + if (selfHasRuntime) { + return isAvailable(this, otherChunk); + } else if (otherChunkHasRuntime) { + return isAvailable(otherChunk, this); + } else { + return false; + } + } -/***/ 29859: -/***/ (function(module) { + if (this.hasEntryModule() || otherChunk.hasEntryModule()) { + return false; + } -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - - __extends = function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function (m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - }; - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; - } - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); -}); + return true; + } + /** + * + * @param {number} size the size + * @param {Object} options the options passed in + * @returns {number} the multiplier returned + */ + addMultiplierAndOverhead(size, options) { + const overhead = + typeof options.chunkOverhead === "number" ? options.chunkOverhead : 10000; + const multiplicator = this.canBeInitial() + ? options.entryChunkMultiplicator || 10 + : 1; -/***/ }), + return size * multiplicator + overhead; + } -/***/ 7716: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** + * @returns {number} the size of all modules + */ + modulesSize() { + return this._modules.getFromUnorderedCache(getModulesSize); + } -"use strict"; + /** + * @param {Object} options the size display options + * @returns {number} the chunk size + */ + size(options = {}) { + return this.addMultiplierAndOverhead(this.modulesSize(), options); + } + /** + * @param {Chunk} otherChunk the other chunk + * @param {TODO} options the options for this function + * @returns {number | false} the size, or false if it can't be integrated + */ + integratedSize(otherChunk, options) { + // Chunk if it's possible to integrate this chunk + if (!this.canBeIntegrated(otherChunk)) { + return false; + } -var isObject = __webpack_require__(18493); -var union = __webpack_require__(69123); -var get = __webpack_require__(89304); -var set = __webpack_require__(34857); + let integratedModulesSize = this.modulesSize(); + // only count modules that do not exist in this chunk! + for (const otherModule of otherChunk._modules) { + if (!this._modules.has(otherModule)) { + integratedModulesSize += otherModule.size(); + } + } -module.exports = function unionValue(obj, prop, value) { - if (!isObject(obj)) { - throw new TypeError('union-value expects the first argument to be an object.'); - } + return this.addMultiplierAndOverhead(integratedModulesSize, options); + } - if (typeof prop !== 'string') { - throw new TypeError('union-value expects `prop` to be a string.'); - } + /** + * @param {function(Module, Module): -1|0|1=} sortByFn a predicate function used to sort modules + * @returns {void} + */ + sortModules(sortByFn) { + this._modules.sortWith(sortByFn || sortModuleById); + } - var arr = arrayify(get(obj, prop)); - set(obj, prop, union(arr, arrayify(value))); - return obj; -}; + sortItems() { + this.sortModules(); + } -function arrayify(val) { - if (val === null || typeof val === 'undefined') { - return []; - } - if (Array.isArray(val)) { - return val; - } - return [val]; -} + /** + * @returns {Set} a set of all the async chunks + */ + getAllAsyncChunks() { + const queue = new Set(); + const chunks = new Set(); + const initialChunks = intersect( + Array.from(this.groupsIterable, g => new Set(g.chunks)) + ); -/***/ }), + for (const chunkGroup of this.groupsIterable) { + for (const child of chunkGroup.childrenIterable) { + queue.add(child); + } + } -/***/ 5834: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + for (const chunkGroup of queue) { + for (const chunk of chunkGroup.chunks) { + if (!initialChunks.has(chunk)) { + chunks.add(chunk); + } + } + for (const child of chunkGroup.childrenIterable) { + queue.add(child); + } + } -"use strict"; -/*! - * unset-value - * - * Copyright (c) 2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ + return chunks; + } + /** + * @typedef {Object} ChunkMaps + * @property {Record} hash + * @property {Record>} contentHash + * @property {Record} name + */ + /** + * @param {boolean} realHash should the full hash or the rendered hash be used + * @returns {ChunkMaps} the chunk map information + */ + getChunkMaps(realHash) { + /** @type {Record} */ + const chunkHashMap = Object.create(null); + /** @type {Record>} */ + const chunkContentHashMap = Object.create(null); + /** @type {Record} */ + const chunkNameMap = Object.create(null); -var isObject = __webpack_require__(96667); -var has = __webpack_require__(77735); + for (const chunk of this.getAllAsyncChunks()) { + chunkHashMap[chunk.id] = realHash ? chunk.hash : chunk.renderedHash; + for (const key of Object.keys(chunk.contentHash)) { + if (!chunkContentHashMap[key]) { + chunkContentHashMap[key] = Object.create(null); + } + chunkContentHashMap[key][chunk.id] = chunk.contentHash[key]; + } + if (chunk.name) { + chunkNameMap[chunk.id] = chunk.name; + } + } -module.exports = function unset(obj, prop) { - if (!isObject(obj)) { - throw new TypeError('expected an object.'); - } - if (obj.hasOwnProperty(prop)) { - delete obj[prop]; - return true; - } + return { + hash: chunkHashMap, + contentHash: chunkContentHashMap, + name: chunkNameMap + }; + } - if (has(obj, prop)) { - var segs = prop.split('.'); - var last = segs.pop(); - while (segs.length && segs[segs.length - 1].slice(-1) === '\\') { - last = segs.pop().slice(0, -1) + '.' + last; - } - while (segs.length) obj = obj[prop = segs.shift()]; - return (delete obj[last]); - } - return true; -}; + /** + * @returns {Record[]>} a record object of names to lists of child ids(?) + */ + getChildIdsByOrders() { + const lists = new Map(); + for (const group of this.groupsIterable) { + if (group.chunks[group.chunks.length - 1] === this) { + for (const childGroup of group.childrenIterable) { + // TODO webpack 5 remove this check for options + if (typeof childGroup.options === "object") { + for (const key of Object.keys(childGroup.options)) { + if (key.endsWith("Order")) { + const name = key.substr(0, key.length - "Order".length); + let list = lists.get(name); + if (list === undefined) lists.set(name, (list = [])); + list.push({ + order: childGroup.options[key], + group: childGroup + }); + } + } + } + } + } + } + const result = Object.create(null); + for (const [name, list] of lists) { + list.sort((a, b) => { + const cmp = b.order - a.order; + if (cmp !== 0) return cmp; + // TODO webpack 5 remove this check of compareTo + if (a.group.compareTo) { + return a.group.compareTo(b.group); + } + return 0; + }); + result[name] = Array.from( + list.reduce((set, item) => { + for (const chunk of item.group.chunks) { + set.add(chunk.id); + } + return set; + }, new Set()) + ); + } + return result; + } + getChildIdsByOrdersMap(includeDirectChildren) { + const chunkMaps = Object.create(null); -/***/ }), + const addChildIdsByOrdersToMap = chunk => { + const data = chunk.getChildIdsByOrders(); + for (const key of Object.keys(data)) { + let chunkMap = chunkMaps[key]; + if (chunkMap === undefined) { + chunkMaps[key] = chunkMap = Object.create(null); + } + chunkMap[chunk.id] = data[key]; + } + }; -/***/ 77735: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if (includeDirectChildren) { + const chunks = new Set(); + for (const chunkGroup of this.groupsIterable) { + for (const chunk of chunkGroup.chunks) { + chunks.add(chunk); + } + } + for (const chunk of chunks) { + addChildIdsByOrdersToMap(chunk); + } + } -"use strict"; -/*! - * has-value - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ + for (const chunk of this.getAllAsyncChunks()) { + addChildIdsByOrdersToMap(chunk); + } + return chunkMaps; + } + /** + * @typedef {Object} ChunkModuleMaps + * @property {Record} id + * @property {Record} hash + */ -var isObject = __webpack_require__(78037); -var hasValues = __webpack_require__(38719); -var get = __webpack_require__(89304); + /** + * @param {ModuleFilterPredicate} filterFn function used to filter modules + * @returns {ChunkModuleMaps} module map information + */ + getChunkModuleMaps(filterFn) { + /** @type {Record} */ + const chunkModuleIdMap = Object.create(null); + /** @type {Record} */ + const chunkModuleHashMap = Object.create(null); -module.exports = function(obj, prop, noZero) { - if (isObject(obj)) { - return hasValues(get(obj, prop), noZero); - } - return hasValues(obj, prop); -}; + for (const chunk of this.getAllAsyncChunks()) { + /** @type {(string|number)[]} */ + let array; + for (const module of chunk.modulesIterable) { + if (filterFn(module)) { + if (array === undefined) { + array = []; + chunkModuleIdMap[chunk.id] = array; + } + array.push(module.id); + chunkModuleHashMap[module.id] = module.renderedHash; + } + } + if (array !== undefined) { + array.sort(); + } + } + return { + id: chunkModuleIdMap, + hash: chunkModuleHashMap + }; + } -/***/ }), + /** + * + * @param {function(Module): boolean} filterFn predicate function used to filter modules + * @param {function(Chunk): boolean} filterChunkFn predicate function used to filter chunks + * @returns {boolean} return true if module exists in graph + */ + hasModuleInGraph(filterFn, filterChunkFn) { + const queue = new Set(this.groupsIterable); + const chunksProcessed = new Set(); -/***/ 78037: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + for (const chunkGroup of queue) { + for (const chunk of chunkGroup.chunks) { + if (!chunksProcessed.has(chunk)) { + chunksProcessed.add(chunk); + if (!filterChunkFn || filterChunkFn(chunk)) { + for (const module of chunk.modulesIterable) { + if (filterFn(module)) { + return true; + } + } + } + } + } + for (const child of chunkGroup.childrenIterable) { + queue.add(child); + } + } + return false; + } -"use strict"; -/*! - * isobject - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ + toString() { + return `Chunk[${Array.from(this._modules).join()}]`; + } +} + +// TODO remove in webpack 5 +Object.defineProperty(Chunk.prototype, "forEachModule", { + configurable: false, + value: util.deprecate( + /** + * @deprecated + * @this {Chunk} + * @typedef {function(any, any, Set): void} ForEachModuleCallback + * @param {ForEachModuleCallback} fn Callback function + * @returns {void} + */ + function(fn) { + this._modules.forEach(fn); + }, + "Chunk.forEachModule: Use for(const module of chunk.modulesIterable) instead" + ) +}); + +// TODO remove in webpack 5 +Object.defineProperty(Chunk.prototype, "mapModules", { + configurable: false, + value: util.deprecate( + /** + * @deprecated + * @this {Chunk} + * @typedef {function(any, number): any} MapModulesCallback + * @param {MapModulesCallback} fn Callback function + * @returns {TODO[]} result of mapped modules + */ + function(fn) { + return Array.from(this._modules, fn); + }, + "Chunk.mapModules: Use Array.from(chunk.modulesIterable, fn) instead" + ) +}); +// TODO remove in webpack 5 +Object.defineProperty(Chunk.prototype, "chunks", { + configurable: false, + get() { + throw new Error("Chunk.chunks: Use ChunkGroup.getChildren() instead"); + }, + set() { + throw new Error("Chunk.chunks: Use ChunkGroup.add/removeChild() instead"); + } +}); +// TODO remove in webpack 5 +Object.defineProperty(Chunk.prototype, "parents", { + configurable: false, + get() { + throw new Error("Chunk.parents: Use ChunkGroup.getParents() instead"); + }, + set() { + throw new Error("Chunk.parents: Use ChunkGroup.add/removeParent() instead"); + } +}); -var isArray = __webpack_require__(21352); +// TODO remove in webpack 5 +Object.defineProperty(Chunk.prototype, "blocks", { + configurable: false, + get() { + throw new Error("Chunk.blocks: Use ChunkGroup.getBlocks() instead"); + }, + set() { + throw new Error("Chunk.blocks: Use ChunkGroup.add/removeBlock() instead"); + } +}); -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && isArray(val) === false; -}; +// TODO remove in webpack 5 +Object.defineProperty(Chunk.prototype, "entrypoints", { + configurable: false, + get() { + throw new Error( + "Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead" + ); + }, + set() { + throw new Error("Chunk.entrypoints: Use Chunks.addGroup instead"); + } +}); + +module.exports = Chunk; /***/ }), -/***/ 38719: -/***/ (function(module) { +/***/ 52911: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/*! - * has-values - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +const SortableSet = __webpack_require__(50071); +const compareLocations = __webpack_require__(22562); -module.exports = function hasValue(o, noZero) { - if (o === null || o === undefined) { - return false; - } +/** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./ModuleReason")} ModuleReason */ - if (typeof o === 'boolean') { - return true; - } +/** @typedef {{module: Module, loc: TODO, request: string}} OriginRecord */ +/** @typedef {string|{name: string}} ChunkGroupOptions */ - if (typeof o === 'number') { - if (o === 0 && noZero === true) { - return false; - } - return true; - } +let debugId = 5000; - if (o.length !== undefined) { - return o.length !== 0; - } +/** + * @template T + * @param {SortableSet} set set to convert to array. + * @returns {T[]} the array format of existing set + */ +const getArray = set => Array.from(set); - for (var key in o) { - if (o.hasOwnProperty(key)) { - return true; - } - } - return false; +/** + * A convenience method used to sort chunks based on their id's + * @param {ChunkGroup} a first sorting comparator + * @param {ChunkGroup} b second sorting comparator + * @returns {1|0|-1} a sorting index to determine order + */ +const sortById = (a, b) => { + if (a.id < b.id) return -1; + if (b.id < a.id) return 1; + return 0; }; +/** + * @param {OriginRecord} a the first comparator in sort + * @param {OriginRecord} b the second comparator in sort + * @returns {1|-1|0} returns sorting order as index + */ +const sortOrigin = (a, b) => { + const aIdent = a.module ? a.module.identifier() : ""; + const bIdent = b.module ? b.module.identifier() : ""; + if (aIdent < bIdent) return -1; + if (aIdent > bIdent) return 1; + return compareLocations(a.loc, b.loc); +}; -/***/ }), - -/***/ 94007: -/***/ (function(__unused_webpack_module, exports) { - -/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -(function (global, factory) { - true ? factory(exports) : - 0; -}(this, (function (exports) { 'use strict'; - -function merge() { - for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { - sets[_key] = arguments[_key]; - } - - if (sets.length > 1) { - sets[0] = sets[0].slice(0, -1); - var xl = sets.length - 1; - for (var x = 1; x < xl; ++x) { - sets[x] = sets[x].slice(1, -1); - } - sets[xl] = sets[xl].slice(1); - return sets.join(''); - } else { - return sets[0]; - } -} -function subexp(str) { - return "(?:" + str + ")"; -} -function typeOf(o) { - return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); -} -function toUpperCase(str) { - return str.toUpperCase(); -} -function toArray(obj) { - return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; -} -function assign(target, source) { - var obj = target; - if (source) { - for (var key in source) { - obj[key] = source[key]; - } - } - return obj; -} - -function buildExps(isIRI) { - var ALPHA$$ = "[A-Za-z]", - CR$ = "[\\x0D]", - DIGIT$$ = "[0-9]", - DQUOTE$$ = "[\\x22]", - HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), - //case-insensitive - LF$$ = "[\\x0A]", - SP$$ = "[\\x20]", - PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), - //expanded - GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", - SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", - RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), - UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", - //subset, excludes bidi control characters - IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", - //subset - UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), - SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), - USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), - DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), - DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), - //relaxed parsing rules - IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), - H16$ = subexp(HEXDIG$$ + "{1,4}"), - LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), - IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), - // 6( h16 ":" ) ls32 - IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), - // "::" 5( h16 ":" ) ls32 - IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), - //[ h16 ] "::" 4( h16 ":" ) ls32 - IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), - //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), - //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), - //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), - //[ *4( h16 ":" ) h16 ] "::" ls32 - IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), - //[ *5( h16 ":" ) h16 ] "::" h16 - IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), - //[ *6( h16 ":" ) h16 ] "::" - IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), - ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), - //RFC 6874 - IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), - //RFC 6874 - IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), - //RFC 6874, with relaxed parsing rules - IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), - IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), - //RFC 6874 - REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), - HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), - PORT$ = subexp(DIGIT$$ + "*"), - AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), - PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), - SEGMENT$ = subexp(PCHAR$ + "*"), - SEGMENT_NZ$ = subexp(PCHAR$ + "+"), - SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), - PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), - PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), - //simplified - PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), - //simplified - PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), - //simplified - PATH_EMPTY$ = "(?!" + PCHAR$ + ")", - PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), - QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), - FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), - HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), - URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), - RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), - RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), - URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), - ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), - GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", - SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; - return { - NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), - NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), - UNRESERVED: new RegExp(UNRESERVED$$, "g"), - OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), - PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), - IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules - }; -} -var URI_PROTOCOL = buildExps(false); - -var IRI_PROTOCOL = buildExps(true); - -var slicedToArray = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; -}(); - - - - - +class ChunkGroup { + /** + * Creates an instance of ChunkGroup. + * @param {ChunkGroupOptions=} options chunk group options passed to chunkGroup + */ + constructor(options) { + if (typeof options === "string") { + options = { name: options }; + } else if (!options) { + options = { name: undefined }; + } + /** @type {number} */ + this.groupDebugId = debugId++; + this.options = options; + /** @type {SortableSet} */ + this._children = new SortableSet(undefined, sortById); + this._parents = new SortableSet(undefined, sortById); + this._blocks = new SortableSet(); + /** @type {Chunk[]} */ + this.chunks = []; + /** @type {OriginRecord[]} */ + this.origins = []; + /** Indices in top-down order */ + /** @private @type {Map} */ + this._moduleIndices = new Map(); + /** Indices in bottom-up order */ + /** @private @type {Map} */ + this._moduleIndices2 = new Map(); + } + /** + * when a new chunk is added to a chunkGroup, addingOptions will occur. + * @param {ChunkGroupOptions} options the chunkGroup options passed to addOptions + * @returns {void} + */ + addOptions(options) { + for (const key of Object.keys(options)) { + if (this.options[key] === undefined) { + this.options[key] = options[key]; + } else if (this.options[key] !== options[key]) { + if (key.endsWith("Order")) { + this.options[key] = Math.max(this.options[key], options[key]); + } else { + throw new Error( + `ChunkGroup.addOptions: No option merge strategy for ${key}` + ); + } + } + } + } + /** + * returns the name of current ChunkGroup + * @returns {string|undefined} returns the ChunkGroup name + */ + get name() { + return this.options.name; + } + /** + * sets a new name for current ChunkGroup + * @param {string} value the new name for ChunkGroup + * @returns {void} + */ + set name(value) { + this.options.name = value; + } + /** + * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's + * @returns {string} a unique concatenation of chunk debugId's + */ + get debugId() { + return Array.from(this.chunks, x => x.debugId).join("+"); + } + /** + * get a unique id for ChunkGroup, made up of its member Chunk id's + * @returns {string} a unique concatenation of chunk ids + */ + get id() { + return Array.from(this.chunks, x => x.id).join("+"); + } + /** + * Performs an unshift of a specific chunk + * @param {Chunk} chunk chunk being unshifted + * @returns {boolean} returns true if attempted chunk shift is accepted + */ + unshiftChunk(chunk) { + const oldIdx = this.chunks.indexOf(chunk); + if (oldIdx > 0) { + this.chunks.splice(oldIdx, 1); + this.chunks.unshift(chunk); + } else if (oldIdx < 0) { + this.chunks.unshift(chunk); + return true; + } + return false; + } + /** + * inserts a chunk before another existing chunk in group + * @param {Chunk} chunk Chunk being inserted + * @param {Chunk} before Placeholder/target chunk marking new chunk insertion point + * @returns {boolean} return true if insertion was successful + */ + insertChunk(chunk, before) { + const oldIdx = this.chunks.indexOf(chunk); + const idx = this.chunks.indexOf(before); + if (idx < 0) { + throw new Error("before chunk not found"); + } + if (oldIdx >= 0 && oldIdx > idx) { + this.chunks.splice(oldIdx, 1); + this.chunks.splice(idx, 0, chunk); + } else if (oldIdx < 0) { + this.chunks.splice(idx, 0, chunk); + return true; + } + return false; + } -var toConsumableArray = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + /** + * add a chunk into ChunkGroup. Is pushed on or prepended + * @param {Chunk} chunk chunk being pushed into ChunkGroupS + * @returns {boolean} returns true if chunk addition was successful. + */ + pushChunk(chunk) { + const oldIdx = this.chunks.indexOf(chunk); + if (oldIdx >= 0) { + return false; + } + this.chunks.push(chunk); + return true; + } - return arr2; - } else { - return Array.from(arr); - } -}; + /** + * @param {Chunk} oldChunk chunk to be replaced + * @param {Chunk} newChunk New chunk that will be replaced with + * @returns {boolean} returns true if the replacement was successful + */ + replaceChunk(oldChunk, newChunk) { + const oldIdx = this.chunks.indexOf(oldChunk); + if (oldIdx < 0) return false; + const newIdx = this.chunks.indexOf(newChunk); + if (newIdx < 0) { + this.chunks[oldIdx] = newChunk; + return true; + } + if (newIdx < oldIdx) { + this.chunks.splice(oldIdx, 1); + return true; + } else if (newIdx !== oldIdx) { + this.chunks[oldIdx] = newChunk; + this.chunks.splice(newIdx, 1); + return true; + } + } -/** Highest positive signed 32-bit float value */ + removeChunk(chunk) { + const idx = this.chunks.indexOf(chunk); + if (idx >= 0) { + this.chunks.splice(idx, 1); + return true; + } + return false; + } -var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + isInitial() { + return false; + } -/** Bootstring parameters */ -var base = 36; -var tMin = 1; -var tMax = 26; -var skew = 38; -var damp = 700; -var initialBias = 72; -var initialN = 128; // 0x80 -var delimiter = '-'; // '\x2D' + addChild(chunk) { + if (this._children.has(chunk)) { + return false; + } + this._children.add(chunk); + return true; + } -/** Regular expressions */ -var regexPunycode = /^xn--/; -var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars -var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + getChildren() { + return this._children.getFromCache(getArray); + } -/** Error messages */ -var errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; + getNumberOfChildren() { + return this._children.size; + } -/** Convenience shortcuts */ -var baseMinusTMin = base - tMin; -var floor = Math.floor; -var stringFromCharCode = String.fromCharCode; + get childrenIterable() { + return this._children; + } -/*--------------------------------------------------------------------------*/ + removeChild(chunk) { + if (!this._children.has(chunk)) { + return false; + } -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error$1(type) { - throw new RangeError(errors[type]); -} + this._children.delete(chunk); + chunk.removeParent(this); + return true; + } -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, fn) { - var result = []; - var length = array.length; - while (length--) { - result[length] = fn(array[length]); + addParent(parentChunk) { + if (!this._parents.has(parentChunk)) { + this._parents.add(parentChunk); + return true; + } + return false; } - return result; -} -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ -function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; + getParents() { + return this._parents.getFromCache(getArray); } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; -} -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - var output = []; - var counter = 0; - var length = string.length; - while (counter < length) { - var value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - var extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { - // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); + setParents(newParents) { + this._parents.clear(); + for (const p of newParents) { + this._parents.add(p); } } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -var ucs2encode = function ucs2encode(array) { - return String.fromCodePoint.apply(String, toConsumableArray(array)); -}; -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -var basicToDigit = function basicToDigit(codePoint) { - if (codePoint - 0x30 < 0x0A) { - return codePoint - 0x16; + getNumberOfParents() { + return this._parents.size; } - if (codePoint - 0x41 < 0x1A) { - return codePoint - 0x41; + + hasParent(parent) { + return this._parents.has(parent); } - if (codePoint - 0x61 < 0x1A) { - return codePoint - 0x61; + + get parentsIterable() { + return this._parents; } - return base; -}; -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -var digitToBasic = function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; + removeParent(chunk) { + if (this._parents.delete(chunk)) { + chunk.removeChunk(this); + return true; + } + return false; + } -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -var adapt = function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); + /** + * @returns {Array} - an array containing the blocks + */ + getBlocks() { + return this._blocks.getFromCache(getArray); } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -var decode = function decode(input) { - // Don't use UCS-2. - var output = []; - var inputLength = input.length; - var i = 0; - var n = initialN; - var bias = initialBias; + getNumberOfBlocks() { + return this._blocks.size; + } - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. + hasBlock(block) { + return this._blocks.has(block); + } - var basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; + get blocksIterable() { + return this._blocks; } - for (var j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error$1('not-basic'); + addBlock(block) { + if (!this._blocks.has(block)) { + this._blocks.add(block); + return true; } - output.push(input.charCodeAt(j)); + return false; } - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. + addOrigin(module, loc, request) { + this.origins.push({ + module, + loc, + request + }); + } - for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ + containsModule(module) { + for (const chunk of this.chunks) { + if (chunk.containsModule(module)) return true; + } + return false; + } - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - var oldi = i; - for (var w = 1, k = base;; /* no condition */k += base) { + getFiles() { + const files = new Set(); - if (index >= inputLength) { - error$1('invalid-input'); + for (const chunk of this.chunks) { + for (const file of chunk.files) { + files.add(file); } + } - var digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base || digit > floor((maxInt - i) / w)) { - error$1('overflow'); - } + return Array.from(files); + } - i += digit * w; - var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + /** + * @param {string=} reason reason for removing ChunkGroup + * @returns {void} + */ + remove(reason) { + // cleanup parents + for (const parentChunkGroup of this._parents) { + // remove this chunk from its parents + parentChunkGroup._children.delete(this); - if (digit < t) { - break; + // cleanup "sub chunks" + for (const chunkGroup of this._children) { + /** + * remove this chunk as "intermediary" and connect + * it "sub chunks" and parents directly + */ + // add parent to each "sub chunk" + chunkGroup.addParent(parentChunkGroup); + // add "sub chunk" to parent + parentChunkGroup.addChild(chunkGroup); } - - var baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error$1('overflow'); - } - - w *= baseMinusT; } - var out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error$1('overflow'); + /** + * we need to iterate again over the children + * to remove this from the child's parents. + * This can not be done in the above loop + * as it is not guaranteed that `this._parents` contains anything. + */ + for (const chunkGroup of this._children) { + // remove this as parent of every "sub chunk" + chunkGroup._parents.delete(this); } - n += floor(i / out); - i %= out; + // cleanup blocks + for (const block of this._blocks) { + block.chunkGroup = null; + } - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); + // remove chunks + for (const chunk of this.chunks) { + chunk.removeGroup(this); + } } - return String.fromCodePoint.apply(String, output); -}; + sortItems() { + this.origins.sort(sortOrigin); + this._parents.sort(); + this._children.sort(); + } -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -var encode = function encode(input) { - var output = []; + /** + * Sorting predicate which allows current ChunkGroup to be compared against another. + * Sorting values are based off of number of chunks in ChunkGroup. + * + * @param {ChunkGroup} otherGroup the chunkGroup to compare this against + * @returns {-1|0|1} sort position for comparison + */ + compareTo(otherGroup) { + if (this.chunks.length > otherGroup.chunks.length) return -1; + if (this.chunks.length < otherGroup.chunks.length) return 1; + const a = this.chunks[Symbol.iterator](); + const b = otherGroup.chunks[Symbol.iterator](); + // eslint-disable-next-line no-constant-condition + while (true) { + const aItem = a.next(); + const bItem = b.next(); + if (aItem.done) return 0; + const cmp = aItem.value.compareTo(bItem.value); + if (cmp !== 0) return cmp; + } + } - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); + getChildrenByOrders() { + const lists = new Map(); + for (const childGroup of this._children) { + // TODO webpack 5 remove this check for options + if (typeof childGroup.options === "object") { + for (const key of Object.keys(childGroup.options)) { + if (key.endsWith("Order")) { + const name = key.substr(0, key.length - "Order".length); + let list = lists.get(name); + if (list === undefined) { + lists.set(name, (list = [])); + } + list.push({ + order: childGroup.options[key], + group: childGroup + }); + } + } + } + } + const result = Object.create(null); + for (const [name, list] of lists) { + list.sort((a, b) => { + const cmp = b.order - a.order; + if (cmp !== 0) return cmp; + // TODO webpack 5 remove this check of compareTo + if (a.group.compareTo) { + return a.group.compareTo(b.group); + } + return 0; + }); + result[name] = list.map(i => i.group); + } + return result; + } - // Cache the length. - var inputLength = input.length; + /** + * Sets the top-down index of a module in this ChunkGroup + * @param {Module} module module for which the index should be set + * @param {number} index the index of the module + * @returns {void} + */ + setModuleIndex(module, index) { + this._moduleIndices.set(module, index); + } - // Initialize the state. - var n = initialN; - var delta = 0; - var bias = initialBias; + /** + * Gets the top-down index of a module in this ChunkGroup + * @param {Module} module the module + * @returns {number} index + */ + getModuleIndex(module) { + return this._moduleIndices.get(module); + } - // Handle the basic code points. - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; + /** + * Sets the bottom-up index of a module in this ChunkGroup + * @param {Module} module module for which the index should be set + * @param {number} index the index of the module + * @returns {void} + */ + setModuleIndex2(module, index) { + this._moduleIndices2.set(module, index); + } - try { - for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _currentValue2 = _step.value; + /** + * Gets the bottom-up index of a module in this ChunkGroup + * @param {Module} module the module + * @returns {number} index + */ + getModuleIndex2(module) { + return this._moduleIndices2.get(module); + } - if (_currentValue2 < 0x80) { - output.push(stringFromCharCode(_currentValue2)); + checkConstraints() { + const chunk = this; + for (const child of chunk._children) { + if (!child._parents.has(chunk)) { + throw new Error( + `checkConstraints: child missing parent ${chunk.debugId} -> ${child.debugId}` + ); } } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; + for (const parentChunk of chunk._parents) { + if (!parentChunk._children.has(chunk)) { + throw new Error( + `checkConstraints: parent missing child ${parentChunk.debugId} <- ${chunk.debugId}` + ); } } } +} - var basicLength = output.length; - var handledCPCount = basicLength; +module.exports = ChunkGroup; - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } +/***/ }), - // Main encoding loop: - while (handledCPCount < inputLength) { +/***/ 69865: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // All non-basic code points < n have been handled already. Find the next - // larger one: - var m = maxInt; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - try { - for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var currentValue = _step2.value; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } +const WebpackError = __webpack_require__(97391); - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } +/** @typedef {import("./Chunk")} Chunk */ - var handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error$1('overflow'); - } +class ChunkRenderError extends WebpackError { + /** + * Create a new ChunkRenderError + * @param {Chunk} chunk A chunk + * @param {string} file Related file + * @param {Error} error Original error + */ + constructor(chunk, file, error) { + super(); - delta += (m - n) * handledCPCountPlusOne; - n = m; + this.name = "ChunkRenderError"; + this.error = error; + this.message = error.message; + this.details = error.stack; + this.file = file; + this.chunk = chunk; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; + Error.captureStackTrace(this, this.constructor); + } +} - try { - for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var _currentValue = _step3.value; +module.exports = ChunkRenderError; - if (_currentValue < n && ++delta > maxInt) { - error$1('overflow'); - } - if (_currentValue == n) { - // Represent delta as a generalized variable-length integer. - var q = delta; - for (var k = base;; /* no condition */k += base) { - var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - if (q < t) { - break; - } - var qMinusT = q - t; - var baseMinusT = base - t; - output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); - q = floor(qMinusT / baseMinusT); - } - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } +/***/ }), - ++delta; - ++n; - } - return output.join(''); -}; +/***/ 6170: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -var toUnicode = function toUnicode(input) { - return mapDomain(input, function (string) { - return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; - }); -}; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -var toASCII = function toASCII(input) { - return mapDomain(input, function (string) { - return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; - }); -}; -/*--------------------------------------------------------------------------*/ +const { Tapable, SyncWaterfallHook, SyncHook } = __webpack_require__(92402); -/** Define the public API */ -var punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.1.0', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; +/** @typedef {import("./ModuleTemplate")} ModuleTemplate */ +/** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("./Module")} Module} */ +/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate} */ +/** @typedef {import("./util/createHash").Hash} Hash} */ /** - * URI.js - * - * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. - * @author Gary Court - * @see http://github.com/garycourt/uri-js - */ -/** - * Copyright 2011 Gary Court. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of Gary Court. + * @typedef {Object} RenderManifestOptions + * @property {Chunk} chunk the chunk used to render + * @property {string} hash + * @property {string} fullHash + * @property {TODO} outputOptions + * @property {{javascript: ModuleTemplate, webassembly: ModuleTemplate}} moduleTemplates + * @property {Map} dependencyTemplates */ -var SCHEMES = {}; -function pctEncChar(chr) { - var c = chr.charCodeAt(0); - var e = void 0; - if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); - return e; -} -function pctDecChars(str) { - var newStr = ""; - var i = 0; - var il = str.length; - while (i < il) { - var c = parseInt(str.substr(i + 1, 2), 16); - if (c < 128) { - newStr += String.fromCharCode(c); - i += 3; - } else if (c >= 194 && c < 224) { - if (il - i >= 6) { - var c2 = parseInt(str.substr(i + 4, 2), 16); - newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); - } else { - newStr += str.substr(i, 6); - } - i += 6; - } else if (c >= 224) { - if (il - i >= 9) { - var _c = parseInt(str.substr(i + 4, 2), 16); - var c3 = parseInt(str.substr(i + 7, 2), 16); - newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); - } else { - newStr += str.substr(i, 9); - } - i += 9; - } else { - newStr += str.substr(i, 3); - i += 3; - } - } - return newStr; -} -function _normalizeComponentEncoding(components, protocol) { - function decodeUnreserved(str) { - var decStr = pctDecChars(str); - return !decStr.match(protocol.UNRESERVED) ? str : decStr; - } - if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); - if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - return components; -} -function _stripLeadingZeros(str) { - return str.replace(/^0*(.*)/, "$1") || "0"; -} -function _normalizeIPv4(host, protocol) { - var matches = host.match(protocol.IPV4ADDRESS) || []; +module.exports = class ChunkTemplate extends Tapable { + constructor(outputOptions) { + super(); + this.outputOptions = outputOptions || {}; + this.hooks = { + /** @type {SyncWaterfallHook} */ + renderManifest: new SyncWaterfallHook(["result", "options"]), + modules: new SyncWaterfallHook([ + "source", + "chunk", + "moduleTemplate", + "dependencyTemplates" + ]), + render: new SyncWaterfallHook([ + "source", + "chunk", + "moduleTemplate", + "dependencyTemplates" + ]), + renderWithEntry: new SyncWaterfallHook(["source", "chunk"]), + hash: new SyncHook(["hash"]), + hashForChunk: new SyncHook(["hash", "chunk"]) + }; + } - var _matches = slicedToArray(matches, 2), - address = _matches[1]; + /** + * + * @param {RenderManifestOptions} options render manifest options + * @returns {TODO[]} returns render manifest + */ + getRenderManifest(options) { + const result = []; - if (address) { - return address.split(".").map(_stripLeadingZeros).join("."); - } else { - return host; - } -} -function _normalizeIPv6(host, protocol) { - var matches = host.match(protocol.IPV6ADDRESS) || []; + this.hooks.renderManifest.call(result, options); - var _matches2 = slicedToArray(matches, 3), - address = _matches2[1], - zone = _matches2[2]; + return result; + } - if (address) { - var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), - _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), - last = _address$toLowerCase$2[0], - first = _address$toLowerCase$2[1]; + /** + * Updates hash with information from this template + * @param {Hash} hash the hash to update + * @returns {void} + */ + updateHash(hash) { + hash.update("ChunkTemplate"); + hash.update("2"); + this.hooks.hash.call(hash); + } - var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; - var lastFields = last.split(":").map(_stripLeadingZeros); - var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); - var fieldCount = isLastFieldIPv4Address ? 7 : 8; - var lastFieldsStart = lastFields.length - fieldCount; - var fields = Array(fieldCount); - for (var x = 0; x < fieldCount; ++x) { - fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; - } - if (isLastFieldIPv4Address) { - fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); - } - var allZeroFields = fields.reduce(function (acc, field, index) { - if (!field || field === "0") { - var lastLongest = acc[acc.length - 1]; - if (lastLongest && lastLongest.index + lastLongest.length === index) { - lastLongest.length++; - } else { - acc.push({ index: index, length: 1 }); - } - } - return acc; - }, []); - var longestZeroFields = allZeroFields.sort(function (a, b) { - return b.length - a.length; - })[0]; - var newHost = void 0; - if (longestZeroFields && longestZeroFields.length > 1) { - var newFirst = fields.slice(0, longestZeroFields.index); - var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); - newHost = newFirst.join(":") + "::" + newLast.join(":"); - } else { - newHost = fields.join(":"); - } - if (zone) { - newHost += "%" + zone; - } - return newHost; - } else { - return host; - } -} -var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; -var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; -function parse(uriString) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + /** + * TODO webpack 5: remove moduleTemplate and dependencyTemplates + * Updates hash with chunk-specific information from this template + * @param {Hash} hash the hash to update + * @param {Chunk} chunk the chunk + * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render + * @param {Map} dependencyTemplates dependency templates + * @returns {void} + */ + updateHashForChunk(hash, chunk, moduleTemplate, dependencyTemplates) { + this.updateHash(hash); + this.hooks.hashForChunk.call(hash, chunk); + } +}; - var components = {}; - var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; - if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; - var matches = uriString.match(URI_PARSE); - if (matches) { - if (NO_MATCH_IS_UNDEFINED) { - //store each component - components.scheme = matches[1]; - components.userinfo = matches[3]; - components.host = matches[4]; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = matches[7]; - components.fragment = matches[8]; - //fix port number - if (isNaN(components.port)) { - components.port = matches[5]; - } - } else { - //IE FIX for improper RegExp matching - //store each component - components.scheme = matches[1] || undefined; - components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; - components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; - components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; - //fix port number - if (isNaN(components.port)) { - components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; - } - } - if (components.host) { - //normalize IP hosts - components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); - } - //determine reference type - if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { - components.reference = "same-document"; - } else if (components.scheme === undefined) { - components.reference = "relative"; - } else if (components.fragment === undefined) { - components.reference = "absolute"; - } else { - components.reference = "uri"; - } - //check for reference errors - if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { - components.error = components.error || "URI is not a " + options.reference + " reference."; - } - //find scheme handler - var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //check if scheme can't handle IRIs - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - //if host component is a domain name - if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { - //convert Unicode IDN -> ASCII IDN - try { - components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); - } catch (e) { - components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; - } - } - //convert IRI -> URI - _normalizeComponentEncoding(components, URI_PROTOCOL); - } else { - //normalize encodings - _normalizeComponentEncoding(components, protocol); - } - //perform scheme specific parsing - if (schemeHandler && schemeHandler.parse) { - schemeHandler.parse(components, options); - } - } else { - components.error = components.error || "URI can not be parsed."; - } - return components; -} -function _recomposeAuthority(components, options) { - var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; - var uriTokens = []; - if (components.userinfo !== undefined) { - uriTokens.push(components.userinfo); - uriTokens.push("@"); - } - if (components.host !== undefined) { - //normalize IP hosts, add brackets and escape zone separator for IPv6 - uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { - return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; - })); - } - if (typeof components.port === "number") { - uriTokens.push(":"); - uriTokens.push(components.port.toString(10)); - } - return uriTokens.length ? uriTokens.join("") : undefined; -} +/***/ }), -var RDS1 = /^\.\.?\//; -var RDS2 = /^\/\.(\/|$)/; -var RDS3 = /^\/\.\.(\/|$)/; -var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; -function removeDotSegments(input) { - var output = []; - while (input.length) { - if (input.match(RDS1)) { - input = input.replace(RDS1, ""); - } else if (input.match(RDS2)) { - input = input.replace(RDS2, "/"); - } else if (input.match(RDS3)) { - input = input.replace(RDS3, "/"); - output.pop(); - } else if (input === "." || input === "..") { - input = ""; - } else { - var im = input.match(RDS5); - if (im) { - var s = im[0]; - input = input.slice(s.length); - output.push(s); - } else { - throw new Error("Unexpected dot segment condition"); - } - } - } - return output.join(""); -} +/***/ 51760: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -function serialize(components) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; - var uriTokens = []; - //find scheme handler - var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //perform scheme specific serialization - if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); - if (components.host) { - //if host component is an IPv6 address - if (protocol.IPV6ADDRESS.test(components.host)) {} - //TODO: normalize IPv6 address as per RFC 5952 - //if host component is a domain name - else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { - //convert IDN via punycode - try { - components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); - } catch (e) { - components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - } - } - //normalize encoding - _normalizeComponentEncoding(components, protocol); - if (options.reference !== "suffix" && components.scheme) { - uriTokens.push(components.scheme); - uriTokens.push(":"); - } - var authority = _recomposeAuthority(components, options); - if (authority !== undefined) { - if (options.reference !== "suffix") { - uriTokens.push("//"); - } - uriTokens.push(authority); - if (components.path && components.path.charAt(0) !== "/") { - uriTokens.push("/"); - } - } - if (components.path !== undefined) { - var s = components.path; - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { - s = removeDotSegments(s); - } - if (authority === undefined) { - s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" - } - uriTokens.push(s); - } - if (components.query !== undefined) { - uriTokens.push("?"); - uriTokens.push(components.query); - } - if (components.fragment !== undefined) { - uriTokens.push("#"); - uriTokens.push(components.fragment); - } - return uriTokens.join(""); //merge tokens into a string -} +const WebpackError = __webpack_require__(97391); -function resolveComponents(base, relative) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var skipNormalization = arguments[3]; +/** @typedef {import("./Module")} Module */ - var target = {}; - if (!skipNormalization) { - base = parse(serialize(base, options), options); //normalize base components - relative = parse(serialize(relative, options), options); //normalize relative components - } - options = options || {}; - if (!options.tolerant && relative.scheme) { - target.scheme = relative.scheme; - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (!relative.path) { - target.path = base.path; - if (relative.query !== undefined) { - target.query = relative.query; - } else { - target.query = base.query; - } - } else { - if (relative.path.charAt(0) === "/") { - target.path = removeDotSegments(relative.path); - } else { - if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { - target.path = "/" + relative.path; - } else if (!base.path) { - target.path = relative.path; - } else { - target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; - } - target.path = removeDotSegments(target.path); - } - target.query = relative.query; - } - //target.authority = base.authority; - target.userinfo = base.userinfo; - target.host = base.host; - target.port = base.port; - } - target.scheme = base.scheme; - } - target.fragment = relative.fragment; - return target; -} +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ -function resolve(baseURI, relativeURI, options) { - var schemelessOptions = assign({ scheme: 'null' }, options); - return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); -} +class CommentCompilationWarning extends WebpackError { + /** + * + * @param {string} message warning message + * @param {Module} module affected module + * @param {DependencyLocation} loc affected lines of code + */ + constructor(message, module, loc) { + super(message); -function normalize(uri, options) { - if (typeof uri === "string") { - uri = serialize(parse(uri, options), options); - } else if (typeOf(uri) === "object") { - uri = parse(serialize(uri, options), options); - } - return uri; -} + this.name = "CommentCompilationWarning"; -function equal(uriA, uriB, options) { - if (typeof uriA === "string") { - uriA = serialize(parse(uriA, options), options); - } else if (typeOf(uriA) === "object") { - uriA = serialize(uriA, options); - } - if (typeof uriB === "string") { - uriB = serialize(parse(uriB, options), options); - } else if (typeOf(uriB) === "object") { - uriB = serialize(uriB, options); - } - return uriA === uriB; -} + this.module = module; + this.loc = loc; -function escapeComponent(str, options) { - return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); + Error.captureStackTrace(this, this.constructor); + } } -function unescapeComponent(str, options) { - return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); -} +module.exports = CommentCompilationWarning; -var handler = { - scheme: "http", - domainHost: true, - parse: function parse(components, options) { - //report missing host - if (!components.host) { - components.error = components.error || "HTTP URIs must have a host."; - } - return components; - }, - serialize: function serialize(components, options) { - //normalize the default port - if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") { - components.port = undefined; - } - //normalize the empty path - if (!components.path) { - components.path = "/"; - } - //NOTE: We do not parse query strings for HTTP URIs - //as WWW Form Url Encoded query strings are part of the HTML4+ spec, - //and not the HTTP spec. - return components; - } -}; -var handler$1 = { - scheme: "https", - domainHost: handler.domainHost, - parse: handler.parse, - serialize: handler.serialize -}; +/***/ }), -var O = {}; -var isIRI = true; -//RFC 3986 -var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; -var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive -var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded -//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = -//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) -//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext -//const VCHAR$$ = "[\\x21-\\x7E]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext -//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); -//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); -//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); -var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; -var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; -var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); -var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; -var UNRESERVED = new RegExp(UNRESERVED$$, "g"); -var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); -var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); -var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); -var NOT_HFVALUE = NOT_HFNAME; -function decodeUnreserved(str) { - var decStr = pctDecChars(str); - return !decStr.match(UNRESERVED) ? str : decStr; -} -var handler$2 = { - scheme: "mailto", - parse: function parse$$1(components, options) { - var mailtoComponents = components; - var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; - mailtoComponents.path = undefined; - if (mailtoComponents.query) { - var unknownHeaders = false; - var headers = {}; - var hfields = mailtoComponents.query.split("&"); - for (var x = 0, xl = hfields.length; x < xl; ++x) { - var hfield = hfields[x].split("="); - switch (hfield[0]) { - case "to": - var toAddrs = hfield[1].split(","); - for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { - to.push(toAddrs[_x]); - } - break; - case "subject": - mailtoComponents.subject = unescapeComponent(hfield[1], options); - break; - case "body": - mailtoComponents.body = unescapeComponent(hfield[1], options); - break; - default: - unknownHeaders = true; - headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); - break; - } - } - if (unknownHeaders) mailtoComponents.headers = headers; - } - mailtoComponents.query = undefined; - for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { - var addr = to[_x2].split("@"); - addr[0] = unescapeComponent(addr[0]); - if (!options.unicodeSupport) { - //convert Unicode IDN -> ASCII IDN - try { - addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); - } catch (e) { - mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; - } - } else { - addr[1] = unescapeComponent(addr[1], options).toLowerCase(); - } - to[_x2] = addr.join("@"); - } - return mailtoComponents; - }, - serialize: function serialize$$1(mailtoComponents, options) { - var components = mailtoComponents; - var to = toArray(mailtoComponents.to); - if (to) { - for (var x = 0, xl = to.length; x < xl; ++x) { - var toAddr = String(to[x]); - var atIdx = toAddr.lastIndexOf("@"); - var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); - var domain = toAddr.slice(atIdx + 1); - //convert IDN via punycode - try { - domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); - } catch (e) { - components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - to[x] = localPart + "@" + domain; - } - components.path = to.join(","); - } - var headers = mailtoComponents.headers = mailtoComponents.headers || {}; - if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; - if (mailtoComponents.body) headers["body"] = mailtoComponents.body; - var fields = []; - for (var name in headers) { - if (headers[name] !== O[name]) { - fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); - } - } - if (fields.length) { - components.query = fields.join("&"); - } - return components; - } -}; - -var URN_PARSE = /^([^\:]+)\:(.*)/; -//RFC 2141 -var handler$3 = { - scheme: "urn", - parse: function parse$$1(components, options) { - var matches = components.path && components.path.match(URN_PARSE); - var urnComponents = components; - if (matches) { - var scheme = options.scheme || urnComponents.scheme || "urn"; - var nid = matches[1].toLowerCase(); - var nss = matches[2]; - var urnScheme = scheme + ":" + (options.nid || nid); - var schemeHandler = SCHEMES[urnScheme]; - urnComponents.nid = nid; - urnComponents.nss = nss; - urnComponents.path = undefined; - if (schemeHandler) { - urnComponents = schemeHandler.parse(urnComponents, options); - } - } else { - urnComponents.error = urnComponents.error || "URN can not be parsed."; - } - return urnComponents; - }, - serialize: function serialize$$1(urnComponents, options) { - var scheme = options.scheme || urnComponents.scheme || "urn"; - var nid = urnComponents.nid; - var urnScheme = scheme + ":" + (options.nid || nid); - var schemeHandler = SCHEMES[urnScheme]; - if (schemeHandler) { - urnComponents = schemeHandler.serialize(urnComponents, options); - } - var uriComponents = urnComponents; - var nss = urnComponents.nss; - uriComponents.path = (nid || options.nid) + ":" + nss; - return uriComponents; - } -}; - -var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; -//RFC 4122 -var handler$4 = { - scheme: "urn:uuid", - parse: function parse(urnComponents, options) { - var uuidComponents = urnComponents; - uuidComponents.uuid = uuidComponents.nss; - uuidComponents.nss = undefined; - if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { - uuidComponents.error = uuidComponents.error || "UUID is not valid."; - } - return uuidComponents; - }, - serialize: function serialize(uuidComponents, options) { - var urnComponents = uuidComponents; - //normalize UUID - urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); - return urnComponents; - } -}; - -SCHEMES[handler.scheme] = handler; -SCHEMES[handler$1.scheme] = handler$1; -SCHEMES[handler$2.scheme] = handler$2; -SCHEMES[handler$3.scheme] = handler$3; -SCHEMES[handler$4.scheme] = handler$4; - -exports.SCHEMES = SCHEMES; -exports.pctEncChar = pctEncChar; -exports.pctDecChars = pctDecChars; -exports.parse = parse; -exports.removeDotSegments = removeDotSegments; -exports.serialize = serialize; -exports.resolveComponents = resolveComponents; -exports.resolve = resolve; -exports.normalize = normalize; -exports.equal = equal; -exports.escapeComponent = escapeComponent; -exports.unescapeComponent = unescapeComponent; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=uri.all.js.map - - -/***/ }), - -/***/ 67806: +/***/ 85736: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var path = __webpack_require__(85622) - -"use strict" - -function urix(aPath) { - if (path.sep === "\\") { - return aPath - .replace(/\\/g, "/") - .replace(/^[a-z]:\/?/i, "/") - } - return aPath -} - -module.exports = urix - - -/***/ }), - -/***/ 77709: -/***/ (function(module) { - "use strict"; -/*! - * use - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - - - -module.exports = function base(app, options) { - if (!isObject(app) && typeof app !== 'function') { - throw new TypeError('expected an object or function'); - } - - var opts = isObject(options) ? options : {}; - var prop = typeof opts.prop === 'string' ? opts.prop : 'fns'; - if (!Array.isArray(app[prop])) { - define(app, prop, []); - } - - /** - * Define a plugin function to be passed to use. The only - * parameter exposed to the plugin is `app`, the object or function. - * passed to `use(app)`. `app` is also exposed as `this` in plugins. - * - * Additionally, **if a plugin returns a function, the function will - * be pushed onto the `fns` array**, allowing the plugin to be - * called at a later point by the `run` method. - * - * ```js - * var use = require('use'); - * - * // define a plugin - * function foo(app) { - * // do stuff - * } - * - * var app = function(){}; - * use(app); - * - * // register plugins - * app.use(foo); - * app.use(bar); - * app.use(baz); - * ``` - * @name .use - * @param {Function} `fn` plugin function to call - * @api public - */ - - define(app, 'use', use); - - /** - * Run all plugins on `fns`. Any plugin that returns a function - * when called by `use` is pushed onto the `fns` array. - * - * ```js - * var config = {}; - * app.run(config); - * ``` - * @name .run - * @param {Object} `value` Object to be modified by plugins. - * @return {Object} Returns the object passed to `run` - * @api public - */ - - define(app, 'run', function(val) { - if (!isObject(val)) return; - - if (!val.use || !val.run) { - define(val, prop, val[prop] || []); - define(val, 'use', use); - } - - if (!val[prop] || val[prop].indexOf(base) === -1) { - val.use(base); - } - - var self = this || app; - var fns = self[prop]; - var len = fns.length; - var idx = -1; - - while (++idx < len) { - val.use(fns[idx]); - } - return val; - }); - - /** - * Call plugin `fn`. If a function is returned push it into the - * `fns` array to be called by the `run` method. - */ - - function use(type, fn, options) { - var offset = 1; - - if (typeof type === 'string' || Array.isArray(type)) { - fn = wrap(type, fn); - offset++; - } else { - options = fn; - fn = type; - } - - if (typeof fn !== 'function') { - throw new TypeError('expected a function'); - } - - var self = this || app; - var fns = self[prop]; - - var args = [].slice.call(arguments, offset); - args.unshift(self); - - if (typeof opts.hook === 'function') { - opts.hook.apply(self, args); - } - - var val = fn.apply(self, args); - if (typeof val === 'function' && fns.indexOf(val) === -1) { - fns.push(val); - } - return self; - } - - /** - * Wrap a named plugin function so that it's only called on objects of the - * given `type` - * - * @param {String} `type` - * @param {Function} `fn` Plugin function - * @return {Function} - */ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - function wrap(type, fn) { - return function plugin() { - return this.type === type ? fn.apply(this, arguments) : plugin; - }; - } - return app; -}; +const path = __webpack_require__(85622); +const ParserHelpers = __webpack_require__(23999); -function isObject(val) { - return val && typeof val === 'object' && !Array.isArray(val); -} +class CommonJsStuffPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "CommonJsStuffPlugin", + (compilation, { normalModuleFactory }) => { + const handler = (parser, parserOptions) => { + parser.hooks.expression + .for("require.main.require") + .tap( + "CommonJsStuffPlugin", + ParserHelpers.expressionIsUnsupported( + parser, + "require.main.require is not supported by webpack." + ) + ); + parser.hooks.expression + .for("module.parent.require") + .tap( + "CommonJsStuffPlugin", + ParserHelpers.expressionIsUnsupported( + parser, + "module.parent.require is not supported by webpack." + ) + ); + parser.hooks.expression + .for("require.main") + .tap( + "CommonJsStuffPlugin", + ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + "__webpack_require__.c[__webpack_require__.s]" + ) + ); + parser.hooks.expression + .for("module.loaded") + .tap("CommonJsStuffPlugin", expr => { + parser.state.module.buildMeta.moduleConcatenationBailout = + "module.loaded"; + return ParserHelpers.toConstantDependency( + parser, + "module.l" + )(expr); + }); + parser.hooks.expression + .for("module.id") + .tap("CommonJsStuffPlugin", expr => { + parser.state.module.buildMeta.moduleConcatenationBailout = + "module.id"; + return ParserHelpers.toConstantDependency( + parser, + "module.i" + )(expr); + }); + parser.hooks.expression + .for("module.exports") + .tap("CommonJsStuffPlugin", () => { + const module = parser.state.module; + const isHarmony = + module.buildMeta && module.buildMeta.exportsType; + if (!isHarmony) return true; + }); + parser.hooks.evaluateIdentifier + .for("module.hot") + .tap( + "CommonJsStuffPlugin", + ParserHelpers.evaluateToIdentifier("module.hot", false) + ); + parser.hooks.expression + .for("module") + .tap("CommonJsStuffPlugin", () => { + const module = parser.state.module; + const isHarmony = + module.buildMeta && module.buildMeta.exportsType; + let moduleJsPath = isHarmony ? __webpack_require__.ab + "harmony-module.js" : __webpack_require__.ab + "module.js"; + if (module.context) { + moduleJsPath = path.relative( + parser.state.module.context, + moduleJsPath + ); + if (!/^[A-Z]:/i.test(moduleJsPath)) { + moduleJsPath = `./${moduleJsPath.replace(/\\/g, "/")}`; + } + } + return ParserHelpers.addParsedVariableToModule( + parser, + "module", + `require(${JSON.stringify(moduleJsPath)})(module)` + ); + }); + }; -function define(obj, key, val) { - Object.defineProperty(obj, key, { - configurable: true, - writable: true, - value: val - }); + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("CommonJsStuffPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("CommonJsStuffPlugin", handler); + } + ); + } } +module.exports = CommonJsStuffPlugin; /***/ }), -/***/ 92262: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = __webpack_require__(31669).deprecate; - - -/***/ }), - -/***/ 24059: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -module.exports = __webpack_require__(47257); - - -/***/ }), - -/***/ 71118: +/***/ 85918: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -51105,36 +50104,20 @@ module.exports = __webpack_require__(47257); const ConstDependency = __webpack_require__(71101); -const ParserHelpers = __webpack_require__(23999); const NullFactory = __webpack_require__(40438); -/* eslint-disable camelcase */ -const REPLACEMENTS = { - __webpack_require__: "__webpack_require__", - __webpack_public_path__: "__webpack_require__.p", - __webpack_modules__: "__webpack_require__.m", - __webpack_chunk_load__: "__webpack_require__.e", - __non_webpack_require__: "require", - __webpack_nonce__: "__webpack_require__.nc", - "require.onError": "__webpack_require__.oe" -}; -const NO_WEBPACK_REQUIRE = { - __non_webpack_require__: true -}; -const REPLACEMENT_TYPES = { - __webpack_public_path__: "string", - __webpack_require__: "function", - __webpack_modules__: "object", - __webpack_chunk_load__: "function", - __webpack_nonce__: "string" -}; -/* eslint-enable camelcase */ +/** @typedef {import("./Compiler")} Compiler */ -class APIPlugin { +class CompatibilityPlugin { + /** + * Apply the plugin + * @param {Compiler} compiler Webpack Compiler + * @returns {void} + */ apply(compiler) { compiler.hooks.compilation.tap( - "APIPlugin", + "CompatibilityPlugin", (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set(ConstDependency, new NullFactory()); compilation.dependencyTemplates.set( @@ -51142,1890 +50125,2388 @@ class APIPlugin { new ConstDependency.Template() ); - const handler = parser => { - Object.keys(REPLACEMENTS).forEach(key => { - parser.hooks.expression - .for(key) - .tap( - "APIPlugin", - NO_WEBPACK_REQUIRE[key] - ? ParserHelpers.toConstantDependency( - parser, - REPLACEMENTS[key] - ) - : ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - REPLACEMENTS[key] - ) - ); - const type = REPLACEMENT_TYPES[key]; - if (type) { - parser.hooks.evaluateTypeof - .for(key) - .tap("APIPlugin", ParserHelpers.evaluateToString(type)); - } - }); - }; - normalModuleFactory.hooks.parser .for("javascript/auto") - .tap("APIPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("APIPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("APIPlugin", handler); + .tap("CompatibilityPlugin", (parser, parserOptions) => { + if ( + parserOptions.browserify !== undefined && + !parserOptions.browserify + ) + return; + + parser.hooks.call + .for("require") + .tap("CompatibilityPlugin", expr => { + // support for browserify style require delegator: "require(o, !0)" + if (expr.arguments.length !== 2) return; + const second = parser.evaluateExpression(expr.arguments[1]); + if (!second.isBoolean()) return; + if (second.asBool() !== true) return; + const dep = new ConstDependency("require", expr.callee.range); + dep.loc = expr.loc; + if (parser.state.current.dependencies.length > 1) { + const last = + parser.state.current.dependencies[ + parser.state.current.dependencies.length - 1 + ]; + if ( + last.critical && + last.options && + last.options.request === "." && + last.userRequest === "." && + last.options.recursive + ) + parser.state.current.dependencies.pop(); + } + parser.state.current.addDependency(dep); + return true; + }); + }); } ); } } - -module.exports = APIPlugin; +module.exports = CompatibilityPlugin; /***/ }), -/***/ 36104: +/***/ 34968: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ +const asyncLib = __webpack_require__(36386); +const util = __webpack_require__(31669); +const { CachedSource } = __webpack_require__(53665); +const { + Tapable, + SyncHook, + SyncBailHook, + SyncWaterfallHook, + AsyncSeriesHook +} = __webpack_require__(92402); +const EntryModuleNotFoundError = __webpack_require__(99531); +const ModuleNotFoundError = __webpack_require__(71638); +const ModuleDependencyWarning = __webpack_require__(59136); +const ModuleDependencyError = __webpack_require__(14953); +const ChunkGroup = __webpack_require__(52911); +const Chunk = __webpack_require__(2919); +const Entrypoint = __webpack_require__(71931); +const MainTemplate = __webpack_require__(43626); +const ChunkTemplate = __webpack_require__(6170); +const HotUpdateChunkTemplate = __webpack_require__(66062); +const ModuleTemplate = __webpack_require__(75100); +const RuntimeTemplate = __webpack_require__(44006); +const ChunkRenderError = __webpack_require__(69865); +const Stats = __webpack_require__(99977); +const Semaphore = __webpack_require__(33349); +const createHash = __webpack_require__(15660); +const SortableSet = __webpack_require__(50071); +const GraphHelpers = __webpack_require__(32973); +const ModuleDependency = __webpack_require__(90865); +const compareLocations = __webpack_require__(22562); +const { Logger, LogType } = __webpack_require__(47194); +const ErrorHelpers = __webpack_require__(80140); +const buildChunkGraph = __webpack_require__(52337); const WebpackError = __webpack_require__(97391); -const CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/; + +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("./DependenciesBlockVariable")} DependenciesBlockVariable */ +/** @typedef {import("./dependencies/SingleEntryDependency")} SingleEntryDependency */ +/** @typedef {import("./dependencies/MultiEntryDependency")} MultiEntryDependency */ +/** @typedef {import("./dependencies/DllEntryDependency")} DllEntryDependency */ +/** @typedef {import("./dependencies/DependencyReference")} DependencyReference */ +/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ +/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ +/** @typedef {import("./Dependency")} Dependency */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate */ +/** @typedef {import("./util/createHash").Hash} Hash */ + +// TODO use @callback +/** @typedef {{[assetName: string]: Source}} CompilationAssets */ +/** @typedef {(err: Error|null, result?: Module) => void } ModuleCallback */ +/** @typedef {(err?: Error|null, result?: Module) => void } ModuleChainCallback */ +/** @typedef {(module: Module) => void} OnModuleCallback */ +/** @typedef {(err?: Error|null) => void} Callback */ +/** @typedef {(d: Dependency) => any} DepBlockVarDependenciesCallback */ +/** @typedef {new (...args: any[]) => Dependency} DepConstructor */ +/** @typedef {{apply: () => void}} Plugin */ /** - * @param {string=} method method name - * @returns {string} message + * @typedef {Object} ModuleFactoryCreateDataContextInfo + * @property {string} issuer + * @property {string} compiler */ -function createMessage(method) { - return `Abstract method${method ? " " + method : ""}. Must be overridden.`; -} /** - * @constructor + * @typedef {Object} ModuleFactoryCreateData + * @property {ModuleFactoryCreateDataContextInfo} contextInfo + * @property {any=} resolveOptions + * @property {string} context + * @property {Dependency[]} dependencies */ -function Message() { - this.stack = undefined; - Error.captureStackTrace(this); - /** @type {RegExpMatchArray} */ - const match = this.stack.split("\n")[3].match(CURRENT_METHOD_REGEXP); - this.message = match && match[1] ? createMessage(match[1]) : createMessage(); -} +/** + * @typedef {Object} ModuleFactory + * @property {(data: ModuleFactoryCreateData, callback: ModuleCallback) => any} create + */ /** - * Error for abstract method - * @example - * class FooClass { - * abstractMethod() { - * throw new AbstractMethodError(); // error message: Abstract method FooClass.abstractMethod. Must be overriden. - * } - * } - * + * @typedef {Object} SortedDependency + * @property {ModuleFactory} factory + * @property {Dependency[]} dependencies */ -class AbstractMethodError extends WebpackError { - constructor() { - super(new Message().message); - this.name = "AbstractMethodError"; - } -} -module.exports = AbstractMethodError; +/** + * @typedef {Object} DependenciesBlockLike + * @property {Dependency[]} dependencies + * @property {AsyncDependenciesBlock[]} blocks + * @property {DependenciesBlockVariable[]} variables + */ +/** + * @typedef {Object} LogEntry + * @property {string} type + * @property {any[]} args + * @property {number} time + * @property {string[]=} trace + */ -/***/ }), +/** + * @typedef {Object} AssetInfo + * @property {boolean=} immutable true, if the asset can be long term cached forever (contains a hash) + * @property {number=} size size in bytes, only set after asset has been emitted + * @property {boolean=} development true, when asset is only used for development and doesn't count towards user-facing assets + * @property {boolean=} hotModuleReplacement true, when asset ships data for updating an existing application (HMR) + */ -/***/ 9701: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/** + * @typedef {Object} Asset + * @property {string} name the filename of the asset + * @property {Source} source source of the asset + * @property {AssetInfo} info info about the asset + */ -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra +/** + * @param {Chunk} a first chunk to sort by id + * @param {Chunk} b second chunk to sort by id + * @returns {-1|0|1} sort value */ +const byId = (a, b) => { + if (typeof a.id !== typeof b.id) { + return typeof a.id < typeof b.id ? -1 : 1; + } + if (a.id < b.id) return -1; + if (a.id > b.id) return 1; + return 0; +}; +/** + * @param {Module} a first module to sort by + * @param {Module} b second module to sort by + * @returns {-1|0|1} sort value + */ +const byIdOrIdentifier = (a, b) => { + if (typeof a.id !== typeof b.id) { + return typeof a.id < typeof b.id ? -1 : 1; + } + if (a.id < b.id) return -1; + if (a.id > b.id) return 1; + const identA = a.identifier(); + const identB = b.identifier(); + if (identA < identB) return -1; + if (identA > identB) return 1; + return 0; +}; +/** + * @param {Module} a first module to sort by + * @param {Module} b second module to sort by + * @returns {-1|0|1} sort value + */ +const byIndexOrIdentifier = (a, b) => { + if (a.index < b.index) return -1; + if (a.index > b.index) return 1; + const identA = a.identifier(); + const identB = b.identifier(); + if (identA < identB) return -1; + if (identA > identB) return 1; + return 0; +}; -const { ConcatSource } = __webpack_require__(53665); -const Template = __webpack_require__(96066); +/** + * @param {Compilation} a first compilation to sort by + * @param {Compilation} b second compilation to sort by + * @returns {-1|0|1} sort value + */ +const byNameOrHash = (a, b) => { + if (a.name < b.name) return -1; + if (a.name > b.name) return 1; + if (a.fullHash < b.fullHash) return -1; + if (a.fullHash > b.fullHash) return 1; + return 0; +}; -/** @typedef {import("./Compilation")} Compilation */ +/** + * @param {DependenciesBlockVariable[]} variables DepBlock Variables to iterate over + * @param {DepBlockVarDependenciesCallback} fn callback to apply on iterated elements + * @returns {void} + */ +const iterationBlockVariable = (variables, fn) => { + for ( + let indexVariable = 0; + indexVariable < variables.length; + indexVariable++ + ) { + const varDep = variables[indexVariable].dependencies; + for (let indexVDep = 0; indexVDep < varDep.length; indexVDep++) { + fn(varDep[indexVDep]); + } + } +}; /** - * @typedef {Object} AmdMainTemplatePluginOptions - * @param {string=} name the library name - * @property {boolean=} requireAsWrapper + * @template T + * @param {T[]} arr array of elements to iterate over + * @param {function(T): void} fn callback applied to each element + * @returns {void} */ +const iterationOfArrayCallback = (arr, fn) => { + for (let index = 0; index < arr.length; index++) { + fn(arr[index]); + } +}; -class AmdMainTemplatePlugin { - /** - * @param {AmdMainTemplatePluginOptions} options the plugin options - */ - constructor(options) { - if (!options || typeof options === "string") { - this.name = options; - this.requireAsWrapper = false; - } else { - this.name = options.name; - this.requireAsWrapper = options.requireAsWrapper; - } +/** + * @template T + * @param {Set} set set to add items to + * @param {Set} otherSet set to add items from + * @returns {void} + */ +const addAllToSet = (set, otherSet) => { + for (const item of otherSet) { + set.add(item); } +}; + +/** + * @param {Source} a a source + * @param {Source} b another source + * @returns {boolean} true, when both sources are equal + */ +const isSourceEqual = (a, b) => { + if (a === b) return true; + // TODO webpack 5: check .buffer() instead, it's called anyway during emit + /** @type {Buffer|string} */ + let aSource = a.source(); + /** @type {Buffer|string} */ + let bSource = b.source(); + if (aSource === bSource) return true; + if (typeof aSource === "string" && typeof bSource === "string") return false; + if (!Buffer.isBuffer(aSource)) aSource = Buffer.from(aSource, "utf-8"); + if (!Buffer.isBuffer(bSource)) bSource = Buffer.from(bSource, "utf-8"); + return aSource.equals(bSource); +}; +class Compilation extends Tapable { /** - * @param {Compilation} compilation the compilation instance - * @returns {void} + * Creates an instance of Compilation. + * @param {Compiler} compiler the compiler which created the compilation */ - apply(compilation) { - const { mainTemplate, chunkTemplate } = compilation; - - const onRenderWithEntry = (source, chunk, hash) => { - const externals = chunk.getModules().filter(m => m.external); - const externalsDepsArray = JSON.stringify( - externals.map(m => - typeof m.request === "object" ? m.request.amd : m.request - ) - ); - const externalsArguments = externals - .map( - m => `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(`${m.id}`)}__` - ) - .join(", "); + constructor(compiler) { + super(); + this.hooks = { + /** @type {SyncHook} */ + buildModule: new SyncHook(["module"]), + /** @type {SyncHook} */ + rebuildModule: new SyncHook(["module"]), + /** @type {SyncHook} */ + failedModule: new SyncHook(["module", "error"]), + /** @type {SyncHook} */ + succeedModule: new SyncHook(["module"]), - if (this.requireAsWrapper) { - return new ConcatSource( - `require(${externalsDepsArray}, function(${externalsArguments}) { return `, - source, - "});" - ); - } else if (this.name) { - const name = mainTemplate.getAssetPath(this.name, { - hash, - chunk - }); + /** @type {SyncHook} */ + addEntry: new SyncHook(["entry", "name"]), + /** @type {SyncHook} */ + failedEntry: new SyncHook(["entry", "name", "error"]), + /** @type {SyncHook} */ + succeedEntry: new SyncHook(["entry", "name", "module"]), - return new ConcatSource( - `define(${JSON.stringify( - name - )}, ${externalsDepsArray}, function(${externalsArguments}) { return `, - source, - "});" - ); - } else if (externalsArguments) { - return new ConcatSource( - `define(${externalsDepsArray}, function(${externalsArguments}) { return `, - source, - "});" - ); - } else { - return new ConcatSource("define(function() { return ", source, "});"); - } - }; + /** @type {SyncWaterfallHook} */ + dependencyReference: new SyncWaterfallHook([ + "dependencyReference", + "dependency", + "module" + ]), - for (const template of [mainTemplate, chunkTemplate]) { - template.hooks.renderWithEntry.tap( - "AmdMainTemplatePlugin", - onRenderWithEntry - ); - } + /** @type {AsyncSeriesHook} */ + finishModules: new AsyncSeriesHook(["modules"]), + /** @type {SyncHook} */ + finishRebuildingModule: new SyncHook(["module"]), + /** @type {SyncHook} */ + unseal: new SyncHook([]), + /** @type {SyncHook} */ + seal: new SyncHook([]), - mainTemplate.hooks.globalHashPaths.tap("AmdMainTemplatePlugin", paths => { - if (this.name) { - paths.push(this.name); - } - return paths; - }); + /** @type {SyncHook} */ + beforeChunks: new SyncHook([]), + /** @type {SyncHook} */ + afterChunks: new SyncHook(["chunks"]), - mainTemplate.hooks.hash.tap("AmdMainTemplatePlugin", hash => { - hash.update("exports amd"); - if (this.name) { - hash.update(this.name); - } - }); - } -} + /** @type {SyncBailHook} */ + optimizeDependenciesBasic: new SyncBailHook(["modules"]), + /** @type {SyncBailHook} */ + optimizeDependencies: new SyncBailHook(["modules"]), + /** @type {SyncBailHook} */ + optimizeDependenciesAdvanced: new SyncBailHook(["modules"]), + /** @type {SyncBailHook} */ + afterOptimizeDependencies: new SyncHook(["modules"]), -module.exports = AmdMainTemplatePlugin; + /** @type {SyncHook} */ + optimize: new SyncHook([]), + /** @type {SyncBailHook} */ + optimizeModulesBasic: new SyncBailHook(["modules"]), + /** @type {SyncBailHook} */ + optimizeModules: new SyncBailHook(["modules"]), + /** @type {SyncBailHook} */ + optimizeModulesAdvanced: new SyncBailHook(["modules"]), + /** @type {SyncHook} */ + afterOptimizeModules: new SyncHook(["modules"]), + /** @type {SyncBailHook} */ + optimizeChunksBasic: new SyncBailHook(["chunks", "chunkGroups"]), + /** @type {SyncBailHook} */ + optimizeChunks: new SyncBailHook(["chunks", "chunkGroups"]), + /** @type {SyncBailHook} */ + optimizeChunksAdvanced: new SyncBailHook(["chunks", "chunkGroups"]), + /** @type {SyncHook} */ + afterOptimizeChunks: new SyncHook(["chunks", "chunkGroups"]), -/***/ }), + /** @type {AsyncSeriesHook} */ + optimizeTree: new AsyncSeriesHook(["chunks", "modules"]), + /** @type {SyncHook} */ + afterOptimizeTree: new SyncHook(["chunks", "modules"]), -/***/ 22814: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** @type {SyncBailHook} */ + optimizeChunkModulesBasic: new SyncBailHook(["chunks", "modules"]), + /** @type {SyncBailHook} */ + optimizeChunkModules: new SyncBailHook(["chunks", "modules"]), + /** @type {SyncBailHook} */ + optimizeChunkModulesAdvanced: new SyncBailHook(["chunks", "modules"]), + /** @type {SyncHook} */ + afterOptimizeChunkModules: new SyncHook(["chunks", "modules"]), + /** @type {SyncBailHook} */ + shouldRecord: new SyncBailHook([]), -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + /** @type {SyncHook} */ + reviveModules: new SyncHook(["modules", "records"]), + /** @type {SyncHook} */ + optimizeModuleOrder: new SyncHook(["modules"]), + /** @type {SyncHook} */ + advancedOptimizeModuleOrder: new SyncHook(["modules"]), + /** @type {SyncHook} */ + beforeModuleIds: new SyncHook(["modules"]), + /** @type {SyncHook} */ + moduleIds: new SyncHook(["modules"]), + /** @type {SyncHook} */ + optimizeModuleIds: new SyncHook(["modules"]), + /** @type {SyncHook} */ + afterOptimizeModuleIds: new SyncHook(["modules"]), + /** @type {SyncHook} */ + reviveChunks: new SyncHook(["chunks", "records"]), + /** @type {SyncHook} */ + optimizeChunkOrder: new SyncHook(["chunks"]), + /** @type {SyncHook} */ + beforeChunkIds: new SyncHook(["chunks"]), + /** @type {SyncHook} */ + optimizeChunkIds: new SyncHook(["chunks"]), + /** @type {SyncHook} */ + afterOptimizeChunkIds: new SyncHook(["chunks"]), -const DependenciesBlock = __webpack_require__(16071); + /** @type {SyncHook} */ + recordModules: new SyncHook(["modules", "records"]), + /** @type {SyncHook} */ + recordChunks: new SyncHook(["chunks", "records"]), -/** @typedef {import("./ChunkGroup")} ChunkGroup */ -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ -/** @typedef {import("./util/createHash").Hash} Hash */ -/** @typedef {TODO} GroupOptions */ + /** @type {SyncHook} */ + beforeHash: new SyncHook([]), + /** @type {SyncHook} */ + contentHash: new SyncHook(["chunk"]), + /** @type {SyncHook} */ + afterHash: new SyncHook([]), + /** @type {SyncHook} */ + recordHash: new SyncHook(["records"]), + /** @type {SyncHook} */ + record: new SyncHook(["compilation", "records"]), -module.exports = class AsyncDependenciesBlock extends DependenciesBlock { - /** - * @param {GroupOptions} groupOptions options for the group - * @param {Module} module the Module object - * @param {DependencyLocation=} loc the line of code - * @param {TODO=} request the request - */ - constructor(groupOptions, module, loc, request) { - super(); - if (typeof groupOptions === "string") { - groupOptions = { name: groupOptions }; - } else if (!groupOptions) { - groupOptions = { name: undefined }; - } - this.groupOptions = groupOptions; - /** @type {ChunkGroup=} */ - this.chunkGroup = undefined; - this.module = module; - this.loc = loc; - this.request = request; - /** @type {DependenciesBlock} */ - this.parent = undefined; - } + /** @type {SyncHook} */ + beforeModuleAssets: new SyncHook([]), + /** @type {SyncBailHook} */ + shouldGenerateChunkAssets: new SyncBailHook([]), + /** @type {SyncHook} */ + beforeChunkAssets: new SyncHook([]), + /** @type {SyncHook} */ + additionalChunkAssets: new SyncHook(["chunks"]), - /** - * @returns {string} The name of the chunk - */ - get chunkName() { - return this.groupOptions.name; - } + /** @type {AsyncSeriesHook} */ + additionalAssets: new AsyncSeriesHook([]), + /** @type {AsyncSeriesHook} */ + optimizeChunkAssets: new AsyncSeriesHook(["chunks"]), + /** @type {SyncHook} */ + afterOptimizeChunkAssets: new SyncHook(["chunks"]), + /** @type {AsyncSeriesHook} */ + optimizeAssets: new AsyncSeriesHook(["assets"]), + /** @type {SyncHook} */ + afterOptimizeAssets: new SyncHook(["assets"]), - /** - * @param {string} value The new chunk name - * @returns {void} - */ - set chunkName(value) { - this.groupOptions.name = value; + /** @type {SyncBailHook} */ + needAdditionalSeal: new SyncBailHook([]), + /** @type {AsyncSeriesHook} */ + afterSeal: new AsyncSeriesHook([]), + + /** @type {SyncHook} */ + chunkHash: new SyncHook(["chunk", "chunkHash"]), + /** @type {SyncHook} */ + moduleAsset: new SyncHook(["module", "filename"]), + /** @type {SyncHook} */ + chunkAsset: new SyncHook(["chunk", "filename"]), + + /** @type {SyncWaterfallHook} */ + assetPath: new SyncWaterfallHook(["filename", "data"]), // TODO MainTemplate + + /** @type {SyncBailHook} */ + needAdditionalPass: new SyncBailHook([]), + + /** @type {SyncHook} */ + childCompiler: new SyncHook([ + "childCompiler", + "compilerName", + "compilerIndex" + ]), + + /** @type {SyncBailHook} */ + log: new SyncBailHook(["origin", "logEntry"]), + + // TODO the following hooks are weirdly located here + // TODO move them for webpack 5 + /** @type {SyncHook} */ + normalModuleLoader: new SyncHook(["loaderContext", "module"]), + + /** @type {SyncBailHook} */ + optimizeExtractedChunksBasic: new SyncBailHook(["chunks"]), + /** @type {SyncBailHook} */ + optimizeExtractedChunks: new SyncBailHook(["chunks"]), + /** @type {SyncBailHook} */ + optimizeExtractedChunksAdvanced: new SyncBailHook(["chunks"]), + /** @type {SyncHook} */ + afterOptimizeExtractedChunks: new SyncHook(["chunks"]) + }; + this._pluginCompat.tap("Compilation", options => { + switch (options.name) { + case "optimize-tree": + case "additional-assets": + case "optimize-chunk-assets": + case "optimize-assets": + case "after-seal": + options.async = true; + break; + } + }); + /** @type {string=} */ + this.name = undefined; + /** @type {Compiler} */ + this.compiler = compiler; + this.resolverFactory = compiler.resolverFactory; + this.inputFileSystem = compiler.inputFileSystem; + this.requestShortener = compiler.requestShortener; + + const options = compiler.options; + this.options = options; + this.outputOptions = options && options.output; + /** @type {boolean=} */ + this.bail = options && options.bail; + this.profile = options && options.profile; + this.performance = options && options.performance; + + this.mainTemplate = new MainTemplate(this.outputOptions); + this.chunkTemplate = new ChunkTemplate(this.outputOptions); + this.hotUpdateChunkTemplate = new HotUpdateChunkTemplate( + this.outputOptions + ); + this.runtimeTemplate = new RuntimeTemplate( + this.outputOptions, + this.requestShortener + ); + this.moduleTemplates = { + javascript: new ModuleTemplate(this.runtimeTemplate, "javascript"), + webassembly: new ModuleTemplate(this.runtimeTemplate, "webassembly") + }; + + this.semaphore = new Semaphore(options.parallelism || 100); + + this.entries = []; + /** @private @type {{name: string, request: string, module: Module}[]} */ + this._preparedEntrypoints = []; + /** @type {Map} */ + this.entrypoints = new Map(); + /** @type {Chunk[]} */ + this.chunks = []; + /** @type {ChunkGroup[]} */ + this.chunkGroups = []; + /** @type {Map} */ + this.namedChunkGroups = new Map(); + /** @type {Map} */ + this.namedChunks = new Map(); + /** @type {Module[]} */ + this.modules = []; + /** @private @type {Map} */ + this._modules = new Map(); + this.cache = null; + this.records = null; + /** @type {string[]} */ + this.additionalChunkAssets = []; + /** @type {CompilationAssets} */ + this.assets = {}; + /** @type {Map} */ + this.assetsInfo = new Map(); + /** @type {WebpackError[]} */ + this.errors = []; + /** @type {WebpackError[]} */ + this.warnings = []; + /** @type {Compilation[]} */ + this.children = []; + /** @type {Map} */ + this.logging = new Map(); + /** @type {Map} */ + this.dependencyFactories = new Map(); + /** @type {Map} */ + this.dependencyTemplates = new Map(); + // TODO refactor this in webpack 5 to a custom DependencyTemplates class with a hash property + // @ts-ignore + this.dependencyTemplates.set("hash", ""); + this.childrenCounters = {}; + /** @type {Set} */ + this.usedChunkIds = null; + /** @type {Set} */ + this.usedModuleIds = null; + /** @type {Map=} */ + this.fileTimestamps = undefined; + /** @type {Map=} */ + this.contextTimestamps = undefined; + /** @type {Set=} */ + this.compilationDependencies = undefined; + /** @private @type {Map} */ + this._buildingModules = new Map(); + /** @private @type {Map} */ + this._rebuildingModules = new Map(); + /** @type {Set} */ + this.emittedAssets = new Set(); + } + + getStats() { + return new Stats(this); } /** - * @returns {never} this throws and should never be called + * @param {string | (function(): string)} name name of the logger, or function called once to get the logger name + * @returns {Logger} a logger with that name */ - get chunks() { - throw new Error("Moved to AsyncDependenciesBlock.chunkGroup"); + getLogger(name) { + if (!name) { + throw new TypeError("Compilation.getLogger(name) called without a name"); + } + /** @type {LogEntry[] | undefined} */ + let logEntries; + return new Logger((type, args) => { + if (typeof name === "function") { + name = name(); + if (!name) { + throw new TypeError( + "Compilation.getLogger(name) called with a function not returning a name" + ); + } + } + let trace; + switch (type) { + case LogType.warn: + case LogType.error: + case LogType.trace: + trace = ErrorHelpers.cutOffLoaderExecution(new Error("Trace").stack) + .split("\n") + .slice(3); + break; + } + /** @type {LogEntry} */ + const logEntry = { + time: Date.now(), + type, + args, + trace + }; + if (this.hooks.log.call(name, logEntry) === undefined) { + if (logEntry.type === LogType.profileEnd) { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.profileEnd === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.profileEnd(`[${name}] ${logEntry.args[0]}`); + } + } + if (logEntries === undefined) { + logEntries = this.logging.get(name); + if (logEntries === undefined) { + logEntries = []; + this.logging.set(name, logEntries); + } + } + logEntries.push(logEntry); + if (logEntry.type === LogType.profile) { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.profile === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.profile(`[${name}] ${logEntry.args[0]}`); + } + } + } + }); } /** - * @param {never} value setter value - * @returns {never} this is going to throw therefore we should throw type - * assertions by returning never + * @typedef {Object} AddModuleResult + * @property {Module} module the added or existing module + * @property {boolean} issuer was this the first request for this module + * @property {boolean} build should the module be build + * @property {boolean} dependencies should dependencies be walked */ - set chunks(value) { - throw new Error("Moved to AsyncDependenciesBlock.chunkGroup"); - } /** - * @param {Hash} hash the hash used to track block changes, from "crypto" module - * @returns {void} + * @param {Module} module module to be added that was created + * @param {any=} cacheGroup cacheGroup it is apart of + * @returns {AddModuleResult} returns meta about whether or not the module had built + * had an issuer, or any dependnecies */ - updateHash(hash) { - hash.update(JSON.stringify(this.groupOptions)); - hash.update( - (this.chunkGroup && - this.chunkGroup.chunks - .map(chunk => { - return chunk.id !== null ? chunk.id : ""; - }) - .join(",")) || - "" - ); - super.updateHash(hash); + addModule(module, cacheGroup) { + const identifier = module.identifier(); + const alreadyAddedModule = this._modules.get(identifier); + if (alreadyAddedModule) { + return { + module: alreadyAddedModule, + issuer: false, + build: false, + dependencies: false + }; + } + const cacheName = (cacheGroup || "m") + identifier; + if (this.cache && this.cache[cacheName]) { + const cacheModule = this.cache[cacheName]; + + if (typeof cacheModule.updateCacheModule === "function") { + cacheModule.updateCacheModule(module); + } + + let rebuild = true; + if (this.fileTimestamps && this.contextTimestamps) { + rebuild = cacheModule.needRebuild( + this.fileTimestamps, + this.contextTimestamps + ); + } + + if (!rebuild) { + cacheModule.disconnect(); + this._modules.set(identifier, cacheModule); + this.modules.push(cacheModule); + for (const err of cacheModule.errors) { + this.errors.push(err); + } + for (const err of cacheModule.warnings) { + this.warnings.push(err); + } + return { + module: cacheModule, + issuer: true, + build: false, + dependencies: true + }; + } + cacheModule.unbuild(); + module = cacheModule; + } + this._modules.set(identifier, module); + if (this.cache) { + this.cache[cacheName] = module; + } + this.modules.push(module); + return { + module: module, + issuer: true, + build: true, + dependencies: true + }; } /** - * @returns {void} + * Fetches a module from a compilation by its identifier + * @param {Module} module the module provided + * @returns {Module} the module requested */ - disconnect() { - this.chunkGroup = undefined; - super.disconnect(); + getModule(module) { + const identifier = module.identifier(); + return this._modules.get(identifier); } /** - * @returns {void} + * Attempts to search for a module by its identifier + * @param {string} identifier identifier (usually path) for module + * @returns {Module|undefined} attempt to search for module and return it, else undefined */ - unseal() { - this.chunkGroup = undefined; - super.unseal(); + findModule(identifier) { + return this._modules.get(identifier); } /** + * @param {Module} module module with its callback list + * @param {Callback} callback the callback function * @returns {void} */ - sortItems() { - super.sortItems(); + waitForBuildingFinished(module, callback) { + let callbackList = this._buildingModules.get(module); + if (callbackList) { + callbackList.push(() => callback()); + } else { + process.nextTick(callback); + } } -}; - - -/***/ }), - -/***/ 67089: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Sean Larkin @thelarkinn -*/ - -const WebpackError = __webpack_require__(97391); - -/** @typedef {import("./Module")} Module */ - -class AsyncDependencyToInitialChunkError extends WebpackError { /** - * Creates an instance of AsyncDependencyToInitialChunkError. - * @param {string} chunkName Name of Chunk - * @param {Module} module module tied to dependency - * @param {TODO} loc location of dependency + * Builds the module object + * + * @param {Module} module module to be built + * @param {boolean} optional optional flag + * @param {Module=} origin origin module this module build was requested from + * @param {Dependency[]=} dependencies optional dependencies from the module to be built + * @param {TODO} thisCallback the callback + * @returns {TODO} returns the callback function with results */ - constructor(chunkName, module, loc) { - super( - `It's not allowed to load an initial chunk on demand. The chunk name "${chunkName}" is already used by an entrypoint.` - ); + buildModule(module, optional, origin, dependencies, thisCallback) { + let callbackList = this._buildingModules.get(module); + if (callbackList) { + callbackList.push(thisCallback); + return; + } + this._buildingModules.set(module, (callbackList = [thisCallback])); - this.name = "AsyncDependencyToInitialChunkError"; - this.module = module; - this.loc = loc; + const callback = err => { + this._buildingModules.delete(module); + for (const cb of callbackList) { + cb(err); + } + }; - Error.captureStackTrace(this, this.constructor); - } -} + this.hooks.buildModule.call(module); + module.build( + this.options, + this, + this.resolverFactory.get("normal", module.resolveOptions), + this.inputFileSystem, + error => { + const errors = module.errors; + for (let indexError = 0; indexError < errors.length; indexError++) { + const err = errors[indexError]; + err.origin = origin; + err.dependencies = dependencies; + if (optional) { + this.warnings.push(err); + } else { + this.errors.push(err); + } + } -module.exports = AsyncDependencyToInitialChunkError; + const warnings = module.warnings; + for ( + let indexWarning = 0; + indexWarning < warnings.length; + indexWarning++ + ) { + const war = warnings[indexWarning]; + war.origin = origin; + war.dependencies = dependencies; + this.warnings.push(war); + } + const originalMap = module.dependencies.reduce((map, v, i) => { + map.set(v, i); + return map; + }, new Map()); + module.dependencies.sort((a, b) => { + const cmp = compareLocations(a.loc, b.loc); + if (cmp) return cmp; + return originalMap.get(a) - originalMap.get(b); + }); + if (error) { + this.hooks.failedModule.call(module, error); + return callback(error); + } + this.hooks.succeedModule.call(module); + return callback(); + } + ); + } + /** + * @param {Module} module to be processed for deps + * @param {ModuleCallback} callback callback to be triggered + * @returns {void} + */ + processModuleDependencies(module, callback) { + const dependencies = new Map(); -/***/ }), + const addDependency = dep => { + const resourceIdent = dep.getResourceIdentifier(); + if (resourceIdent) { + const factory = this.dependencyFactories.get(dep.constructor); + if (factory === undefined) { + throw new Error( + `No module factory available for dependency type: ${dep.constructor.name}` + ); + } + let innerMap = dependencies.get(factory); + if (innerMap === undefined) { + dependencies.set(factory, (innerMap = new Map())); + } + let list = innerMap.get(resourceIdent); + if (list === undefined) innerMap.set(resourceIdent, (list = [])); + list.push(dep); + } + }; -/***/ 51596: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + const addDependenciesBlock = block => { + if (block.dependencies) { + iterationOfArrayCallback(block.dependencies, addDependency); + } + if (block.blocks) { + iterationOfArrayCallback(block.blocks, addDependenciesBlock); + } + if (block.variables) { + iterationBlockVariable(block.variables, addDependency); + } + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + try { + addDependenciesBlock(module); + } catch (e) { + callback(e); + } + const sortedDependencies = []; -const asyncLib = __webpack_require__(36386); -const PrefetchDependency = __webpack_require__(14237); -const NormalModule = __webpack_require__(25963); + for (const pair1 of dependencies) { + for (const pair2 of pair1[1]) { + sortedDependencies.push({ + factory: pair1[0], + dependencies: pair2[1] + }); + } + } -/** @typedef {import("./Compiler")} Compiler */ + this.addModuleDependencies( + module, + sortedDependencies, + this.bail, + null, + true, + callback + ); + } -class AutomaticPrefetchPlugin { /** - * Apply the plugin - * @param {Compiler} compiler Webpack Compiler + * @param {Module} module module to add deps to + * @param {SortedDependency[]} dependencies set of sorted dependencies to iterate through + * @param {(boolean|null)=} bail whether to bail or not + * @param {TODO} cacheGroup optional cacheGroup + * @param {boolean} recursive whether it is recursive traversal + * @param {function} callback callback for when dependencies are finished being added * @returns {void} */ - apply(compiler) { - compiler.hooks.compilation.tap( - "AutomaticPrefetchPlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set( - PrefetchDependency, - normalModuleFactory - ); - } - ); - let lastModules = null; - compiler.hooks.afterCompile.tap("AutomaticPrefetchPlugin", compilation => { - lastModules = compilation.modules - .filter(m => m instanceof NormalModule) - .map((/** @type {NormalModule} */ m) => ({ - context: m.context, - request: m.request - })); - }); - compiler.hooks.make.tapAsync( - "AutomaticPrefetchPlugin", - (compilation, callback) => { - if (!lastModules) return callback(); - asyncLib.forEach( - lastModules, - (m, callback) => { - compilation.prefetch( - m.context || compiler.context, - new PrefetchDependency(m.request), - callback - ); - }, - callback - ); - } - ); - } -} -module.exports = AutomaticPrefetchPlugin; + addModuleDependencies( + module, + dependencies, + bail, + cacheGroup, + recursive, + callback + ) { + const start = this.profile && Date.now(); + const currentProfile = this.profile && {}; + asyncLib.forEach( + dependencies, + (item, callback) => { + const dependencies = item.dependencies; -/***/ }), + const errorAndCallback = err => { + err.origin = module; + err.dependencies = dependencies; + this.errors.push(err); + if (bail) { + callback(err); + } else { + callback(); + } + }; + const warningAndCallback = err => { + err.origin = module; + this.warnings.push(err); + callback(); + }; -/***/ 4009: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + const semaphore = this.semaphore; + semaphore.acquire(() => { + const factory = item.factory; + factory.create( + { + contextInfo: { + issuer: module.nameForCondition && module.nameForCondition(), + compiler: this.compiler.name + }, + resolveOptions: module.resolveOptions, + context: module.context, + dependencies: dependencies + }, + (err, dependentModule) => { + let afterFactory; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ + const isOptional = () => { + return dependencies.every(d => d.optional); + }; + const errorOrWarningAndCallback = err => { + if (isOptional()) { + return warningAndCallback(err); + } else { + return errorAndCallback(err); + } + }; + if (err) { + semaphore.release(); + return errorOrWarningAndCallback( + new ModuleNotFoundError(module, err) + ); + } + if (!dependentModule) { + semaphore.release(); + return process.nextTick(callback); + } + if (currentProfile) { + afterFactory = Date.now(); + currentProfile.factory = afterFactory - start; + } -const { ConcatSource } = __webpack_require__(53665); -const ModuleFilenameHelpers = __webpack_require__(71474); -const Template = __webpack_require__(96066); + const iterationDependencies = depend => { + for (let index = 0; index < depend.length; index++) { + const dep = depend[index]; + dep.module = dependentModule; + dependentModule.addReason(module, dep); + } + }; -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(10171); + const addModuleResult = this.addModule( + dependentModule, + cacheGroup + ); + dependentModule = addModuleResult.module; + iterationDependencies(dependencies); -/** @typedef {import("../declarations/plugins/BannerPlugin").BannerPluginArgument} BannerPluginArgument */ -/** @typedef {import("../declarations/plugins/BannerPlugin").BannerPluginOptions} BannerPluginOptions */ + const afterBuild = () => { + if (recursive && addModuleResult.dependencies) { + this.processModuleDependencies(dependentModule, callback); + } else { + return callback(); + } + }; -const wrapComment = str => { - if (!str.includes("\n")) { - return Template.toComment(str); + if (addModuleResult.issuer) { + if (currentProfile) { + dependentModule.profile = currentProfile; + } + + dependentModule.issuer = module; + } else { + if (this.profile) { + if (module.profile) { + const time = Date.now() - start; + if ( + !module.profile.dependencies || + time > module.profile.dependencies + ) { + module.profile.dependencies = time; + } + } + } + } + + if (addModuleResult.build) { + this.buildModule( + dependentModule, + isOptional(), + module, + dependencies, + err => { + if (err) { + semaphore.release(); + return errorOrWarningAndCallback(err); + } + + if (currentProfile) { + const afterBuilding = Date.now(); + currentProfile.building = afterBuilding - afterFactory; + } + + semaphore.release(); + afterBuild(); + } + ); + } else { + semaphore.release(); + this.waitForBuildingFinished(dependentModule, afterBuild); + } + } + ); + }); + }, + err => { + // In V8, the Error objects keep a reference to the functions on the stack. These warnings & + // errors are created inside closures that keep a reference to the Compilation, so errors are + // leaking the Compilation object. + + if (err) { + // eslint-disable-next-line no-self-assign + err.stack = err.stack; + return callback(err); + } + + return process.nextTick(callback); + } + ); } - return `/*!\n * ${str - .replace(/\*\//g, "* /") - .split("\n") - .join("\n * ")}\n */`; -}; -class BannerPlugin { /** - * @param {BannerPluginArgument} options options object + * + * @param {string} context context string path + * @param {Dependency} dependency dependency used to create Module chain + * @param {OnModuleCallback} onModule function invoked on modules creation + * @param {ModuleChainCallback} callback callback for when module chain is complete + * @returns {void} will throw if dependency instance is not a valid Dependency */ - constructor(options) { - if (arguments.length > 1) { + _addModuleChain(context, dependency, onModule, callback) { + const start = this.profile && Date.now(); + const currentProfile = this.profile && {}; + + const errorAndCallback = this.bail + ? err => { + callback(err); + } + : err => { + err.dependencies = [dependency]; + this.errors.push(err); + callback(); + }; + + if ( + typeof dependency !== "object" || + dependency === null || + !dependency.constructor + ) { + throw new Error("Parameter 'dependency' must be a Dependency"); + } + const Dep = /** @type {DepConstructor} */ (dependency.constructor); + const moduleFactory = this.dependencyFactories.get(Dep); + if (!moduleFactory) { throw new Error( - "BannerPlugin only takes one argument (pass an options object)" + `No dependency factory available for this dependency type: ${dependency.constructor.name}` ); } - validateOptions(schema, options, "Banner Plugin"); + this.semaphore.acquire(() => { + moduleFactory.create( + { + contextInfo: { + issuer: "", + compiler: this.compiler.name + }, + context: context, + dependencies: [dependency] + }, + (err, module) => { + if (err) { + this.semaphore.release(); + return errorAndCallback(new EntryModuleNotFoundError(err)); + } - if (typeof options === "string" || typeof options === "function") { - options = { - banner: options - }; - } + let afterFactory; - /** @type {BannerPluginOptions} */ - this.options = options; + if (currentProfile) { + afterFactory = Date.now(); + currentProfile.factory = afterFactory - start; + } - const bannerOption = options.banner; - if (typeof bannerOption === "function") { - const getBanner = bannerOption; - this.banner = this.options.raw - ? getBanner - : data => wrapComment(getBanner(data)); - } else { - const banner = this.options.raw - ? bannerOption - : wrapComment(bannerOption); - this.banner = () => banner; - } - } + const addModuleResult = this.addModule(module); + module = addModuleResult.module; - apply(compiler) { - const options = this.options; - const banner = this.banner; - const matchObject = ModuleFilenameHelpers.matchObject.bind( - undefined, - options - ); + onModule(module); - compiler.hooks.compilation.tap("BannerPlugin", compilation => { - compilation.hooks.optimizeChunkAssets.tap("BannerPlugin", chunks => { - for (const chunk of chunks) { - if (options.entryOnly && !chunk.canBeInitial()) { - continue; - } + dependency.module = module; + module.addReason(null, dependency); - for (const file of chunk.files) { - if (!matchObject(file)) { - continue; + const afterBuild = () => { + if (addModuleResult.dependencies) { + this.processModuleDependencies(module, err => { + if (err) return callback(err); + callback(null, module); + }); + } else { + return callback(null, module); } + }; - let query = ""; - let filename = file; - const hash = compilation.hash; - const querySplit = filename.indexOf("?"); - - if (querySplit >= 0) { - query = filename.substr(querySplit); - filename = filename.substr(0, querySplit); + if (addModuleResult.issuer) { + if (currentProfile) { + module.profile = currentProfile; } + } - const lastSlashIndex = filename.lastIndexOf("/"); - - const basename = - lastSlashIndex === -1 - ? filename - : filename.substr(lastSlashIndex + 1); - - const data = { - hash, - chunk, - filename, - basename, - query - }; + if (addModuleResult.build) { + this.buildModule(module, false, null, null, err => { + if (err) { + this.semaphore.release(); + return errorAndCallback(err); + } - const comment = compilation.getPath(banner(data), data); + if (currentProfile) { + const afterBuilding = Date.now(); + currentProfile.building = afterBuilding - afterFactory; + } - compilation.updateAsset( - file, - old => new ConcatSource(comment, "\n", old) - ); + this.semaphore.release(); + afterBuild(); + }); + } else { + this.semaphore.release(); + this.waitForBuildingFinished(module, afterBuild); } } - }); + ); }); } -} - -module.exports = BannerPlugin; - - -/***/ }), - -/***/ 96770: -/***/ (function(module) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + /** + * + * @param {string} context context path for entry + * @param {Dependency} entry entry dependency being created + * @param {string} name name of entry + * @param {ModuleCallback} callback callback function + * @returns {void} returns + */ + addEntry(context, entry, name, callback) { + this.hooks.addEntry.call(entry, name); + const slot = { + name: name, + // TODO webpack 5 remove `request` + request: null, + module: null + }; -const TypeUnknown = 0; -const TypeNull = 1; -const TypeString = 2; -const TypeNumber = 3; -const TypeBoolean = 4; -const TypeRegExp = 5; -const TypeConditional = 6; -const TypeArray = 7; -const TypeConstArray = 8; -const TypeIdentifier = 9; -const TypeWrapped = 10; -const TypeTemplateString = 11; + if (entry instanceof ModuleDependency) { + slot.request = entry.request; + } -class BasicEvaluatedExpression { - constructor() { - this.type = TypeUnknown; - this.range = null; - this.falsy = false; - this.truthy = false; - this.bool = null; - this.number = null; - this.regExp = null; - this.string = null; - this.quasis = null; - this.parts = null; - this.array = null; - this.items = null; - this.options = null; - this.prefix = null; - this.postfix = null; - this.wrappedInnerExpressions = null; - this.expression = null; - } + // TODO webpack 5: merge modules instead when multiple entry modules are supported + const idx = this._preparedEntrypoints.findIndex(slot => slot.name === name); + if (idx >= 0) { + // Overwrite existing entrypoint + this._preparedEntrypoints[idx] = slot; + } else { + this._preparedEntrypoints.push(slot); + } + this._addModuleChain( + context, + entry, + module => { + this.entries.push(module); + }, + (err, module) => { + if (err) { + this.hooks.failedEntry.call(entry, name, err); + return callback(err); + } - isNull() { - return this.type === TypeNull; + if (module) { + slot.module = module; + } else { + const idx = this._preparedEntrypoints.indexOf(slot); + if (idx >= 0) { + this._preparedEntrypoints.splice(idx, 1); + } + } + this.hooks.succeedEntry.call(entry, name, module); + return callback(null, module); + } + ); } - isString() { - return this.type === TypeString; + /** + * @param {string} context context path string + * @param {Dependency} dependency dep used to create module + * @param {ModuleCallback} callback module callback sending module up a level + * @returns {void} + */ + prefetch(context, dependency, callback) { + this._addModuleChain( + context, + dependency, + module => { + module.prefetched = true; + }, + callback + ); } - isNumber() { - return this.type === TypeNumber; - } + /** + * @param {Module} module module to be rebuilt + * @param {Callback} thisCallback callback when module finishes rebuilding + * @returns {void} + */ + rebuildModule(module, thisCallback) { + let callbackList = this._rebuildingModules.get(module); + if (callbackList) { + callbackList.push(thisCallback); + return; + } + this._rebuildingModules.set(module, (callbackList = [thisCallback])); - isBoolean() { - return this.type === TypeBoolean; - } + const callback = err => { + this._rebuildingModules.delete(module); + for (const cb of callbackList) { + cb(err); + } + }; - isRegExp() { - return this.type === TypeRegExp; - } + this.hooks.rebuildModule.call(module); + const oldDependencies = module.dependencies.slice(); + const oldVariables = module.variables.slice(); + const oldBlocks = module.blocks.slice(); + module.unbuild(); + this.buildModule(module, false, module, null, err => { + if (err) { + this.hooks.finishRebuildingModule.call(module); + return callback(err); + } - isConditional() { - return this.type === TypeConditional; + this.processModuleDependencies(module, err => { + if (err) return callback(err); + this.removeReasonsOfDependencyBlock(module, { + dependencies: oldDependencies, + variables: oldVariables, + blocks: oldBlocks + }); + this.hooks.finishRebuildingModule.call(module); + callback(); + }); + }); } - isArray() { - return this.type === TypeArray; - } + finish(callback) { + const modules = this.modules; + this.hooks.finishModules.callAsync(modules, err => { + if (err) return callback(err); - isConstArray() { - return this.type === TypeConstArray; - } + for (let index = 0; index < modules.length; index++) { + const module = modules[index]; + this.reportDependencyErrorsAndWarnings(module, [module]); + } - isIdentifier() { - return this.type === TypeIdentifier; + callback(); + }); } - isWrapped() { - return this.type === TypeWrapped; + unseal() { + this.hooks.unseal.call(); + this.chunks.length = 0; + this.chunkGroups.length = 0; + this.namedChunks.clear(); + this.namedChunkGroups.clear(); + this.additionalChunkAssets.length = 0; + this.assets = {}; + this.assetsInfo.clear(); + for (const module of this.modules) { + module.unseal(); + } } - isTemplateString() { - return this.type === TypeTemplateString; - } + /** + * @param {Callback} callback signals when the seal method is finishes + * @returns {void} + */ + seal(callback) { + this.hooks.seal.call(); - isTruthy() { - return this.truthy; - } + while ( + this.hooks.optimizeDependenciesBasic.call(this.modules) || + this.hooks.optimizeDependencies.call(this.modules) || + this.hooks.optimizeDependenciesAdvanced.call(this.modules) + ) { + /* empty */ + } + this.hooks.afterOptimizeDependencies.call(this.modules); - isFalsy() { - return this.falsy; - } + this.hooks.beforeChunks.call(); + for (const preparedEntrypoint of this._preparedEntrypoints) { + const module = preparedEntrypoint.module; + const name = preparedEntrypoint.name; + const chunk = this.addChunk(name); + const entrypoint = new Entrypoint(name); + entrypoint.setRuntimeChunk(chunk); + entrypoint.addOrigin(null, name, preparedEntrypoint.request); + this.namedChunkGroups.set(name, entrypoint); + this.entrypoints.set(name, entrypoint); + this.chunkGroups.push(entrypoint); - asBool() { - if (this.truthy) return true; - if (this.falsy) return false; - if (this.isBoolean()) return this.bool; - if (this.isNull()) return false; - if (this.isString()) return this.string !== ""; - if (this.isNumber()) return this.number !== 0; - if (this.isRegExp()) return true; - if (this.isArray()) return true; - if (this.isConstArray()) return true; - if (this.isWrapped()) { - return (this.prefix && this.prefix.asBool()) || - (this.postfix && this.postfix.asBool()) - ? true - : undefined; - } - if (this.isTemplateString()) { - const str = this.asString(); - if (typeof str === "string") return str !== ""; - } - return undefined; - } + GraphHelpers.connectChunkGroupAndChunk(entrypoint, chunk); + GraphHelpers.connectChunkAndModule(chunk, module); - asString() { - if (this.isBoolean()) return `${this.bool}`; - if (this.isNull()) return "null"; - if (this.isString()) return this.string; - if (this.isNumber()) return `${this.number}`; - if (this.isRegExp()) return `${this.regExp}`; - if (this.isArray()) { - let array = []; - for (const item of this.items) { - const itemStr = item.asString(); - if (itemStr === undefined) return undefined; - array.push(itemStr); - } - return `${array}`; - } - if (this.isConstArray()) return `${this.array}`; - if (this.isTemplateString()) { - let str = ""; - for (const part of this.parts) { - const partStr = part.asString(); - if (partStr === undefined) return undefined; - str += partStr; - } - return str; + chunk.entryModule = module; + chunk.name = name; + + this.assignDepth(module); } - return undefined; - } + buildChunkGraph( + this, + /** @type {Entrypoint[]} */ (this.chunkGroups.slice()) + ); + this.sortModules(this.modules); + this.hooks.afterChunks.call(this.chunks); - setString(string) { - this.type = TypeString; - this.string = string; - return this; - } + this.hooks.optimize.call(); - setNull() { - this.type = TypeNull; - return this; - } + while ( + this.hooks.optimizeModulesBasic.call(this.modules) || + this.hooks.optimizeModules.call(this.modules) || + this.hooks.optimizeModulesAdvanced.call(this.modules) + ) { + /* empty */ + } + this.hooks.afterOptimizeModules.call(this.modules); - setNumber(number) { - this.type = TypeNumber; - this.number = number; - return this; - } + while ( + this.hooks.optimizeChunksBasic.call(this.chunks, this.chunkGroups) || + this.hooks.optimizeChunks.call(this.chunks, this.chunkGroups) || + this.hooks.optimizeChunksAdvanced.call(this.chunks, this.chunkGroups) + ) { + /* empty */ + } + this.hooks.afterOptimizeChunks.call(this.chunks, this.chunkGroups); - setBoolean(bool) { - this.type = TypeBoolean; - this.bool = bool; - return this; - } + this.hooks.optimizeTree.callAsync(this.chunks, this.modules, err => { + if (err) { + return callback(err); + } - setRegExp(regExp) { - this.type = TypeRegExp; - this.regExp = regExp; - return this; - } + this.hooks.afterOptimizeTree.call(this.chunks, this.modules); - setIdentifier(identifier) { - this.type = TypeIdentifier; - this.identifier = identifier; - return this; - } + while ( + this.hooks.optimizeChunkModulesBasic.call(this.chunks, this.modules) || + this.hooks.optimizeChunkModules.call(this.chunks, this.modules) || + this.hooks.optimizeChunkModulesAdvanced.call(this.chunks, this.modules) + ) { + /* empty */ + } + this.hooks.afterOptimizeChunkModules.call(this.chunks, this.modules); - setWrapped(prefix, postfix, innerExpressions) { - this.type = TypeWrapped; - this.prefix = prefix; - this.postfix = postfix; - this.wrappedInnerExpressions = innerExpressions; - return this; - } + const shouldRecord = this.hooks.shouldRecord.call() !== false; - setOptions(options) { - this.type = TypeConditional; - this.options = options; - return this; - } + this.hooks.reviveModules.call(this.modules, this.records); + this.hooks.optimizeModuleOrder.call(this.modules); + this.hooks.advancedOptimizeModuleOrder.call(this.modules); + this.hooks.beforeModuleIds.call(this.modules); + this.hooks.moduleIds.call(this.modules); + this.applyModuleIds(); + this.hooks.optimizeModuleIds.call(this.modules); + this.hooks.afterOptimizeModuleIds.call(this.modules); - addOptions(options) { - if (!this.options) { - this.type = TypeConditional; - this.options = []; - } - for (const item of options) { - this.options.push(item); - } - return this; - } + this.sortItemsWithModuleIds(); - setItems(items) { - this.type = TypeArray; - this.items = items; - return this; - } + this.hooks.reviveChunks.call(this.chunks, this.records); + this.hooks.optimizeChunkOrder.call(this.chunks); + this.hooks.beforeChunkIds.call(this.chunks); + this.applyChunkIds(); + this.hooks.optimizeChunkIds.call(this.chunks); + this.hooks.afterOptimizeChunkIds.call(this.chunks); - setArray(array) { - this.type = TypeConstArray; - this.array = array; - return this; - } + this.sortItemsWithChunkIds(); - setTemplateString(quasis, parts, kind) { - this.type = TypeTemplateString; - this.quasis = quasis; - this.parts = parts; - this.templateStringKind = kind; - return this; - } + if (shouldRecord) { + this.hooks.recordModules.call(this.modules, this.records); + this.hooks.recordChunks.call(this.chunks, this.records); + } - setTruthy() { - this.falsy = false; - this.truthy = true; - return this; - } + this.hooks.beforeHash.call(); + this.createHash(); + this.hooks.afterHash.call(); - setFalsy() { - this.falsy = true; - this.truthy = false; - return this; - } + if (shouldRecord) { + this.hooks.recordHash.call(this.records); + } - setRange(range) { - this.range = range; - return this; - } + this.hooks.beforeModuleAssets.call(); + this.createModuleAssets(); + if (this.hooks.shouldGenerateChunkAssets.call() !== false) { + this.hooks.beforeChunkAssets.call(); + this.createChunkAssets(); + } + this.hooks.additionalChunkAssets.call(this.chunks); + this.summarizeDependencies(); + if (shouldRecord) { + this.hooks.record.call(this, this.records); + } - setExpression(expression) { - this.expression = expression; - return this; + this.hooks.additionalAssets.callAsync(err => { + if (err) { + return callback(err); + } + this.hooks.optimizeChunkAssets.callAsync(this.chunks, err => { + if (err) { + return callback(err); + } + this.hooks.afterOptimizeChunkAssets.call(this.chunks); + this.hooks.optimizeAssets.callAsync(this.assets, err => { + if (err) { + return callback(err); + } + this.hooks.afterOptimizeAssets.call(this.assets); + if (this.hooks.needAdditionalSeal.call()) { + this.unseal(); + return this.seal(callback); + } + return this.hooks.afterSeal.callAsync(callback); + }); + }); + }); + }); } -} - -module.exports = BasicEvaluatedExpression; + /** + * @param {Module[]} modules the modules array on compilation to perform the sort for + * @returns {void} + */ + sortModules(modules) { + // TODO webpack 5: this should only be enabled when `moduleIds: "natural"` + // TODO move it into a plugin (NaturalModuleIdsPlugin) and use this in WebpackOptionsApply + // TODO remove this method + modules.sort(byIndexOrIdentifier); + } -/***/ }), + /** + * @param {Module} module moulde to report from + * @param {DependenciesBlock[]} blocks blocks to report from + * @returns {void} + */ + reportDependencyErrorsAndWarnings(module, blocks) { + for (let indexBlock = 0; indexBlock < blocks.length; indexBlock++) { + const block = blocks[indexBlock]; + const dependencies = block.dependencies; -/***/ 6465: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + for (let indexDep = 0; indexDep < dependencies.length; indexDep++) { + const d = dependencies[indexDep]; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + const warnings = d.getWarnings(); + if (warnings) { + for (let indexWar = 0; indexWar < warnings.length; indexWar++) { + const w = warnings[indexWar]; + const warning = new ModuleDependencyWarning(module, w, d.loc); + this.warnings.push(warning); + } + } + const errors = d.getErrors(); + if (errors) { + for (let indexErr = 0; indexErr < errors.length; indexErr++) { + const e = errors[indexErr]; -const asyncLib = __webpack_require__(36386); + const error = new ModuleDependencyError(module, e, d.loc); + this.errors.push(error); + } + } + } -class CachePlugin { - constructor(cache) { - this.cache = cache || {}; - this.FS_ACCURACY = 2000; + this.reportDependencyErrorsAndWarnings(module, block.blocks); + } } - apply(compiler) { - if (Array.isArray(compiler.compilers)) { - compiler.compilers.forEach((c, idx) => { - new CachePlugin((this.cache[idx] = this.cache[idx] || {})).apply(c); - }); - } else { - const registerCacheToCompiler = (compiler, cache) => { - compiler.hooks.thisCompilation.tap("CachePlugin", compilation => { - compilation.cache = cache; - compilation.hooks.childCompiler.tap( - "CachePlugin", - (childCompiler, compilerName, compilerIndex) => { - let childCache; - if (!cache.children) { - cache.children = {}; - } - if (!cache.children[compilerName]) { - cache.children[compilerName] = []; - } - if (cache.children[compilerName][compilerIndex]) { - childCache = cache.children[compilerName][compilerIndex]; - } else { - cache.children[compilerName].push((childCache = {})); - } - registerCacheToCompiler(childCompiler, childCache); - } - ); - }); - }; - registerCacheToCompiler(compiler, this.cache); - compiler.hooks.watchRun.tap("CachePlugin", () => { - this.watching = true; - }); - compiler.hooks.run.tapAsync("CachePlugin", (compiler, callback) => { - if (!compiler._lastCompilationFileDependencies) { - return callback(); + /** + * @param {TODO} groupOptions options for the chunk group + * @param {Module} module the module the references the chunk group + * @param {DependencyLocation} loc the location from with the chunk group is referenced (inside of module) + * @param {string} request the request from which the the chunk group is referenced + * @returns {ChunkGroup} the new or existing chunk group + */ + addChunkInGroup(groupOptions, module, loc, request) { + if (typeof groupOptions === "string") { + groupOptions = { name: groupOptions }; + } + const name = groupOptions.name; + if (name) { + const chunkGroup = this.namedChunkGroups.get(name); + if (chunkGroup !== undefined) { + chunkGroup.addOptions(groupOptions); + if (module) { + chunkGroup.addOrigin(module, loc, request); } - const fs = compiler.inputFileSystem; - const fileTs = (compiler.fileTimestamps = new Map()); - asyncLib.forEach( - compiler._lastCompilationFileDependencies, - (file, callback) => { - fs.stat(file, (err, stat) => { - if (err) { - if (err.code === "ENOENT") return callback(); - return callback(err); - } - - if (stat.mtime) this.applyMtime(+stat.mtime); - - fileTs.set(file, +stat.mtime || Infinity); - - callback(); - }); - }, - err => { - if (err) return callback(err); + return chunkGroup; + } + } + const chunkGroup = new ChunkGroup(groupOptions); + if (module) chunkGroup.addOrigin(module, loc, request); + const chunk = this.addChunk(name); - for (const [file, ts] of fileTs) { - fileTs.set(file, ts + this.FS_ACCURACY); - } + GraphHelpers.connectChunkGroupAndChunk(chunkGroup, chunk); - callback(); - } - ); - }); - compiler.hooks.afterCompile.tap("CachePlugin", compilation => { - compilation.compiler._lastCompilationFileDependencies = - compilation.fileDependencies; - compilation.compiler._lastCompilationContextDependencies = - compilation.contextDependencies; - }); + this.chunkGroups.push(chunkGroup); + if (name) { + this.namedChunkGroups.set(name, chunkGroup); } + return chunkGroup; } - /* istanbul ignore next */ - applyMtime(mtime) { - if (this.FS_ACCURACY > 1 && mtime % 2 !== 0) this.FS_ACCURACY = 1; - else if (this.FS_ACCURACY > 10 && mtime % 20 !== 0) this.FS_ACCURACY = 10; - else if (this.FS_ACCURACY > 100 && mtime % 200 !== 0) - this.FS_ACCURACY = 100; - else if (this.FS_ACCURACY > 1000 && mtime % 2000 !== 0) - this.FS_ACCURACY = 1000; + /** + * This method first looks to see if a name is provided for a new chunk, + * and first looks to see if any named chunks already exist and reuse that chunk instead. + * + * @param {string=} name optional chunk name to be provided + * @returns {Chunk} create a chunk (invoked during seal event) + */ + addChunk(name) { + if (name) { + const chunk = this.namedChunks.get(name); + if (chunk !== undefined) { + return chunk; + } + } + const chunk = new Chunk(name); + this.chunks.push(chunk); + if (name) { + this.namedChunks.set(name, chunk); + } + return chunk; } -} -module.exports = CachePlugin; - - -/***/ }), -/***/ 8335: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const WebpackError = __webpack_require__(97391); - -/** @typedef {import("./Module")} Module */ - -/** - * @param {Module[]} modules the modules to be sorted - * @returns {Module[]} sorted version of original modules - */ -const sortModules = modules => { - return modules.slice().sort((a, b) => { - const aIdent = a.identifier(); - const bIdent = b.identifier(); - /* istanbul ignore next */ - if (aIdent < bIdent) return -1; - /* istanbul ignore next */ - if (aIdent > bIdent) return 1; - /* istanbul ignore next */ - return 0; - }); -}; - -/** - * @param {Module[]} modules each module from throw - * @returns {string} each message from provided moduels - */ -const createModulesListMessage = modules => { - return modules - .map(m => { - let message = `* ${m.identifier()}`; - const validReasons = m.reasons.filter(reason => reason.module); - - if (validReasons.length > 0) { - message += `\n Used by ${validReasons.length} module(s), i. e.`; - message += `\n ${validReasons[0].module.identifier()}`; - } - return message; - }) - .join("\n"); -}; - -class CaseSensitiveModulesWarning extends WebpackError { /** - * Creates an instance of CaseSensitiveModulesWarning. - * @param {Module[]} modules modules that were detected + * @param {Module} module module to assign depth + * @returns {void} */ - constructor(modules) { - const sortedModules = sortModules(modules); - const modulesList = createModulesListMessage(sortedModules); - super(`There are multiple modules with names that only differ in casing. -This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. -Use equal casing. Compare these module identifiers: -${modulesList}`); - - this.name = "CaseSensitiveModulesWarning"; - this.origin = this.module = sortedModules[0]; - - Error.captureStackTrace(this, this.constructor); - } -} - -module.exports = CaseSensitiveModulesWarning; - - -/***/ }), - -/***/ 2919: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* -MIT License http://www.opensource.org/licenses/mit-license.php -Author Tobias Koppers @sokra -*/ - - -const util = __webpack_require__(31669); -const SortableSet = __webpack_require__(50071); -const intersect = __webpack_require__(54262).intersect; -const GraphHelpers = __webpack_require__(32973); -const Entrypoint = __webpack_require__(71931); -let debugId = 1000; -const ERR_CHUNK_ENTRY = "Chunk.entry was removed. Use hasRuntime()"; -const ERR_CHUNK_INITIAL = - "Chunk.initial was removed. Use canBeInitial/isOnlyInitial()"; - -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./ChunkGroup")} ChunkGroup */ -/** @typedef {import("./ModuleReason")} ModuleReason */ -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("./util/createHash").Hash} Hash */ - -/** - * @typedef {Object} WithId an object who has an id property * - * @property {string | number} id the id of the object - */ + assignDepth(module) { + const queue = new Set([module]); + let depth; -/** - * Compare two Modules based on their ids for sorting - * @param {Module} a module - * @param {Module} b module - * @returns {-1|0|1} sort value - */ + module.depth = 0; -// TODO use @callback -/** @typedef {(a: Module, b: Module) => -1|0|1} ModuleSortPredicate */ -/** @typedef {(m: Module) => boolean} ModuleFilterPredicate */ -/** @typedef {(c: Chunk) => boolean} ChunkFilterPredicate */ + /** + * @param {Module} module module for processeing + * @returns {void} + */ + const enqueueJob = module => { + const d = module.depth; + if (typeof d === "number" && d <= depth) return; + queue.add(module); + module.depth = depth; + }; -const sortModuleById = (a, b) => { - if (a.id < b.id) return -1; - if (b.id < a.id) return 1; - return 0; -}; + /** + * @param {Dependency} dependency dependency to assign depth to + * @returns {void} + */ + const assignDepthToDependency = dependency => { + if (dependency.module) { + enqueueJob(dependency.module); + } + }; -/** - * Compare two ChunkGroups based on their ids for sorting - * @param {ChunkGroup} a chunk group - * @param {ChunkGroup} b chunk group - * @returns {-1|0|1} sort value - */ -const sortChunkGroupById = (a, b) => { - if (a.id < b.id) return -1; - if (b.id < a.id) return 1; - return 0; -}; + /** + * @param {DependenciesBlock} block block to assign depth to + * @returns {void} + */ + const assignDepthToDependencyBlock = block => { + if (block.variables) { + iterationBlockVariable(block.variables, assignDepthToDependency); + } -/** - * Compare two Identifiables , based on their ids for sorting - * @param {Module} a first object with ident fn - * @param {Module} b second object with ident fn - * @returns {-1|0|1} The order number of the sort - */ -const sortByIdentifier = (a, b) => { - if (a.identifier() > b.identifier()) return 1; - if (a.identifier() < b.identifier()) return -1; - return 0; -}; + if (block.dependencies) { + iterationOfArrayCallback(block.dependencies, assignDepthToDependency); + } -/** - * @returns {string} a concatenation of module identifiers sorted - * @param {SortableSet} set to pull module identifiers from - */ -const getModulesIdent = set => { - set.sort(); - let str = ""; - for (const m of set) { - str += m.identifier() + "#"; - } - return str; -}; + if (block.blocks) { + iterationOfArrayCallback(block.blocks, assignDepthToDependencyBlock); + } + }; -/** - * @template T - * @param {SortableSet} set the sortable set to convert to array - * @returns {Array} the array returned from Array.from(set) - */ -const getArray = set => Array.from(set); + for (module of queue) { + queue.delete(module); + depth = module.depth; -/** - * @param {SortableSet} set the sortable Set to get the count/size of - * @returns {number} the size of the modules - */ -const getModulesSize = set => { - let size = 0; - for (const module of set) { - size += module.size(); + depth++; + assignDepthToDependencyBlock(module); + } } - return size; -}; -/** - * A Chunk is a unit of encapsulation for Modules. - * Chunks are "rendered" into bundles that get emitted when the build completes. - */ -class Chunk { /** - * @param {string=} name of chunk being created, is optional (for subclasses) + * @param {Module} module the module containing the dependency + * @param {Dependency} dependency the dependency + * @returns {DependencyReference} a reference for the dependency */ - constructor(name) { - /** @type {number | null} */ - this.id = null; - /** @type {number[] | null} */ - this.ids = null; - /** @type {number} */ - this.debugId = debugId++; - /** @type {string} */ - this.name = name; - /** @type {boolean} */ - this.preventIntegration = false; - /** @type {Module=} */ - this.entryModule = undefined; - /** @private @type {SortableSet} */ - this._modules = new SortableSet(undefined, sortByIdentifier); - /** @type {string?} */ - this.filenameTemplate = undefined; - /** @private @type {SortableSet} */ - this._groups = new SortableSet(undefined, sortChunkGroupById); - /** @type {string[]} */ - this.files = []; - /** @type {boolean} */ - this.rendered = false; - /** @type {string=} */ - this.hash = undefined; - /** @type {Object} */ - this.contentHash = Object.create(null); - /** @type {string=} */ - this.renderedHash = undefined; - /** @type {string=} */ - this.chunkReason = undefined; - /** @type {boolean} */ - this.extraAsync = false; - this.removedModules = undefined; + getDependencyReference(module, dependency) { + // TODO remove dep.getReference existence check in webpack 5 + if (typeof dependency.getReference !== "function") return null; + const ref = dependency.getReference(); + if (!ref) return null; + return this.hooks.dependencyReference.call(ref, dependency, module); } /** - * @deprecated Chunk.entry has been deprecated. Please use .hasRuntime() instead - * @returns {never} Throws an error trying to access this property + * + * @param {Module} module module relationship for removal + * @param {DependenciesBlockLike} block //TODO: good description + * @returns {void} */ - get entry() { - throw new Error(ERR_CHUNK_ENTRY); - } + removeReasonsOfDependencyBlock(module, block) { + const iteratorDependency = d => { + if (!d.module) { + return; + } + if (d.module.removeReason(module, d)) { + for (const chunk of d.module.chunksIterable) { + this.patchChunksAfterReasonRemoval(d.module, chunk); + } + } + }; - /** - * @deprecated .entry has been deprecated. Please use .hasRuntime() instead - * @param {never} data The data that was attempting to be set - * @returns {never} Throws an error trying to access this property - */ - set entry(data) { - throw new Error(ERR_CHUNK_ENTRY); - } + if (block.blocks) { + iterationOfArrayCallback(block.blocks, block => + this.removeReasonsOfDependencyBlock(module, block) + ); + } - /** - * @deprecated Chunk.initial was removed. Use canBeInitial/isOnlyInitial() - * @returns {never} Throws an error trying to access this property - */ - get initial() { - throw new Error(ERR_CHUNK_INITIAL); - } + if (block.dependencies) { + iterationOfArrayCallback(block.dependencies, iteratorDependency); + } - /** - * @deprecated Chunk.initial was removed. Use canBeInitial/isOnlyInitial() - * @param {never} data The data attempting to be set - * @returns {never} Throws an error trying to access this property - */ - set initial(data) { - throw new Error(ERR_CHUNK_INITIAL); + if (block.variables) { + iterationBlockVariable(block.variables, iteratorDependency); + } } /** - * @returns {boolean} whether or not the Chunk will have a runtime + * @param {Module} module module to patch tie + * @param {Chunk} chunk chunk to patch tie + * @returns {void} */ - hasRuntime() { - for (const chunkGroup of this._groups) { - if ( - chunkGroup.isInitial() && - chunkGroup instanceof Entrypoint && - chunkGroup.getRuntimeChunk() === this - ) { - return true; + patchChunksAfterReasonRemoval(module, chunk) { + if (!module.hasReasons()) { + this.removeReasonsOfDependencyBlock(module, module); + } + if (!module.hasReasonForChunk(chunk)) { + if (module.removeChunk(chunk)) { + this.removeChunkFromDependencies(module, chunk); } } - return false; } /** - * @returns {boolean} whether or not this chunk can be an initial chunk + * + * @param {DependenciesBlock} block block tie for Chunk + * @param {Chunk} chunk chunk to remove from dep + * @returns {void} */ - canBeInitial() { - for (const chunkGroup of this._groups) { - if (chunkGroup.isInitial()) return true; - } - return false; - } + removeChunkFromDependencies(block, chunk) { + const iteratorDependency = d => { + if (!d.module) { + return; + } + this.patchChunksAfterReasonRemoval(d.module, chunk); + }; - /** - * @returns {boolean} whether this chunk can only be an initial chunk - */ - isOnlyInitial() { - if (this._groups.size <= 0) return false; - for (const chunkGroup of this._groups) { - if (!chunkGroup.isInitial()) return false; + const blocks = block.blocks; + for (let indexBlock = 0; indexBlock < blocks.length; indexBlock++) { + const asyncBlock = blocks[indexBlock]; + // Grab all chunks from the first Block's AsyncDepBlock + const chunks = asyncBlock.chunkGroup.chunks; + // For each chunk in chunkGroup + for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { + const iteratedChunk = chunks[indexChunk]; + asyncBlock.chunkGroup.removeChunk(iteratedChunk); + asyncBlock.chunkGroup.removeParent(iteratedChunk); + // Recurse + this.removeChunkFromDependencies(block, iteratedChunk); + } } - return true; - } - /** - * @returns {boolean} if this chunk contains the entry module - */ - hasEntryModule() { - return !!this.entryModule; - } + if (block.dependencies) { + iterationOfArrayCallback(block.dependencies, iteratorDependency); + } - /** - * @param {Module} module the module that will be added to this chunk. - * @returns {boolean} returns true if the chunk doesn't have the module and it was added - */ - addModule(module) { - if (!this._modules.has(module)) { - this._modules.add(module); - return true; + if (block.variables) { + iterationBlockVariable(block.variables, iteratorDependency); } - return false; } - /** - * @param {Module} module the module that will be removed from this chunk - * @returns {boolean} returns true if chunk exists and is successfully deleted - */ - removeModule(module) { - if (this._modules.delete(module)) { - module.removeChunk(this); - return true; + applyModuleIds() { + const unusedIds = []; + let nextFreeModuleId = 0; + const usedIds = new Set(); + if (this.usedModuleIds) { + for (const id of this.usedModuleIds) { + usedIds.add(id); + } } - return false; - } - /** - * @param {Module[]} modules the new modules to be set - * @returns {void} set new modules to this chunk and return nothing - */ - setModules(modules) { - this._modules = new SortableSet(modules, sortByIdentifier); - } + const modules1 = this.modules; + for (let indexModule1 = 0; indexModule1 < modules1.length; indexModule1++) { + const module1 = modules1[indexModule1]; + if (module1.id !== null) { + usedIds.add(module1.id); + } + } - /** - * @returns {number} the amount of modules in chunk - */ - getNumberOfModules() { - return this._modules.size; - } + if (usedIds.size > 0) { + let usedIdMax = -1; + for (const usedIdKey of usedIds) { + if (typeof usedIdKey !== "number") { + continue; + } - /** - * @returns {SortableSet} return the modules SortableSet for this chunk - */ - get modulesIterable() { - return this._modules; - } + usedIdMax = Math.max(usedIdMax, usedIdKey); + } - /** - * @param {ChunkGroup} chunkGroup the chunkGroup the chunk is being added - * @returns {boolean} returns true if chunk is not apart of chunkGroup and is added successfully - */ - addGroup(chunkGroup) { - if (this._groups.has(chunkGroup)) return false; - this._groups.add(chunkGroup); - return true; - } + let lengthFreeModules = (nextFreeModuleId = usedIdMax + 1); - /** - * @param {ChunkGroup} chunkGroup the chunkGroup the chunk is being removed from - * @returns {boolean} returns true if chunk does exist in chunkGroup and is removed - */ - removeGroup(chunkGroup) { - if (!this._groups.has(chunkGroup)) return false; - this._groups.delete(chunkGroup); - return true; - } + while (lengthFreeModules--) { + if (!usedIds.has(lengthFreeModules)) { + unusedIds.push(lengthFreeModules); + } + } + } - /** - * @param {ChunkGroup} chunkGroup the chunkGroup to check - * @returns {boolean} returns true if chunk has chunkGroup reference and exists in chunkGroup - */ - isInGroup(chunkGroup) { - return this._groups.has(chunkGroup); + const modules2 = this.modules; + for (let indexModule2 = 0; indexModule2 < modules2.length; indexModule2++) { + const module2 = modules2[indexModule2]; + if (module2.id === null) { + if (unusedIds.length > 0) { + module2.id = unusedIds.pop(); + } else { + module2.id = nextFreeModuleId++; + } + } + } } - /** - * @returns {number} the amount of groups said chunk is in - */ - getNumberOfGroups() { - return this._groups.size; - } + applyChunkIds() { + /** @type {Set} */ + const usedIds = new Set(); - /** - * @returns {SortableSet} the chunkGroups that said chunk is referenced in - */ - get groupsIterable() { - return this._groups; - } + // Get used ids from usedChunkIds property (i. e. from records) + if (this.usedChunkIds) { + for (const id of this.usedChunkIds) { + if (typeof id !== "number") { + continue; + } - /** - * @param {Chunk} otherChunk the chunk to compare itself with - * @returns {-1|0|1} this is a comparitor function like sort and returns -1, 0, or 1 based on sort order - */ - compareTo(otherChunk) { - if (this.name && !otherChunk.name) return -1; - if (!this.name && otherChunk.name) return 1; - if (this.name < otherChunk.name) return -1; - if (this.name > otherChunk.name) return 1; - if (this._modules.size > otherChunk._modules.size) return -1; - if (this._modules.size < otherChunk._modules.size) return 1; - this._modules.sort(); - otherChunk._modules.sort(); - const a = this._modules[Symbol.iterator](); - const b = otherChunk._modules[Symbol.iterator](); - // eslint-disable-next-line no-constant-condition - while (true) { - const aItem = a.next(); - if (aItem.done) return 0; - const bItem = b.next(); - const aModuleIdentifier = aItem.value.identifier(); - const bModuleIdentifier = bItem.value.identifier(); - if (aModuleIdentifier < bModuleIdentifier) return -1; - if (aModuleIdentifier > bModuleIdentifier) return 1; + usedIds.add(id); + } } - } - - /** - * @param {Module} module Module to check - * @returns {boolean} returns true if module does exist in this chunk - */ - containsModule(module) { - return this._modules.has(module); - } - /** - * @returns {Module[]} an array of modules (do not modify) - */ - getModules() { - return this._modules.getFromCache(getArray); - } + // Get used ids from existing chunks + const chunks = this.chunks; + for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { + const chunk = chunks[indexChunk]; + const usedIdValue = chunk.id; - getModulesIdent() { - return this._modules.getFromUnorderedCache(getModulesIdent); - } + if (typeof usedIdValue !== "number") { + continue; + } - /** - * @param {string=} reason reason why chunk is removed - * @returns {void} - */ - remove(reason) { - // cleanup modules - // Array.from is used here to create a clone, because removeChunk modifies this._modules - for (const module of Array.from(this._modules)) { - module.removeChunk(this); - } - for (const chunkGroup of this._groups) { - chunkGroup.removeChunk(this); + usedIds.add(usedIdValue); } - } - /** - * - * @param {Module} module module to move - * @param {Chunk} otherChunk other chunk to move it to - * @returns {void} - */ - moveModule(module, otherChunk) { - GraphHelpers.disconnectChunkAndModule(this, module); - GraphHelpers.connectChunkAndModule(otherChunk, module); - module.rewriteChunkInReasons(this, [otherChunk]); - } + // Calculate maximum assigned chunk id + let nextFreeChunkId = -1; + for (const id of usedIds) { + nextFreeChunkId = Math.max(nextFreeChunkId, id); + } + nextFreeChunkId++; - /** - * - * @param {Chunk} otherChunk the chunk to integrate with - * @param {string} reason reason why the module is being integrated - * @returns {boolean} returns true or false if integration succeeds or fails - */ - integrate(otherChunk, reason) { - if (!this.canBeIntegrated(otherChunk)) { - return false; + // Determine free chunk ids from 0 to maximum + /** @type {number[]} */ + const unusedIds = []; + if (nextFreeChunkId > 0) { + let index = nextFreeChunkId; + while (index--) { + if (!usedIds.has(index)) { + unusedIds.push(index); + } + } } - // Pick a new name for the integrated chunk - if (this.name && otherChunk.name) { - if (this.hasEntryModule() === otherChunk.hasEntryModule()) { - // When both chunks have entry modules or none have one, use - // shortest name - if (this.name.length !== otherChunk.name.length) { - this.name = - this.name.length < otherChunk.name.length - ? this.name - : otherChunk.name; + // Assign ids to chunk which has no id + for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { + const chunk = chunks[indexChunk]; + if (chunk.id === null) { + if (unusedIds.length > 0) { + chunk.id = unusedIds.pop(); } else { - this.name = this.name < otherChunk.name ? this.name : otherChunk.name; + chunk.id = nextFreeChunkId++; } - } else if (otherChunk.hasEntryModule()) { - // Pick the name of the chunk with the entry module - this.name = otherChunk.name; } - } else if (otherChunk.name) { - this.name = otherChunk.name; + if (!chunk.ids) { + chunk.ids = [chunk.id]; + } } + } - // Array.from is used here to create a clone, because moveModule modifies otherChunk._modules - for (const module of Array.from(otherChunk._modules)) { - otherChunk.moveModule(module, this); - } - otherChunk._modules.clear(); + sortItemsWithModuleIds() { + this.modules.sort(byIdOrIdentifier); - if (otherChunk.entryModule) { - this.entryModule = otherChunk.entryModule; + const modules = this.modules; + for (let indexModule = 0; indexModule < modules.length; indexModule++) { + modules[indexModule].sortItems(false); } - for (const chunkGroup of otherChunk._groups) { - chunkGroup.replaceChunk(otherChunk, this); - this.addGroup(chunkGroup); + const chunks = this.chunks; + for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { + chunks[indexChunk].sortItems(); } - otherChunk._groups.clear(); - return true; + chunks.sort((a, b) => a.compareTo(b)); } - /** - * @param {Chunk} newChunk the new chunk that will be split out of the current chunk - * @returns {void} - */ - split(newChunk) { - for (const chunkGroup of this._groups) { - chunkGroup.insertChunk(newChunk, this); - newChunk.addGroup(chunkGroup); + sortItemsWithChunkIds() { + for (const chunkGroup of this.chunkGroups) { + chunkGroup.sortItems(); } - } - isEmpty() { - return this._modules.size === 0; - } + this.chunks.sort(byId); - updateHash(hash) { - hash.update(`${this.id} `); - hash.update(this.ids ? this.ids.join(",") : ""); - hash.update(`${this.name || ""} `); - for (const m of this._modules) { - hash.update(m.hash); + for ( + let indexModule = 0; + indexModule < this.modules.length; + indexModule++ + ) { + this.modules[indexModule].sortItems(true); } - } - canBeIntegrated(otherChunk) { - if (this.preventIntegration || otherChunk.preventIntegration) { - return false; + const chunks = this.chunks; + for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { + chunks[indexChunk].sortItems(); } /** - * @param {Chunk} a chunk - * @param {Chunk} b chunk - * @returns {boolean} true, if a is always available when b is reached + * Used to sort errors and warnings in compilation. this.warnings, and + * this.errors contribute to the compilation hash and therefore should be + * updated whenever other references (having a chunk id) are sorted. This preserves the hash + * integrity + * + * @param {WebpackError} a first WebpackError instance (including subclasses) + * @param {WebpackError} b second WebpackError instance (including subclasses) + * @returns {-1|0|1} sort order index */ - const isAvailable = (a, b) => { - const queue = new Set(b.groupsIterable); - for (const chunkGroup of queue) { - if (a.isInGroup(chunkGroup)) continue; - if (chunkGroup.isInitial()) return false; - for (const parent of chunkGroup.parentsIterable) { - queue.add(parent); - } - } - return true; + const byMessage = (a, b) => { + const ma = `${a.message}`; + const mb = `${b.message}`; + if (ma < mb) return -1; + if (mb < ma) return 1; + return 0; }; - const selfHasRuntime = this.hasRuntime(); - const otherChunkHasRuntime = otherChunk.hasRuntime(); + this.errors.sort(byMessage); + this.warnings.sort(byMessage); + this.children.sort(byNameOrHash); + } - if (selfHasRuntime !== otherChunkHasRuntime) { - if (selfHasRuntime) { - return isAvailable(this, otherChunk); - } else if (otherChunkHasRuntime) { - return isAvailable(otherChunk, this); - } else { - return false; - } - } + summarizeDependencies() { + this.fileDependencies = new SortableSet(this.compilationDependencies); + this.contextDependencies = new SortableSet(); + this.missingDependencies = new SortableSet(); - if (this.hasEntryModule() || otherChunk.hasEntryModule()) { - return false; - } + for ( + let indexChildren = 0; + indexChildren < this.children.length; + indexChildren++ + ) { + const child = this.children[indexChildren]; - return true; - } + addAllToSet(this.fileDependencies, child.fileDependencies); + addAllToSet(this.contextDependencies, child.contextDependencies); + addAllToSet(this.missingDependencies, child.missingDependencies); + } - /** - * - * @param {number} size the size - * @param {Object} options the options passed in - * @returns {number} the multiplier returned - */ - addMultiplierAndOverhead(size, options) { - const overhead = - typeof options.chunkOverhead === "number" ? options.chunkOverhead : 10000; - const multiplicator = this.canBeInitial() - ? options.entryChunkMultiplicator || 10 - : 1; + for ( + let indexModule = 0; + indexModule < this.modules.length; + indexModule++ + ) { + const module = this.modules[indexModule]; - return size * multiplicator + overhead; + if (module.buildInfo.fileDependencies) { + addAllToSet(this.fileDependencies, module.buildInfo.fileDependencies); + } + if (module.buildInfo.contextDependencies) { + addAllToSet( + this.contextDependencies, + module.buildInfo.contextDependencies + ); + } + } + for (const error of this.errors) { + if ( + typeof error.missing === "object" && + error.missing && + error.missing[Symbol.iterator] + ) { + addAllToSet(this.missingDependencies, error.missing); + } + } + this.fileDependencies.sort(); + this.contextDependencies.sort(); + this.missingDependencies.sort(); } - /** - * @returns {number} the size of all modules - */ - modulesSize() { - return this._modules.getFromUnorderedCache(getModulesSize); + createHash() { + const outputOptions = this.outputOptions; + const hashFunction = outputOptions.hashFunction; + const hashDigest = outputOptions.hashDigest; + const hashDigestLength = outputOptions.hashDigestLength; + const hash = createHash(hashFunction); + if (outputOptions.hashSalt) { + hash.update(outputOptions.hashSalt); + } + this.mainTemplate.updateHash(hash); + this.chunkTemplate.updateHash(hash); + for (const key of Object.keys(this.moduleTemplates).sort()) { + this.moduleTemplates[key].updateHash(hash); + } + for (const child of this.children) { + hash.update(child.hash); + } + for (const warning of this.warnings) { + hash.update(`${warning.message}`); + } + for (const error of this.errors) { + hash.update(`${error.message}`); + } + const modules = this.modules; + for (let i = 0; i < modules.length; i++) { + const module = modules[i]; + const moduleHash = createHash(hashFunction); + module.updateHash(moduleHash); + module.hash = /** @type {string} */ (moduleHash.digest(hashDigest)); + module.renderedHash = module.hash.substr(0, hashDigestLength); + } + // clone needed as sort below is inplace mutation + const chunks = this.chunks.slice(); + /** + * sort here will bring all "falsy" values to the beginning + * this is needed as the "hasRuntime()" chunks are dependent on the + * hashes of the non-runtime chunks. + */ + chunks.sort((a, b) => { + const aEntry = a.hasRuntime(); + const bEntry = b.hasRuntime(); + if (aEntry && !bEntry) return 1; + if (!aEntry && bEntry) return -1; + return byId(a, b); + }); + for (let i = 0; i < chunks.length; i++) { + const chunk = chunks[i]; + const chunkHash = createHash(hashFunction); + try { + if (outputOptions.hashSalt) { + chunkHash.update(outputOptions.hashSalt); + } + chunk.updateHash(chunkHash); + const template = chunk.hasRuntime() + ? this.mainTemplate + : this.chunkTemplate; + template.updateHashForChunk( + chunkHash, + chunk, + this.moduleTemplates.javascript, + this.dependencyTemplates + ); + this.hooks.chunkHash.call(chunk, chunkHash); + chunk.hash = /** @type {string} */ (chunkHash.digest(hashDigest)); + hash.update(chunk.hash); + chunk.renderedHash = chunk.hash.substr(0, hashDigestLength); + this.hooks.contentHash.call(chunk); + } catch (err) { + this.errors.push(new ChunkRenderError(chunk, "", err)); + } + } + this.fullHash = /** @type {string} */ (hash.digest(hashDigest)); + this.hash = this.fullHash.substr(0, hashDigestLength); } /** - * @param {Object} options the size display options - * @returns {number} the chunk size + * @param {string} update extra information + * @returns {void} */ - size(options = {}) { - return this.addMultiplierAndOverhead(this.modulesSize(), options); + modifyHash(update) { + const outputOptions = this.outputOptions; + const hashFunction = outputOptions.hashFunction; + const hashDigest = outputOptions.hashDigest; + const hashDigestLength = outputOptions.hashDigestLength; + const hash = createHash(hashFunction); + hash.update(this.fullHash); + hash.update(update); + this.fullHash = /** @type {string} */ (hash.digest(hashDigest)); + this.hash = this.fullHash.substr(0, hashDigestLength); } /** - * @param {Chunk} otherChunk the other chunk - * @param {TODO} options the options for this function - * @returns {number | false} the size, or false if it can't be integrated + * @param {string} file file name + * @param {Source} source asset source + * @param {AssetInfo} assetInfo extra asset information + * @returns {void} */ - integratedSize(otherChunk, options) { - // Chunk if it's possible to integrate this chunk - if (!this.canBeIntegrated(otherChunk)) { - return false; - } - - let integratedModulesSize = this.modulesSize(); - // only count modules that do not exist in this chunk! - for (const otherModule of otherChunk._modules) { - if (!this._modules.has(otherModule)) { - integratedModulesSize += otherModule.size(); + emitAsset(file, source, assetInfo = {}) { + if (this.assets[file]) { + if (!isSourceEqual(this.assets[file], source)) { + // TODO webpack 5: make this an error instead + this.warnings.push( + new WebpackError( + `Conflict: Multiple assets emit different content to the same filename ${file}` + ) + ); + this.assets[file] = source; + this.assetsInfo.set(file, assetInfo); + return; } + const oldInfo = this.assetsInfo.get(file); + this.assetsInfo.set(file, Object.assign({}, oldInfo, assetInfo)); + return; } - - return this.addMultiplierAndOverhead(integratedModulesSize, options); + this.assets[file] = source; + this.assetsInfo.set(file, assetInfo); } /** - * @param {function(Module, Module): -1|0|1=} sortByFn a predicate function used to sort modules - * @returns {void} + * @param {string} file file name + * @param {Source | function(Source): Source} newSourceOrFunction new asset source or function converting old to new + * @param {AssetInfo | function(AssetInfo | undefined): AssetInfo} assetInfoUpdateOrFunction new asset info or function converting old to new */ - sortModules(sortByFn) { - this._modules.sortWith(sortByFn || sortModuleById); + updateAsset( + file, + newSourceOrFunction, + assetInfoUpdateOrFunction = undefined + ) { + if (!this.assets[file]) { + throw new Error( + `Called Compilation.updateAsset for not existing filename ${file}` + ); + } + if (typeof newSourceOrFunction === "function") { + this.assets[file] = newSourceOrFunction(this.assets[file]); + } else { + this.assets[file] = newSourceOrFunction; + } + if (assetInfoUpdateOrFunction !== undefined) { + const oldInfo = this.assetsInfo.get(file); + if (typeof assetInfoUpdateOrFunction === "function") { + this.assetsInfo.set(file, assetInfoUpdateOrFunction(oldInfo || {})); + } else { + this.assetsInfo.set( + file, + Object.assign({}, oldInfo, assetInfoUpdateOrFunction) + ); + } + } } - sortItems() { - this.sortModules(); + getAssets() { + /** @type {Asset[]} */ + const array = []; + for (const assetName of Object.keys(this.assets)) { + if (Object.prototype.hasOwnProperty.call(this.assets, assetName)) { + array.push({ + name: assetName, + source: this.assets[assetName], + info: this.assetsInfo.get(assetName) || {} + }); + } + } + return array; } /** - * @returns {Set} a set of all the async chunks + * @param {string} name the name of the asset + * @returns {Asset | undefined} the asset or undefined when not found */ - getAllAsyncChunks() { - const queue = new Set(); - const chunks = new Set(); - - const initialChunks = intersect( - Array.from(this.groupsIterable, g => new Set(g.chunks)) - ); - - for (const chunkGroup of this.groupsIterable) { - for (const child of chunkGroup.childrenIterable) { - queue.add(child); - } - } + getAsset(name) { + if (!Object.prototype.hasOwnProperty.call(this.assets, name)) + return undefined; + return { + name, + source: this.assets[name], + info: this.assetsInfo.get(name) || {} + }; + } - for (const chunkGroup of queue) { - for (const chunk of chunkGroup.chunks) { - if (!initialChunks.has(chunk)) { - chunks.add(chunk); + createModuleAssets() { + for (let i = 0; i < this.modules.length; i++) { + const module = this.modules[i]; + if (module.buildInfo.assets) { + const assetsInfo = module.buildInfo.assetsInfo; + for (const assetName of Object.keys(module.buildInfo.assets)) { + const fileName = this.getPath(assetName); + this.emitAsset( + fileName, + module.buildInfo.assets[assetName], + assetsInfo ? assetsInfo.get(assetName) : undefined + ); + this.hooks.moduleAsset.call(module, fileName); } } - for (const child of chunkGroup.childrenIterable) { - queue.add(child); - } } - - return chunks; } - /** - * @typedef {Object} ChunkMaps - * @property {Record} hash - * @property {Record>} contentHash - * @property {Record} name - */ - - /** - * @param {boolean} realHash should the full hash or the rendered hash be used - * @returns {ChunkMaps} the chunk map information - */ - getChunkMaps(realHash) { - /** @type {Record} */ - const chunkHashMap = Object.create(null); - /** @type {Record>} */ - const chunkContentHashMap = Object.create(null); - /** @type {Record} */ - const chunkNameMap = Object.create(null); - - for (const chunk of this.getAllAsyncChunks()) { - chunkHashMap[chunk.id] = realHash ? chunk.hash : chunk.renderedHash; - for (const key of Object.keys(chunk.contentHash)) { - if (!chunkContentHashMap[key]) { - chunkContentHashMap[key] = Object.create(null); - } - chunkContentHashMap[key][chunk.id] = chunk.contentHash[key]; - } - if (chunk.name) { - chunkNameMap[chunk.id] = chunk.name; - } - } - - return { - hash: chunkHashMap, - contentHash: chunkContentHashMap, - name: chunkNameMap - }; - } + createChunkAssets() { + const outputOptions = this.outputOptions; + const cachedSourceMap = new Map(); + /** @type {Map} */ + const alreadyWrittenFiles = new Map(); + for (let i = 0; i < this.chunks.length; i++) { + const chunk = this.chunks[i]; + chunk.files = []; + let source; + let file; + let filenameTemplate; + try { + const template = chunk.hasRuntime() + ? this.mainTemplate + : this.chunkTemplate; + const manifest = template.getRenderManifest({ + chunk, + hash: this.hash, + fullHash: this.fullHash, + outputOptions, + moduleTemplates: this.moduleTemplates, + dependencyTemplates: this.dependencyTemplates + }); // [{ render(), filenameTemplate, pathOptions, identifier, hash }] + for (const fileManifest of manifest) { + const cacheName = fileManifest.identifier; + const usedHash = fileManifest.hash; + filenameTemplate = fileManifest.filenameTemplate; + const pathAndInfo = this.getPathWithInfo( + filenameTemplate, + fileManifest.pathOptions + ); + file = pathAndInfo.path; + const assetInfo = pathAndInfo.info; - /** - * @returns {Record[]>} a record object of names to lists of child ids(?) - */ - getChildIdsByOrders() { - const lists = new Map(); - for (const group of this.groupsIterable) { - if (group.chunks[group.chunks.length - 1] === this) { - for (const childGroup of group.childrenIterable) { - // TODO webpack 5 remove this check for options - if (typeof childGroup.options === "object") { - for (const key of Object.keys(childGroup.options)) { - if (key.endsWith("Order")) { - const name = key.substr(0, key.length - "Order".length); - let list = lists.get(name); - if (list === undefined) lists.set(name, (list = [])); - list.push({ - order: childGroup.options[key], - group: childGroup - }); + // check if the same filename was already written by another chunk + const alreadyWritten = alreadyWrittenFiles.get(file); + if (alreadyWritten !== undefined) { + if (alreadyWritten.hash === usedHash) { + if (this.cache) { + this.cache[cacheName] = { + hash: usedHash, + source: alreadyWritten.source + }; } + chunk.files.push(file); + this.hooks.chunkAsset.call(chunk, file); + continue; + } else { + throw new Error( + `Conflict: Multiple chunks emit assets to the same filename ${file}` + + ` (chunks ${alreadyWritten.chunk.id} and ${chunk.id})` + ); } } - } - } - } - const result = Object.create(null); - for (const [name, list] of lists) { - list.sort((a, b) => { - const cmp = b.order - a.order; - if (cmp !== 0) return cmp; - // TODO webpack 5 remove this check of compareTo - if (a.group.compareTo) { - return a.group.compareTo(b.group); - } - return 0; - }); - result[name] = Array.from( - list.reduce((set, item) => { - for (const chunk of item.group.chunks) { - set.add(chunk.id); + if ( + this.cache && + this.cache[cacheName] && + this.cache[cacheName].hash === usedHash + ) { + source = this.cache[cacheName].source; + } else { + source = fileManifest.render(); + // Ensure that source is a cached source to avoid additional cost because of repeated access + if (!(source instanceof CachedSource)) { + const cacheEntry = cachedSourceMap.get(source); + if (cacheEntry) { + source = cacheEntry; + } else { + const cachedSource = new CachedSource(source); + cachedSourceMap.set(source, cachedSource); + source = cachedSource; + } + } + if (this.cache) { + this.cache[cacheName] = { + hash: usedHash, + source + }; + } } - return set; - }, new Set()) - ); - } - return result; - } - - getChildIdsByOrdersMap(includeDirectChildren) { - const chunkMaps = Object.create(null); - - const addChildIdsByOrdersToMap = chunk => { - const data = chunk.getChildIdsByOrders(); - for (const key of Object.keys(data)) { - let chunkMap = chunkMaps[key]; - if (chunkMap === undefined) { - chunkMaps[key] = chunkMap = Object.create(null); - } - chunkMap[chunk.id] = data[key]; - } - }; - - if (includeDirectChildren) { - const chunks = new Set(); - for (const chunkGroup of this.groupsIterable) { - for (const chunk of chunkGroup.chunks) { - chunks.add(chunk); + this.emitAsset(file, source, assetInfo); + chunk.files.push(file); + this.hooks.chunkAsset.call(chunk, file); + alreadyWrittenFiles.set(file, { + hash: usedHash, + source, + chunk + }); } + } catch (err) { + this.errors.push( + new ChunkRenderError(chunk, file || filenameTemplate, err) + ); } - for (const chunk of chunks) { - addChildIdsByOrdersToMap(chunk); - } - } - - for (const chunk of this.getAllAsyncChunks()) { - addChildIdsByOrdersToMap(chunk); } - - return chunkMaps; } /** - * @typedef {Object} ChunkModuleMaps - * @property {Record} id - * @property {Record} hash + * @param {string} filename used to get asset path with hash + * @param {TODO=} data // TODO: figure out this param type + * @returns {string} interpolated path */ + getPath(filename, data) { + data = data || {}; + data.hash = data.hash || this.hash; + return this.mainTemplate.getAssetPath(filename, data); + } /** - * @param {ModuleFilterPredicate} filterFn function used to filter modules - * @returns {ChunkModuleMaps} module map information + * @param {string} filename used to get asset path with hash + * @param {TODO=} data // TODO: figure out this param type + * @returns {{ path: string, info: AssetInfo }} interpolated path and asset info */ - getChunkModuleMaps(filterFn) { - /** @type {Record} */ - const chunkModuleIdMap = Object.create(null); - /** @type {Record} */ - const chunkModuleHashMap = Object.create(null); - - for (const chunk of this.getAllAsyncChunks()) { - /** @type {(string|number)[]} */ - let array; - for (const module of chunk.modulesIterable) { - if (filterFn(module)) { - if (array === undefined) { - array = []; - chunkModuleIdMap[chunk.id] = array; - } - array.push(module.id); - chunkModuleHashMap[module.id] = module.renderedHash; - } - } - if (array !== undefined) { - array.sort(); - } - } - - return { - id: chunkModuleIdMap, - hash: chunkModuleHashMap - }; + getPathWithInfo(filename, data) { + data = data || {}; + data.hash = data.hash || this.hash; + return this.mainTemplate.getAssetPathWithInfo(filename, data); } /** + * This function allows you to run another instance of webpack inside of webpack however as + * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins + * from parent (or top level compiler) and creates a child Compilation * - * @param {function(Module): boolean} filterFn predicate function used to filter modules - * @param {function(Chunk): boolean} filterChunkFn predicate function used to filter chunks - * @returns {boolean} return true if module exists in graph + * @param {string} name name of the child compiler + * @param {TODO} outputOptions // Need to convert config schema to types for this + * @param {Plugin[]} plugins webpack plugins that will be applied + * @returns {Compiler} creates a child Compiler instance */ - hasModuleInGraph(filterFn, filterChunkFn) { - const queue = new Set(this.groupsIterable); - const chunksProcessed = new Set(); + createChildCompiler(name, outputOptions, plugins) { + const idx = this.childrenCounters[name] || 0; + this.childrenCounters[name] = idx + 1; + return this.compiler.createChildCompiler( + this, + name, + idx, + outputOptions, + plugins + ); + } - for (const chunkGroup of queue) { - for (const chunk of chunkGroup.chunks) { - if (!chunksProcessed.has(chunk)) { - chunksProcessed.add(chunk); - if (!filterChunkFn || filterChunkFn(chunk)) { - for (const module of chunk.modulesIterable) { - if (filterFn(module)) { - return true; - } - } - } - } + checkConstraints() { + /** @type {Set} */ + const usedIds = new Set(); + + const modules = this.modules; + for (let indexModule = 0; indexModule < modules.length; indexModule++) { + const moduleId = modules[indexModule].id; + if (moduleId === null) continue; + if (usedIds.has(moduleId)) { + throw new Error(`checkConstraints: duplicate module id ${moduleId}`); } - for (const child of chunkGroup.childrenIterable) { - queue.add(child); + usedIds.add(moduleId); + } + + const chunks = this.chunks; + for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { + const chunk = chunks[indexChunk]; + if (chunks.indexOf(chunk) !== indexChunk) { + throw new Error( + `checkConstraints: duplicate chunk in compilation ${chunk.debugId}` + ); } } - return false; - } - toString() { - return `Chunk[${Array.from(this._modules).join()}]`; + for (const chunkGroup of this.chunkGroups) { + chunkGroup.checkConstraints(); + } } } // TODO remove in webpack 5 -Object.defineProperty(Chunk.prototype, "forEachModule", { +Compilation.prototype.applyPlugins = util.deprecate( + /** + * @deprecated + * @param {string} name Name + * @param {any[]} args Other arguments + * @returns {void} + * @this {Compilation} + */ + function(name, ...args) { + this.hooks[ + name.replace(/[- ]([a-z])/g, match => match[1].toUpperCase()) + ].call(...args); + }, + "Compilation.applyPlugins is deprecated. Use new API on `.hooks` instead" +); + +// TODO remove in webpack 5 +Object.defineProperty(Compilation.prototype, "moduleTemplate", { configurable: false, - value: util.deprecate( + get: util.deprecate( /** * @deprecated - * @this {Chunk} - * @typedef {function(any, any, Set): void} ForEachModuleCallback - * @param {ForEachModuleCallback} fn Callback function - * @returns {void} + * @this {Compilation} + * @returns {TODO} module template */ - function(fn) { - this._modules.forEach(fn); + function() { + return this.moduleTemplates.javascript; }, - "Chunk.forEachModule: Use for(const module of chunk.modulesIterable) instead" - ) -}); - -// TODO remove in webpack 5 -Object.defineProperty(Chunk.prototype, "mapModules", { - configurable: false, - value: util.deprecate( + "Compilation.moduleTemplate: Use Compilation.moduleTemplates.javascript instead" + ), + set: util.deprecate( /** * @deprecated - * @this {Chunk} - * @typedef {function(any, number): any} MapModulesCallback - * @param {MapModulesCallback} fn Callback function - * @returns {TODO[]} result of mapped modules + * @param {ModuleTemplate} value Template value + * @this {Compilation} + * @returns {void} */ - function(fn) { - return Array.from(this._modules, fn); + function(value) { + this.moduleTemplates.javascript = value; }, - "Chunk.mapModules: Use Array.from(chunk.modulesIterable, fn) instead" + "Compilation.moduleTemplate: Use Compilation.moduleTemplates.javascript instead." ) }); -// TODO remove in webpack 5 -Object.defineProperty(Chunk.prototype, "chunks", { - configurable: false, - get() { - throw new Error("Chunk.chunks: Use ChunkGroup.getChildren() instead"); - }, - set() { - throw new Error("Chunk.chunks: Use ChunkGroup.add/removeChild() instead"); - } -}); - -// TODO remove in webpack 5 -Object.defineProperty(Chunk.prototype, "parents", { - configurable: false, - get() { - throw new Error("Chunk.parents: Use ChunkGroup.getParents() instead"); - }, - set() { - throw new Error("Chunk.parents: Use ChunkGroup.add/removeParent() instead"); - } -}); - -// TODO remove in webpack 5 -Object.defineProperty(Chunk.prototype, "blocks", { - configurable: false, - get() { - throw new Error("Chunk.blocks: Use ChunkGroup.getBlocks() instead"); - }, - set() { - throw new Error("Chunk.blocks: Use ChunkGroup.add/removeBlock() instead"); - } -}); - -// TODO remove in webpack 5 -Object.defineProperty(Chunk.prototype, "entrypoints", { - configurable: false, - get() { - throw new Error( - "Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead" - ); - }, - set() { - throw new Error("Chunk.entrypoints: Use Chunks.addGroup instead"); - } -}); - -module.exports = Chunk; +module.exports = Compilation; /***/ }), -/***/ 52911: +/***/ 58705: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -53035,558 +52516,767 @@ module.exports = Chunk; */ -const SortableSet = __webpack_require__(50071); -const compareLocations = __webpack_require__(22562); +const parseJson = __webpack_require__(48335); +const asyncLib = __webpack_require__(36386); +const path = __webpack_require__(85622); +const { Source } = __webpack_require__(53665); +const util = __webpack_require__(31669); +const { + Tapable, + SyncHook, + SyncBailHook, + AsyncParallelHook, + AsyncSeriesHook +} = __webpack_require__(92402); -/** @typedef {import("./Chunk")} Chunk */ -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./ModuleReason")} ModuleReason */ +const Compilation = __webpack_require__(34968); +const Stats = __webpack_require__(99977); +const Watching = __webpack_require__(29580); +const NormalModuleFactory = __webpack_require__(22298); +const ContextModuleFactory = __webpack_require__(88239); +const ResolverFactory = __webpack_require__(50588); -/** @typedef {{module: Module, loc: TODO, request: string}} OriginRecord */ -/** @typedef {string|{name: string}} ChunkGroupOptions */ +const RequestShortener = __webpack_require__(54254); +const { makePathsRelative } = __webpack_require__(94658); +const ConcurrentCompilationError = __webpack_require__(18933); +const { Logger } = __webpack_require__(47194); -let debugId = 5000; +/** @typedef {import("../declarations/WebpackOptions").Entry} Entry */ +/** @typedef {import("../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ /** - * @template T - * @param {SortableSet} set set to convert to array. - * @returns {T[]} the array format of existing set + * @typedef {Object} CompilationParams + * @property {NormalModuleFactory} normalModuleFactory + * @property {ContextModuleFactory} contextModuleFactory + * @property {Set} compilationDependencies */ -const getArray = set => Array.from(set); -/** - * A convenience method used to sort chunks based on their id's - * @param {ChunkGroup} a first sorting comparator - * @param {ChunkGroup} b second sorting comparator - * @returns {1|0|-1} a sorting index to determine order - */ -const sortById = (a, b) => { - if (a.id < b.id) return -1; - if (b.id < a.id) return 1; - return 0; -}; +class Compiler extends Tapable { + constructor(context) { + super(); + this.hooks = { + /** @type {SyncBailHook} */ + shouldEmit: new SyncBailHook(["compilation"]), + /** @type {AsyncSeriesHook} */ + done: new AsyncSeriesHook(["stats"]), + /** @type {AsyncSeriesHook<>} */ + additionalPass: new AsyncSeriesHook([]), + /** @type {AsyncSeriesHook} */ + beforeRun: new AsyncSeriesHook(["compiler"]), + /** @type {AsyncSeriesHook} */ + run: new AsyncSeriesHook(["compiler"]), + /** @type {AsyncSeriesHook} */ + emit: new AsyncSeriesHook(["compilation"]), + /** @type {AsyncSeriesHook} */ + assetEmitted: new AsyncSeriesHook(["file", "content"]), + /** @type {AsyncSeriesHook} */ + afterEmit: new AsyncSeriesHook(["compilation"]), -/** - * @param {OriginRecord} a the first comparator in sort - * @param {OriginRecord} b the second comparator in sort - * @returns {1|-1|0} returns sorting order as index - */ -const sortOrigin = (a, b) => { - const aIdent = a.module ? a.module.identifier() : ""; - const bIdent = b.module ? b.module.identifier() : ""; - if (aIdent < bIdent) return -1; - if (aIdent > bIdent) return 1; - return compareLocations(a.loc, b.loc); -}; + /** @type {SyncHook} */ + thisCompilation: new SyncHook(["compilation", "params"]), + /** @type {SyncHook} */ + compilation: new SyncHook(["compilation", "params"]), + /** @type {SyncHook} */ + normalModuleFactory: new SyncHook(["normalModuleFactory"]), + /** @type {SyncHook} */ + contextModuleFactory: new SyncHook(["contextModulefactory"]), -class ChunkGroup { - /** - * Creates an instance of ChunkGroup. - * @param {ChunkGroupOptions=} options chunk group options passed to chunkGroup - */ - constructor(options) { - if (typeof options === "string") { - options = { name: options }; - } else if (!options) { - options = { name: undefined }; - } - /** @type {number} */ - this.groupDebugId = debugId++; - this.options = options; - /** @type {SortableSet} */ - this._children = new SortableSet(undefined, sortById); - this._parents = new SortableSet(undefined, sortById); - this._blocks = new SortableSet(); - /** @type {Chunk[]} */ - this.chunks = []; - /** @type {OriginRecord[]} */ - this.origins = []; - /** Indices in top-down order */ - /** @private @type {Map} */ - this._moduleIndices = new Map(); - /** Indices in bottom-up order */ - /** @private @type {Map} */ - this._moduleIndices2 = new Map(); - } + /** @type {AsyncSeriesHook} */ + beforeCompile: new AsyncSeriesHook(["params"]), + /** @type {SyncHook} */ + compile: new SyncHook(["params"]), + /** @type {AsyncParallelHook} */ + make: new AsyncParallelHook(["compilation"]), + /** @type {AsyncSeriesHook} */ + afterCompile: new AsyncSeriesHook(["compilation"]), - /** - * when a new chunk is added to a chunkGroup, addingOptions will occur. - * @param {ChunkGroupOptions} options the chunkGroup options passed to addOptions - * @returns {void} - */ - addOptions(options) { - for (const key of Object.keys(options)) { - if (this.options[key] === undefined) { - this.options[key] = options[key]; - } else if (this.options[key] !== options[key]) { - if (key.endsWith("Order")) { - this.options[key] = Math.max(this.options[key], options[key]); - } else { - throw new Error( - `ChunkGroup.addOptions: No option merge strategy for ${key}` - ); - } + /** @type {AsyncSeriesHook} */ + watchRun: new AsyncSeriesHook(["compiler"]), + /** @type {SyncHook} */ + failed: new SyncHook(["error"]), + /** @type {SyncHook} */ + invalid: new SyncHook(["filename", "changeTime"]), + /** @type {SyncHook} */ + watchClose: new SyncHook([]), + + /** @type {SyncBailHook} */ + infrastructureLog: new SyncBailHook(["origin", "type", "args"]), + + // TODO the following hooks are weirdly located here + // TODO move them for webpack 5 + /** @type {SyncHook} */ + environment: new SyncHook([]), + /** @type {SyncHook} */ + afterEnvironment: new SyncHook([]), + /** @type {SyncHook} */ + afterPlugins: new SyncHook(["compiler"]), + /** @type {SyncHook} */ + afterResolvers: new SyncHook(["compiler"]), + /** @type {SyncBailHook} */ + entryOption: new SyncBailHook(["context", "entry"]) + }; + // TODO webpack 5 remove this + this.hooks.infrastructurelog = this.hooks.infrastructureLog; + + this._pluginCompat.tap("Compiler", options => { + switch (options.name) { + case "additional-pass": + case "before-run": + case "run": + case "emit": + case "after-emit": + case "before-compile": + case "make": + case "after-compile": + case "watch-run": + options.async = true; + break; } - } - } + }); - /** - * returns the name of current ChunkGroup - * @returns {string|undefined} returns the ChunkGroup name - */ - get name() { - return this.options.name; - } + /** @type {string=} */ + this.name = undefined; + /** @type {Compilation=} */ + this.parentCompilation = undefined; + /** @type {string} */ + this.outputPath = ""; - /** - * sets a new name for current ChunkGroup - * @param {string} value the new name for ChunkGroup - * @returns {void} - */ - set name(value) { - this.options.name = value; - } + this.outputFileSystem = null; + this.inputFileSystem = null; - /** - * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's - * @returns {string} a unique concatenation of chunk debugId's - */ - get debugId() { - return Array.from(this.chunks, x => x.debugId).join("+"); - } + /** @type {string|null} */ + this.recordsInputPath = null; + /** @type {string|null} */ + this.recordsOutputPath = null; + this.records = {}; + this.removedFiles = new Set(); + /** @type {Map} */ + this.fileTimestamps = new Map(); + /** @type {Map} */ + this.contextTimestamps = new Map(); + /** @type {ResolverFactory} */ + this.resolverFactory = new ResolverFactory(); - /** - * get a unique id for ChunkGroup, made up of its member Chunk id's - * @returns {string} a unique concatenation of chunk ids - */ - get id() { - return Array.from(this.chunks, x => x.id).join("+"); - } + this.infrastructureLogger = undefined; - /** - * Performs an unshift of a specific chunk - * @param {Chunk} chunk chunk being unshifted - * @returns {boolean} returns true if attempted chunk shift is accepted - */ - unshiftChunk(chunk) { - const oldIdx = this.chunks.indexOf(chunk); - if (oldIdx > 0) { - this.chunks.splice(oldIdx, 1); - this.chunks.unshift(chunk); - } else if (oldIdx < 0) { - this.chunks.unshift(chunk); - return true; - } - return false; - } + // TODO remove in webpack 5 + this.resolvers = { + normal: { + plugins: util.deprecate((hook, fn) => { + this.resolverFactory.plugin("resolver normal", resolver => { + resolver.plugin(hook, fn); + }); + }, "webpack: Using compiler.resolvers.normal is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver normal", resolver => {\n resolver.plugin(/* … */);\n}); instead.'), + apply: util.deprecate((...args) => { + this.resolverFactory.plugin("resolver normal", resolver => { + resolver.apply(...args); + }); + }, "webpack: Using compiler.resolvers.normal is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver normal", resolver => {\n resolver.apply(/* … */);\n}); instead.') + }, + loader: { + plugins: util.deprecate((hook, fn) => { + this.resolverFactory.plugin("resolver loader", resolver => { + resolver.plugin(hook, fn); + }); + }, "webpack: Using compiler.resolvers.loader is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver loader", resolver => {\n resolver.plugin(/* … */);\n}); instead.'), + apply: util.deprecate((...args) => { + this.resolverFactory.plugin("resolver loader", resolver => { + resolver.apply(...args); + }); + }, "webpack: Using compiler.resolvers.loader is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver loader", resolver => {\n resolver.apply(/* … */);\n}); instead.') + }, + context: { + plugins: util.deprecate((hook, fn) => { + this.resolverFactory.plugin("resolver context", resolver => { + resolver.plugin(hook, fn); + }); + }, "webpack: Using compiler.resolvers.context is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver context", resolver => {\n resolver.plugin(/* … */);\n}); instead.'), + apply: util.deprecate((...args) => { + this.resolverFactory.plugin("resolver context", resolver => { + resolver.apply(...args); + }); + }, "webpack: Using compiler.resolvers.context is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver context", resolver => {\n resolver.apply(/* … */);\n}); instead.') + } + }; - /** - * inserts a chunk before another existing chunk in group - * @param {Chunk} chunk Chunk being inserted - * @param {Chunk} before Placeholder/target chunk marking new chunk insertion point - * @returns {boolean} return true if insertion was successful - */ - insertChunk(chunk, before) { - const oldIdx = this.chunks.indexOf(chunk); - const idx = this.chunks.indexOf(before); - if (idx < 0) { - throw new Error("before chunk not found"); - } - if (oldIdx >= 0 && oldIdx > idx) { - this.chunks.splice(oldIdx, 1); - this.chunks.splice(idx, 0, chunk); - } else if (oldIdx < 0) { - this.chunks.splice(idx, 0, chunk); - return true; - } - return false; - } + /** @type {WebpackOptions} */ + this.options = /** @type {WebpackOptions} */ ({}); - /** - * add a chunk into ChunkGroup. Is pushed on or prepended - * @param {Chunk} chunk chunk being pushed into ChunkGroupS - * @returns {boolean} returns true if chunk addition was successful. - */ - pushChunk(chunk) { - const oldIdx = this.chunks.indexOf(chunk); - if (oldIdx >= 0) { - return false; - } - this.chunks.push(chunk); - return true; + this.context = context; + + this.requestShortener = new RequestShortener(context); + + /** @type {boolean} */ + this.running = false; + + /** @type {boolean} */ + this.watchMode = false; + + /** @private @type {WeakMap }>} */ + this._assetEmittingSourceCache = new WeakMap(); + /** @private @type {Map} */ + this._assetEmittingWrittenFiles = new Map(); } /** - * @param {Chunk} oldChunk chunk to be replaced - * @param {Chunk} newChunk New chunk that will be replaced with - * @returns {boolean} returns true if the replacement was successful + * @param {string | (function(): string)} name name of the logger, or function called once to get the logger name + * @returns {Logger} a logger with that name */ - replaceChunk(oldChunk, newChunk) { - const oldIdx = this.chunks.indexOf(oldChunk); - if (oldIdx < 0) return false; - const newIdx = this.chunks.indexOf(newChunk); - if (newIdx < 0) { - this.chunks[oldIdx] = newChunk; - return true; - } - if (newIdx < oldIdx) { - this.chunks.splice(oldIdx, 1); - return true; - } else if (newIdx !== oldIdx) { - this.chunks[oldIdx] = newChunk; - this.chunks.splice(newIdx, 1); - return true; + getInfrastructureLogger(name) { + if (!name) { + throw new TypeError( + "Compiler.getInfrastructureLogger(name) called without a name" + ); } + return new Logger((type, args) => { + if (typeof name === "function") { + name = name(); + if (!name) { + throw new TypeError( + "Compiler.getInfrastructureLogger(name) called with a function not returning a name" + ); + } + } + if (this.hooks.infrastructureLog.call(name, type, args) === undefined) { + if (this.infrastructureLogger !== undefined) { + this.infrastructureLogger(name, type, args); + } + } + }); } - removeChunk(chunk) { - const idx = this.chunks.indexOf(chunk); - if (idx >= 0) { - this.chunks.splice(idx, 1); - return true; - } - return false; - } + watch(watchOptions, handler) { + if (this.running) return handler(new ConcurrentCompilationError()); - isInitial() { - return false; + this.running = true; + this.watchMode = true; + this.fileTimestamps = new Map(); + this.contextTimestamps = new Map(); + this.removedFiles = new Set(); + return new Watching(this, watchOptions, handler); } - addChild(chunk) { - if (this._children.has(chunk)) { - return false; - } - this._children.add(chunk); - return true; - } + run(callback) { + if (this.running) return callback(new ConcurrentCompilationError()); - getChildren() { - return this._children.getFromCache(getArray); - } + const finalCallback = (err, stats) => { + this.running = false; - getNumberOfChildren() { - return this._children.size; - } + if (err) { + this.hooks.failed.call(err); + } - get childrenIterable() { - return this._children; - } + if (callback !== undefined) return callback(err, stats); + }; - removeChild(chunk) { - if (!this._children.has(chunk)) { - return false; - } + const startTime = Date.now(); - this._children.delete(chunk); - chunk.removeParent(this); - return true; - } + this.running = true; - addParent(parentChunk) { - if (!this._parents.has(parentChunk)) { - this._parents.add(parentChunk); - return true; - } - return false; - } + const onCompiled = (err, compilation) => { + if (err) return finalCallback(err); - getParents() { - return this._parents.getFromCache(getArray); - } + if (this.hooks.shouldEmit.call(compilation) === false) { + const stats = new Stats(compilation); + stats.startTime = startTime; + stats.endTime = Date.now(); + this.hooks.done.callAsync(stats, err => { + if (err) return finalCallback(err); + return finalCallback(null, stats); + }); + return; + } - setParents(newParents) { - this._parents.clear(); - for (const p of newParents) { - this._parents.add(p); - } - } + this.emitAssets(compilation, err => { + if (err) return finalCallback(err); - getNumberOfParents() { - return this._parents.size; - } + if (compilation.hooks.needAdditionalPass.call()) { + compilation.needAdditionalPass = true; - hasParent(parent) { - return this._parents.has(parent); - } + const stats = new Stats(compilation); + stats.startTime = startTime; + stats.endTime = Date.now(); + this.hooks.done.callAsync(stats, err => { + if (err) return finalCallback(err); - get parentsIterable() { - return this._parents; - } + this.hooks.additionalPass.callAsync(err => { + if (err) return finalCallback(err); + this.compile(onCompiled); + }); + }); + return; + } - removeParent(chunk) { - if (this._parents.delete(chunk)) { - chunk.removeChunk(this); - return true; - } - return false; - } + this.emitRecords(err => { + if (err) return finalCallback(err); - /** - * @returns {Array} - an array containing the blocks - */ - getBlocks() { - return this._blocks.getFromCache(getArray); - } + const stats = new Stats(compilation); + stats.startTime = startTime; + stats.endTime = Date.now(); + this.hooks.done.callAsync(stats, err => { + if (err) return finalCallback(err); + return finalCallback(null, stats); + }); + }); + }); + }; - getNumberOfBlocks() { - return this._blocks.size; - } + this.hooks.beforeRun.callAsync(this, err => { + if (err) return finalCallback(err); - hasBlock(block) { - return this._blocks.has(block); - } + this.hooks.run.callAsync(this, err => { + if (err) return finalCallback(err); - get blocksIterable() { - return this._blocks; - } + this.readRecords(err => { + if (err) return finalCallback(err); - addBlock(block) { - if (!this._blocks.has(block)) { - this._blocks.add(block); - return true; - } - return false; + this.compile(onCompiled); + }); + }); + }); } - addOrigin(module, loc, request) { - this.origins.push({ - module, - loc, - request + runAsChild(callback) { + this.compile((err, compilation) => { + if (err) return callback(err); + + this.parentCompilation.children.push(compilation); + for (const { name, source, info } of compilation.getAssets()) { + this.parentCompilation.emitAsset(name, source, info); + } + + const entries = Array.from( + compilation.entrypoints.values(), + ep => ep.chunks + ).reduce((array, chunks) => { + return array.concat(chunks); + }, []); + + return callback(null, entries, compilation); }); } - containsModule(module) { - for (const chunk of this.chunks) { - if (chunk.containsModule(module)) return true; + purgeInputFileSystem() { + if (this.inputFileSystem && this.inputFileSystem.purge) { + this.inputFileSystem.purge(); } - return false; } - getFiles() { - const files = new Set(); + emitAssets(compilation, callback) { + let outputPath; + const emitFiles = err => { + if (err) return callback(err); - for (const chunk of this.chunks) { - for (const file of chunk.files) { - files.add(file); - } - } + asyncLib.forEachLimit( + compilation.getAssets(), + 15, + ({ name: file, source }, callback) => { + let targetFile = file; + const queryStringIdx = targetFile.indexOf("?"); + if (queryStringIdx >= 0) { + targetFile = targetFile.substr(0, queryStringIdx); + } - return Array.from(files); - } + const writeOut = err => { + if (err) return callback(err); + const targetPath = this.outputFileSystem.join( + outputPath, + targetFile + ); + // TODO webpack 5 remove futureEmitAssets option and make it on by default + if (this.options.output.futureEmitAssets) { + // check if the target file has already been written by this Compiler + const targetFileGeneration = this._assetEmittingWrittenFiles.get( + targetPath + ); - /** - * @param {string=} reason reason for removing ChunkGroup - * @returns {void} - */ - remove(reason) { - // cleanup parents - for (const parentChunkGroup of this._parents) { - // remove this chunk from its parents - parentChunkGroup._children.delete(this); + // create an cache entry for this Source if not already existing + let cacheEntry = this._assetEmittingSourceCache.get(source); + if (cacheEntry === undefined) { + cacheEntry = { + sizeOnlySource: undefined, + writtenTo: new Map() + }; + this._assetEmittingSourceCache.set(source, cacheEntry); + } - // cleanup "sub chunks" - for (const chunkGroup of this._children) { - /** - * remove this chunk as "intermediary" and connect - * it "sub chunks" and parents directly - */ - // add parent to each "sub chunk" - chunkGroup.addParent(parentChunkGroup); - // add "sub chunk" to parent - parentChunkGroup.addChild(chunkGroup); - } + // if the target file has already been written + if (targetFileGeneration !== undefined) { + // check if the Source has been written to this target file + const writtenGeneration = cacheEntry.writtenTo.get(targetPath); + if (writtenGeneration === targetFileGeneration) { + // if yes, we skip writing the file + // as it's already there + // (we assume one doesn't remove files while the Compiler is running) + + compilation.updateAsset(file, cacheEntry.sizeOnlySource, { + size: cacheEntry.sizeOnlySource.size() + }); + + return callback(); + } + } + + // TODO webpack 5: if info.immutable check if file already exists in output + // skip emitting if it's already there + + // get the binary (Buffer) content from the Source + /** @type {Buffer} */ + let content; + if (typeof source.buffer === "function") { + content = source.buffer(); + } else { + const bufferOrString = source.source(); + if (Buffer.isBuffer(bufferOrString)) { + content = bufferOrString; + } else { + content = Buffer.from(bufferOrString, "utf8"); + } + } + + // Create a replacement resource which only allows to ask for size + // This allows to GC all memory allocated by the Source + // (expect when the Source is stored in any other cache) + cacheEntry.sizeOnlySource = new SizeOnlySource(content.length); + compilation.updateAsset(file, cacheEntry.sizeOnlySource, { + size: content.length + }); + + // Write the file to output file system + this.outputFileSystem.writeFile(targetPath, content, err => { + if (err) return callback(err); + + // information marker that the asset has been emitted + compilation.emittedAssets.add(file); + + // cache the information that the Source has been written to that location + const newGeneration = + targetFileGeneration === undefined + ? 1 + : targetFileGeneration + 1; + cacheEntry.writtenTo.set(targetPath, newGeneration); + this._assetEmittingWrittenFiles.set(targetPath, newGeneration); + this.hooks.assetEmitted.callAsync(file, content, callback); + }); + } else { + if (source.existsAt === targetPath) { + source.emitted = false; + return callback(); + } + let content = source.source(); + + if (!Buffer.isBuffer(content)) { + content = Buffer.from(content, "utf8"); + } + + source.existsAt = targetPath; + source.emitted = true; + this.outputFileSystem.writeFile(targetPath, content, err => { + if (err) return callback(err); + this.hooks.assetEmitted.callAsync(file, content, callback); + }); + } + }; + + if (targetFile.match(/\/|\\/)) { + const dir = path.dirname(targetFile); + this.outputFileSystem.mkdirp( + this.outputFileSystem.join(outputPath, dir), + writeOut + ); + } else { + writeOut(); + } + }, + err => { + if (err) return callback(err); + + this.hooks.afterEmit.callAsync(compilation, err => { + if (err) return callback(err); + + return callback(); + }); + } + ); + }; + + this.hooks.emit.callAsync(compilation, err => { + if (err) return callback(err); + outputPath = compilation.getPath(this.outputPath); + this.outputFileSystem.mkdirp(outputPath, emitFiles); + }); + } + + emitRecords(callback) { + if (!this.recordsOutputPath) return callback(); + const idx1 = this.recordsOutputPath.lastIndexOf("/"); + const idx2 = this.recordsOutputPath.lastIndexOf("\\"); + let recordsOutputPathDirectory = null; + if (idx1 > idx2) { + recordsOutputPathDirectory = this.recordsOutputPath.substr(0, idx1); + } else if (idx1 < idx2) { + recordsOutputPathDirectory = this.recordsOutputPath.substr(0, idx2); } - /** - * we need to iterate again over the children - * to remove this from the child's parents. - * This can not be done in the above loop - * as it is not guaranteed that `this._parents` contains anything. - */ - for (const chunkGroup of this._children) { - // remove this as parent of every "sub chunk" - chunkGroup._parents.delete(this); + const writeFile = () => { + this.outputFileSystem.writeFile( + this.recordsOutputPath, + JSON.stringify(this.records, undefined, 2), + callback + ); + }; + + if (!recordsOutputPathDirectory) { + return writeFile(); } + this.outputFileSystem.mkdirp(recordsOutputPathDirectory, err => { + if (err) return callback(err); + writeFile(); + }); + } - // cleanup blocks - for (const block of this._blocks) { - block.chunkGroup = null; + readRecords(callback) { + if (!this.recordsInputPath) { + this.records = {}; + return callback(); } + this.inputFileSystem.stat(this.recordsInputPath, err => { + // It doesn't exist + // We can ignore this. + if (err) return callback(); - // remove chunks - for (const chunk of this.chunks) { - chunk.removeGroup(this); + this.inputFileSystem.readFile(this.recordsInputPath, (err, content) => { + if (err) return callback(err); + + try { + this.records = parseJson(content.toString("utf-8")); + } catch (e) { + e.message = "Cannot parse records: " + e.message; + return callback(e); + } + + return callback(); + }); + }); + } + + createChildCompiler( + compilation, + compilerName, + compilerIndex, + outputOptions, + plugins + ) { + const childCompiler = new Compiler(this.context); + if (Array.isArray(plugins)) { + for (const plugin of plugins) { + plugin.apply(childCompiler); + } + } + for (const name in this.hooks) { + if ( + ![ + "make", + "compile", + "emit", + "afterEmit", + "invalid", + "done", + "thisCompilation" + ].includes(name) + ) { + if (childCompiler.hooks[name]) { + childCompiler.hooks[name].taps = this.hooks[name].taps.slice(); + } + } + } + childCompiler.name = compilerName; + childCompiler.outputPath = this.outputPath; + childCompiler.inputFileSystem = this.inputFileSystem; + childCompiler.outputFileSystem = null; + childCompiler.resolverFactory = this.resolverFactory; + childCompiler.fileTimestamps = this.fileTimestamps; + childCompiler.contextTimestamps = this.contextTimestamps; + + const relativeCompilerName = makePathsRelative(this.context, compilerName); + if (!this.records[relativeCompilerName]) { + this.records[relativeCompilerName] = []; + } + if (this.records[relativeCompilerName][compilerIndex]) { + childCompiler.records = this.records[relativeCompilerName][compilerIndex]; + } else { + this.records[relativeCompilerName].push((childCompiler.records = {})); + } + + childCompiler.options = Object.create(this.options); + childCompiler.options.output = Object.create(childCompiler.options.output); + for (const name in outputOptions) { + childCompiler.options.output[name] = outputOptions[name]; } + childCompiler.parentCompilation = compilation; + + compilation.hooks.childCompiler.call( + childCompiler, + compilerName, + compilerIndex + ); + + return childCompiler; } - sortItems() { - this.origins.sort(sortOrigin); - this._parents.sort(); - this._children.sort(); + isChild() { + return !!this.parentCompilation; } - /** - * Sorting predicate which allows current ChunkGroup to be compared against another. - * Sorting values are based off of number of chunks in ChunkGroup. - * - * @param {ChunkGroup} otherGroup the chunkGroup to compare this against - * @returns {-1|0|1} sort position for comparison - */ - compareTo(otherGroup) { - if (this.chunks.length > otherGroup.chunks.length) return -1; - if (this.chunks.length < otherGroup.chunks.length) return 1; - const a = this.chunks[Symbol.iterator](); - const b = otherGroup.chunks[Symbol.iterator](); - // eslint-disable-next-line no-constant-condition - while (true) { - const aItem = a.next(); - const bItem = b.next(); - if (aItem.done) return 0; - const cmp = aItem.value.compareTo(bItem.value); - if (cmp !== 0) return cmp; - } + createCompilation() { + return new Compilation(this); } - getChildrenByOrders() { - const lists = new Map(); - for (const childGroup of this._children) { - // TODO webpack 5 remove this check for options - if (typeof childGroup.options === "object") { - for (const key of Object.keys(childGroup.options)) { - if (key.endsWith("Order")) { - const name = key.substr(0, key.length - "Order".length); - let list = lists.get(name); - if (list === undefined) { - lists.set(name, (list = [])); - } - list.push({ - order: childGroup.options[key], - group: childGroup + newCompilation(params) { + const compilation = this.createCompilation(); + compilation.fileTimestamps = this.fileTimestamps; + compilation.contextTimestamps = this.contextTimestamps; + compilation.name = this.name; + compilation.records = this.records; + compilation.compilationDependencies = params.compilationDependencies; + this.hooks.thisCompilation.call(compilation, params); + this.hooks.compilation.call(compilation, params); + return compilation; + } + + createNormalModuleFactory() { + const normalModuleFactory = new NormalModuleFactory( + this.options.context, + this.resolverFactory, + this.options.module || {} + ); + this.hooks.normalModuleFactory.call(normalModuleFactory); + return normalModuleFactory; + } + + createContextModuleFactory() { + const contextModuleFactory = new ContextModuleFactory(this.resolverFactory); + this.hooks.contextModuleFactory.call(contextModuleFactory); + return contextModuleFactory; + } + + newCompilationParams() { + const params = { + normalModuleFactory: this.createNormalModuleFactory(), + contextModuleFactory: this.createContextModuleFactory(), + compilationDependencies: new Set() + }; + return params; + } + + compile(callback) { + const params = this.newCompilationParams(); + this.hooks.beforeCompile.callAsync(params, err => { + if (err) return callback(err); + + this.hooks.compile.call(params); + + const compilation = this.newCompilation(params); + + this.hooks.make.callAsync(compilation, err => { + if (err) return callback(err); + + compilation.finish(err => { + if (err) return callback(err); + + compilation.seal(err => { + if (err) return callback(err); + + this.hooks.afterCompile.callAsync(compilation, err => { + if (err) return callback(err); + + return callback(null, compilation); }); - } - } - } - } - const result = Object.create(null); - for (const [name, list] of lists) { - list.sort((a, b) => { - const cmp = b.order - a.order; - if (cmp !== 0) return cmp; - // TODO webpack 5 remove this check of compareTo - if (a.group.compareTo) { - return a.group.compareTo(b.group); - } - return 0; + }); + }); }); - result[name] = list.map(i => i.group); - } - return result; + }); } +} - /** - * Sets the top-down index of a module in this ChunkGroup - * @param {Module} module module for which the index should be set - * @param {number} index the index of the module - * @returns {void} - */ - setModuleIndex(module, index) { - this._moduleIndices.set(module, index); +module.exports = Compiler; + +class SizeOnlySource extends Source { + constructor(size) { + super(); + this._size = size; } - /** - * Gets the top-down index of a module in this ChunkGroup - * @param {Module} module the module - * @returns {number} index - */ - getModuleIndex(module) { - return this._moduleIndices.get(module); + _error() { + return new Error( + "Content and Map of this Source is no longer available (only size() is supported)" + ); } - /** - * Sets the bottom-up index of a module in this ChunkGroup - * @param {Module} module module for which the index should be set - * @param {number} index the index of the module - * @returns {void} - */ - setModuleIndex2(module, index) { - this._moduleIndices2.set(module, index); + size() { + return this._size; } /** - * Gets the bottom-up index of a module in this ChunkGroup - * @param {Module} module the module - * @returns {number} index + * @param {any} options options + * @returns {string} the source */ - getModuleIndex2(module) { - return this._moduleIndices2.get(module); + source(options) { + throw this._error(); } - checkConstraints() { - const chunk = this; - for (const child of chunk._children) { - if (!child._parents.has(chunk)) { - throw new Error( - `checkConstraints: child missing parent ${chunk.debugId} -> ${child.debugId}` - ); - } - } - for (const parentChunk of chunk._parents) { - if (!parentChunk._children.has(chunk)) { - throw new Error( - `checkConstraints: parent missing child ${parentChunk.debugId} <- ${chunk.debugId}` - ); - } - } + node() { + throw this._error(); } -} -module.exports = ChunkGroup; + listMap() { + throw this._error(); + } + + map() { + throw this._error(); + } + + listNode() { + throw this._error(); + } + + updateHash() { + throw this._error(); + } +} /***/ }), -/***/ 69865: +/***/ 18933: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra + Author Maksim Nazarjev @acupofspirt */ const WebpackError = __webpack_require__(97391); -/** @typedef {import("./Chunk")} Chunk */ - -class ChunkRenderError extends WebpackError { - /** - * Create a new ChunkRenderError - * @param {Chunk} chunk A chunk - * @param {string} file Related file - * @param {Error} error Original error - */ - constructor(chunk, file, error) { +module.exports = class ConcurrentCompilationError extends WebpackError { + constructor() { super(); - this.name = "ChunkRenderError"; - this.error = error; - this.message = error.message; - this.details = error.stack; - this.file = file; - this.chunk = chunk; + this.name = "ConcurrentCompilationError"; + this.message = + "You ran Webpack twice. Each instance only supports a single concurrent compilation at a time."; Error.captureStackTrace(this, this.constructor); } -} - -module.exports = ChunkRenderError; +}; /***/ }), -/***/ 6170: +/***/ 84072: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -53595,93 +53285,390 @@ module.exports = ChunkRenderError; Author Tobias Koppers @sokra */ +const ConstDependency = __webpack_require__(71101); +const NullFactory = __webpack_require__(40438); +const ParserHelpers = __webpack_require__(23999); -const { Tapable, SyncWaterfallHook, SyncHook } = __webpack_require__(92402); - -/** @typedef {import("./ModuleTemplate")} ModuleTemplate */ -/** @typedef {import("./Chunk")} Chunk */ -/** @typedef {import("./Module")} Module} */ -/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate} */ -/** @typedef {import("./util/createHash").Hash} Hash} */ - -/** - * @typedef {Object} RenderManifestOptions - * @property {Chunk} chunk the chunk used to render - * @property {string} hash - * @property {string} fullHash - * @property {TODO} outputOptions - * @property {{javascript: ModuleTemplate, webassembly: ModuleTemplate}} moduleTemplates - * @property {Map} dependencyTemplates - */ +const getQuery = request => { + const i = request.indexOf("?"); + return i !== -1 ? request.substr(i) : ""; +}; -module.exports = class ChunkTemplate extends Tapable { - constructor(outputOptions) { - super(); - this.outputOptions = outputOptions || {}; - this.hooks = { - /** @type {SyncWaterfallHook} */ - renderManifest: new SyncWaterfallHook(["result", "options"]), - modules: new SyncWaterfallHook([ - "source", - "chunk", - "moduleTemplate", - "dependencyTemplates" - ]), - render: new SyncWaterfallHook([ - "source", - "chunk", - "moduleTemplate", - "dependencyTemplates" - ]), - renderWithEntry: new SyncWaterfallHook(["source", "chunk"]), - hash: new SyncHook(["hash"]), - hashForChunk: new SyncHook(["hash", "chunk"]) - }; +const collectDeclaration = (declarations, pattern) => { + const stack = [pattern]; + while (stack.length > 0) { + const node = stack.pop(); + switch (node.type) { + case "Identifier": + declarations.add(node.name); + break; + case "ArrayPattern": + for (const element of node.elements) { + if (element) { + stack.push(element); + } + } + break; + case "AssignmentPattern": + stack.push(node.left); + break; + case "ObjectPattern": + for (const property of node.properties) { + stack.push(property.value); + } + break; + case "RestElement": + stack.push(node.argument); + break; + } } +}; - /** - * - * @param {RenderManifestOptions} options render manifest options - * @returns {TODO[]} returns render manifest - */ - getRenderManifest(options) { - const result = []; +const getHoistedDeclarations = (branch, includeFunctionDeclarations) => { + const declarations = new Set(); + const stack = [branch]; + while (stack.length > 0) { + const node = stack.pop(); + // Some node could be `null` or `undefined`. + if (!node) continue; + switch (node.type) { + // Walk through control statements to look for hoisted declarations. + // Some branches are skipped since they do not allow declarations. + case "BlockStatement": + for (const stmt of node.body) { + stack.push(stmt); + } + break; + case "IfStatement": + stack.push(node.consequent); + stack.push(node.alternate); + break; + case "ForStatement": + stack.push(node.init); + stack.push(node.body); + break; + case "ForInStatement": + case "ForOfStatement": + stack.push(node.left); + stack.push(node.body); + break; + case "DoWhileStatement": + case "WhileStatement": + case "LabeledStatement": + stack.push(node.body); + break; + case "SwitchStatement": + for (const cs of node.cases) { + for (const consequent of cs.consequent) { + stack.push(consequent); + } + } + break; + case "TryStatement": + stack.push(node.block); + if (node.handler) { + stack.push(node.handler.body); + } + stack.push(node.finalizer); + break; + case "FunctionDeclaration": + if (includeFunctionDeclarations) { + collectDeclaration(declarations, node.id); + } + break; + case "VariableDeclaration": + if (node.kind === "var") { + for (const decl of node.declarations) { + collectDeclaration(declarations, decl.id); + } + } + break; + } + } + return Array.from(declarations); +}; - this.hooks.renderManifest.call(result, options); +class ConstPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "ConstPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(ConstDependency, new NullFactory()); + compilation.dependencyTemplates.set( + ConstDependency, + new ConstDependency.Template() + ); - return result; + const handler = parser => { + parser.hooks.statementIf.tap("ConstPlugin", statement => { + if (parser.scope.isAsmJs) return; + const param = parser.evaluateExpression(statement.test); + const bool = param.asBool(); + if (typeof bool === "boolean") { + if (statement.test.type !== "Literal") { + const dep = new ConstDependency(`${bool}`, param.range); + dep.loc = statement.loc; + parser.state.current.addDependency(dep); + } + const branchToRemove = bool + ? statement.alternate + : statement.consequent; + if (branchToRemove) { + // Before removing the dead branch, the hoisted declarations + // must be collected. + // + // Given the following code: + // + // if (true) f() else g() + // if (false) { + // function f() {} + // const g = function g() {} + // if (someTest) { + // let a = 1 + // var x, {y, z} = obj + // } + // } else { + // … + // } + // + // the generated code is: + // + // if (true) f() else {} + // if (false) { + // var f, x, y, z; (in loose mode) + // var x, y, z; (in strict mode) + // } else { + // … + // } + // + // NOTE: When code runs in strict mode, `var` declarations + // are hoisted but `function` declarations don't. + // + let declarations; + if (parser.scope.isStrict) { + // If the code runs in strict mode, variable declarations + // using `var` must be hoisted. + declarations = getHoistedDeclarations(branchToRemove, false); + } else { + // Otherwise, collect all hoisted declaration. + declarations = getHoistedDeclarations(branchToRemove, true); + } + let replacement; + if (declarations.length > 0) { + replacement = `{ var ${declarations.join(", ")}; }`; + } else { + replacement = "{}"; + } + const dep = new ConstDependency( + replacement, + branchToRemove.range + ); + dep.loc = branchToRemove.loc; + parser.state.current.addDependency(dep); + } + return bool; + } + }); + parser.hooks.expressionConditionalOperator.tap( + "ConstPlugin", + expression => { + if (parser.scope.isAsmJs) return; + const param = parser.evaluateExpression(expression.test); + const bool = param.asBool(); + if (typeof bool === "boolean") { + if (expression.test.type !== "Literal") { + const dep = new ConstDependency(` ${bool}`, param.range); + dep.loc = expression.loc; + parser.state.current.addDependency(dep); + } + // Expressions do not hoist. + // It is safe to remove the dead branch. + // + // Given the following code: + // + // false ? someExpression() : otherExpression(); + // + // the generated code is: + // + // false ? undefined : otherExpression(); + // + const branchToRemove = bool + ? expression.alternate + : expression.consequent; + const dep = new ConstDependency( + "undefined", + branchToRemove.range + ); + dep.loc = branchToRemove.loc; + parser.state.current.addDependency(dep); + return bool; + } + } + ); + parser.hooks.expressionLogicalOperator.tap( + "ConstPlugin", + expression => { + if (parser.scope.isAsmJs) return; + if ( + expression.operator === "&&" || + expression.operator === "||" + ) { + const param = parser.evaluateExpression(expression.left); + const bool = param.asBool(); + if (typeof bool === "boolean") { + // Expressions do not hoist. + // It is safe to remove the dead branch. + // + // ------------------------------------------ + // + // Given the following code: + // + // falsyExpression() && someExpression(); + // + // the generated code is: + // + // falsyExpression() && false; + // + // ------------------------------------------ + // + // Given the following code: + // + // truthyExpression() && someExpression(); + // + // the generated code is: + // + // true && someExpression(); + // + // ------------------------------------------ + // + // Given the following code: + // + // truthyExpression() || someExpression(); + // + // the generated code is: + // + // truthyExpression() || false; + // + // ------------------------------------------ + // + // Given the following code: + // + // falsyExpression() || someExpression(); + // + // the generated code is: + // + // false && someExpression(); + // + const keepRight = + (expression.operator === "&&" && bool) || + (expression.operator === "||" && !bool); + + if (param.isBoolean() || keepRight) { + // for case like + // + // return'development'===process.env.NODE_ENV&&'foo' + // + // we need a space before the bool to prevent result like + // + // returnfalse&&'foo' + // + const dep = new ConstDependency(` ${bool}`, param.range); + dep.loc = expression.loc; + parser.state.current.addDependency(dep); + } else { + parser.walkExpression(expression.left); + } + if (!keepRight) { + const dep = new ConstDependency( + "false", + expression.right.range + ); + dep.loc = expression.loc; + parser.state.current.addDependency(dep); + } + return keepRight; + } + } + } + ); + parser.hooks.evaluateIdentifier + .for("__resourceQuery") + .tap("ConstPlugin", expr => { + if (parser.scope.isAsmJs) return; + if (!parser.state.module) return; + return ParserHelpers.evaluateToString( + getQuery(parser.state.module.resource) + )(expr); + }); + parser.hooks.expression + .for("__resourceQuery") + .tap("ConstPlugin", () => { + if (parser.scope.isAsmJs) return; + if (!parser.state.module) return; + parser.state.current.addVariable( + "__resourceQuery", + JSON.stringify(getQuery(parser.state.module.resource)) + ); + return true; + }); + }; + + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("ConstPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("ConstPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/esm") + .tap("ConstPlugin", handler); + } + ); } +} + +module.exports = ConstPlugin; + + +/***/ }), + +/***/ 10706: +/***/ (function(module) { + +"use strict"; + +/** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./ContextModuleFactory")} ContextModuleFactory */ + +class ContextExclusionPlugin { /** - * Updates hash with information from this template - * @param {Hash} hash the hash to update - * @returns {void} + * @param {RegExp} negativeMatcher Matcher regular expression */ - updateHash(hash) { - hash.update("ChunkTemplate"); - hash.update("2"); - this.hooks.hash.call(hash); + constructor(negativeMatcher) { + this.negativeMatcher = negativeMatcher; } /** - * TODO webpack 5: remove moduleTemplate and dependencyTemplates - * Updates hash with chunk-specific information from this template - * @param {Hash} hash the hash to update - * @param {Chunk} chunk the chunk - * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render - * @param {Map} dependencyTemplates dependency templates + * Apply the plugin + * @param {Compiler} compiler Webpack Compiler * @returns {void} */ - updateHashForChunk(hash, chunk, moduleTemplate, dependencyTemplates) { - this.updateHash(hash); - this.hooks.hashForChunk.call(hash, chunk); + apply(compiler) { + compiler.hooks.contextModuleFactory.tap("ContextExclusionPlugin", cmf => { + cmf.hooks.contextModuleFiles.tap("ContextExclusionPlugin", files => { + return files.filter(filePath => !this.negativeMatcher.test(filePath)); + }); + }); } -}; +} + +module.exports = ContextExclusionPlugin; /***/ }), -/***/ 51760: +/***/ 20090: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -53690,3340 +53677,2693 @@ module.exports = class ChunkTemplate extends Tapable { Author Tobias Koppers @sokra */ +const util = __webpack_require__(31669); +const { OriginalSource, RawSource } = __webpack_require__(53665); +const Module = __webpack_require__(75993); +const AsyncDependenciesBlock = __webpack_require__(22814); +const Template = __webpack_require__(96066); +const contextify = __webpack_require__(94658).contextify; -const WebpackError = __webpack_require__(97391); +/** @typedef {"sync" | "eager" | "weak" | "async-weak" | "lazy" | "lazy-once"} ContextMode Context mode */ +/** @typedef {import("./dependencies/ContextElementDependency")} ContextElementDependency */ -/** @typedef {import("./Module")} Module */ +/** + * @callback ResolveDependenciesCallback + * @param {Error=} err + * @param {ContextElementDependency[]} dependencies + */ -/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ +/** + * @callback ResolveDependencies + * @param {TODO} fs + * @param {TODO} options + * @param {ResolveDependenciesCallback} callback + */ -class CommentCompilationWarning extends WebpackError { +class ContextModule extends Module { + // type ContextMode = "sync" | "eager" | "weak" | "async-weak" | "lazy" | "lazy-once" + // type ContextOptions = { resource: string, recursive: boolean, regExp: RegExp, addon?: string, mode?: ContextMode, chunkName?: string, include?: RegExp, exclude?: RegExp, groupOptions?: Object } + // resolveDependencies: (fs: FS, options: ContextOptions, (err: Error?, dependencies: Dependency[]) => void) => void + // options: ContextOptions /** - * - * @param {string} message warning message - * @param {Module} module affected module - * @param {DependencyLocation} loc affected lines of code + * @param {ResolveDependencies} resolveDependencies function to get dependencies in this context + * @param {TODO} options options object */ - constructor(message, module, loc) { - super(message); - - this.name = "CommentCompilationWarning"; - - this.module = module; - this.loc = loc; - - Error.captureStackTrace(this, this.constructor); - } -} + constructor(resolveDependencies, options) { + let resource; + let resourceQuery; + const queryIdx = options.resource.indexOf("?"); + if (queryIdx >= 0) { + resource = options.resource.substr(0, queryIdx); + resourceQuery = options.resource.substr(queryIdx); + } else { + resource = options.resource; + resourceQuery = ""; + } -module.exports = CommentCompilationWarning; + super("javascript/dynamic", resource); + // Info from Factory + this.resolveDependencies = resolveDependencies; + this.options = Object.assign({}, options, { + resource: resource, + resourceQuery: resourceQuery + }); + if (options.resolveOptions !== undefined) { + this.resolveOptions = options.resolveOptions; + } -/***/ }), + // Info from Build + this._contextDependencies = new Set([this.context]); -/***/ 85736: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if (typeof options.mode !== "string") { + throw new Error("options.mode is a required option"); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + this._identifier = this._createIdentifier(); + } + updateCacheModule(module) { + this.resolveDependencies = module.resolveDependencies; + this.options = module.options; + this.resolveOptions = module.resolveOptions; + } -const path = __webpack_require__(85622); -const ParserHelpers = __webpack_require__(23999); + prettyRegExp(regexString) { + // remove the "/" at the front and the beginning + // "/foo/" -> "foo" + return regexString.substring(1, regexString.length - 1); + } -class CommonJsStuffPlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "CommonJsStuffPlugin", - (compilation, { normalModuleFactory }) => { - const handler = (parser, parserOptions) => { - parser.hooks.expression - .for("require.main.require") - .tap( - "CommonJsStuffPlugin", - ParserHelpers.expressionIsUnsupported( - parser, - "require.main.require is not supported by webpack." - ) - ); - parser.hooks.expression - .for("module.parent.require") - .tap( - "CommonJsStuffPlugin", - ParserHelpers.expressionIsUnsupported( - parser, - "module.parent.require is not supported by webpack." - ) - ); - parser.hooks.expression - .for("require.main") - .tap( - "CommonJsStuffPlugin", - ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - "__webpack_require__.c[__webpack_require__.s]" - ) - ); - parser.hooks.expression - .for("module.loaded") - .tap("CommonJsStuffPlugin", expr => { - parser.state.module.buildMeta.moduleConcatenationBailout = - "module.loaded"; - return ParserHelpers.toConstantDependency( - parser, - "module.l" - )(expr); - }); - parser.hooks.expression - .for("module.id") - .tap("CommonJsStuffPlugin", expr => { - parser.state.module.buildMeta.moduleConcatenationBailout = - "module.id"; - return ParserHelpers.toConstantDependency( - parser, - "module.i" - )(expr); - }); - parser.hooks.expression - .for("module.exports") - .tap("CommonJsStuffPlugin", () => { - const module = parser.state.module; - const isHarmony = - module.buildMeta && module.buildMeta.exportsType; - if (!isHarmony) return true; - }); - parser.hooks.evaluateIdentifier - .for("module.hot") - .tap( - "CommonJsStuffPlugin", - ParserHelpers.evaluateToIdentifier("module.hot", false) - ); - parser.hooks.expression - .for("module") - .tap("CommonJsStuffPlugin", () => { - const module = parser.state.module; - const isHarmony = - module.buildMeta && module.buildMeta.exportsType; - let moduleJsPath = isHarmony ? __webpack_require__.ab + "harmony-module.js" : __webpack_require__.ab + "module.js"; - if (module.context) { - moduleJsPath = path.relative( - parser.state.module.context, - moduleJsPath - ); - if (!/^[A-Z]:/i.test(moduleJsPath)) { - moduleJsPath = `./${moduleJsPath.replace(/\\/g, "/")}`; - } - } - return ParserHelpers.addParsedVariableToModule( - parser, - "module", - `require(${JSON.stringify(moduleJsPath)})(module)` - ); - }); - }; + _createIdentifier() { + let identifier = this.context; + if (this.options.resourceQuery) { + identifier += ` ${this.options.resourceQuery}`; + } + if (this.options.mode) { + identifier += ` ${this.options.mode}`; + } + if (!this.options.recursive) { + identifier += " nonrecursive"; + } + if (this.options.addon) { + identifier += ` ${this.options.addon}`; + } + if (this.options.regExp) { + identifier += ` ${this.options.regExp}`; + } + if (this.options.include) { + identifier += ` include: ${this.options.include}`; + } + if (this.options.exclude) { + identifier += ` exclude: ${this.options.exclude}`; + } + if (this.options.groupOptions) { + identifier += ` groupOptions: ${JSON.stringify( + this.options.groupOptions + )}`; + } + if (this.options.namespaceObject === "strict") { + identifier += " strict namespace object"; + } else if (this.options.namespaceObject) { + identifier += " namespace object"; + } - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("CommonJsStuffPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("CommonJsStuffPlugin", handler); - } - ); + return identifier; } -} -module.exports = CommonJsStuffPlugin; + identifier() { + return this._identifier; + } -/***/ }), + readableIdentifier(requestShortener) { + let identifier = requestShortener.shorten(this.context); + if (this.options.resourceQuery) { + identifier += ` ${this.options.resourceQuery}`; + } + if (this.options.mode) { + identifier += ` ${this.options.mode}`; + } + if (!this.options.recursive) { + identifier += " nonrecursive"; + } + if (this.options.addon) { + identifier += ` ${requestShortener.shorten(this.options.addon)}`; + } + if (this.options.regExp) { + identifier += ` ${this.prettyRegExp(this.options.regExp + "")}`; + } + if (this.options.include) { + identifier += ` include: ${this.prettyRegExp(this.options.include + "")}`; + } + if (this.options.exclude) { + identifier += ` exclude: ${this.prettyRegExp(this.options.exclude + "")}`; + } + if (this.options.groupOptions) { + const groupOptions = this.options.groupOptions; + for (const key of Object.keys(groupOptions)) { + identifier += ` ${key}: ${groupOptions[key]}`; + } + } + if (this.options.namespaceObject === "strict") { + identifier += " strict namespace object"; + } else if (this.options.namespaceObject) { + identifier += " namespace object"; + } -/***/ 85918: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + return identifier; + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + libIdent(options) { + let identifier = contextify(options.context, this.context); + if (this.options.mode) { + identifier += ` ${this.options.mode}`; + } + if (this.options.recursive) { + identifier += " recursive"; + } + if (this.options.addon) { + identifier += ` ${contextify(options.context, this.options.addon)}`; + } + if (this.options.regExp) { + identifier += ` ${this.prettyRegExp(this.options.regExp + "")}`; + } + if (this.options.include) { + identifier += ` include: ${this.prettyRegExp(this.options.include + "")}`; + } + if (this.options.exclude) { + identifier += ` exclude: ${this.prettyRegExp(this.options.exclude + "")}`; + } + return identifier; + } -const ConstDependency = __webpack_require__(71101); + needRebuild(fileTimestamps, contextTimestamps) { + const ts = contextTimestamps.get(this.context); + if (!ts) { + return true; + } -const NullFactory = __webpack_require__(40438); + return ts >= this.buildInfo.builtTime; + } -/** @typedef {import("./Compiler")} Compiler */ + build(options, compilation, resolver, fs, callback) { + this.built = true; + this.buildMeta = {}; + this.buildInfo = { + builtTime: Date.now(), + contextDependencies: this._contextDependencies + }; + this.resolveDependencies(fs, this.options, (err, dependencies) => { + if (err) return callback(err); -class CompatibilityPlugin { - /** - * Apply the plugin - * @param {Compiler} compiler Webpack Compiler - * @returns {void} - */ - apply(compiler) { - compiler.hooks.compilation.tap( - "CompatibilityPlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set(ConstDependency, new NullFactory()); - compilation.dependencyTemplates.set( - ConstDependency, - new ConstDependency.Template() - ); + // abort if something failed + // this will create an empty context + if (!dependencies) { + callback(); + return; + } - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("CompatibilityPlugin", (parser, parserOptions) => { - if ( - parserOptions.browserify !== undefined && - !parserOptions.browserify - ) - return; + // enhance dependencies with meta info + for (const dep of dependencies) { + dep.loc = { + name: dep.userRequest + }; + dep.request = this.options.addon + dep.request; + } - parser.hooks.call - .for("require") - .tap("CompatibilityPlugin", expr => { - // support for browserify style require delegator: "require(o, !0)" - if (expr.arguments.length !== 2) return; - const second = parser.evaluateExpression(expr.arguments[1]); - if (!second.isBoolean()) return; - if (second.asBool() !== true) return; - const dep = new ConstDependency("require", expr.callee.range); - dep.loc = expr.loc; - if (parser.state.current.dependencies.length > 1) { - const last = - parser.state.current.dependencies[ - parser.state.current.dependencies.length - 1 - ]; - if ( - last.critical && - last.options && - last.options.request === "." && - last.userRequest === "." && - last.options.recursive - ) - parser.state.current.dependencies.pop(); - } - parser.state.current.addDependency(dep); - return true; - }); - }); + if (this.options.mode === "sync" || this.options.mode === "eager") { + // if we have an sync or eager context + // just add all dependencies and continue + this.dependencies = dependencies; + } else if (this.options.mode === "lazy-once") { + // for the lazy-once mode create a new async dependency block + // and add that block to this context + if (dependencies.length > 0) { + const block = new AsyncDependenciesBlock( + Object.assign({}, this.options.groupOptions, { + name: this.options.chunkName + }), + this + ); + for (const dep of dependencies) { + block.addDependency(dep); + } + this.addBlock(block); + } + } else if ( + this.options.mode === "weak" || + this.options.mode === "async-weak" + ) { + // we mark all dependencies as weak + for (const dep of dependencies) { + dep.weak = true; + } + this.dependencies = dependencies; + } else if (this.options.mode === "lazy") { + // if we are lazy create a new async dependency block per dependency + // and add all blocks to this context + let index = 0; + for (const dep of dependencies) { + let chunkName = this.options.chunkName; + if (chunkName) { + if (!/\[(index|request)\]/.test(chunkName)) { + chunkName += "[index]"; + } + chunkName = chunkName.replace(/\[index\]/g, index++); + chunkName = chunkName.replace( + /\[request\]/g, + Template.toPath(dep.userRequest) + ); + } + const block = new AsyncDependenciesBlock( + Object.assign({}, this.options.groupOptions, { + name: chunkName + }), + dep.module, + dep.loc, + dep.userRequest + ); + block.addDependency(dep); + this.addBlock(block); + } + } else { + callback( + new Error(`Unsupported mode "${this.options.mode}" in context`) + ); + return; } - ); + callback(); + }); } -} -module.exports = CompatibilityPlugin; + getUserRequestMap(dependencies) { + // if we filter first we get a new array + // therefor we dont need to create a clone of dependencies explicitly + // therefore the order of this is !important! + return dependencies + .filter(dependency => dependency.module) + .sort((a, b) => { + if (a.userRequest === b.userRequest) { + return 0; + } + return a.userRequest < b.userRequest ? -1 : 1; + }) + .reduce((map, dep) => { + map[dep.userRequest] = dep.module.id; + return map; + }, Object.create(null)); + } -/***/ }), + getFakeMap(dependencies) { + if (!this.options.namespaceObject) { + return 9; + } + // if we filter first we get a new array + // therefor we dont need to create a clone of dependencies explicitly + // therefore the order of this is !important! + let hasNonHarmony = false; + let hasNamespace = false; + let hasNamed = false; + const fakeMap = dependencies + .filter(dependency => dependency.module) + .sort((a, b) => { + return b.module.id - a.module.id; + }) + .reduce((map, dep) => { + const exportsType = + dep.module.buildMeta && dep.module.buildMeta.exportsType; + const id = dep.module.id; + if (!exportsType) { + map[id] = this.options.namespaceObject === "strict" ? 1 : 7; + hasNonHarmony = true; + } else if (exportsType === "namespace") { + map[id] = 9; + hasNamespace = true; + } else if (exportsType === "named") { + map[id] = 3; + hasNamed = true; + } + return map; + }, Object.create(null)); + if (!hasNamespace && hasNonHarmony && !hasNamed) { + return this.options.namespaceObject === "strict" ? 1 : 7; + } + if (hasNamespace && !hasNonHarmony && !hasNamed) { + return 9; + } + if (!hasNamespace && !hasNonHarmony && hasNamed) { + return 3; + } + if (!hasNamespace && !hasNonHarmony && !hasNamed) { + return 9; + } + return fakeMap; + } -/***/ 34968: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + getFakeMapInitStatement(fakeMap) { + return typeof fakeMap === "object" + ? `var fakeMap = ${JSON.stringify(fakeMap, null, "\t")};` + : ""; + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ + getReturn(type) { + if (type === 9) { + return "__webpack_require__(id)"; + } + return `__webpack_require__.t(id, ${type})`; + } + getReturnModuleObjectSource(fakeMap, fakeMapDataExpression = "fakeMap[id]") { + if (typeof fakeMap === "number") { + return `return ${this.getReturn(fakeMap)};`; + } + return `return __webpack_require__.t(id, ${fakeMapDataExpression})`; + } -const asyncLib = __webpack_require__(36386); -const util = __webpack_require__(31669); -const { CachedSource } = __webpack_require__(53665); -const { - Tapable, - SyncHook, - SyncBailHook, - SyncWaterfallHook, - AsyncSeriesHook -} = __webpack_require__(92402); -const EntryModuleNotFoundError = __webpack_require__(99531); -const ModuleNotFoundError = __webpack_require__(71638); -const ModuleDependencyWarning = __webpack_require__(59136); -const ModuleDependencyError = __webpack_require__(14953); -const ChunkGroup = __webpack_require__(52911); -const Chunk = __webpack_require__(2919); -const Entrypoint = __webpack_require__(71931); -const MainTemplate = __webpack_require__(43626); -const ChunkTemplate = __webpack_require__(6170); -const HotUpdateChunkTemplate = __webpack_require__(66062); -const ModuleTemplate = __webpack_require__(75100); -const RuntimeTemplate = __webpack_require__(44006); -const ChunkRenderError = __webpack_require__(69865); -const Stats = __webpack_require__(99977); -const Semaphore = __webpack_require__(33349); -const createHash = __webpack_require__(15660); -const SortableSet = __webpack_require__(50071); -const GraphHelpers = __webpack_require__(32973); -const ModuleDependency = __webpack_require__(90865); -const compareLocations = __webpack_require__(22562); -const { Logger, LogType } = __webpack_require__(47194); -const ErrorHelpers = __webpack_require__(80140); -const buildChunkGraph = __webpack_require__(52337); -const WebpackError = __webpack_require__(97391); + getSyncSource(dependencies, id) { + const map = this.getUserRequestMap(dependencies); + const fakeMap = this.getFakeMap(dependencies); + const returnModuleObject = this.getReturnModuleObjectSource(fakeMap); -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./Compiler")} Compiler */ -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("./DependenciesBlockVariable")} DependenciesBlockVariable */ -/** @typedef {import("./dependencies/SingleEntryDependency")} SingleEntryDependency */ -/** @typedef {import("./dependencies/MultiEntryDependency")} MultiEntryDependency */ -/** @typedef {import("./dependencies/DllEntryDependency")} DllEntryDependency */ -/** @typedef {import("./dependencies/DependencyReference")} DependencyReference */ -/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ -/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ -/** @typedef {import("./Dependency")} Dependency */ -/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ -/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate */ -/** @typedef {import("./util/createHash").Hash} Hash */ + return `var map = ${JSON.stringify(map, null, "\t")}; +${this.getFakeMapInitStatement(fakeMap)} -// TODO use @callback -/** @typedef {{[assetName: string]: Source}} CompilationAssets */ -/** @typedef {(err: Error|null, result?: Module) => void } ModuleCallback */ -/** @typedef {(err?: Error|null, result?: Module) => void } ModuleChainCallback */ -/** @typedef {(module: Module) => void} OnModuleCallback */ -/** @typedef {(err?: Error|null) => void} Callback */ -/** @typedef {(d: Dependency) => any} DepBlockVarDependenciesCallback */ -/** @typedef {new (...args: any[]) => Dependency} DepConstructor */ -/** @typedef {{apply: () => void}} Plugin */ +function webpackContext(req) { + var id = webpackContextResolve(req); + ${returnModuleObject} +} +function webpackContextResolve(req) { + if(!__webpack_require__.o(map, req)) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } + return map[req]; +} +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = ${JSON.stringify(id)};`; + } -/** - * @typedef {Object} ModuleFactoryCreateDataContextInfo - * @property {string} issuer - * @property {string} compiler - */ - -/** - * @typedef {Object} ModuleFactoryCreateData - * @property {ModuleFactoryCreateDataContextInfo} contextInfo - * @property {any=} resolveOptions - * @property {string} context - * @property {Dependency[]} dependencies - */ - -/** - * @typedef {Object} ModuleFactory - * @property {(data: ModuleFactoryCreateData, callback: ModuleCallback) => any} create - */ - -/** - * @typedef {Object} SortedDependency - * @property {ModuleFactory} factory - * @property {Dependency[]} dependencies - */ - -/** - * @typedef {Object} DependenciesBlockLike - * @property {Dependency[]} dependencies - * @property {AsyncDependenciesBlock[]} blocks - * @property {DependenciesBlockVariable[]} variables - */ - -/** - * @typedef {Object} LogEntry - * @property {string} type - * @property {any[]} args - * @property {number} time - * @property {string[]=} trace - */ - -/** - * @typedef {Object} AssetInfo - * @property {boolean=} immutable true, if the asset can be long term cached forever (contains a hash) - * @property {number=} size size in bytes, only set after asset has been emitted - * @property {boolean=} development true, when asset is only used for development and doesn't count towards user-facing assets - * @property {boolean=} hotModuleReplacement true, when asset ships data for updating an existing application (HMR) - */ + getWeakSyncSource(dependencies, id) { + const map = this.getUserRequestMap(dependencies); + const fakeMap = this.getFakeMap(dependencies); + const returnModuleObject = this.getReturnModuleObjectSource(fakeMap); -/** - * @typedef {Object} Asset - * @property {string} name the filename of the asset - * @property {Source} source source of the asset - * @property {AssetInfo} info info about the asset - */ + return `var map = ${JSON.stringify(map, null, "\t")}; +${this.getFakeMapInitStatement(fakeMap)} -/** - * @param {Chunk} a first chunk to sort by id - * @param {Chunk} b second chunk to sort by id - * @returns {-1|0|1} sort value - */ -const byId = (a, b) => { - if (typeof a.id !== typeof b.id) { - return typeof a.id < typeof b.id ? -1 : 1; +function webpackContext(req) { + var id = webpackContextResolve(req); + if(!__webpack_require__.m[id]) { + var e = new Error("Module '" + req + "' ('" + id + "') is not available (weak dependency)"); + e.code = 'MODULE_NOT_FOUND'; + throw e; } - if (a.id < b.id) return -1; - if (a.id > b.id) return 1; - return 0; -}; - -/** - * @param {Module} a first module to sort by - * @param {Module} b second module to sort by - * @returns {-1|0|1} sort value - */ -const byIdOrIdentifier = (a, b) => { - if (typeof a.id !== typeof b.id) { - return typeof a.id < typeof b.id ? -1 : 1; + ${returnModuleObject} +} +function webpackContextResolve(req) { + if(!__webpack_require__.o(map, req)) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; } - if (a.id < b.id) return -1; - if (a.id > b.id) return 1; - const identA = a.identifier(); - const identB = b.identifier(); - if (identA < identB) return -1; - if (identA > identB) return 1; - return 0; + return map[req]; +} +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); }; +webpackContext.resolve = webpackContextResolve; +webpackContext.id = ${JSON.stringify(id)}; +module.exports = webpackContext;`; + } -/** - * @param {Module} a first module to sort by - * @param {Module} b second module to sort by - * @returns {-1|0|1} sort value - */ -const byIndexOrIdentifier = (a, b) => { - if (a.index < b.index) return -1; - if (a.index > b.index) return 1; - const identA = a.identifier(); - const identB = b.identifier(); - if (identA < identB) return -1; - if (identA > identB) return 1; - return 0; -}; + getAsyncWeakSource(dependencies, id) { + const map = this.getUserRequestMap(dependencies); + const fakeMap = this.getFakeMap(dependencies); + const returnModuleObject = this.getReturnModuleObjectSource(fakeMap); -/** - * @param {Compilation} a first compilation to sort by - * @param {Compilation} b second compilation to sort by - * @returns {-1|0|1} sort value - */ -const byNameOrHash = (a, b) => { - if (a.name < b.name) return -1; - if (a.name > b.name) return 1; - if (a.fullHash < b.fullHash) return -1; - if (a.fullHash > b.fullHash) return 1; - return 0; -}; + return `var map = ${JSON.stringify(map, null, "\t")}; +${this.getFakeMapInitStatement(fakeMap)} -/** - * @param {DependenciesBlockVariable[]} variables DepBlock Variables to iterate over - * @param {DepBlockVarDependenciesCallback} fn callback to apply on iterated elements - * @returns {void} - */ -const iterationBlockVariable = (variables, fn) => { - for ( - let indexVariable = 0; - indexVariable < variables.length; - indexVariable++ - ) { - const varDep = variables[indexVariable].dependencies; - for (let indexVDep = 0; indexVDep < varDep.length; indexVDep++) { - fn(varDep[indexVDep]); +function webpackAsyncContext(req) { + return webpackAsyncContextResolve(req).then(function(id) { + if(!__webpack_require__.m[id]) { + var e = new Error("Module '" + req + "' ('" + id + "') is not available (weak dependency)"); + e.code = 'MODULE_NOT_FOUND'; + throw e; } - } + ${returnModuleObject} + }); +} +function webpackAsyncContextResolve(req) { + // Here Promise.resolve().then() is used instead of new Promise() to prevent + // uncaught exception popping up in devtools + return Promise.resolve().then(function() { + if(!__webpack_require__.o(map, req)) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } + return map[req]; + }); +} +webpackAsyncContext.keys = function webpackAsyncContextKeys() { + return Object.keys(map); }; - -/** - * @template T - * @param {T[]} arr array of elements to iterate over - * @param {function(T): void} fn callback applied to each element - * @returns {void} - */ -const iterationOfArrayCallback = (arr, fn) => { - for (let index = 0; index < arr.length; index++) { - fn(arr[index]); +webpackAsyncContext.resolve = webpackAsyncContextResolve; +webpackAsyncContext.id = ${JSON.stringify(id)}; +module.exports = webpackAsyncContext;`; } -}; -/** - * @template T - * @param {Set} set set to add items to - * @param {Set} otherSet set to add items from - * @returns {void} - */ -const addAllToSet = (set, otherSet) => { - for (const item of otherSet) { - set.add(item); - } -}; + getEagerSource(dependencies, id) { + const map = this.getUserRequestMap(dependencies); + const fakeMap = this.getFakeMap(dependencies); + const thenFunction = + fakeMap !== 9 + ? `function(id) { + ${this.getReturnModuleObjectSource(fakeMap)} + }` + : "__webpack_require__"; + return `var map = ${JSON.stringify(map, null, "\t")}; +${this.getFakeMapInitStatement(fakeMap)} -/** - * @param {Source} a a source - * @param {Source} b another source - * @returns {boolean} true, when both sources are equal - */ -const isSourceEqual = (a, b) => { - if (a === b) return true; - // TODO webpack 5: check .buffer() instead, it's called anyway during emit - /** @type {Buffer|string} */ - let aSource = a.source(); - /** @type {Buffer|string} */ - let bSource = b.source(); - if (aSource === bSource) return true; - if (typeof aSource === "string" && typeof bSource === "string") return false; - if (!Buffer.isBuffer(aSource)) aSource = Buffer.from(aSource, "utf-8"); - if (!Buffer.isBuffer(bSource)) bSource = Buffer.from(bSource, "utf-8"); - return aSource.equals(bSource); +function webpackAsyncContext(req) { + return webpackAsyncContextResolve(req).then(${thenFunction}); +} +function webpackAsyncContextResolve(req) { + // Here Promise.resolve().then() is used instead of new Promise() to prevent + // uncaught exception popping up in devtools + return Promise.resolve().then(function() { + if(!__webpack_require__.o(map, req)) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } + return map[req]; + }); +} +webpackAsyncContext.keys = function webpackAsyncContextKeys() { + return Object.keys(map); }; +webpackAsyncContext.resolve = webpackAsyncContextResolve; +webpackAsyncContext.id = ${JSON.stringify(id)}; +module.exports = webpackAsyncContext;`; + } -class Compilation extends Tapable { - /** - * Creates an instance of Compilation. - * @param {Compiler} compiler the compiler which created the compilation - */ - constructor(compiler) { - super(); - this.hooks = { - /** @type {SyncHook} */ - buildModule: new SyncHook(["module"]), - /** @type {SyncHook} */ - rebuildModule: new SyncHook(["module"]), - /** @type {SyncHook} */ - failedModule: new SyncHook(["module", "error"]), - /** @type {SyncHook} */ - succeedModule: new SyncHook(["module"]), + getLazyOnceSource(block, dependencies, id, runtimeTemplate) { + const promise = runtimeTemplate.blockPromise({ + block, + message: "lazy-once context" + }); + const map = this.getUserRequestMap(dependencies); + const fakeMap = this.getFakeMap(dependencies); + const thenFunction = + fakeMap !== 9 + ? `function(id) { + ${this.getReturnModuleObjectSource(fakeMap)}; + }` + : "__webpack_require__"; - /** @type {SyncHook} */ - addEntry: new SyncHook(["entry", "name"]), - /** @type {SyncHook} */ - failedEntry: new SyncHook(["entry", "name", "error"]), - /** @type {SyncHook} */ - succeedEntry: new SyncHook(["entry", "name", "module"]), + return `var map = ${JSON.stringify(map, null, "\t")}; +${this.getFakeMapInitStatement(fakeMap)} - /** @type {SyncWaterfallHook} */ - dependencyReference: new SyncWaterfallHook([ - "dependencyReference", - "dependency", - "module" - ]), +function webpackAsyncContext(req) { + return webpackAsyncContextResolve(req).then(${thenFunction}); +} +function webpackAsyncContextResolve(req) { + return ${promise}.then(function() { + if(!__webpack_require__.o(map, req)) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } + return map[req]; + }); +} +webpackAsyncContext.keys = function webpackAsyncContextKeys() { + return Object.keys(map); +}; +webpackAsyncContext.resolve = webpackAsyncContextResolve; +webpackAsyncContext.id = ${JSON.stringify(id)}; +module.exports = webpackAsyncContext;`; + } - /** @type {AsyncSeriesHook} */ - finishModules: new AsyncSeriesHook(["modules"]), - /** @type {SyncHook} */ - finishRebuildingModule: new SyncHook(["module"]), - /** @type {SyncHook} */ - unseal: new SyncHook([]), - /** @type {SyncHook} */ - seal: new SyncHook([]), + getLazySource(blocks, id) { + let hasMultipleOrNoChunks = false; + let hasNoChunk = true; + const fakeMap = this.getFakeMap(blocks.map(b => b.dependencies[0])); + const hasFakeMap = typeof fakeMap === "object"; + const map = blocks + .filter(block => block.dependencies[0].module) + .map(block => { + const chunks = block.chunkGroup ? block.chunkGroup.chunks : []; + if (chunks.length > 0) { + hasNoChunk = false; + } + if (chunks.length !== 1) { + hasMultipleOrNoChunks = true; + } + return { + dependency: block.dependencies[0], + block: block, + userRequest: block.dependencies[0].userRequest, + chunks + }; + }) + .sort((a, b) => { + if (a.userRequest === b.userRequest) return 0; + return a.userRequest < b.userRequest ? -1 : 1; + }) + .reduce((map, item) => { + const chunks = item.chunks; - /** @type {SyncHook} */ - beforeChunks: new SyncHook([]), - /** @type {SyncHook} */ - afterChunks: new SyncHook(["chunks"]), + if (hasNoChunk && !hasFakeMap) { + map[item.userRequest] = item.dependency.module.id; + } else { + const arrayStart = [item.dependency.module.id]; + if (typeof fakeMap === "object") { + arrayStart.push(fakeMap[item.dependency.module.id]); + } + map[item.userRequest] = arrayStart.concat( + chunks.map(chunk => chunk.id) + ); + } - /** @type {SyncBailHook} */ - optimizeDependenciesBasic: new SyncBailHook(["modules"]), - /** @type {SyncBailHook} */ - optimizeDependencies: new SyncBailHook(["modules"]), - /** @type {SyncBailHook} */ - optimizeDependenciesAdvanced: new SyncBailHook(["modules"]), - /** @type {SyncBailHook} */ - afterOptimizeDependencies: new SyncHook(["modules"]), + return map; + }, Object.create(null)); - /** @type {SyncHook} */ - optimize: new SyncHook([]), - /** @type {SyncBailHook} */ - optimizeModulesBasic: new SyncBailHook(["modules"]), - /** @type {SyncBailHook} */ - optimizeModules: new SyncBailHook(["modules"]), - /** @type {SyncBailHook} */ - optimizeModulesAdvanced: new SyncBailHook(["modules"]), - /** @type {SyncHook} */ - afterOptimizeModules: new SyncHook(["modules"]), + const shortMode = hasNoChunk && !hasFakeMap; + const chunksStartPosition = hasFakeMap ? 2 : 1; + const requestPrefix = hasNoChunk + ? "Promise.resolve()" + : hasMultipleOrNoChunks + ? `Promise.all(ids.slice(${chunksStartPosition}).map(__webpack_require__.e))` + : `__webpack_require__.e(ids[${chunksStartPosition}])`; + const returnModuleObject = this.getReturnModuleObjectSource( + fakeMap, + shortMode ? "invalid" : "ids[1]" + ); - /** @type {SyncBailHook} */ - optimizeChunksBasic: new SyncBailHook(["chunks", "chunkGroups"]), - /** @type {SyncBailHook} */ - optimizeChunks: new SyncBailHook(["chunks", "chunkGroups"]), - /** @type {SyncBailHook} */ - optimizeChunksAdvanced: new SyncBailHook(["chunks", "chunkGroups"]), - /** @type {SyncHook} */ - afterOptimizeChunks: new SyncHook(["chunks", "chunkGroups"]), + const webpackAsyncContext = + requestPrefix === "Promise.resolve()" + ? `${shortMode ? "" : ""} +function webpackAsyncContext(req) { + return Promise.resolve().then(function() { + if(!__webpack_require__.o(map, req)) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } - /** @type {AsyncSeriesHook} */ - optimizeTree: new AsyncSeriesHook(["chunks", "modules"]), - /** @type {SyncHook} */ - afterOptimizeTree: new SyncHook(["chunks", "modules"]), + ${shortMode ? "var id = map[req];" : "var ids = map[req], id = ids[0];"} + ${returnModuleObject} + }); +}` + : `function webpackAsyncContext(req) { + if(!__webpack_require__.o(map, req)) { + return Promise.resolve().then(function() { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + }); + } - /** @type {SyncBailHook} */ - optimizeChunkModulesBasic: new SyncBailHook(["chunks", "modules"]), - /** @type {SyncBailHook} */ - optimizeChunkModules: new SyncBailHook(["chunks", "modules"]), - /** @type {SyncBailHook} */ - optimizeChunkModulesAdvanced: new SyncBailHook(["chunks", "modules"]), - /** @type {SyncHook} */ - afterOptimizeChunkModules: new SyncHook(["chunks", "modules"]), - /** @type {SyncBailHook} */ - shouldRecord: new SyncBailHook([]), + var ids = map[req], id = ids[0]; + return ${requestPrefix}.then(function() { + ${returnModuleObject} + }); +}`; - /** @type {SyncHook} */ - reviveModules: new SyncHook(["modules", "records"]), - /** @type {SyncHook} */ - optimizeModuleOrder: new SyncHook(["modules"]), - /** @type {SyncHook} */ - advancedOptimizeModuleOrder: new SyncHook(["modules"]), - /** @type {SyncHook} */ - beforeModuleIds: new SyncHook(["modules"]), - /** @type {SyncHook} */ - moduleIds: new SyncHook(["modules"]), - /** @type {SyncHook} */ - optimizeModuleIds: new SyncHook(["modules"]), - /** @type {SyncHook} */ - afterOptimizeModuleIds: new SyncHook(["modules"]), + return `var map = ${JSON.stringify(map, null, "\t")}; +${webpackAsyncContext} +webpackAsyncContext.keys = function webpackAsyncContextKeys() { + return Object.keys(map); +}; +webpackAsyncContext.id = ${JSON.stringify(id)}; +module.exports = webpackAsyncContext;`; + } - /** @type {SyncHook} */ - reviveChunks: new SyncHook(["chunks", "records"]), - /** @type {SyncHook} */ - optimizeChunkOrder: new SyncHook(["chunks"]), - /** @type {SyncHook} */ - beforeChunkIds: new SyncHook(["chunks"]), - /** @type {SyncHook} */ - optimizeChunkIds: new SyncHook(["chunks"]), - /** @type {SyncHook} */ - afterOptimizeChunkIds: new SyncHook(["chunks"]), + getSourceForEmptyContext(id) { + return `function webpackEmptyContext(req) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; +} +webpackEmptyContext.keys = function() { return []; }; +webpackEmptyContext.resolve = webpackEmptyContext; +module.exports = webpackEmptyContext; +webpackEmptyContext.id = ${JSON.stringify(id)};`; + } - /** @type {SyncHook} */ - recordModules: new SyncHook(["modules", "records"]), - /** @type {SyncHook} */ - recordChunks: new SyncHook(["chunks", "records"]), + getSourceForEmptyAsyncContext(id) { + return `function webpackEmptyAsyncContext(req) { + // Here Promise.resolve().then() is used instead of new Promise() to prevent + // uncaught exception popping up in devtools + return Promise.resolve().then(function() { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + }); +} +webpackEmptyAsyncContext.keys = function() { return []; }; +webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext; +module.exports = webpackEmptyAsyncContext; +webpackEmptyAsyncContext.id = ${JSON.stringify(id)};`; + } - /** @type {SyncHook} */ - beforeHash: new SyncHook([]), - /** @type {SyncHook} */ - contentHash: new SyncHook(["chunk"]), - /** @type {SyncHook} */ - afterHash: new SyncHook([]), - /** @type {SyncHook} */ - recordHash: new SyncHook(["records"]), - /** @type {SyncHook} */ - record: new SyncHook(["compilation", "records"]), + getSourceString(asyncMode, runtimeTemplate) { + if (asyncMode === "lazy") { + if (this.blocks && this.blocks.length > 0) { + return this.getLazySource(this.blocks, this.id); + } + return this.getSourceForEmptyAsyncContext(this.id); + } + if (asyncMode === "eager") { + if (this.dependencies && this.dependencies.length > 0) { + return this.getEagerSource(this.dependencies, this.id); + } + return this.getSourceForEmptyAsyncContext(this.id); + } + if (asyncMode === "lazy-once") { + const block = this.blocks[0]; + if (block) { + return this.getLazyOnceSource( + block, + block.dependencies, + this.id, + runtimeTemplate + ); + } + return this.getSourceForEmptyAsyncContext(this.id); + } + if (asyncMode === "async-weak") { + if (this.dependencies && this.dependencies.length > 0) { + return this.getAsyncWeakSource(this.dependencies, this.id); + } + return this.getSourceForEmptyAsyncContext(this.id); + } + if (asyncMode === "weak") { + if (this.dependencies && this.dependencies.length > 0) { + return this.getWeakSyncSource(this.dependencies, this.id); + } + } + if (this.dependencies && this.dependencies.length > 0) { + return this.getSyncSource(this.dependencies, this.id); + } + return this.getSourceForEmptyContext(this.id); + } - /** @type {SyncHook} */ - beforeModuleAssets: new SyncHook([]), - /** @type {SyncBailHook} */ - shouldGenerateChunkAssets: new SyncBailHook([]), - /** @type {SyncHook} */ - beforeChunkAssets: new SyncHook([]), - /** @type {SyncHook} */ - additionalChunkAssets: new SyncHook(["chunks"]), + getSource(sourceString) { + if (this.useSourceMap) { + return new OriginalSource(sourceString, this.identifier()); + } + return new RawSource(sourceString); + } - /** @type {AsyncSeriesHook} */ - additionalAssets: new AsyncSeriesHook([]), - /** @type {AsyncSeriesHook} */ - optimizeChunkAssets: new AsyncSeriesHook(["chunks"]), - /** @type {SyncHook} */ - afterOptimizeChunkAssets: new SyncHook(["chunks"]), - /** @type {AsyncSeriesHook} */ - optimizeAssets: new AsyncSeriesHook(["assets"]), - /** @type {SyncHook} */ - afterOptimizeAssets: new SyncHook(["assets"]), + source(dependencyTemplates, runtimeTemplate) { + return this.getSource( + this.getSourceString(this.options.mode, runtimeTemplate) + ); + } - /** @type {SyncBailHook} */ - needAdditionalSeal: new SyncBailHook([]), - /** @type {AsyncSeriesHook} */ - afterSeal: new AsyncSeriesHook([]), + size() { + // base penalty + const initialSize = 160; - /** @type {SyncHook} */ - chunkHash: new SyncHook(["chunk", "chunkHash"]), - /** @type {SyncHook} */ - moduleAsset: new SyncHook(["module", "filename"]), - /** @type {SyncHook} */ - chunkAsset: new SyncHook(["chunk", "filename"]), + // if we dont have dependencies we stop here. + return this.dependencies.reduce((size, dependency) => { + const element = /** @type {ContextElementDependency} */ (dependency); + return size + 5 + element.userRequest.length; + }, initialSize); + } +} - /** @type {SyncWaterfallHook} */ - assetPath: new SyncWaterfallHook(["filename", "data"]), // TODO MainTemplate +// TODO remove in webpack 5 +Object.defineProperty(ContextModule.prototype, "recursive", { + configurable: false, + get: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @returns {boolean} is recursive + */ + function() { + return this.options.recursive; + }, + "ContextModule.recursive has been moved to ContextModule.options.recursive" + ), + set: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @param {boolean} value is recursive + * @returns {void} + */ + function(value) { + this.options.recursive = value; + }, + "ContextModule.recursive has been moved to ContextModule.options.recursive" + ) +}); - /** @type {SyncBailHook} */ - needAdditionalPass: new SyncBailHook([]), +// TODO remove in webpack 5 +Object.defineProperty(ContextModule.prototype, "regExp", { + configurable: false, + get: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @returns {RegExp} regular expression + */ + function() { + return this.options.regExp; + }, + "ContextModule.regExp has been moved to ContextModule.options.regExp" + ), + set: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @param {RegExp} value Regular expression + * @returns {void} + */ + function(value) { + this.options.regExp = value; + }, + "ContextModule.regExp has been moved to ContextModule.options.regExp" + ) +}); - /** @type {SyncHook} */ - childCompiler: new SyncHook([ - "childCompiler", - "compilerName", - "compilerIndex" - ]), +// TODO remove in webpack 5 +Object.defineProperty(ContextModule.prototype, "addon", { + configurable: false, + get: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @returns {string} addon + */ + function() { + return this.options.addon; + }, + "ContextModule.addon has been moved to ContextModule.options.addon" + ), + set: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @param {string} value addon + * @returns {void} + */ + function(value) { + this.options.addon = value; + }, + "ContextModule.addon has been moved to ContextModule.options.addon" + ) +}); - /** @type {SyncBailHook} */ - log: new SyncBailHook(["origin", "logEntry"]), +// TODO remove in webpack 5 +Object.defineProperty(ContextModule.prototype, "async", { + configurable: false, + get: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @returns {boolean} is async + */ + function() { + return this.options.mode; + }, + "ContextModule.async has been moved to ContextModule.options.mode" + ), + set: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @param {ContextMode} value Context mode + * @returns {void} + */ + function(value) { + this.options.mode = value; + }, + "ContextModule.async has been moved to ContextModule.options.mode" + ) +}); - // TODO the following hooks are weirdly located here - // TODO move them for webpack 5 - /** @type {SyncHook} */ - normalModuleLoader: new SyncHook(["loaderContext", "module"]), +// TODO remove in webpack 5 +Object.defineProperty(ContextModule.prototype, "chunkName", { + configurable: false, + get: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @returns {string} chunk name + */ + function() { + return this.options.chunkName; + }, + "ContextModule.chunkName has been moved to ContextModule.options.chunkName" + ), + set: util.deprecate( + /** + * @deprecated + * @this {ContextModule} + * @param {string} value chunk name + * @returns {void} + */ + function(value) { + this.options.chunkName = value; + }, + "ContextModule.chunkName has been moved to ContextModule.options.chunkName" + ) +}); - /** @type {SyncBailHook} */ - optimizeExtractedChunksBasic: new SyncBailHook(["chunks"]), - /** @type {SyncBailHook} */ - optimizeExtractedChunks: new SyncBailHook(["chunks"]), - /** @type {SyncBailHook} */ - optimizeExtractedChunksAdvanced: new SyncBailHook(["chunks"]), - /** @type {SyncHook} */ - afterOptimizeExtractedChunks: new SyncHook(["chunks"]) - }; - this._pluginCompat.tap("Compilation", options => { - switch (options.name) { - case "optimize-tree": - case "additional-assets": - case "optimize-chunk-assets": - case "optimize-assets": - case "after-seal": - options.async = true; - break; - } - }); - /** @type {string=} */ - this.name = undefined; - /** @type {Compiler} */ - this.compiler = compiler; - this.resolverFactory = compiler.resolverFactory; - this.inputFileSystem = compiler.inputFileSystem; - this.requestShortener = compiler.requestShortener; +module.exports = ContextModule; - const options = compiler.options; - this.options = options; - this.outputOptions = options && options.output; - /** @type {boolean=} */ - this.bail = options && options.bail; - this.profile = options && options.profile; - this.performance = options && options.performance; - this.mainTemplate = new MainTemplate(this.outputOptions); - this.chunkTemplate = new ChunkTemplate(this.outputOptions); - this.hotUpdateChunkTemplate = new HotUpdateChunkTemplate( - this.outputOptions - ); - this.runtimeTemplate = new RuntimeTemplate( - this.outputOptions, - this.requestShortener - ); - this.moduleTemplates = { - javascript: new ModuleTemplate(this.runtimeTemplate, "javascript"), - webassembly: new ModuleTemplate(this.runtimeTemplate, "webassembly") - }; +/***/ }), - this.semaphore = new Semaphore(options.parallelism || 100); +/***/ 88239: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - this.entries = []; - /** @private @type {{name: string, request: string, module: Module}[]} */ - this._preparedEntrypoints = []; - /** @type {Map} */ - this.entrypoints = new Map(); - /** @type {Chunk[]} */ - this.chunks = []; - /** @type {ChunkGroup[]} */ - this.chunkGroups = []; - /** @type {Map} */ - this.namedChunkGroups = new Map(); - /** @type {Map} */ - this.namedChunks = new Map(); - /** @type {Module[]} */ - this.modules = []; - /** @private @type {Map} */ - this._modules = new Map(); - this.cache = null; - this.records = null; - /** @type {string[]} */ - this.additionalChunkAssets = []; - /** @type {CompilationAssets} */ - this.assets = {}; - /** @type {Map} */ - this.assetsInfo = new Map(); - /** @type {WebpackError[]} */ - this.errors = []; - /** @type {WebpackError[]} */ - this.warnings = []; - /** @type {Compilation[]} */ - this.children = []; - /** @type {Map} */ - this.logging = new Map(); - /** @type {Map} */ - this.dependencyFactories = new Map(); - /** @type {Map} */ - this.dependencyTemplates = new Map(); - // TODO refactor this in webpack 5 to a custom DependencyTemplates class with a hash property - // @ts-ignore - this.dependencyTemplates.set("hash", ""); - this.childrenCounters = {}; - /** @type {Set} */ - this.usedChunkIds = null; - /** @type {Set} */ - this.usedModuleIds = null; - /** @type {Map=} */ - this.fileTimestamps = undefined; - /** @type {Map=} */ - this.contextTimestamps = undefined; - /** @type {Set=} */ - this.compilationDependencies = undefined; - /** @private @type {Map} */ - this._buildingModules = new Map(); - /** @private @type {Map} */ - this._rebuildingModules = new Map(); - /** @type {Set} */ - this.emittedAssets = new Set(); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - getStats() { - return new Stats(this); - } - /** - * @param {string | (function(): string)} name name of the logger, or function called once to get the logger name - * @returns {Logger} a logger with that name - */ - getLogger(name) { - if (!name) { - throw new TypeError("Compilation.getLogger(name) called without a name"); - } - /** @type {LogEntry[] | undefined} */ - let logEntries; - return new Logger((type, args) => { - if (typeof name === "function") { - name = name(); - if (!name) { - throw new TypeError( - "Compilation.getLogger(name) called with a function not returning a name" - ); - } - } - let trace; - switch (type) { - case LogType.warn: - case LogType.error: - case LogType.trace: - trace = ErrorHelpers.cutOffLoaderExecution(new Error("Trace").stack) - .split("\n") - .slice(3); +const asyncLib = __webpack_require__(36386); +const path = __webpack_require__(85622); + +const { + Tapable, + AsyncSeriesWaterfallHook, + SyncWaterfallHook +} = __webpack_require__(92402); +const ContextModule = __webpack_require__(20090); +const ContextElementDependency = __webpack_require__(89079); + +/** @typedef {import("./Module")} Module */ + +const EMPTY_RESOLVE_OPTIONS = {}; + +module.exports = class ContextModuleFactory extends Tapable { + constructor(resolverFactory) { + super(); + this.hooks = { + /** @type {AsyncSeriesWaterfallHook} */ + beforeResolve: new AsyncSeriesWaterfallHook(["data"]), + /** @type {AsyncSeriesWaterfallHook} */ + afterResolve: new AsyncSeriesWaterfallHook(["data"]), + /** @type {SyncWaterfallHook} */ + contextModuleFiles: new SyncWaterfallHook(["files"]), + /** @type {SyncWaterfallHook} */ + alternatives: new AsyncSeriesWaterfallHook(["modules"]) + }; + this._pluginCompat.tap("ContextModuleFactory", options => { + switch (options.name) { + case "before-resolve": + case "after-resolve": + case "alternatives": + options.async = true; break; } - /** @type {LogEntry} */ - const logEntry = { - time: Date.now(), - type, - args, - trace - }; - if (this.hooks.log.call(name, logEntry) === undefined) { - if (logEntry.type === LogType.profileEnd) { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.profileEnd === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.profileEnd(`[${name}] ${logEntry.args[0]}`); - } - } - if (logEntries === undefined) { - logEntries = this.logging.get(name); - if (logEntries === undefined) { - logEntries = []; - this.logging.set(name, logEntries); - } - } - logEntries.push(logEntry); - if (logEntry.type === LogType.profile) { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.profile === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.profile(`[${name}] ${logEntry.args[0]}`); - } - } - } }); + this.resolverFactory = resolverFactory; } - /** - * @typedef {Object} AddModuleResult - * @property {Module} module the added or existing module - * @property {boolean} issuer was this the first request for this module - * @property {boolean} build should the module be build - * @property {boolean} dependencies should dependencies be walked - */ - - /** - * @param {Module} module module to be added that was created - * @param {any=} cacheGroup cacheGroup it is apart of - * @returns {AddModuleResult} returns meta about whether or not the module had built - * had an issuer, or any dependnecies - */ - addModule(module, cacheGroup) { - const identifier = module.identifier(); - const alreadyAddedModule = this._modules.get(identifier); - if (alreadyAddedModule) { - return { - module: alreadyAddedModule, - issuer: false, - build: false, - dependencies: false - }; - } - const cacheName = (cacheGroup || "m") + identifier; - if (this.cache && this.cache[cacheName]) { - const cacheModule = this.cache[cacheName]; + create(data, callback) { + const context = data.context; + const dependencies = data.dependencies; + const resolveOptions = data.resolveOptions; + const dependency = dependencies[0]; + this.hooks.beforeResolve.callAsync( + Object.assign( + { + context: context, + dependencies: dependencies, + resolveOptions + }, + dependency.options + ), + (err, beforeResolveResult) => { + if (err) return callback(err); - if (typeof cacheModule.updateCacheModule === "function") { - cacheModule.updateCacheModule(module); - } + // Ignored + if (!beforeResolveResult) return callback(); - let rebuild = true; - if (this.fileTimestamps && this.contextTimestamps) { - rebuild = cacheModule.needRebuild( - this.fileTimestamps, - this.contextTimestamps - ); - } + const context = beforeResolveResult.context; + const request = beforeResolveResult.request; + const resolveOptions = beforeResolveResult.resolveOptions; - if (!rebuild) { - cacheModule.disconnect(); - this._modules.set(identifier, cacheModule); - this.modules.push(cacheModule); - for (const err of cacheModule.errors) { - this.errors.push(err); - } - for (const err of cacheModule.warnings) { - this.warnings.push(err); + let loaders, + resource, + loadersPrefix = ""; + const idx = request.lastIndexOf("!"); + if (idx >= 0) { + let loadersRequest = request.substr(0, idx + 1); + let i; + for ( + i = 0; + i < loadersRequest.length && loadersRequest[i] === "!"; + i++ + ) { + loadersPrefix += "!"; + } + loadersRequest = loadersRequest + .substr(i) + .replace(/!+$/, "") + .replace(/!!+/g, "!"); + if (loadersRequest === "") { + loaders = []; + } else { + loaders = loadersRequest.split("!"); + } + resource = request.substr(idx + 1); + } else { + loaders = []; + resource = request; } - return { - module: cacheModule, - issuer: true, - build: false, - dependencies: true - }; - } - cacheModule.unbuild(); - module = cacheModule; - } - this._modules.set(identifier, module); - if (this.cache) { - this.cache[cacheName] = module; - } - this.modules.push(module); - return { - module: module, - issuer: true, - build: true, - dependencies: true - }; - } - - /** - * Fetches a module from a compilation by its identifier - * @param {Module} module the module provided - * @returns {Module} the module requested - */ - getModule(module) { - const identifier = module.identifier(); - return this._modules.get(identifier); - } - /** - * Attempts to search for a module by its identifier - * @param {string} identifier identifier (usually path) for module - * @returns {Module|undefined} attempt to search for module and return it, else undefined - */ - findModule(identifier) { - return this._modules.get(identifier); - } + const contextResolver = this.resolverFactory.get( + "context", + resolveOptions || EMPTY_RESOLVE_OPTIONS + ); + const loaderResolver = this.resolverFactory.get( + "loader", + EMPTY_RESOLVE_OPTIONS + ); - /** - * @param {Module} module module with its callback list - * @param {Callback} callback the callback function - * @returns {void} - */ - waitForBuildingFinished(module, callback) { - let callbackList = this._buildingModules.get(module); - if (callbackList) { - callbackList.push(() => callback()); - } else { - process.nextTick(callback); - } - } + asyncLib.parallel( + [ + callback => { + contextResolver.resolve( + {}, + context, + resource, + {}, + (err, result) => { + if (err) return callback(err); + callback(null, result); + } + ); + }, + callback => { + asyncLib.map( + loaders, + (loader, callback) => { + loaderResolver.resolve( + {}, + context, + loader, + {}, + (err, result) => { + if (err) return callback(err); + callback(null, result); + } + ); + }, + callback + ); + } + ], + (err, result) => { + if (err) return callback(err); - /** - * Builds the module object - * - * @param {Module} module module to be built - * @param {boolean} optional optional flag - * @param {Module=} origin origin module this module build was requested from - * @param {Dependency[]=} dependencies optional dependencies from the module to be built - * @param {TODO} thisCallback the callback - * @returns {TODO} returns the callback function with results - */ - buildModule(module, optional, origin, dependencies, thisCallback) { - let callbackList = this._buildingModules.get(module); - if (callbackList) { - callbackList.push(thisCallback); - return; - } - this._buildingModules.set(module, (callbackList = [thisCallback])); + this.hooks.afterResolve.callAsync( + Object.assign( + { + addon: + loadersPrefix + + result[1].join("!") + + (result[1].length > 0 ? "!" : ""), + resource: result[0], + resolveDependencies: this.resolveDependencies.bind(this) + }, + beforeResolveResult + ), + (err, result) => { + if (err) return callback(err); - const callback = err => { - this._buildingModules.delete(module); - for (const cb of callbackList) { - cb(err); - } - }; + // Ignored + if (!result) return callback(); - this.hooks.buildModule.call(module); - module.build( - this.options, - this, - this.resolverFactory.get("normal", module.resolveOptions), - this.inputFileSystem, - error => { - const errors = module.errors; - for (let indexError = 0; indexError < errors.length; indexError++) { - const err = errors[indexError]; - err.origin = origin; - err.dependencies = dependencies; - if (optional) { - this.warnings.push(err); - } else { - this.errors.push(err); + return callback( + null, + new ContextModule(result.resolveDependencies, result) + ); + } + ); } - } - - const warnings = module.warnings; - for ( - let indexWarning = 0; - indexWarning < warnings.length; - indexWarning++ - ) { - const war = warnings[indexWarning]; - war.origin = origin; - war.dependencies = dependencies; - this.warnings.push(war); - } - const originalMap = module.dependencies.reduce((map, v, i) => { - map.set(v, i); - return map; - }, new Map()); - module.dependencies.sort((a, b) => { - const cmp = compareLocations(a.loc, b.loc); - if (cmp) return cmp; - return originalMap.get(a) - originalMap.get(b); - }); - if (error) { - this.hooks.failedModule.call(module, error); - return callback(error); - } - this.hooks.succeedModule.call(module); - return callback(); + ); } ); } - /** - * @param {Module} module to be processed for deps - * @param {ModuleCallback} callback callback to be triggered - * @returns {void} - */ - processModuleDependencies(module, callback) { - const dependencies = new Map(); + resolveDependencies(fs, options, callback) { + const cmf = this; + let resource = options.resource; + let resourceQuery = options.resourceQuery; + let recursive = options.recursive; + let regExp = options.regExp; + let include = options.include; + let exclude = options.exclude; + if (!regExp || !resource) return callback(null, []); - const addDependency = dep => { - const resourceIdent = dep.getResourceIdentifier(); - if (resourceIdent) { - const factory = this.dependencyFactories.get(dep.constructor); - if (factory === undefined) { - throw new Error( - `No module factory available for dependency type: ${dep.constructor.name}` - ); - } - let innerMap = dependencies.get(factory); - if (innerMap === undefined) { - dependencies.set(factory, (innerMap = new Map())); - } - let list = innerMap.get(resourceIdent); - if (list === undefined) innerMap.set(resourceIdent, (list = [])); - list.push(dep); - } - }; + const addDirectory = (directory, callback) => { + fs.readdir(directory, (err, files) => { + if (err) return callback(err); + files = cmf.hooks.contextModuleFiles.call(files); + if (!files || files.length === 0) return callback(null, []); + asyncLib.map( + files.filter(p => p.indexOf(".") !== 0), + (segment, callback) => { + const subResource = path.join(directory, segment); - const addDependenciesBlock = block => { - if (block.dependencies) { - iterationOfArrayCallback(block.dependencies, addDependency); - } - if (block.blocks) { - iterationOfArrayCallback(block.blocks, addDependenciesBlock); - } - if (block.variables) { - iterationBlockVariable(block.variables, addDependency); - } - }; + if (!exclude || !subResource.match(exclude)) { + fs.stat(subResource, (err, stat) => { + if (err) { + if (err.code === "ENOENT") { + // ENOENT is ok here because the file may have been deleted between + // the readdir and stat calls. + return callback(); + } else { + return callback(err); + } + } - try { - addDependenciesBlock(module); - } catch (e) { - callback(e); - } + if (stat.isDirectory()) { + if (!recursive) return callback(); + addDirectory.call(this, subResource, callback); + } else if ( + stat.isFile() && + (!include || subResource.match(include)) + ) { + const obj = { + context: resource, + request: + "." + + subResource.substr(resource.length).replace(/\\/g, "/") + }; - const sortedDependencies = []; + this.hooks.alternatives.callAsync( + [obj], + (err, alternatives) => { + if (err) return callback(err); + alternatives = alternatives + .filter(obj => regExp.test(obj.request)) + .map(obj => { + const dep = new ContextElementDependency( + obj.request + resourceQuery, + obj.request + ); + dep.optional = true; + return dep; + }); + callback(null, alternatives); + } + ); + } else { + callback(); + } + }); + } else { + callback(); + } + }, + (err, result) => { + if (err) return callback(err); - for (const pair1 of dependencies) { - for (const pair2 of pair1[1]) { - sortedDependencies.push({ - factory: pair1[0], - dependencies: pair2[1] - }); - } - } + if (!result) return callback(null, []); - this.addModuleDependencies( - module, - sortedDependencies, - this.bail, - null, - true, - callback - ); + callback( + null, + result.filter(Boolean).reduce((a, i) => a.concat(i), []) + ); + } + ); + }); + }; + + addDirectory(resource, callback); } +}; - /** - * @param {Module} module module to add deps to - * @param {SortedDependency[]} dependencies set of sorted dependencies to iterate through - * @param {(boolean|null)=} bail whether to bail or not - * @param {TODO} cacheGroup optional cacheGroup - * @param {boolean} recursive whether it is recursive traversal - * @param {function} callback callback for when dependencies are finished being added - * @returns {void} - */ - addModuleDependencies( - module, - dependencies, - bail, - cacheGroup, - recursive, - callback - ) { - const start = this.profile && Date.now(); - const currentProfile = this.profile && {}; - asyncLib.forEach( - dependencies, - (item, callback) => { - const dependencies = item.dependencies; +/***/ }), - const errorAndCallback = err => { - err.origin = module; - err.dependencies = dependencies; - this.errors.push(err); - if (bail) { - callback(err); - } else { - callback(); - } - }; - const warningAndCallback = err => { - err.origin = module; - this.warnings.push(err); - callback(); - }; +/***/ 27295: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - const semaphore = this.semaphore; - semaphore.acquire(() => { - const factory = item.factory; - factory.create( - { - contextInfo: { - issuer: module.nameForCondition && module.nameForCondition(), - compiler: this.compiler.name - }, - resolveOptions: module.resolveOptions, - context: module.context, - dependencies: dependencies - }, - (err, dependentModule) => { - let afterFactory; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - const isOptional = () => { - return dependencies.every(d => d.optional); - }; - const errorOrWarningAndCallback = err => { - if (isOptional()) { - return warningAndCallback(err); - } else { - return errorAndCallback(err); - } - }; +const path = __webpack_require__(85622); +const ContextElementDependency = __webpack_require__(89079); - if (err) { - semaphore.release(); - return errorOrWarningAndCallback( - new ModuleNotFoundError(module, err) - ); - } - if (!dependentModule) { - semaphore.release(); - return process.nextTick(callback); - } - if (currentProfile) { - afterFactory = Date.now(); - currentProfile.factory = afterFactory - start; - } +class ContextReplacementPlugin { + constructor( + resourceRegExp, + newContentResource, + newContentRecursive, + newContentRegExp + ) { + this.resourceRegExp = resourceRegExp; - const iterationDependencies = depend => { - for (let index = 0; index < depend.length; index++) { - const dep = depend[index]; - dep.module = dependentModule; - dependentModule.addReason(module, dep); - } - }; + if (typeof newContentResource === "function") { + this.newContentCallback = newContentResource; + } else if ( + typeof newContentResource === "string" && + typeof newContentRecursive === "object" + ) { + this.newContentResource = newContentResource; + this.newContentCreateContextMap = (fs, callback) => { + callback(null, newContentRecursive); + }; + } else if ( + typeof newContentResource === "string" && + typeof newContentRecursive === "function" + ) { + this.newContentResource = newContentResource; + this.newContentCreateContextMap = newContentRecursive; + } else { + if (typeof newContentResource !== "string") { + newContentRegExp = newContentRecursive; + newContentRecursive = newContentResource; + newContentResource = undefined; + } + if (typeof newContentRecursive !== "boolean") { + newContentRegExp = newContentRecursive; + newContentRecursive = undefined; + } + this.newContentResource = newContentResource; + this.newContentRecursive = newContentRecursive; + this.newContentRegExp = newContentRegExp; + } + } - const addModuleResult = this.addModule( - dependentModule, - cacheGroup - ); - dependentModule = addModuleResult.module; - iterationDependencies(dependencies); + apply(compiler) { + const resourceRegExp = this.resourceRegExp; + const newContentCallback = this.newContentCallback; + const newContentResource = this.newContentResource; + const newContentRecursive = this.newContentRecursive; + const newContentRegExp = this.newContentRegExp; + const newContentCreateContextMap = this.newContentCreateContextMap; - const afterBuild = () => { - if (recursive && addModuleResult.dependencies) { - this.processModuleDependencies(dependentModule, callback); - } else { - return callback(); - } - }; - - if (addModuleResult.issuer) { - if (currentProfile) { - dependentModule.profile = currentProfile; - } - - dependentModule.issuer = module; - } else { - if (this.profile) { - if (module.profile) { - const time = Date.now() - start; - if ( - !module.profile.dependencies || - time > module.profile.dependencies - ) { - module.profile.dependencies = time; - } - } - } - } - - if (addModuleResult.build) { - this.buildModule( - dependentModule, - isOptional(), - module, - dependencies, - err => { - if (err) { - semaphore.release(); - return errorOrWarningAndCallback(err); - } - - if (currentProfile) { - const afterBuilding = Date.now(); - currentProfile.building = afterBuilding - afterFactory; - } - - semaphore.release(); - afterBuild(); - } - ); - } else { - semaphore.release(); - this.waitForBuildingFinished(dependentModule, afterBuild); - } + compiler.hooks.contextModuleFactory.tap("ContextReplacementPlugin", cmf => { + cmf.hooks.beforeResolve.tap("ContextReplacementPlugin", result => { + if (!result) return; + if (resourceRegExp.test(result.request)) { + if (newContentResource !== undefined) { + result.request = newContentResource; + } + if (newContentRecursive !== undefined) { + result.recursive = newContentRecursive; + } + if (newContentRegExp !== undefined) { + result.regExp = newContentRegExp; + } + if (typeof newContentCallback === "function") { + newContentCallback(result); + } else { + for (const d of result.dependencies) { + if (d.critical) d.critical = false; } - ); - }); - }, - err => { - // In V8, the Error objects keep a reference to the functions on the stack. These warnings & - // errors are created inside closures that keep a reference to the Compilation, so errors are - // leaking the Compilation object. - - if (err) { - // eslint-disable-next-line no-self-assign - err.stack = err.stack; - return callback(err); + } } - - return process.nextTick(callback); - } - ); - } - - /** - * - * @param {string} context context string path - * @param {Dependency} dependency dependency used to create Module chain - * @param {OnModuleCallback} onModule function invoked on modules creation - * @param {ModuleChainCallback} callback callback for when module chain is complete - * @returns {void} will throw if dependency instance is not a valid Dependency - */ - _addModuleChain(context, dependency, onModule, callback) { - const start = this.profile && Date.now(); - const currentProfile = this.profile && {}; - - const errorAndCallback = this.bail - ? err => { - callback(err); - } - : err => { - err.dependencies = [dependency]; - this.errors.push(err); - callback(); - }; - - if ( - typeof dependency !== "object" || - dependency === null || - !dependency.constructor - ) { - throw new Error("Parameter 'dependency' must be a Dependency"); - } - const Dep = /** @type {DepConstructor} */ (dependency.constructor); - const moduleFactory = this.dependencyFactories.get(Dep); - if (!moduleFactory) { - throw new Error( - `No dependency factory available for this dependency type: ${dependency.constructor.name}` - ); - } - - this.semaphore.acquire(() => { - moduleFactory.create( - { - contextInfo: { - issuer: "", - compiler: this.compiler.name - }, - context: context, - dependencies: [dependency] - }, - (err, module) => { - if (err) { - this.semaphore.release(); - return errorAndCallback(new EntryModuleNotFoundError(err)); + return result; + }); + cmf.hooks.afterResolve.tap("ContextReplacementPlugin", result => { + if (!result) return; + if (resourceRegExp.test(result.resource)) { + if (newContentResource !== undefined) { + result.resource = path.resolve(result.resource, newContentResource); } - - let afterFactory; - - if (currentProfile) { - afterFactory = Date.now(); - currentProfile.factory = afterFactory - start; + if (newContentRecursive !== undefined) { + result.recursive = newContentRecursive; } - - const addModuleResult = this.addModule(module); - module = addModuleResult.module; - - onModule(module); - - dependency.module = module; - module.addReason(null, dependency); - - const afterBuild = () => { - if (addModuleResult.dependencies) { - this.processModuleDependencies(module, err => { - if (err) return callback(err); - callback(null, module); - }); - } else { - return callback(null, module); - } - }; - - if (addModuleResult.issuer) { - if (currentProfile) { - module.profile = currentProfile; - } + if (newContentRegExp !== undefined) { + result.regExp = newContentRegExp; } - - if (addModuleResult.build) { - this.buildModule(module, false, null, null, err => { - if (err) { - this.semaphore.release(); - return errorAndCallback(err); - } - - if (currentProfile) { - const afterBuilding = Date.now(); - currentProfile.building = afterBuilding - afterFactory; - } - - this.semaphore.release(); - afterBuild(); - }); + if (typeof newContentCreateContextMap === "function") { + result.resolveDependencies = createResolveDependenciesFromContextMap( + newContentCreateContextMap + ); + } + if (typeof newContentCallback === "function") { + const origResource = result.resource; + newContentCallback(result); + if (result.resource !== origResource) { + result.resource = path.resolve(origResource, result.resource); + } } else { - this.semaphore.release(); - this.waitForBuildingFinished(module, afterBuild); + for (const d of result.dependencies) { + if (d.critical) d.critical = false; + } } } - ); + return result; + }); }); } +} - /** - * - * @param {string} context context path for entry - * @param {Dependency} entry entry dependency being created - * @param {string} name name of entry - * @param {ModuleCallback} callback callback function - * @returns {void} returns - */ - addEntry(context, entry, name, callback) { - this.hooks.addEntry.call(entry, name); +const createResolveDependenciesFromContextMap = createContextMap => { + const resolveDependenciesFromContextMap = (fs, options, callback) => { + createContextMap(fs, (err, map) => { + if (err) return callback(err); + const dependencies = Object.keys(map).map(key => { + return new ContextElementDependency( + map[key] + options.resourceQuery, + key + ); + }); + callback(null, dependencies); + }); + }; + return resolveDependenciesFromContextMap; +}; - const slot = { - name: name, - // TODO webpack 5 remove `request` - request: null, - module: null - }; +module.exports = ContextReplacementPlugin; - if (entry instanceof ModuleDependency) { - slot.request = entry.request; - } - // TODO webpack 5: merge modules instead when multiple entry modules are supported - const idx = this._preparedEntrypoints.findIndex(slot => slot.name === name); - if (idx >= 0) { - // Overwrite existing entrypoint - this._preparedEntrypoints[idx] = slot; - } else { - this._preparedEntrypoints.push(slot); - } - this._addModuleChain( - context, - entry, - module => { - this.entries.push(module); - }, - (err, module) => { - if (err) { - this.hooks.failedEntry.call(entry, name, err); - return callback(err); - } +/***/ }), - if (module) { - slot.module = module; - } else { - const idx = this._preparedEntrypoints.indexOf(slot); - if (idx >= 0) { - this._preparedEntrypoints.splice(idx, 1); - } - } - this.hooks.succeedEntry.call(entry, name, module); - return callback(null, module); - } - ); - } +/***/ 97374: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - /** - * @param {string} context context path string - * @param {Dependency} dependency dep used to create module - * @param {ModuleCallback} callback module callback sending module up a level - * @returns {void} - */ - prefetch(context, dependency, callback) { - this._addModuleChain( - context, - dependency, - module => { - module.prefetched = true; - }, - callback - ); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - /** - * @param {Module} module module to be rebuilt - * @param {Callback} thisCallback callback when module finishes rebuilding - * @returns {void} - */ - rebuildModule(module, thisCallback) { - let callbackList = this._rebuildingModules.get(module); - if (callbackList) { - callbackList.push(thisCallback); - return; - } - this._rebuildingModules.set(module, (callbackList = [thisCallback])); - const callback = err => { - this._rebuildingModules.delete(module); - for (const cb of callbackList) { - cb(err); - } - }; +const ConstDependency = __webpack_require__(71101); +const BasicEvaluatedExpression = __webpack_require__(96770); +const ParserHelpers = __webpack_require__(23999); +const NullFactory = __webpack_require__(40438); - this.hooks.rebuildModule.call(module); - const oldDependencies = module.dependencies.slice(); - const oldVariables = module.variables.slice(); - const oldBlocks = module.blocks.slice(); - module.unbuild(); - this.buildModule(module, false, module, null, err => { - if (err) { - this.hooks.finishRebuildingModule.call(module); - return callback(err); - } +/** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Parser")} Parser */ +/** @typedef {null|undefined|RegExp|Function|string|number} CodeValuePrimitive */ +/** @typedef {CodeValuePrimitive|Record|RuntimeValue} CodeValue */ - this.processModuleDependencies(module, err => { - if (err) return callback(err); - this.removeReasonsOfDependencyBlock(module, { - dependencies: oldDependencies, - variables: oldVariables, - blocks: oldBlocks - }); - this.hooks.finishRebuildingModule.call(module); - callback(); - }); - }); +class RuntimeValue { + constructor(fn, fileDependencies) { + this.fn = fn; + this.fileDependencies = fileDependencies || []; } - finish(callback) { - const modules = this.modules; - this.hooks.finishModules.callAsync(modules, err => { - if (err) return callback(err); - - for (let index = 0; index < modules.length; index++) { - const module = modules[index]; - this.reportDependencyErrorsAndWarnings(module, [module]); + exec(parser) { + if (this.fileDependencies === true) { + parser.state.module.buildInfo.cacheable = false; + } else { + for (const fileDependency of this.fileDependencies) { + parser.state.module.buildInfo.fileDependencies.add(fileDependency); } + } - callback(); - }); + return this.fn({ module: parser.state.module }); } +} - unseal() { - this.hooks.unseal.call(); - this.chunks.length = 0; - this.chunkGroups.length = 0; - this.namedChunks.clear(); - this.namedChunkGroups.clear(); - this.additionalChunkAssets.length = 0; - this.assets = {}; - this.assetsInfo.clear(); - for (const module of this.modules) { - module.unseal(); - } +const stringifyObj = (obj, parser) => { + return ( + "Object({" + + Object.keys(obj) + .map(key => { + const code = obj[key]; + return JSON.stringify(key) + ":" + toCode(code, parser); + }) + .join(",") + + "})" + ); +}; + +/** + * Convert code to a string that evaluates + * @param {CodeValue} code Code to evaluate + * @param {Parser} parser Parser + * @returns {string} code converted to string that evaluates + */ +const toCode = (code, parser) => { + if (code === null) { + return "null"; + } + if (code === undefined) { + return "undefined"; + } + if (code instanceof RuntimeValue) { + return toCode(code.exec(parser), parser); + } + if (code instanceof RegExp && code.toString) { + return code.toString(); + } + if (typeof code === "function" && code.toString) { + return "(" + code.toString() + ")"; } + if (typeof code === "object") { + return stringifyObj(code, parser); + } + return code + ""; +}; +class DefinePlugin { /** - * @param {Callback} callback signals when the seal method is finishes - * @returns {void} + * Create a new define plugin + * @param {Record} definitions A map of global object definitions */ - seal(callback) { - this.hooks.seal.call(); - - while ( - this.hooks.optimizeDependenciesBasic.call(this.modules) || - this.hooks.optimizeDependencies.call(this.modules) || - this.hooks.optimizeDependenciesAdvanced.call(this.modules) - ) { - /* empty */ - } - this.hooks.afterOptimizeDependencies.call(this.modules); + constructor(definitions) { + this.definitions = definitions; + } - this.hooks.beforeChunks.call(); - for (const preparedEntrypoint of this._preparedEntrypoints) { - const module = preparedEntrypoint.module; - const name = preparedEntrypoint.name; - const chunk = this.addChunk(name); - const entrypoint = new Entrypoint(name); - entrypoint.setRuntimeChunk(chunk); - entrypoint.addOrigin(null, name, preparedEntrypoint.request); - this.namedChunkGroups.set(name, entrypoint); - this.entrypoints.set(name, entrypoint); - this.chunkGroups.push(entrypoint); + static runtimeValue(fn, fileDependencies) { + return new RuntimeValue(fn, fileDependencies); + } - GraphHelpers.connectChunkGroupAndChunk(entrypoint, chunk); - GraphHelpers.connectChunkAndModule(chunk, module); + /** + * Apply the plugin + * @param {Compiler} compiler Webpack compiler + * @returns {void} + */ + apply(compiler) { + const definitions = this.definitions; + compiler.hooks.compilation.tap( + "DefinePlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(ConstDependency, new NullFactory()); + compilation.dependencyTemplates.set( + ConstDependency, + new ConstDependency.Template() + ); - chunk.entryModule = module; - chunk.name = name; + /** + * Handler + * @param {Parser} parser Parser + * @returns {void} + */ + const handler = parser => { + /** + * Walk definitions + * @param {Object} definitions Definitions map + * @param {string} prefix Prefix string + * @returns {void} + */ + const walkDefinitions = (definitions, prefix) => { + Object.keys(definitions).forEach(key => { + const code = definitions[key]; + if ( + code && + typeof code === "object" && + !(code instanceof RuntimeValue) && + !(code instanceof RegExp) + ) { + walkDefinitions(code, prefix + key + "."); + applyObjectDefine(prefix + key, code); + return; + } + applyDefineKey(prefix, key); + applyDefine(prefix + key, code); + }); + }; - this.assignDepth(module); - } - buildChunkGraph( - this, - /** @type {Entrypoint[]} */ (this.chunkGroups.slice()) - ); - this.sortModules(this.modules); - this.hooks.afterChunks.call(this.chunks); - - this.hooks.optimize.call(); + /** + * Apply define key + * @param {string} prefix Prefix + * @param {string} key Key + * @returns {void} + */ + const applyDefineKey = (prefix, key) => { + const splittedKey = key.split("."); + splittedKey.slice(1).forEach((_, i) => { + const fullKey = prefix + splittedKey.slice(0, i + 1).join("."); + parser.hooks.canRename + .for(fullKey) + .tap("DefinePlugin", ParserHelpers.approve); + }); + }; - while ( - this.hooks.optimizeModulesBasic.call(this.modules) || - this.hooks.optimizeModules.call(this.modules) || - this.hooks.optimizeModulesAdvanced.call(this.modules) - ) { - /* empty */ - } - this.hooks.afterOptimizeModules.call(this.modules); + /** + * Apply Code + * @param {string} key Key + * @param {CodeValue} code Code + * @returns {void} + */ + const applyDefine = (key, code) => { + const isTypeof = /^typeof\s+/.test(key); + if (isTypeof) key = key.replace(/^typeof\s+/, ""); + let recurse = false; + let recurseTypeof = false; + if (!isTypeof) { + parser.hooks.canRename + .for(key) + .tap("DefinePlugin", ParserHelpers.approve); + parser.hooks.evaluateIdentifier + .for(key) + .tap("DefinePlugin", expr => { + /** + * this is needed in case there is a recursion in the DefinePlugin + * to prevent an endless recursion + * e.g.: new DefinePlugin({ + * "a": "b", + * "b": "a" + * }); + */ + if (recurse) return; + recurse = true; + const res = parser.evaluate(toCode(code, parser)); + recurse = false; + res.setRange(expr.range); + return res; + }); + parser.hooks.expression.for(key).tap("DefinePlugin", expr => { + const strCode = toCode(code, parser); + if (/__webpack_require__/.test(strCode)) { + return ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + strCode + )(expr); + } else { + return ParserHelpers.toConstantDependency( + parser, + strCode + )(expr); + } + }); + } + parser.hooks.evaluateTypeof.for(key).tap("DefinePlugin", expr => { + /** + * this is needed in case there is a recursion in the DefinePlugin + * to prevent an endless recursion + * e.g.: new DefinePlugin({ + * "typeof a": "typeof b", + * "typeof b": "typeof a" + * }); + */ + if (recurseTypeof) return; + recurseTypeof = true; + const typeofCode = isTypeof + ? toCode(code, parser) + : "typeof (" + toCode(code, parser) + ")"; + const res = parser.evaluate(typeofCode); + recurseTypeof = false; + res.setRange(expr.range); + return res; + }); + parser.hooks.typeof.for(key).tap("DefinePlugin", expr => { + const typeofCode = isTypeof + ? toCode(code, parser) + : "typeof (" + toCode(code, parser) + ")"; + const res = parser.evaluate(typeofCode); + if (!res.isString()) return; + return ParserHelpers.toConstantDependency( + parser, + JSON.stringify(res.string) + ).bind(parser)(expr); + }); + }; - while ( - this.hooks.optimizeChunksBasic.call(this.chunks, this.chunkGroups) || - this.hooks.optimizeChunks.call(this.chunks, this.chunkGroups) || - this.hooks.optimizeChunksAdvanced.call(this.chunks, this.chunkGroups) - ) { - /* empty */ - } - this.hooks.afterOptimizeChunks.call(this.chunks, this.chunkGroups); + /** + * Apply Object + * @param {string} key Key + * @param {Object} obj Object + * @returns {void} + */ + const applyObjectDefine = (key, obj) => { + parser.hooks.canRename + .for(key) + .tap("DefinePlugin", ParserHelpers.approve); + parser.hooks.evaluateIdentifier + .for(key) + .tap("DefinePlugin", expr => + new BasicEvaluatedExpression().setTruthy().setRange(expr.range) + ); + parser.hooks.evaluateTypeof.for(key).tap("DefinePlugin", expr => { + return ParserHelpers.evaluateToString("object")(expr); + }); + parser.hooks.expression.for(key).tap("DefinePlugin", expr => { + const strCode = stringifyObj(obj, parser); - this.hooks.optimizeTree.callAsync(this.chunks, this.modules, err => { - if (err) { - return callback(err); - } + if (/__webpack_require__/.test(strCode)) { + return ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + strCode + )(expr); + } else { + return ParserHelpers.toConstantDependency( + parser, + strCode + )(expr); + } + }); + parser.hooks.typeof.for(key).tap("DefinePlugin", expr => { + return ParserHelpers.toConstantDependency( + parser, + JSON.stringify("object") + )(expr); + }); + }; - this.hooks.afterOptimizeTree.call(this.chunks, this.modules); + walkDefinitions(definitions, ""); + }; - while ( - this.hooks.optimizeChunkModulesBasic.call(this.chunks, this.modules) || - this.hooks.optimizeChunkModules.call(this.chunks, this.modules) || - this.hooks.optimizeChunkModulesAdvanced.call(this.chunks, this.modules) - ) { - /* empty */ + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("DefinePlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("DefinePlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/esm") + .tap("DefinePlugin", handler); } - this.hooks.afterOptimizeChunkModules.call(this.chunks, this.modules); + ); + } +} +module.exports = DefinePlugin; - const shouldRecord = this.hooks.shouldRecord.call() !== false; - this.hooks.reviveModules.call(this.modules, this.records); - this.hooks.optimizeModuleOrder.call(this.modules); - this.hooks.advancedOptimizeModuleOrder.call(this.modules); - this.hooks.beforeModuleIds.call(this.modules); - this.hooks.moduleIds.call(this.modules); - this.applyModuleIds(); - this.hooks.optimizeModuleIds.call(this.modules); - this.hooks.afterOptimizeModuleIds.call(this.modules); +/***/ }), - this.sortItemsWithModuleIds(); +/***/ 42173: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - this.hooks.reviveChunks.call(this.chunks, this.records); - this.hooks.optimizeChunkOrder.call(this.chunks); - this.hooks.beforeChunkIds.call(this.chunks); - this.applyChunkIds(); - this.hooks.optimizeChunkIds.call(this.chunks); - this.hooks.afterOptimizeChunkIds.call(this.chunks); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - this.sortItemsWithChunkIds(); - if (shouldRecord) { - this.hooks.recordModules.call(this.modules, this.records); - this.hooks.recordChunks.call(this.chunks, this.records); - } +const { OriginalSource, RawSource } = __webpack_require__(53665); - this.hooks.beforeHash.call(); - this.createHash(); - this.hooks.afterHash.call(); +const Module = __webpack_require__(75993); +const WebpackMissingModule = __webpack_require__(75386); +const DelegatedSourceDependency = __webpack_require__(25930); +const DelegatedExportsDependency = __webpack_require__(53104); - if (shouldRecord) { - this.hooks.recordHash.call(this.records); - } +/** @typedef {import("./dependencies/ModuleDependency")} ModuleDependency */ +/** @typedef {import("./util/createHash").Hash} Hash */ - this.hooks.beforeModuleAssets.call(); - this.createModuleAssets(); - if (this.hooks.shouldGenerateChunkAssets.call() !== false) { - this.hooks.beforeChunkAssets.call(); - this.createChunkAssets(); - } - this.hooks.additionalChunkAssets.call(this.chunks); - this.summarizeDependencies(); - if (shouldRecord) { - this.hooks.record.call(this, this.records); - } +class DelegatedModule extends Module { + constructor(sourceRequest, data, type, userRequest, originalRequest) { + super("javascript/dynamic", null); - this.hooks.additionalAssets.callAsync(err => { - if (err) { - return callback(err); - } - this.hooks.optimizeChunkAssets.callAsync(this.chunks, err => { - if (err) { - return callback(err); - } - this.hooks.afterOptimizeChunkAssets.call(this.chunks); - this.hooks.optimizeAssets.callAsync(this.assets, err => { - if (err) { - return callback(err); - } - this.hooks.afterOptimizeAssets.call(this.assets); - if (this.hooks.needAdditionalSeal.call()) { - this.unseal(); - return this.seal(callback); - } - return this.hooks.afterSeal.callAsync(callback); - }); - }); - }); - }); + // Info from Factory + this.sourceRequest = sourceRequest; + this.request = data.id; + this.type = type; + this.userRequest = userRequest; + this.originalRequest = originalRequest; + this.delegateData = data; + + // Build info + this.delegatedSourceDependency = undefined; } - /** - * @param {Module[]} modules the modules array on compilation to perform the sort for - * @returns {void} - */ - sortModules(modules) { - // TODO webpack 5: this should only be enabled when `moduleIds: "natural"` - // TODO move it into a plugin (NaturalModuleIdsPlugin) and use this in WebpackOptionsApply - // TODO remove this method - modules.sort(byIndexOrIdentifier); + libIdent(options) { + return typeof this.originalRequest === "string" + ? this.originalRequest + : this.originalRequest.libIdent(options); } - /** - * @param {Module} module moulde to report from - * @param {DependenciesBlock[]} blocks blocks to report from - * @returns {void} - */ - reportDependencyErrorsAndWarnings(module, blocks) { - for (let indexBlock = 0; indexBlock < blocks.length; indexBlock++) { - const block = blocks[indexBlock]; - const dependencies = block.dependencies; + identifier() { + return `delegated ${JSON.stringify(this.request)} from ${ + this.sourceRequest + }`; + } - for (let indexDep = 0; indexDep < dependencies.length; indexDep++) { - const d = dependencies[indexDep]; + readableIdentifier() { + return `delegated ${this.userRequest} from ${this.sourceRequest}`; + } - const warnings = d.getWarnings(); - if (warnings) { - for (let indexWar = 0; indexWar < warnings.length; indexWar++) { - const w = warnings[indexWar]; + needRebuild() { + return false; + } - const warning = new ModuleDependencyWarning(module, w, d.loc); - this.warnings.push(warning); - } - } - const errors = d.getErrors(); - if (errors) { - for (let indexErr = 0; indexErr < errors.length; indexErr++) { - const e = errors[indexErr]; + build(options, compilation, resolver, fs, callback) { + this.built = true; + this.buildMeta = Object.assign({}, this.delegateData.buildMeta); + this.buildInfo = {}; + this.delegatedSourceDependency = new DelegatedSourceDependency( + this.sourceRequest + ); + this.addDependency(this.delegatedSourceDependency); + this.addDependency( + new DelegatedExportsDependency(this, this.delegateData.exports || true) + ); + callback(); + } - const error = new ModuleDependencyError(module, e, d.loc); - this.errors.push(error); - } - } - } + source(depTemplates, runtime) { + const dep = /** @type {DelegatedSourceDependency} */ (this.dependencies[0]); + const sourceModule = dep.module; + let str; - this.reportDependencyErrorsAndWarnings(module, block.blocks); - } - } + if (!sourceModule) { + str = WebpackMissingModule.moduleCode(this.sourceRequest); + } else { + str = `module.exports = (${runtime.moduleExports({ + module: sourceModule, + request: dep.request + })})`; - /** - * @param {TODO} groupOptions options for the chunk group - * @param {Module} module the module the references the chunk group - * @param {DependencyLocation} loc the location from with the chunk group is referenced (inside of module) - * @param {string} request the request from which the the chunk group is referenced - * @returns {ChunkGroup} the new or existing chunk group - */ - addChunkInGroup(groupOptions, module, loc, request) { - if (typeof groupOptions === "string") { - groupOptions = { name: groupOptions }; - } - const name = groupOptions.name; - if (name) { - const chunkGroup = this.namedChunkGroups.get(name); - if (chunkGroup !== undefined) { - chunkGroup.addOptions(groupOptions); - if (module) { - chunkGroup.addOrigin(module, loc, request); - } - return chunkGroup; + switch (this.type) { + case "require": + str += `(${JSON.stringify(this.request)})`; + break; + case "object": + str += `[${JSON.stringify(this.request)}]`; + break; } - } - const chunkGroup = new ChunkGroup(groupOptions); - if (module) chunkGroup.addOrigin(module, loc, request); - const chunk = this.addChunk(name); - GraphHelpers.connectChunkGroupAndChunk(chunkGroup, chunk); + str += ";"; + } - this.chunkGroups.push(chunkGroup); - if (name) { - this.namedChunkGroups.set(name, chunkGroup); + if (this.useSourceMap) { + return new OriginalSource(str, this.identifier()); + } else { + return new RawSource(str); } - return chunkGroup; } - /** - * This method first looks to see if a name is provided for a new chunk, - * and first looks to see if any named chunks already exist and reuse that chunk instead. - * - * @param {string=} name optional chunk name to be provided - * @returns {Chunk} create a chunk (invoked during seal event) - */ - addChunk(name) { - if (name) { - const chunk = this.namedChunks.get(name); - if (chunk !== undefined) { - return chunk; - } - } - const chunk = new Chunk(name); - this.chunks.push(chunk); - if (name) { - this.namedChunks.set(name, chunk); - } - return chunk; + size() { + return 42; } /** - * @param {Module} module module to assign depth + * @param {Hash} hash the hash used to track dependencies * @returns {void} */ - assignDepth(module) { - const queue = new Set([module]); - let depth; - - module.depth = 0; + updateHash(hash) { + hash.update(this.type); + hash.update(JSON.stringify(this.request)); + super.updateHash(hash); + } +} - /** - * @param {Module} module module for processeing - * @returns {void} - */ - const enqueueJob = module => { - const d = module.depth; - if (typeof d === "number" && d <= depth) return; - queue.add(module); - module.depth = depth; - }; +module.exports = DelegatedModule; - /** - * @param {Dependency} dependency dependency to assign depth to - * @returns {void} - */ - const assignDepthToDependency = dependency => { - if (dependency.module) { - enqueueJob(dependency.module); - } - }; - /** - * @param {DependenciesBlock} block block to assign depth to - * @returns {void} - */ - const assignDepthToDependencyBlock = block => { - if (block.variables) { - iterationBlockVariable(block.variables, assignDepthToDependency); - } +/***/ }), - if (block.dependencies) { - iterationOfArrayCallback(block.dependencies, assignDepthToDependency); - } +/***/ 81002: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (block.blocks) { - iterationOfArrayCallback(block.blocks, assignDepthToDependencyBlock); - } - }; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - for (module of queue) { - queue.delete(module); - depth = module.depth; - depth++; - assignDepthToDependencyBlock(module); - } - } +const DelegatedModule = __webpack_require__(42173); - /** - * @param {Module} module the module containing the dependency - * @param {Dependency} dependency the dependency - * @returns {DependencyReference} a reference for the dependency - */ - getDependencyReference(module, dependency) { - // TODO remove dep.getReference existence check in webpack 5 - if (typeof dependency.getReference !== "function") return null; - const ref = dependency.getReference(); - if (!ref) return null; - return this.hooks.dependencyReference.call(ref, dependency, module); +// options.source +// options.type +// options.context +// options.scope +// options.content +class DelegatedModuleFactoryPlugin { + constructor(options) { + this.options = options; + options.type = options.type || "require"; + options.extensions = options.extensions || [ + "", + ".wasm", + ".mjs", + ".js", + ".json" + ]; } - /** - * - * @param {Module} module module relationship for removal - * @param {DependenciesBlockLike} block //TODO: good description - * @returns {void} - */ - removeReasonsOfDependencyBlock(module, block) { - const iteratorDependency = d => { - if (!d.module) { - return; - } - if (d.module.removeReason(module, d)) { - for (const chunk of d.module.chunksIterable) { - this.patchChunksAfterReasonRemoval(d.module, chunk); + apply(normalModuleFactory) { + const scope = this.options.scope; + if (scope) { + normalModuleFactory.hooks.factory.tap( + "DelegatedModuleFactoryPlugin", + factory => (data, callback) => { + const dependency = data.dependencies[0]; + const request = dependency.request; + if (request && request.indexOf(scope + "/") === 0) { + const innerRequest = "." + request.substr(scope.length); + let resolved; + if (innerRequest in this.options.content) { + resolved = this.options.content[innerRequest]; + return callback( + null, + new DelegatedModule( + this.options.source, + resolved, + this.options.type, + innerRequest, + request + ) + ); + } + for (let i = 0; i < this.options.extensions.length; i++) { + const extension = this.options.extensions[i]; + const requestPlusExt = innerRequest + extension; + if (requestPlusExt in this.options.content) { + resolved = this.options.content[requestPlusExt]; + return callback( + null, + new DelegatedModule( + this.options.source, + resolved, + this.options.type, + requestPlusExt, + request + extension + ) + ); + } + } + } + return factory(data, callback); + } + ); + } else { + normalModuleFactory.hooks.module.tap( + "DelegatedModuleFactoryPlugin", + module => { + if (module.libIdent) { + const request = module.libIdent(this.options); + if (request && request in this.options.content) { + const resolved = this.options.content[request]; + return new DelegatedModule( + this.options.source, + resolved, + this.options.type, + request, + module + ); + } + } + return module; } - } - }; - - if (block.blocks) { - iterationOfArrayCallback(block.blocks, block => - this.removeReasonsOfDependencyBlock(module, block) ); } + } +} +module.exports = DelegatedModuleFactoryPlugin; - if (block.dependencies) { - iterationOfArrayCallback(block.dependencies, iteratorDependency); - } - if (block.variables) { - iterationBlockVariable(block.variables, iteratorDependency); - } +/***/ }), + +/***/ 16071: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ + + +const DependenciesBlockVariable = __webpack_require__(82904); + +/** @typedef {import("./ChunkGroup")} ChunkGroup */ +/** @typedef {import("./Dependency")} Dependency */ +/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ +/** @typedef {import("./DependenciesBlockVariable")} DependenciesBlockVariable */ +/** @typedef {(d: Dependency) => boolean} DependencyFilterFunction */ +/** @typedef {import("./util/createHash").Hash} Hash */ + +class DependenciesBlock { + constructor() { + /** @type {Dependency[]} */ + this.dependencies = []; + /** @type {AsyncDependenciesBlock[]} */ + this.blocks = []; + /** @type {DependenciesBlockVariable[]} */ + this.variables = []; } /** - * @param {Module} module module to patch tie - * @param {Chunk} chunk chunk to patch tie + * Adds a DependencyBlock to DependencyBlock relationship. + * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting) + * + * @param {AsyncDependenciesBlock} block block being added * @returns {void} */ - patchChunksAfterReasonRemoval(module, chunk) { - if (!module.hasReasons()) { - this.removeReasonsOfDependencyBlock(module, module); - } - if (!module.hasReasonForChunk(chunk)) { - if (module.removeChunk(chunk)) { - this.removeChunkFromDependencies(module, chunk); - } - } + addBlock(block) { + this.blocks.push(block); + block.parent = this; } /** - * - * @param {DependenciesBlock} block block tie for Chunk - * @param {Chunk} chunk chunk to remove from dep + * @param {string} name name of dependency + * @param {string} expression expression string for variable + * @param {Dependency[]} dependencies dependency instances tied to variable * @returns {void} */ - removeChunkFromDependencies(block, chunk) { - const iteratorDependency = d => { - if (!d.module) { + addVariable(name, expression, dependencies) { + for (let v of this.variables) { + if (v.name === name && v.expression === expression) { return; } - this.patchChunksAfterReasonRemoval(d.module, chunk); - }; - - const blocks = block.blocks; - for (let indexBlock = 0; indexBlock < blocks.length; indexBlock++) { - const asyncBlock = blocks[indexBlock]; - // Grab all chunks from the first Block's AsyncDepBlock - const chunks = asyncBlock.chunkGroup.chunks; - // For each chunk in chunkGroup - for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { - const iteratedChunk = chunks[indexChunk]; - asyncBlock.chunkGroup.removeChunk(iteratedChunk); - asyncBlock.chunkGroup.removeParent(iteratedChunk); - // Recurse - this.removeChunkFromDependencies(block, iteratedChunk); - } } + this.variables.push( + new DependenciesBlockVariable(name, expression, dependencies) + ); + } - if (block.dependencies) { - iterationOfArrayCallback(block.dependencies, iteratorDependency); - } + /** + * @param {Dependency} dependency dependency being tied to block. + * This is an "edge" pointing to another "node" on module graph. + * @returns {void} + */ + addDependency(dependency) { + this.dependencies.push(dependency); + } - if (block.variables) { - iterationBlockVariable(block.variables, iteratorDependency); + /** + * @param {Dependency} dependency dependency being removed + * @returns {void} + */ + removeDependency(dependency) { + const idx = this.dependencies.indexOf(dependency); + if (idx >= 0) { + this.dependencies.splice(idx, 1); } } - applyModuleIds() { - const unusedIds = []; - let nextFreeModuleId = 0; - const usedIds = new Set(); - if (this.usedModuleIds) { - for (const id of this.usedModuleIds) { - usedIds.add(id); - } - } + /** + * @param {Hash} hash the hash used to track dependencies + * @returns {void} + */ + updateHash(hash) { + for (const dep of this.dependencies) dep.updateHash(hash); + for (const block of this.blocks) block.updateHash(hash); + for (const variable of this.variables) variable.updateHash(hash); + } - const modules1 = this.modules; - for (let indexModule1 = 0; indexModule1 < modules1.length; indexModule1++) { - const module1 = modules1[indexModule1]; - if (module1.id !== null) { - usedIds.add(module1.id); - } - } + disconnect() { + for (const dep of this.dependencies) dep.disconnect(); + for (const block of this.blocks) block.disconnect(); + for (const variable of this.variables) variable.disconnect(); + } - if (usedIds.size > 0) { - let usedIdMax = -1; - for (const usedIdKey of usedIds) { - if (typeof usedIdKey !== "number") { - continue; - } + unseal() { + for (const block of this.blocks) block.unseal(); + } - usedIdMax = Math.max(usedIdMax, usedIdKey); + /** + * @param {DependencyFilterFunction} filter filter function for dependencies, gets passed all dependency ties from current instance + * @returns {boolean} returns boolean for filter + */ + hasDependencies(filter) { + if (filter) { + for (const dep of this.dependencies) { + if (filter(dep)) return true; } - - let lengthFreeModules = (nextFreeModuleId = usedIdMax + 1); - - while (lengthFreeModules--) { - if (!usedIds.has(lengthFreeModules)) { - unusedIds.push(lengthFreeModules); - } + } else { + if (this.dependencies.length > 0) { + return true; } } - const modules2 = this.modules; - for (let indexModule2 = 0; indexModule2 < modules2.length; indexModule2++) { - const module2 = modules2[indexModule2]; - if (module2.id === null) { - if (unusedIds.length > 0) { - module2.id = unusedIds.pop(); - } else { - module2.id = nextFreeModuleId++; - } - } + for (const block of this.blocks) { + if (block.hasDependencies(filter)) return true; + } + for (const variable of this.variables) { + if (variable.hasDependencies(filter)) return true; } + return false; } - applyChunkIds() { - /** @type {Set} */ - const usedIds = new Set(); + sortItems() { + for (const block of this.blocks) block.sortItems(); + } +} - // Get used ids from usedChunkIds property (i. e. from records) - if (this.usedChunkIds) { - for (const id of this.usedChunkIds) { - if (typeof id !== "number") { - continue; - } +module.exports = DependenciesBlock; - usedIds.add(id); - } - } - // Get used ids from existing chunks - const chunks = this.chunks; - for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { - const chunk = chunks[indexChunk]; - const usedIdValue = chunk.id; +/***/ }), - if (typeof usedIdValue !== "number") { - continue; - } +/***/ 82904: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - usedIds.add(usedIdValue); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // Calculate maximum assigned chunk id - let nextFreeChunkId = -1; - for (const id of usedIds) { - nextFreeChunkId = Math.max(nextFreeChunkId, id); - } - nextFreeChunkId++; - // Determine free chunk ids from 0 to maximum - /** @type {number[]} */ - const unusedIds = []; - if (nextFreeChunkId > 0) { - let index = nextFreeChunkId; - while (index--) { - if (!usedIds.has(index)) { - unusedIds.push(index); - } - } +const { RawSource, ReplaceSource } = __webpack_require__(53665); + +/** @typedef {import("./Dependency")} Dependency */ +/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate */ +/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("./util/createHash").Hash} Hash */ +/** @typedef {(d: Dependency) => boolean} DependencyFilterFunction */ +/** @typedef {Map} DependencyTemplates */ + +class DependenciesBlockVariable { + /** + * Creates an instance of DependenciesBlockVariable. + * @param {string} name name of DependenciesBlockVariable + * @param {string} expression expression string + * @param {Dependency[]=} dependencies dependencies tied to this varaiable + */ + constructor(name, expression, dependencies) { + this.name = name; + this.expression = expression; + this.dependencies = dependencies || []; + } + + /** + * @param {Hash} hash hash for instance to update + * @returns {void} + */ + updateHash(hash) { + hash.update(this.name); + hash.update(this.expression); + for (const d of this.dependencies) { + d.updateHash(hash); } + } - // Assign ids to chunk which has no id - for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { - const chunk = chunks[indexChunk]; - if (chunk.id === null) { - if (unusedIds.length > 0) { - chunk.id = unusedIds.pop(); - } else { - chunk.id = nextFreeChunkId++; - } - } - if (!chunk.ids) { - chunk.ids = [chunk.id]; + /** + * @param {DependencyTemplates} dependencyTemplates Dependency constructors and templates Map. + * @param {RuntimeTemplate} runtimeTemplate runtimeTemplate to generate expression souce + * @returns {ReplaceSource} returns constructed source for expression via templates + */ + expressionSource(dependencyTemplates, runtimeTemplate) { + const source = new ReplaceSource(new RawSource(this.expression)); + for (const dep of this.dependencies) { + const template = dependencyTemplates.get(dep.constructor); + if (!template) { + throw new Error(`No template for dependency: ${dep.constructor.name}`); } + template.apply(dep, source, runtimeTemplate, dependencyTemplates); } + return source; } - sortItemsWithModuleIds() { - this.modules.sort(byIdOrIdentifier); - - const modules = this.modules; - for (let indexModule = 0; indexModule < modules.length; indexModule++) { - modules[indexModule].sortItems(false); + disconnect() { + for (const d of this.dependencies) { + d.disconnect(); } + } - const chunks = this.chunks; - for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { - chunks[indexChunk].sortItems(); + hasDependencies(filter) { + if (filter) { + return this.dependencies.some(filter); } - - chunks.sort((a, b) => a.compareTo(b)); + return this.dependencies.length > 0; } +} - sortItemsWithChunkIds() { - for (const chunkGroup of this.chunkGroups) { - chunkGroup.sortItems(); - } +module.exports = DependenciesBlockVariable; - this.chunks.sort(byId); - for ( - let indexModule = 0; - indexModule < this.modules.length; - indexModule++ - ) { - this.modules[indexModule].sortItems(true); - } +/***/ }), - const chunks = this.chunks; - for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { - chunks[indexChunk].sortItems(); - } +/***/ 57282: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - /** - * Used to sort errors and warnings in compilation. this.warnings, and - * this.errors contribute to the compilation hash and therefore should be - * updated whenever other references (having a chunk id) are sorted. This preserves the hash - * integrity - * - * @param {WebpackError} a first WebpackError instance (including subclasses) - * @param {WebpackError} b second WebpackError instance (including subclasses) - * @returns {-1|0|1} sort order index - */ - const byMessage = (a, b) => { - const ma = `${a.message}`; - const mb = `${b.message}`; - if (ma < mb) return -1; - if (mb < ma) return 1; - return 0; - }; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - this.errors.sort(byMessage); - this.warnings.sort(byMessage); - this.children.sort(byNameOrHash); - } - summarizeDependencies() { - this.fileDependencies = new SortableSet(this.compilationDependencies); - this.contextDependencies = new SortableSet(); - this.missingDependencies = new SortableSet(); +const util = __webpack_require__(31669); +const compareLocations = __webpack_require__(22562); +const DependencyReference = __webpack_require__(71722); - for ( - let indexChildren = 0; - indexChildren < this.children.length; - indexChildren++ - ) { - const child = this.children[indexChildren]; +/** @typedef {import("./Module")} Module */ +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ - addAllToSet(this.fileDependencies, child.fileDependencies); - addAllToSet(this.contextDependencies, child.contextDependencies); - addAllToSet(this.missingDependencies, child.missingDependencies); - } +/** + * @typedef {Object} DependencyTemplate + * @property {function(Dependency, Source, RuntimeTemplate, Map): void} apply + */ - for ( - let indexModule = 0; - indexModule < this.modules.length; - indexModule++ - ) { - const module = this.modules[indexModule]; +/** @typedef {Object} SourcePosition + * @property {number} line + * @property {number=} column + */ - if (module.buildInfo.fileDependencies) { - addAllToSet(this.fileDependencies, module.buildInfo.fileDependencies); - } - if (module.buildInfo.contextDependencies) { - addAllToSet( - this.contextDependencies, - module.buildInfo.contextDependencies - ); - } - } - for (const error of this.errors) { - if ( - typeof error.missing === "object" && - error.missing && - error.missing[Symbol.iterator] - ) { - addAllToSet(this.missingDependencies, error.missing); - } - } - this.fileDependencies.sort(); - this.contextDependencies.sort(); - this.missingDependencies.sort(); +/** @typedef {Object} RealDependencyLocation + * @property {SourcePosition} start + * @property {SourcePosition=} end + * @property {number=} index + */ + +/** @typedef {Object} SynteticDependencyLocation + * @property {string} name + * @property {number=} index + */ + +/** @typedef {SynteticDependencyLocation|RealDependencyLocation} DependencyLocation */ + +class Dependency { + constructor() { + /** @type {Module|null} */ + this.module = null; + // TODO remove in webpack 5 + /** @type {boolean} */ + this.weak = false; + /** @type {boolean} */ + this.optional = false; + /** @type {DependencyLocation} */ + this.loc = undefined; } - createHash() { - const outputOptions = this.outputOptions; - const hashFunction = outputOptions.hashFunction; - const hashDigest = outputOptions.hashDigest; - const hashDigestLength = outputOptions.hashDigestLength; - const hash = createHash(hashFunction); - if (outputOptions.hashSalt) { - hash.update(outputOptions.hashSalt); - } - this.mainTemplate.updateHash(hash); - this.chunkTemplate.updateHash(hash); - for (const key of Object.keys(this.moduleTemplates).sort()) { - this.moduleTemplates[key].updateHash(hash); - } - for (const child of this.children) { - hash.update(child.hash); - } - for (const warning of this.warnings) { - hash.update(`${warning.message}`); - } - for (const error of this.errors) { - hash.update(`${error.message}`); - } - const modules = this.modules; - for (let i = 0; i < modules.length; i++) { - const module = modules[i]; - const moduleHash = createHash(hashFunction); - module.updateHash(moduleHash); - module.hash = /** @type {string} */ (moduleHash.digest(hashDigest)); - module.renderedHash = module.hash.substr(0, hashDigestLength); - } - // clone needed as sort below is inplace mutation - const chunks = this.chunks.slice(); - /** - * sort here will bring all "falsy" values to the beginning - * this is needed as the "hasRuntime()" chunks are dependent on the - * hashes of the non-runtime chunks. - */ - chunks.sort((a, b) => { - const aEntry = a.hasRuntime(); - const bEntry = b.hasRuntime(); - if (aEntry && !bEntry) return 1; - if (!aEntry && bEntry) return -1; - return byId(a, b); - }); - for (let i = 0; i < chunks.length; i++) { - const chunk = chunks[i]; - const chunkHash = createHash(hashFunction); - try { - if (outputOptions.hashSalt) { - chunkHash.update(outputOptions.hashSalt); - } - chunk.updateHash(chunkHash); - const template = chunk.hasRuntime() - ? this.mainTemplate - : this.chunkTemplate; - template.updateHashForChunk( - chunkHash, - chunk, - this.moduleTemplates.javascript, - this.dependencyTemplates - ); - this.hooks.chunkHash.call(chunk, chunkHash); - chunk.hash = /** @type {string} */ (chunkHash.digest(hashDigest)); - hash.update(chunk.hash); - chunk.renderedHash = chunk.hash.substr(0, hashDigestLength); - this.hooks.contentHash.call(chunk); - } catch (err) { - this.errors.push(new ChunkRenderError(chunk, "", err)); - } - } - this.fullHash = /** @type {string} */ (hash.digest(hashDigest)); - this.hash = this.fullHash.substr(0, hashDigestLength); + getResourceIdentifier() { + return null; } - /** - * @param {string} update extra information - * @returns {void} - */ - modifyHash(update) { - const outputOptions = this.outputOptions; - const hashFunction = outputOptions.hashFunction; - const hashDigest = outputOptions.hashDigest; - const hashDigestLength = outputOptions.hashDigestLength; - const hash = createHash(hashFunction); - hash.update(this.fullHash); - hash.update(update); - this.fullHash = /** @type {string} */ (hash.digest(hashDigest)); - this.hash = this.fullHash.substr(0, hashDigestLength); + // Returns the referenced module and export + getReference() { + if (!this.module) return null; + return new DependencyReference(this.module, true, this.weak); } - /** - * @param {string} file file name - * @param {Source} source asset source - * @param {AssetInfo} assetInfo extra asset information - * @returns {void} - */ - emitAsset(file, source, assetInfo = {}) { - if (this.assets[file]) { - if (!isSourceEqual(this.assets[file], source)) { - // TODO webpack 5: make this an error instead - this.warnings.push( - new WebpackError( - `Conflict: Multiple assets emit different content to the same filename ${file}` - ) - ); - this.assets[file] = source; - this.assetsInfo.set(file, assetInfo); - return; - } - const oldInfo = this.assetsInfo.get(file); - this.assetsInfo.set(file, Object.assign({}, oldInfo, assetInfo)); - return; - } - this.assets[file] = source; - this.assetsInfo.set(file, assetInfo); + // Returns the exported names + getExports() { + return null; } - /** - * @param {string} file file name - * @param {Source | function(Source): Source} newSourceOrFunction new asset source or function converting old to new - * @param {AssetInfo | function(AssetInfo | undefined): AssetInfo} assetInfoUpdateOrFunction new asset info or function converting old to new - */ - updateAsset( - file, - newSourceOrFunction, - assetInfoUpdateOrFunction = undefined - ) { - if (!this.assets[file]) { - throw new Error( - `Called Compilation.updateAsset for not existing filename ${file}` - ); - } - if (typeof newSourceOrFunction === "function") { - this.assets[file] = newSourceOrFunction(this.assets[file]); - } else { - this.assets[file] = newSourceOrFunction; - } - if (assetInfoUpdateOrFunction !== undefined) { - const oldInfo = this.assetsInfo.get(file); - if (typeof assetInfoUpdateOrFunction === "function") { - this.assetsInfo.set(file, assetInfoUpdateOrFunction(oldInfo || {})); - } else { - this.assetsInfo.set( - file, - Object.assign({}, oldInfo, assetInfoUpdateOrFunction) - ); - } - } + getWarnings() { + return null; } - getAssets() { - /** @type {Asset[]} */ - const array = []; - for (const assetName of Object.keys(this.assets)) { - if (Object.prototype.hasOwnProperty.call(this.assets, assetName)) { - array.push({ - name: assetName, - source: this.assets[assetName], - info: this.assetsInfo.get(assetName) || {} - }); - } - } - return array; + getErrors() { + return null; } - /** - * @param {string} name the name of the asset - * @returns {Asset | undefined} the asset or undefined when not found - */ - getAsset(name) { - if (!Object.prototype.hasOwnProperty.call(this.assets, name)) - return undefined; - return { - name, - source: this.assets[name], - info: this.assetsInfo.get(name) || {} - }; + updateHash(hash) { + hash.update((this.module && this.module.id) + ""); } - createModuleAssets() { - for (let i = 0; i < this.modules.length; i++) { - const module = this.modules[i]; - if (module.buildInfo.assets) { - const assetsInfo = module.buildInfo.assetsInfo; - for (const assetName of Object.keys(module.buildInfo.assets)) { - const fileName = this.getPath(assetName); - this.emitAsset( - fileName, - module.buildInfo.assets[assetName], - assetsInfo ? assetsInfo.get(assetName) : undefined - ); - this.hooks.moduleAsset.call(module, fileName); - } - } - } + disconnect() { + this.module = null; } +} - createChunkAssets() { - const outputOptions = this.outputOptions; - const cachedSourceMap = new Map(); - /** @type {Map} */ - const alreadyWrittenFiles = new Map(); - for (let i = 0; i < this.chunks.length; i++) { - const chunk = this.chunks[i]; - chunk.files = []; - let source; - let file; - let filenameTemplate; - try { - const template = chunk.hasRuntime() - ? this.mainTemplate - : this.chunkTemplate; - const manifest = template.getRenderManifest({ - chunk, - hash: this.hash, - fullHash: this.fullHash, - outputOptions, - moduleTemplates: this.moduleTemplates, - dependencyTemplates: this.dependencyTemplates - }); // [{ render(), filenameTemplate, pathOptions, identifier, hash }] - for (const fileManifest of manifest) { - const cacheName = fileManifest.identifier; - const usedHash = fileManifest.hash; - filenameTemplate = fileManifest.filenameTemplate; - const pathAndInfo = this.getPathWithInfo( - filenameTemplate, - fileManifest.pathOptions - ); - file = pathAndInfo.path; - const assetInfo = pathAndInfo.info; +// TODO remove in webpack 5 +Dependency.compare = util.deprecate( + (a, b) => compareLocations(a.loc, b.loc), + "Dependency.compare is deprecated and will be removed in the next major version" +); - // check if the same filename was already written by another chunk - const alreadyWritten = alreadyWrittenFiles.get(file); - if (alreadyWritten !== undefined) { - if (alreadyWritten.hash === usedHash) { - if (this.cache) { - this.cache[cacheName] = { - hash: usedHash, - source: alreadyWritten.source - }; - } - chunk.files.push(file); - this.hooks.chunkAsset.call(chunk, file); - continue; - } else { - throw new Error( - `Conflict: Multiple chunks emit assets to the same filename ${file}` + - ` (chunks ${alreadyWritten.chunk.id} and ${chunk.id})` - ); - } - } - if ( - this.cache && - this.cache[cacheName] && - this.cache[cacheName].hash === usedHash - ) { - source = this.cache[cacheName].source; - } else { - source = fileManifest.render(); - // Ensure that source is a cached source to avoid additional cost because of repeated access - if (!(source instanceof CachedSource)) { - const cacheEntry = cachedSourceMap.get(source); - if (cacheEntry) { - source = cacheEntry; - } else { - const cachedSource = new CachedSource(source); - cachedSourceMap.set(source, cachedSource); - source = cachedSource; - } - } - if (this.cache) { - this.cache[cacheName] = { - hash: usedHash, - source - }; - } - } - this.emitAsset(file, source, assetInfo); - chunk.files.push(file); - this.hooks.chunkAsset.call(chunk, file); - alreadyWrittenFiles.set(file, { - hash: usedHash, - source, - chunk - }); - } - } catch (err) { - this.errors.push( - new ChunkRenderError(chunk, file || filenameTemplate, err) - ); - } - } - } +module.exports = Dependency; - /** - * @param {string} filename used to get asset path with hash - * @param {TODO=} data // TODO: figure out this param type - * @returns {string} interpolated path - */ - getPath(filename, data) { - data = data || {}; - data.hash = data.hash || this.hash; - return this.mainTemplate.getAssetPath(filename, data); - } - /** - * @param {string} filename used to get asset path with hash - * @param {TODO=} data // TODO: figure out this param type - * @returns {{ path: string, info: AssetInfo }} interpolated path and asset info - */ - getPathWithInfo(filename, data) { - data = data || {}; - data.hash = data.hash || this.hash; - return this.mainTemplate.getAssetPathWithInfo(filename, data); - } +/***/ }), - /** - * This function allows you to run another instance of webpack inside of webpack however as - * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins - * from parent (or top level compiler) and creates a child Compilation - * - * @param {string} name name of the child compiler - * @param {TODO} outputOptions // Need to convert config schema to types for this - * @param {Plugin[]} plugins webpack plugins that will be applied - * @returns {Compiler} creates a child Compiler instance - */ - createChildCompiler(name, outputOptions, plugins) { - const idx = this.childrenCounters[name] || 0; - this.childrenCounters[name] = idx + 1; - return this.compiler.createChildCompiler( - this, - name, - idx, - outputOptions, - plugins - ); - } +/***/ 6659: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - checkConstraints() { - /** @type {Set} */ - const usedIds = new Set(); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - const modules = this.modules; - for (let indexModule = 0; indexModule < modules.length; indexModule++) { - const moduleId = modules[indexModule].id; - if (moduleId === null) continue; - if (usedIds.has(moduleId)) { - throw new Error(`checkConstraints: duplicate module id ${moduleId}`); - } - usedIds.add(moduleId); - } - const chunks = this.chunks; - for (let indexChunk = 0; indexChunk < chunks.length; indexChunk++) { - const chunk = chunks[indexChunk]; - if (chunks.indexOf(chunk) !== indexChunk) { - throw new Error( - `checkConstraints: duplicate chunk in compilation ${chunk.debugId}` +const DllEntryDependency = __webpack_require__(66279); +const SingleEntryDependency = __webpack_require__(84828); +const DllModuleFactory = __webpack_require__(62468); + +class DllEntryPlugin { + constructor(context, entries, name) { + this.context = context; + this.entries = entries; + this.name = name; + } + + apply(compiler) { + compiler.hooks.compilation.tap( + "DllEntryPlugin", + (compilation, { normalModuleFactory }) => { + const dllModuleFactory = new DllModuleFactory(); + compilation.dependencyFactories.set( + DllEntryDependency, + dllModuleFactory + ); + compilation.dependencyFactories.set( + SingleEntryDependency, + normalModuleFactory ); } - } - - for (const chunkGroup of this.chunkGroups) { - chunkGroup.checkConstraints(); - } + ); + compiler.hooks.make.tapAsync("DllEntryPlugin", (compilation, callback) => { + compilation.addEntry( + this.context, + new DllEntryDependency( + this.entries.map((e, idx) => { + const dep = new SingleEntryDependency(e); + dep.loc = { + name: this.name, + index: idx + }; + return dep; + }), + this.name + ), + this.name, + callback + ); + }); } } -// TODO remove in webpack 5 -Compilation.prototype.applyPlugins = util.deprecate( - /** - * @deprecated - * @param {string} name Name - * @param {any[]} args Other arguments - * @returns {void} - * @this {Compilation} - */ - function(name, ...args) { - this.hooks[ - name.replace(/[- ]([a-z])/g, match => match[1].toUpperCase()) - ].call(...args); - }, - "Compilation.applyPlugins is deprecated. Use new API on `.hooks` instead" -); - -// TODO remove in webpack 5 -Object.defineProperty(Compilation.prototype, "moduleTemplate", { - configurable: false, - get: util.deprecate( - /** - * @deprecated - * @this {Compilation} - * @returns {TODO} module template - */ - function() { - return this.moduleTemplates.javascript; - }, - "Compilation.moduleTemplate: Use Compilation.moduleTemplates.javascript instead" - ), - set: util.deprecate( - /** - * @deprecated - * @param {ModuleTemplate} value Template value - * @this {Compilation} - * @returns {void} - */ - function(value) { - this.moduleTemplates.javascript = value; - }, - "Compilation.moduleTemplate: Use Compilation.moduleTemplates.javascript instead." - ) -}); - -module.exports = Compilation; +module.exports = DllEntryPlugin; /***/ }), -/***/ 58705: +/***/ 24803: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra -*/ + */ -const parseJson = __webpack_require__(48335); -const asyncLib = __webpack_require__(36386); -const path = __webpack_require__(85622); -const { Source } = __webpack_require__(53665); -const util = __webpack_require__(31669); -const { - Tapable, - SyncHook, - SyncBailHook, - AsyncParallelHook, - AsyncSeriesHook -} = __webpack_require__(92402); +const { RawSource } = __webpack_require__(53665); +const Module = __webpack_require__(75993); -const Compilation = __webpack_require__(34968); -const Stats = __webpack_require__(99977); -const Watching = __webpack_require__(29580); -const NormalModuleFactory = __webpack_require__(22298); -const ContextModuleFactory = __webpack_require__(88239); -const ResolverFactory = __webpack_require__(50588); +/** @typedef {import("./util/createHash").Hash} Hash */ -const RequestShortener = __webpack_require__(54254); -const { makePathsRelative } = __webpack_require__(94658); -const ConcurrentCompilationError = __webpack_require__(18933); -const { Logger } = __webpack_require__(47194); +class DllModule extends Module { + constructor(context, dependencies, name, type) { + super("javascript/dynamic", context); -/** @typedef {import("../declarations/WebpackOptions").Entry} Entry */ -/** @typedef {import("../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ + // Info from Factory + this.dependencies = dependencies; + this.name = name; + this.type = type; + } -/** - * @typedef {Object} CompilationParams - * @property {NormalModuleFactory} normalModuleFactory - * @property {ContextModuleFactory} contextModuleFactory - * @property {Set} compilationDependencies - */ + identifier() { + return `dll ${this.name}`; + } -class Compiler extends Tapable { - constructor(context) { - super(); - this.hooks = { - /** @type {SyncBailHook} */ - shouldEmit: new SyncBailHook(["compilation"]), - /** @type {AsyncSeriesHook} */ - done: new AsyncSeriesHook(["stats"]), - /** @type {AsyncSeriesHook<>} */ - additionalPass: new AsyncSeriesHook([]), - /** @type {AsyncSeriesHook} */ - beforeRun: new AsyncSeriesHook(["compiler"]), - /** @type {AsyncSeriesHook} */ - run: new AsyncSeriesHook(["compiler"]), - /** @type {AsyncSeriesHook} */ - emit: new AsyncSeriesHook(["compilation"]), - /** @type {AsyncSeriesHook} */ - assetEmitted: new AsyncSeriesHook(["file", "content"]), - /** @type {AsyncSeriesHook} */ - afterEmit: new AsyncSeriesHook(["compilation"]), + readableIdentifier() { + return `dll ${this.name}`; + } - /** @type {SyncHook} */ - thisCompilation: new SyncHook(["compilation", "params"]), - /** @type {SyncHook} */ - compilation: new SyncHook(["compilation", "params"]), - /** @type {SyncHook} */ - normalModuleFactory: new SyncHook(["normalModuleFactory"]), - /** @type {SyncHook} */ - contextModuleFactory: new SyncHook(["contextModulefactory"]), + build(options, compilation, resolver, fs, callback) { + this.built = true; + this.buildMeta = {}; + this.buildInfo = {}; + return callback(); + } - /** @type {AsyncSeriesHook} */ - beforeCompile: new AsyncSeriesHook(["params"]), - /** @type {SyncHook} */ - compile: new SyncHook(["params"]), - /** @type {AsyncParallelHook} */ - make: new AsyncParallelHook(["compilation"]), - /** @type {AsyncSeriesHook} */ - afterCompile: new AsyncSeriesHook(["compilation"]), + source() { + return new RawSource("module.exports = __webpack_require__;"); + } - /** @type {AsyncSeriesHook} */ - watchRun: new AsyncSeriesHook(["compiler"]), - /** @type {SyncHook} */ - failed: new SyncHook(["error"]), - /** @type {SyncHook} */ - invalid: new SyncHook(["filename", "changeTime"]), - /** @type {SyncHook} */ - watchClose: new SyncHook([]), + needRebuild() { + return false; + } - /** @type {SyncBailHook} */ - infrastructureLog: new SyncBailHook(["origin", "type", "args"]), + size() { + return 12; + } - // TODO the following hooks are weirdly located here - // TODO move them for webpack 5 - /** @type {SyncHook} */ - environment: new SyncHook([]), - /** @type {SyncHook} */ - afterEnvironment: new SyncHook([]), - /** @type {SyncHook} */ - afterPlugins: new SyncHook(["compiler"]), - /** @type {SyncHook} */ - afterResolvers: new SyncHook(["compiler"]), - /** @type {SyncBailHook} */ - entryOption: new SyncBailHook(["context", "entry"]) - }; - // TODO webpack 5 remove this - this.hooks.infrastructurelog = this.hooks.infrastructureLog; + /** + * @param {Hash} hash the hash used to track dependencies + * @returns {void} + */ + updateHash(hash) { + hash.update("dll module"); + hash.update(this.name || ""); + super.updateHash(hash); + } +} - this._pluginCompat.tap("Compiler", options => { - switch (options.name) { - case "additional-pass": - case "before-run": - case "run": - case "emit": - case "after-emit": - case "before-compile": - case "make": - case "after-compile": - case "watch-run": - options.async = true; - break; - } - }); +module.exports = DllModule; - /** @type {string=} */ - this.name = undefined; - /** @type {Compilation=} */ - this.parentCompilation = undefined; - /** @type {string} */ - this.outputPath = ""; - this.outputFileSystem = null; - this.inputFileSystem = null; +/***/ }), - /** @type {string|null} */ - this.recordsInputPath = null; - /** @type {string|null} */ - this.recordsOutputPath = null; - this.records = {}; - this.removedFiles = new Set(); - /** @type {Map} */ - this.fileTimestamps = new Map(); - /** @type {Map} */ - this.contextTimestamps = new Map(); - /** @type {ResolverFactory} */ - this.resolverFactory = new ResolverFactory(); +/***/ 62468: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - this.infrastructureLogger = undefined; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // TODO remove in webpack 5 - this.resolvers = { - normal: { - plugins: util.deprecate((hook, fn) => { - this.resolverFactory.plugin("resolver normal", resolver => { - resolver.plugin(hook, fn); - }); - }, "webpack: Using compiler.resolvers.normal is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver normal", resolver => {\n resolver.plugin(/* … */);\n}); instead.'), - apply: util.deprecate((...args) => { - this.resolverFactory.plugin("resolver normal", resolver => { - resolver.apply(...args); - }); - }, "webpack: Using compiler.resolvers.normal is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver normal", resolver => {\n resolver.apply(/* … */);\n}); instead.') - }, - loader: { - plugins: util.deprecate((hook, fn) => { - this.resolverFactory.plugin("resolver loader", resolver => { - resolver.plugin(hook, fn); - }); - }, "webpack: Using compiler.resolvers.loader is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver loader", resolver => {\n resolver.plugin(/* … */);\n}); instead.'), - apply: util.deprecate((...args) => { - this.resolverFactory.plugin("resolver loader", resolver => { - resolver.apply(...args); - }); - }, "webpack: Using compiler.resolvers.loader is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver loader", resolver => {\n resolver.apply(/* … */);\n}); instead.') - }, - context: { - plugins: util.deprecate((hook, fn) => { - this.resolverFactory.plugin("resolver context", resolver => { - resolver.plugin(hook, fn); - }); - }, "webpack: Using compiler.resolvers.context is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver context", resolver => {\n resolver.plugin(/* … */);\n}); instead.'), - apply: util.deprecate((...args) => { - this.resolverFactory.plugin("resolver context", resolver => { - resolver.apply(...args); - }); - }, "webpack: Using compiler.resolvers.context is deprecated.\n" + 'Use compiler.resolverFactory.plugin("resolver context", resolver => {\n resolver.apply(/* … */);\n}); instead.') - } - }; - /** @type {WebpackOptions} */ - this.options = /** @type {WebpackOptions} */ ({}); +const { Tapable } = __webpack_require__(92402); +const DllModule = __webpack_require__(24803); - this.context = context; +class DllModuleFactory extends Tapable { + constructor() { + super(); + this.hooks = {}; + } + create(data, callback) { + const dependency = data.dependencies[0]; + callback( + null, + new DllModule( + data.context, + dependency.dependencies, + dependency.name, + dependency.type + ) + ); + } +} - this.requestShortener = new RequestShortener(context); +module.exports = DllModuleFactory; - /** @type {boolean} */ - this.running = false; - /** @type {boolean} */ - this.watchMode = false; +/***/ }), - /** @private @type {WeakMap }>} */ - this._assetEmittingSourceCache = new WeakMap(); - /** @private @type {Map} */ - this._assetEmittingWrittenFiles = new Map(); - } +/***/ 45255: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ + + +const DllEntryPlugin = __webpack_require__(6659); +const FlagAllModulesAsUsedPlugin = __webpack_require__(47163); +const LibManifestPlugin = __webpack_require__(30735); + +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(7303); + +/** @typedef {import("../declarations/plugins/DllPlugin").DllPluginOptions} DllPluginOptions */ +class DllPlugin { /** - * @param {string | (function(): string)} name name of the logger, or function called once to get the logger name - * @returns {Logger} a logger with that name + * @param {DllPluginOptions} options options object */ - getInfrastructureLogger(name) { - if (!name) { - throw new TypeError( - "Compiler.getInfrastructureLogger(name) called without a name" - ); - } - return new Logger((type, args) => { - if (typeof name === "function") { - name = name(); - if (!name) { - throw new TypeError( - "Compiler.getInfrastructureLogger(name) called with a function not returning a name" - ); - } - } - if (this.hooks.infrastructureLog.call(name, type, args) === undefined) { - if (this.infrastructureLogger !== undefined) { - this.infrastructureLogger(name, type, args); + constructor(options) { + validateOptions(schema, options, "Dll Plugin"); + this.options = options; + } + + apply(compiler) { + compiler.hooks.entryOption.tap("DllPlugin", (context, entry) => { + const itemToPlugin = (item, name) => { + if (Array.isArray(item)) { + return new DllEntryPlugin(context, item, name); } + throw new Error("DllPlugin: supply an Array as entry"); + }; + if (typeof entry === "object" && !Array.isArray(entry)) { + Object.keys(entry).forEach(name => { + itemToPlugin(entry[name], name).apply(compiler); + }); + } else { + itemToPlugin(entry, "main").apply(compiler); } + return true; }); + new LibManifestPlugin(this.options).apply(compiler); + if (!this.options.entryOnly) { + new FlagAllModulesAsUsedPlugin("DllPlugin").apply(compiler); + } } +} - watch(watchOptions, handler) { - if (this.running) return handler(new ConcurrentCompilationError()); - - this.running = true; - this.watchMode = true; - this.fileTimestamps = new Map(); - this.contextTimestamps = new Map(); - this.removedFiles = new Set(); - return new Watching(this, watchOptions, handler); - } - - run(callback) { - if (this.running) return callback(new ConcurrentCompilationError()); +module.exports = DllPlugin; - const finalCallback = (err, stats) => { - this.running = false; - if (err) { - this.hooks.failed.call(err); - } +/***/ }), - if (callback !== undefined) return callback(err, stats); - }; +/***/ 86231: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - const startTime = Date.now(); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - this.running = true; - const onCompiled = (err, compilation) => { - if (err) return finalCallback(err); +const parseJson = __webpack_require__(48335); +const DelegatedSourceDependency = __webpack_require__(25930); +const DelegatedModuleFactoryPlugin = __webpack_require__(81002); +const ExternalModuleFactoryPlugin = __webpack_require__(67876); +const DelegatedExportsDependency = __webpack_require__(53104); +const NullFactory = __webpack_require__(40438); +const makePathsRelative = __webpack_require__(94658).makePathsRelative; +const WebpackError = __webpack_require__(97391); - if (this.hooks.shouldEmit.call(compilation) === false) { - const stats = new Stats(compilation); - stats.startTime = startTime; - stats.endTime = Date.now(); - this.hooks.done.callAsync(stats, err => { - if (err) return finalCallback(err); - return finalCallback(null, stats); - }); - return; - } +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(61112); - this.emitAssets(compilation, err => { - if (err) return finalCallback(err); +/** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptions} DllReferencePluginOptions */ +/** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptionsManifest} DllReferencePluginOptionsManifest */ - if (compilation.hooks.needAdditionalPass.call()) { - compilation.needAdditionalPass = true; +class DllReferencePlugin { + /** + * @param {DllReferencePluginOptions} options options object + */ + constructor(options) { + validateOptions(schema, options, "Dll Reference Plugin"); + this.options = options; + } - const stats = new Stats(compilation); - stats.startTime = startTime; - stats.endTime = Date.now(); - this.hooks.done.callAsync(stats, err => { - if (err) return finalCallback(err); + apply(compiler) { + compiler.hooks.compilation.tap( + "DllReferencePlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set( + DelegatedSourceDependency, + normalModuleFactory + ); + compilation.dependencyFactories.set( + DelegatedExportsDependency, + new NullFactory() + ); + } + ); - this.hooks.additionalPass.callAsync(err => { - if (err) return finalCallback(err); - this.compile(onCompiled); + compiler.hooks.beforeCompile.tapAsync( + "DllReferencePlugin", + (params, callback) => { + if ("manifest" in this.options) { + const manifest = this.options.manifest; + if (typeof manifest === "string") { + params.compilationDependencies.add(manifest); + compiler.inputFileSystem.readFile(manifest, (err, result) => { + if (err) return callback(err); + // Catch errors parsing the manifest so that blank + // or malformed manifest files don't kill the process. + try { + params["dll reference " + manifest] = parseJson( + result.toString("utf-8") + ); + } catch (e) { + // Store the error in the params so that it can + // be added as a compilation error later on. + const manifestPath = makePathsRelative( + compiler.options.context, + manifest + ); + params[ + "dll reference parse error " + manifest + ] = new DllManifestError(manifestPath, e.message); + } + return callback(); }); - }); - return; + return; + } } + return callback(); + } + ); - this.emitRecords(err => { - if (err) return finalCallback(err); - - const stats = new Stats(compilation); - stats.startTime = startTime; - stats.endTime = Date.now(); - this.hooks.done.callAsync(stats, err => { - if (err) return finalCallback(err); - return finalCallback(null, stats); - }); - }); - }); - }; + compiler.hooks.compile.tap("DllReferencePlugin", params => { + let name = this.options.name; + let sourceType = this.options.sourceType; + let content = + "content" in this.options ? this.options.content : undefined; + if ("manifest" in this.options) { + let manifestParameter = this.options.manifest; + let manifest; + if (typeof manifestParameter === "string") { + // If there was an error parsing the manifest + // file, exit now because the error will be added + // as a compilation error in the "compilation" hook. + if (params["dll reference parse error " + manifestParameter]) { + return; + } + manifest = + /** @type {DllReferencePluginOptionsManifest} */ (params[ + "dll reference " + manifestParameter + ]); + } else { + manifest = manifestParameter; + } + if (manifest) { + if (!name) name = manifest.name; + if (!sourceType) sourceType = manifest.type; + if (!content) content = manifest.content; + } + } + const externals = {}; + const source = "dll-reference " + name; + externals[source] = name; + const normalModuleFactory = params.normalModuleFactory; + new ExternalModuleFactoryPlugin(sourceType || "var", externals).apply( + normalModuleFactory + ); + new DelegatedModuleFactoryPlugin({ + source: source, + type: this.options.type, + scope: this.options.scope, + context: this.options.context || compiler.options.context, + content, + extensions: this.options.extensions + }).apply(normalModuleFactory); + }); - this.hooks.beforeRun.callAsync(this, err => { - if (err) return finalCallback(err); + compiler.hooks.compilation.tap( + "DllReferencePlugin", + (compilation, params) => { + if ("manifest" in this.options) { + let manifest = this.options.manifest; + if (typeof manifest === "string") { + // If there was an error parsing the manifest file, add the + // error as a compilation error to make the compilation fail. + let e = params["dll reference parse error " + manifest]; + if (e) { + compilation.errors.push(e); + } + } + } + } + ); + } +} - this.hooks.run.callAsync(this, err => { - if (err) return finalCallback(err); +class DllManifestError extends WebpackError { + constructor(filename, message) { + super(); - this.readRecords(err => { - if (err) return finalCallback(err); + this.name = "DllManifestError"; + this.message = `Dll manifest ${filename}\n${message}`; - this.compile(onCompiled); - }); - }); - }); + Error.captureStackTrace(this, this.constructor); } +} - runAsChild(callback) { - this.compile((err, compilation) => { - if (err) return callback(err); - - this.parentCompilation.children.push(compilation); - for (const { name, source, info } of compilation.getAssets()) { - this.parentCompilation.emitAsset(name, source, info); - } +module.exports = DllReferencePlugin; - const entries = Array.from( - compilation.entrypoints.values(), - ep => ep.chunks - ).reduce((array, chunks) => { - return array.concat(chunks); - }, []); - return callback(null, entries, compilation); - }); - } +/***/ }), - purgeInputFileSystem() { - if (this.inputFileSystem && this.inputFileSystem.purge) { - this.inputFileSystem.purge(); - } - } +/***/ 49784: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - emitAssets(compilation, callback) { - let outputPath; - const emitFiles = err => { - if (err) return callback(err); - - asyncLib.forEachLimit( - compilation.getAssets(), - 15, - ({ name: file, source }, callback) => { - let targetFile = file; - const queryStringIdx = targetFile.indexOf("?"); - if (queryStringIdx >= 0) { - targetFile = targetFile.substr(0, queryStringIdx); - } - - const writeOut = err => { - if (err) return callback(err); - const targetPath = this.outputFileSystem.join( - outputPath, - targetFile - ); - // TODO webpack 5 remove futureEmitAssets option and make it on by default - if (this.options.output.futureEmitAssets) { - // check if the target file has already been written by this Compiler - const targetFileGeneration = this._assetEmittingWrittenFiles.get( - targetPath - ); - - // create an cache entry for this Source if not already existing - let cacheEntry = this._assetEmittingSourceCache.get(source); - if (cacheEntry === undefined) { - cacheEntry = { - sizeOnlySource: undefined, - writtenTo: new Map() - }; - this._assetEmittingSourceCache.set(source, cacheEntry); - } - - // if the target file has already been written - if (targetFileGeneration !== undefined) { - // check if the Source has been written to this target file - const writtenGeneration = cacheEntry.writtenTo.get(targetPath); - if (writtenGeneration === targetFileGeneration) { - // if yes, we skip writing the file - // as it's already there - // (we assume one doesn't remove files while the Compiler is running) - - compilation.updateAsset(file, cacheEntry.sizeOnlySource, { - size: cacheEntry.sizeOnlySource.size() - }); - - return callback(); - } - } - - // TODO webpack 5: if info.immutable check if file already exists in output - // skip emitting if it's already there - - // get the binary (Buffer) content from the Source - /** @type {Buffer} */ - let content; - if (typeof source.buffer === "function") { - content = source.buffer(); - } else { - const bufferOrString = source.source(); - if (Buffer.isBuffer(bufferOrString)) { - content = bufferOrString; - } else { - content = Buffer.from(bufferOrString, "utf8"); - } - } - - // Create a replacement resource which only allows to ask for size - // This allows to GC all memory allocated by the Source - // (expect when the Source is stored in any other cache) - cacheEntry.sizeOnlySource = new SizeOnlySource(content.length); - compilation.updateAsset(file, cacheEntry.sizeOnlySource, { - size: content.length - }); - - // Write the file to output file system - this.outputFileSystem.writeFile(targetPath, content, err => { - if (err) return callback(err); - - // information marker that the asset has been emitted - compilation.emittedAssets.add(file); - - // cache the information that the Source has been written to that location - const newGeneration = - targetFileGeneration === undefined - ? 1 - : targetFileGeneration + 1; - cacheEntry.writtenTo.set(targetPath, newGeneration); - this._assetEmittingWrittenFiles.set(targetPath, newGeneration); - this.hooks.assetEmitted.callAsync(file, content, callback); - }); - } else { - if (source.existsAt === targetPath) { - source.emitted = false; - return callback(); - } - let content = source.source(); - - if (!Buffer.isBuffer(content)) { - content = Buffer.from(content, "utf8"); - } - - source.existsAt = targetPath; - source.emitted = true; - this.outputFileSystem.writeFile(targetPath, content, err => { - if (err) return callback(err); - this.hooks.assetEmitted.callAsync(file, content, callback); - }); - } - }; - - if (targetFile.match(/\/|\\/)) { - const dir = path.dirname(targetFile); - this.outputFileSystem.mkdirp( - this.outputFileSystem.join(outputPath, dir), - writeOut - ); - } else { - writeOut(); - } - }, - err => { - if (err) return callback(err); - - this.hooks.afterEmit.callAsync(compilation, err => { - if (err) return callback(err); - - return callback(); - }); - } - ); - }; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Naoyuki Kanezawa @nkzawa +*/ - this.hooks.emit.callAsync(compilation, err => { - if (err) return callback(err); - outputPath = compilation.getPath(this.outputPath); - this.outputFileSystem.mkdirp(outputPath, emitFiles); - }); - } - emitRecords(callback) { - if (!this.recordsOutputPath) return callback(); - const idx1 = this.recordsOutputPath.lastIndexOf("/"); - const idx2 = this.recordsOutputPath.lastIndexOf("\\"); - let recordsOutputPathDirectory = null; - if (idx1 > idx2) { - recordsOutputPathDirectory = this.recordsOutputPath.substr(0, idx1); - } else if (idx1 < idx2) { - recordsOutputPathDirectory = this.recordsOutputPath.substr(0, idx2); - } +const MultiEntryDependency = __webpack_require__(7791); +const SingleEntryDependency = __webpack_require__(84828); +const MultiModuleFactory = __webpack_require__(24005); +const MultiEntryPlugin = __webpack_require__(98046); +const SingleEntryPlugin = __webpack_require__(19070); - const writeFile = () => { - this.outputFileSystem.writeFile( - this.recordsOutputPath, - JSON.stringify(this.records, undefined, 2), - callback - ); - }; +/** @typedef {import("../declarations/WebpackOptions").EntryDynamic} EntryDynamic */ +/** @typedef {import("../declarations/WebpackOptions").EntryStatic} EntryStatic */ +/** @typedef {import("./Compiler")} Compiler */ - if (!recordsOutputPathDirectory) { - return writeFile(); - } - this.outputFileSystem.mkdirp(recordsOutputPathDirectory, err => { - if (err) return callback(err); - writeFile(); - }); +class DynamicEntryPlugin { + /** + * @param {string} context the context path + * @param {EntryDynamic} entry the entry value + */ + constructor(context, entry) { + this.context = context; + this.entry = entry; } - readRecords(callback) { - if (!this.recordsInputPath) { - this.records = {}; - return callback(); - } - this.inputFileSystem.stat(this.recordsInputPath, err => { - // It doesn't exist - // We can ignore this. - if (err) return callback(); - - this.inputFileSystem.readFile(this.recordsInputPath, (err, content) => { - if (err) return callback(err); - - try { - this.records = parseJson(content.toString("utf-8")); - } catch (e) { - e.message = "Cannot parse records: " + e.message; - return callback(e); - } - - return callback(); - }); - }); - } + /** + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ + apply(compiler) { + compiler.hooks.compilation.tap( + "DynamicEntryPlugin", + (compilation, { normalModuleFactory }) => { + const multiModuleFactory = new MultiModuleFactory(); - createChildCompiler( - compilation, - compilerName, - compilerIndex, - outputOptions, - plugins - ) { - const childCompiler = new Compiler(this.context); - if (Array.isArray(plugins)) { - for (const plugin of plugins) { - plugin.apply(childCompiler); - } - } - for (const name in this.hooks) { - if ( - ![ - "make", - "compile", - "emit", - "afterEmit", - "invalid", - "done", - "thisCompilation" - ].includes(name) - ) { - if (childCompiler.hooks[name]) { - childCompiler.hooks[name].taps = this.hooks[name].taps.slice(); - } + compilation.dependencyFactories.set( + MultiEntryDependency, + multiModuleFactory + ); + compilation.dependencyFactories.set( + SingleEntryDependency, + normalModuleFactory + ); } - } - childCompiler.name = compilerName; - childCompiler.outputPath = this.outputPath; - childCompiler.inputFileSystem = this.inputFileSystem; - childCompiler.outputFileSystem = null; - childCompiler.resolverFactory = this.resolverFactory; - childCompiler.fileTimestamps = this.fileTimestamps; - childCompiler.contextTimestamps = this.contextTimestamps; - - const relativeCompilerName = makePathsRelative(this.context, compilerName); - if (!this.records[relativeCompilerName]) { - this.records[relativeCompilerName] = []; - } - if (this.records[relativeCompilerName][compilerIndex]) { - childCompiler.records = this.records[relativeCompilerName][compilerIndex]; - } else { - this.records[relativeCompilerName].push((childCompiler.records = {})); - } - - childCompiler.options = Object.create(this.options); - childCompiler.options.output = Object.create(childCompiler.options.output); - for (const name in outputOptions) { - childCompiler.options.output[name] = outputOptions[name]; - } - childCompiler.parentCompilation = compilation; - - compilation.hooks.childCompiler.call( - childCompiler, - compilerName, - compilerIndex - ); - - return childCompiler; - } - - isChild() { - return !!this.parentCompilation; - } - - createCompilation() { - return new Compilation(this); - } - - newCompilation(params) { - const compilation = this.createCompilation(); - compilation.fileTimestamps = this.fileTimestamps; - compilation.contextTimestamps = this.contextTimestamps; - compilation.name = this.name; - compilation.records = this.records; - compilation.compilationDependencies = params.compilationDependencies; - this.hooks.thisCompilation.call(compilation, params); - this.hooks.compilation.call(compilation, params); - return compilation; - } - - createNormalModuleFactory() { - const normalModuleFactory = new NormalModuleFactory( - this.options.context, - this.resolverFactory, - this.options.module || {} ); - this.hooks.normalModuleFactory.call(normalModuleFactory); - return normalModuleFactory; - } - createContextModuleFactory() { - const contextModuleFactory = new ContextModuleFactory(this.resolverFactory); - this.hooks.contextModuleFactory.call(contextModuleFactory); - return contextModuleFactory; - } - - newCompilationParams() { - const params = { - normalModuleFactory: this.createNormalModuleFactory(), - contextModuleFactory: this.createContextModuleFactory(), - compilationDependencies: new Set() - }; - return params; - } - - compile(callback) { - const params = this.newCompilationParams(); - this.hooks.beforeCompile.callAsync(params, err => { - if (err) return callback(err); - - this.hooks.compile.call(params); - - const compilation = this.newCompilation(params); - - this.hooks.make.callAsync(compilation, err => { - if (err) return callback(err); - - compilation.finish(err => { - if (err) return callback(err); - - compilation.seal(err => { - if (err) return callback(err); - - this.hooks.afterCompile.callAsync(compilation, err => { - if (err) return callback(err); - - return callback(null, compilation); + compiler.hooks.make.tapAsync( + "DynamicEntryPlugin", + (compilation, callback) => { + /** + * @param {string|string[]} entry entry value or array of entry values + * @param {string} name name of entry + * @returns {Promise} returns the promise resolving the Compilation#addEntry function + */ + const addEntry = (entry, name) => { + const dep = DynamicEntryPlugin.createDependency(entry, name); + return new Promise((resolve, reject) => { + compilation.addEntry(this.context, dep, name, err => { + if (err) return reject(err); + resolve(); }); }); + }; + + Promise.resolve(this.entry()).then(entry => { + if (typeof entry === "string" || Array.isArray(entry)) { + addEntry(entry, "main").then(() => callback(), callback); + } else if (typeof entry === "object") { + Promise.all( + Object.keys(entry).map(name => { + return addEntry(entry[name], name); + }) + ).then(() => callback(), callback); + } }); - }); - }); + } + ); } } -module.exports = Compiler; - -class SizeOnlySource extends Source { - constructor(size) { - super(); - this._size = size; +module.exports = DynamicEntryPlugin; +/** + * @param {string|string[]} entry entry value or array of entry paths + * @param {string} name name of entry + * @returns {SingleEntryDependency|MultiEntryDependency} returns dep + */ +DynamicEntryPlugin.createDependency = (entry, name) => { + if (Array.isArray(entry)) { + return MultiEntryPlugin.createDependency(entry, name); + } else { + return SingleEntryPlugin.createDependency(entry, name); } +}; - _error() { - return new Error( - "Content and Map of this Source is no longer available (only size() is supported)" - ); - } - size() { - return this._size; - } +/***/ }), - /** - * @param {any} options options - * @returns {string} the source - */ - source(options) { - throw this._error(); - } +/***/ 99531: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - node() { - throw this._error(); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - listMap() { - throw this._error(); - } - map() { - throw this._error(); - } +const WebpackError = __webpack_require__(97391); - listNode() { - throw this._error(); - } +class EntryModuleNotFoundError extends WebpackError { + constructor(err) { + super("Entry module not found: " + err); - updateHash() { - throw this._error(); + this.name = "EntryModuleNotFoundError"; + this.details = err.details; + this.error = err; + + Error.captureStackTrace(this, this.constructor); } } +module.exports = EntryModuleNotFoundError; + /***/ }), -/***/ 18933: +/***/ 14604: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Maksim Nazarjev @acupofspirt + Author Tobias Koppers @sokra */ -const WebpackError = __webpack_require__(97391); +const SingleEntryPlugin = __webpack_require__(19070); +const MultiEntryPlugin = __webpack_require__(98046); +const DynamicEntryPlugin = __webpack_require__(49784); -module.exports = class ConcurrentCompilationError extends WebpackError { - constructor() { - super(); +/** @typedef {import("../declarations/WebpackOptions").EntryItem} EntryItem */ +/** @typedef {import("./Compiler")} Compiler */ - this.name = "ConcurrentCompilationError"; - this.message = - "You ran Webpack twice. Each instance only supports a single concurrent compilation at a time."; +/** + * @param {string} context context path + * @param {EntryItem} item entry array or single path + * @param {string} name entry key name + * @returns {SingleEntryPlugin | MultiEntryPlugin} returns either a single or multi entry plugin + */ +const itemToPlugin = (context, item, name) => { + if (Array.isArray(item)) { + return new MultiEntryPlugin(context, item, name); + } + return new SingleEntryPlugin(context, item, name); +}; - Error.captureStackTrace(this, this.constructor); +module.exports = class EntryOptionPlugin { + /** + * @param {Compiler} compiler the compiler instance one is tapping into + * @returns {void} + */ + apply(compiler) { + compiler.hooks.entryOption.tap("EntryOptionPlugin", (context, entry) => { + if (typeof entry === "string" || Array.isArray(entry)) { + itemToPlugin(context, entry, "main").apply(compiler); + } else if (typeof entry === "object") { + for (const name of Object.keys(entry)) { + itemToPlugin(context, entry[name], name).apply(compiler); + } + } else if (typeof entry === "function") { + new DynamicEntryPlugin(context, entry).apply(compiler); + } + return true; + }); } }; /***/ }), -/***/ 84072: +/***/ 71931: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -57032,391 +56372,151 @@ module.exports = class ConcurrentCompilationError extends WebpackError { Author Tobias Koppers @sokra */ -const ConstDependency = __webpack_require__(71101); -const NullFactory = __webpack_require__(40438); -const ParserHelpers = __webpack_require__(23999); -const getQuery = request => { - const i = request.indexOf("?"); - return i !== -1 ? request.substr(i) : ""; -}; +const ChunkGroup = __webpack_require__(52911); -const collectDeclaration = (declarations, pattern) => { - const stack = [pattern]; - while (stack.length > 0) { - const node = stack.pop(); - switch (node.type) { - case "Identifier": - declarations.add(node.name); - break; - case "ArrayPattern": - for (const element of node.elements) { - if (element) { - stack.push(element); - } - } - break; - case "AssignmentPattern": - stack.push(node.left); - break; - case "ObjectPattern": - for (const property of node.properties) { - stack.push(property.value); - } - break; - case "RestElement": - stack.push(node.argument); - break; - } - } -}; +/** @typedef {import("./Chunk")} Chunk */ -const getHoistedDeclarations = (branch, includeFunctionDeclarations) => { - const declarations = new Set(); - const stack = [branch]; - while (stack.length > 0) { - const node = stack.pop(); - // Some node could be `null` or `undefined`. - if (!node) continue; - switch (node.type) { - // Walk through control statements to look for hoisted declarations. - // Some branches are skipped since they do not allow declarations. - case "BlockStatement": - for (const stmt of node.body) { - stack.push(stmt); - } - break; - case "IfStatement": - stack.push(node.consequent); - stack.push(node.alternate); - break; - case "ForStatement": - stack.push(node.init); - stack.push(node.body); - break; - case "ForInStatement": - case "ForOfStatement": - stack.push(node.left); - stack.push(node.body); - break; - case "DoWhileStatement": - case "WhileStatement": - case "LabeledStatement": - stack.push(node.body); - break; - case "SwitchStatement": - for (const cs of node.cases) { - for (const consequent of cs.consequent) { - stack.push(consequent); - } - } - break; - case "TryStatement": - stack.push(node.block); - if (node.handler) { - stack.push(node.handler.body); - } - stack.push(node.finalizer); - break; - case "FunctionDeclaration": - if (includeFunctionDeclarations) { - collectDeclaration(declarations, node.id); - } - break; - case "VariableDeclaration": - if (node.kind === "var") { - for (const decl of node.declarations) { - collectDeclaration(declarations, decl.id); - } - } - break; - } +/** + * Entrypoint serves as an encapsulation primitive for chunks that are + * a part of a single ChunkGroup. They represent all bundles that need to be loaded for a + * single instance of a page. Multi-page application architectures will typically yield multiple Entrypoint objects + * inside of the compilation, whereas a Single Page App may only contain one with many lazy-loaded chunks. + */ +class Entrypoint extends ChunkGroup { + /** + * Creates an instance of Entrypoint. + * @param {string} name the name of the entrypoint + */ + constructor(name) { + super(name); + /** @type {Chunk=} */ + this.runtimeChunk = undefined; } - return Array.from(declarations); -}; -class ConstPlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "ConstPlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set(ConstDependency, new NullFactory()); - compilation.dependencyTemplates.set( - ConstDependency, - new ConstDependency.Template() - ); + /** + * isInitial will always return true for Entrypoint ChunkGroup. + * @returns {true} returns true as all entrypoints are initial ChunkGroups + */ + isInitial() { + return true; + } - const handler = parser => { - parser.hooks.statementIf.tap("ConstPlugin", statement => { - if (parser.scope.isAsmJs) return; - const param = parser.evaluateExpression(statement.test); - const bool = param.asBool(); - if (typeof bool === "boolean") { - if (statement.test.type !== "Literal") { - const dep = new ConstDependency(`${bool}`, param.range); - dep.loc = statement.loc; - parser.state.current.addDependency(dep); - } - const branchToRemove = bool - ? statement.alternate - : statement.consequent; - if (branchToRemove) { - // Before removing the dead branch, the hoisted declarations - // must be collected. - // - // Given the following code: - // - // if (true) f() else g() - // if (false) { - // function f() {} - // const g = function g() {} - // if (someTest) { - // let a = 1 - // var x, {y, z} = obj - // } - // } else { - // … - // } - // - // the generated code is: - // - // if (true) f() else {} - // if (false) { - // var f, x, y, z; (in loose mode) - // var x, y, z; (in strict mode) - // } else { - // … - // } - // - // NOTE: When code runs in strict mode, `var` declarations - // are hoisted but `function` declarations don't. - // - let declarations; - if (parser.scope.isStrict) { - // If the code runs in strict mode, variable declarations - // using `var` must be hoisted. - declarations = getHoistedDeclarations(branchToRemove, false); - } else { - // Otherwise, collect all hoisted declaration. - declarations = getHoistedDeclarations(branchToRemove, true); - } - let replacement; - if (declarations.length > 0) { - replacement = `{ var ${declarations.join(", ")}; }`; - } else { - replacement = "{}"; - } - const dep = new ConstDependency( - replacement, - branchToRemove.range - ); - dep.loc = branchToRemove.loc; - parser.state.current.addDependency(dep); - } - return bool; - } - }); - parser.hooks.expressionConditionalOperator.tap( - "ConstPlugin", - expression => { - if (parser.scope.isAsmJs) return; - const param = parser.evaluateExpression(expression.test); - const bool = param.asBool(); - if (typeof bool === "boolean") { - if (expression.test.type !== "Literal") { - const dep = new ConstDependency(` ${bool}`, param.range); - dep.loc = expression.loc; - parser.state.current.addDependency(dep); - } - // Expressions do not hoist. - // It is safe to remove the dead branch. - // - // Given the following code: - // - // false ? someExpression() : otherExpression(); - // - // the generated code is: - // - // false ? undefined : otherExpression(); - // - const branchToRemove = bool - ? expression.alternate - : expression.consequent; - const dep = new ConstDependency( - "undefined", - branchToRemove.range - ); - dep.loc = branchToRemove.loc; - parser.state.current.addDependency(dep); - return bool; - } - } - ); - parser.hooks.expressionLogicalOperator.tap( - "ConstPlugin", - expression => { - if (parser.scope.isAsmJs) return; - if ( - expression.operator === "&&" || - expression.operator === "||" - ) { - const param = parser.evaluateExpression(expression.left); - const bool = param.asBool(); - if (typeof bool === "boolean") { - // Expressions do not hoist. - // It is safe to remove the dead branch. - // - // ------------------------------------------ - // - // Given the following code: - // - // falsyExpression() && someExpression(); - // - // the generated code is: - // - // falsyExpression() && false; - // - // ------------------------------------------ - // - // Given the following code: - // - // truthyExpression() && someExpression(); - // - // the generated code is: - // - // true && someExpression(); - // - // ------------------------------------------ - // - // Given the following code: - // - // truthyExpression() || someExpression(); - // - // the generated code is: - // - // truthyExpression() || false; - // - // ------------------------------------------ - // - // Given the following code: - // - // falsyExpression() || someExpression(); - // - // the generated code is: - // - // false && someExpression(); - // - const keepRight = - (expression.operator === "&&" && bool) || - (expression.operator === "||" && !bool); + /** + * Sets the runtimeChunk for an entrypoint. + * @param {Chunk} chunk the chunk being set as the runtime chunk. + * @returns {void} + */ + setRuntimeChunk(chunk) { + this.runtimeChunk = chunk; + } - if (param.isBoolean() || keepRight) { - // for case like - // - // return'development'===process.env.NODE_ENV&&'foo' - // - // we need a space before the bool to prevent result like - // - // returnfalse&&'foo' - // - const dep = new ConstDependency(` ${bool}`, param.range); - dep.loc = expression.loc; - parser.state.current.addDependency(dep); - } else { - parser.walkExpression(expression.left); - } - if (!keepRight) { - const dep = new ConstDependency( - "false", - expression.right.range - ); - dep.loc = expression.loc; - parser.state.current.addDependency(dep); - } - return keepRight; - } - } - } - ); - parser.hooks.evaluateIdentifier - .for("__resourceQuery") - .tap("ConstPlugin", expr => { - if (parser.scope.isAsmJs) return; - if (!parser.state.module) return; - return ParserHelpers.evaluateToString( - getQuery(parser.state.module.resource) - )(expr); - }); - parser.hooks.expression - .for("__resourceQuery") - .tap("ConstPlugin", () => { - if (parser.scope.isAsmJs) return; - if (!parser.state.module) return; - parser.state.current.addVariable( - "__resourceQuery", - JSON.stringify(getQuery(parser.state.module.resource)) - ); - return true; - }); - }; + /** + * Fetches the chunk reference containing the webpack bootstrap code + * @returns {Chunk} returns the runtime chunk or first chunk in `this.chunks` + */ + getRuntimeChunk() { + return this.runtimeChunk || this.chunks[0]; + } - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ConstPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ConstPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ConstPlugin", handler); - } - ); + /** + * @param {Chunk} oldChunk chunk to be replaced + * @param {Chunk} newChunk New chunk that will be replaced with + * @returns {boolean} returns true if the replacement was successful + */ + replaceChunk(oldChunk, newChunk) { + if (this.runtimeChunk === oldChunk) this.runtimeChunk = newChunk; + return super.replaceChunk(oldChunk, newChunk); } } -module.exports = ConstPlugin; +module.exports = Entrypoint; /***/ }), -/***/ 10706: -/***/ (function(module) { +/***/ 6098: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Authors Simen Brekken @simenbrekken, Einar Löve @einarlove +*/ + /** @typedef {import("./Compiler")} Compiler */ -/** @typedef {import("./ContextModuleFactory")} ContextModuleFactory */ -class ContextExclusionPlugin { - /** - * @param {RegExp} negativeMatcher Matcher regular expression - */ - constructor(negativeMatcher) { - this.negativeMatcher = negativeMatcher; +const WebpackError = __webpack_require__(97391); +const DefinePlugin = __webpack_require__(97374); + +const needsEnvVarFix = + ["8", "9"].indexOf(process.versions.node.split(".")[0]) >= 0 && + process.platform === "win32"; + +class EnvironmentPlugin { + constructor(...keys) { + if (keys.length === 1 && Array.isArray(keys[0])) { + this.keys = keys[0]; + this.defaultValues = {}; + } else if (keys.length === 1 && keys[0] && typeof keys[0] === "object") { + this.keys = Object.keys(keys[0]); + this.defaultValues = keys[0]; + } else { + this.keys = keys; + this.defaultValues = {}; + } } /** - * Apply the plugin - * @param {Compiler} compiler Webpack Compiler + * @param {Compiler} compiler webpack compiler instance * @returns {void} */ apply(compiler) { - compiler.hooks.contextModuleFactory.tap("ContextExclusionPlugin", cmf => { - cmf.hooks.contextModuleFiles.tap("ContextExclusionPlugin", files => { - return files.filter(filePath => !this.negativeMatcher.test(filePath)); - }); - }); + const definitions = this.keys.reduce((defs, key) => { + // TODO remove once the fix has made its way into Node 8. + // Work around https://github.com/nodejs/node/pull/18463, + // affecting Node 8 & 9 by performing an OS-level + // operation that always succeeds before reading + // environment variables: + if (needsEnvVarFix) __webpack_require__(12087).cpus(); + + const value = + process.env[key] !== undefined + ? process.env[key] + : this.defaultValues[key]; + + if (value === undefined) { + compiler.hooks.thisCompilation.tap("EnvironmentPlugin", compilation => { + const error = new WebpackError( + `EnvironmentPlugin - ${key} environment variable is undefined.\n\n` + + "You can pass an object with default values to suppress this warning.\n" + + "See https://webpack.js.org/plugins/environment-plugin for example." + ); + + error.name = "EnvVariableNotDefinedError"; + compilation.warnings.push(error); + }); + } + + defs[`process.env.${key}`] = + value === undefined ? "undefined" : JSON.stringify(value); + + return defs; + }, {}); + + new DefinePlugin(definitions).apply(compiler); } } -module.exports = ContextExclusionPlugin; +module.exports = EnvironmentPlugin; /***/ }), -/***/ 20090: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 80140: +/***/ (function(__unused_webpack_module, exports) { "use strict"; /* @@ -57424,878 +56524,347 @@ module.exports = ContextExclusionPlugin; Author Tobias Koppers @sokra */ -const util = __webpack_require__(31669); -const { OriginalSource, RawSource } = __webpack_require__(53665); -const Module = __webpack_require__(75993); -const AsyncDependenciesBlock = __webpack_require__(22814); -const Template = __webpack_require__(96066); -const contextify = __webpack_require__(94658).contextify; - -/** @typedef {"sync" | "eager" | "weak" | "async-weak" | "lazy" | "lazy-once"} ContextMode Context mode */ -/** @typedef {import("./dependencies/ContextElementDependency")} ContextElementDependency */ -/** - * @callback ResolveDependenciesCallback - * @param {Error=} err - * @param {ContextElementDependency[]} dependencies - */ +const loaderFlag = "LOADER_EXECUTION"; -/** - * @callback ResolveDependencies - * @param {TODO} fs - * @param {TODO} options - * @param {ResolveDependenciesCallback} callback - */ +const webpackOptionsFlag = "WEBPACK_OPTIONS"; -class ContextModule extends Module { - // type ContextMode = "sync" | "eager" | "weak" | "async-weak" | "lazy" | "lazy-once" - // type ContextOptions = { resource: string, recursive: boolean, regExp: RegExp, addon?: string, mode?: ContextMode, chunkName?: string, include?: RegExp, exclude?: RegExp, groupOptions?: Object } - // resolveDependencies: (fs: FS, options: ContextOptions, (err: Error?, dependencies: Dependency[]) => void) => void - // options: ContextOptions - /** - * @param {ResolveDependencies} resolveDependencies function to get dependencies in this context - * @param {TODO} options options object - */ - constructor(resolveDependencies, options) { - let resource; - let resourceQuery; - const queryIdx = options.resource.indexOf("?"); - if (queryIdx >= 0) { - resource = options.resource.substr(0, queryIdx); - resourceQuery = options.resource.substr(queryIdx); - } else { - resource = options.resource; - resourceQuery = ""; +exports.cutOffByFlag = (stack, flag) => { + stack = stack.split("\n"); + for (let i = 0; i < stack.length; i++) { + if (stack[i].includes(flag)) { + stack.length = i; } + } + return stack.join("\n"); +}; - super("javascript/dynamic", resource); +exports.cutOffLoaderExecution = stack => + exports.cutOffByFlag(stack, loaderFlag); - // Info from Factory - this.resolveDependencies = resolveDependencies; - this.options = Object.assign({}, options, { - resource: resource, - resourceQuery: resourceQuery - }); - if (options.resolveOptions !== undefined) { - this.resolveOptions = options.resolveOptions; - } +exports.cutOffWebpackOptions = stack => + exports.cutOffByFlag(stack, webpackOptionsFlag); - // Info from Build - this._contextDependencies = new Set([this.context]); +exports.cutOffMultilineMessage = (stack, message) => { + stack = stack.split("\n"); + message = message.split("\n"); - if (typeof options.mode !== "string") { - throw new Error("options.mode is a required option"); - } + return stack + .reduce( + (acc, line, idx) => + line.includes(message[idx]) ? acc : acc.concat(line), + [] + ) + .join("\n"); +}; - this._identifier = this._createIdentifier(); +exports.cutOffMessage = (stack, message) => { + const nextLine = stack.indexOf("\n"); + if (nextLine === -1) { + return stack === message ? "" : stack; + } else { + const firstLine = stack.substr(0, nextLine); + return firstLine === message ? stack.substr(nextLine + 1) : stack; } +}; - updateCacheModule(module) { - this.resolveDependencies = module.resolveDependencies; - this.options = module.options; - this.resolveOptions = module.resolveOptions; - } +exports.cleanUp = (stack, message) => { + stack = exports.cutOffLoaderExecution(stack); + stack = exports.cutOffMessage(stack, message); + return stack; +}; - prettyRegExp(regexString) { - // remove the "/" at the front and the beginning - // "/foo/" -> "foo" - return regexString.substring(1, regexString.length - 1); - } +exports.cleanUpWebpackOptions = (stack, message) => { + stack = exports.cutOffWebpackOptions(stack); + stack = exports.cutOffMultilineMessage(stack, message); + return stack; +}; - _createIdentifier() { - let identifier = this.context; - if (this.options.resourceQuery) { - identifier += ` ${this.options.resourceQuery}`; - } - if (this.options.mode) { - identifier += ` ${this.options.mode}`; - } - if (!this.options.recursive) { - identifier += " nonrecursive"; - } - if (this.options.addon) { - identifier += ` ${this.options.addon}`; - } - if (this.options.regExp) { - identifier += ` ${this.options.regExp}`; - } - if (this.options.include) { - identifier += ` include: ${this.options.include}`; - } - if (this.options.exclude) { - identifier += ` exclude: ${this.options.exclude}`; - } - if (this.options.groupOptions) { - identifier += ` groupOptions: ${JSON.stringify( - this.options.groupOptions - )}`; - } - if (this.options.namespaceObject === "strict") { - identifier += " strict namespace object"; - } else if (this.options.namespaceObject) { - identifier += " namespace object"; - } - return identifier; +/***/ }), + +/***/ 65200: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const EvalDevToolModuleTemplatePlugin = __webpack_require__(24157); + +class EvalDevToolModulePlugin { + constructor(options) { + this.sourceUrlComment = options.sourceUrlComment; + this.moduleFilenameTemplate = options.moduleFilenameTemplate; + this.namespace = options.namespace; } - identifier() { - return this._identifier; + apply(compiler) { + compiler.hooks.compilation.tap("EvalDevToolModulePlugin", compilation => { + new EvalDevToolModuleTemplatePlugin({ + sourceUrlComment: this.sourceUrlComment, + moduleFilenameTemplate: this.moduleFilenameTemplate, + namespace: this.namespace + }).apply(compilation.moduleTemplates.javascript); + }); } +} - readableIdentifier(requestShortener) { - let identifier = requestShortener.shorten(this.context); - if (this.options.resourceQuery) { - identifier += ` ${this.options.resourceQuery}`; - } - if (this.options.mode) { - identifier += ` ${this.options.mode}`; - } - if (!this.options.recursive) { - identifier += " nonrecursive"; - } - if (this.options.addon) { - identifier += ` ${requestShortener.shorten(this.options.addon)}`; - } - if (this.options.regExp) { - identifier += ` ${this.prettyRegExp(this.options.regExp + "")}`; - } - if (this.options.include) { - identifier += ` include: ${this.prettyRegExp(this.options.include + "")}`; - } - if (this.options.exclude) { - identifier += ` exclude: ${this.prettyRegExp(this.options.exclude + "")}`; - } - if (this.options.groupOptions) { - const groupOptions = this.options.groupOptions; - for (const key of Object.keys(groupOptions)) { - identifier += ` ${key}: ${groupOptions[key]}`; - } - } - if (this.options.namespaceObject === "strict") { - identifier += " strict namespace object"; - } else if (this.options.namespaceObject) { - identifier += " namespace object"; - } +module.exports = EvalDevToolModulePlugin; - return identifier; - } - libIdent(options) { - let identifier = contextify(options.context, this.context); - if (this.options.mode) { - identifier += ` ${this.options.mode}`; - } - if (this.options.recursive) { - identifier += " recursive"; - } - if (this.options.addon) { - identifier += ` ${contextify(options.context, this.options.addon)}`; - } - if (this.options.regExp) { - identifier += ` ${this.prettyRegExp(this.options.regExp + "")}`; - } - if (this.options.include) { - identifier += ` include: ${this.prettyRegExp(this.options.include + "")}`; - } - if (this.options.exclude) { - identifier += ` exclude: ${this.prettyRegExp(this.options.exclude + "")}`; - } +/***/ }), - return identifier; - } +/***/ 24157: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - needRebuild(fileTimestamps, contextTimestamps) { - const ts = contextTimestamps.get(this.context); - if (!ts) { - return true; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - return ts >= this.buildInfo.builtTime; - } - build(options, compilation, resolver, fs, callback) { - this.built = true; - this.buildMeta = {}; - this.buildInfo = { - builtTime: Date.now(), - contextDependencies: this._contextDependencies - }; - this.resolveDependencies(fs, this.options, (err, dependencies) => { - if (err) return callback(err); +const { RawSource } = __webpack_require__(53665); +const ModuleFilenameHelpers = __webpack_require__(71474); - // abort if something failed - // this will create an empty context - if (!dependencies) { - callback(); - return; - } +const cache = new WeakMap(); - // enhance dependencies with meta info - for (const dep of dependencies) { - dep.loc = { - name: dep.userRequest - }; - dep.request = this.options.addon + dep.request; - } +class EvalDevToolModuleTemplatePlugin { + constructor(options) { + this.sourceUrlComment = options.sourceUrlComment || "\n//# sourceURL=[url]"; + this.moduleFilenameTemplate = + options.moduleFilenameTemplate || + "webpack://[namespace]/[resourcePath]?[loaders]"; + this.namespace = options.namespace || ""; + } - if (this.options.mode === "sync" || this.options.mode === "eager") { - // if we have an sync or eager context - // just add all dependencies and continue - this.dependencies = dependencies; - } else if (this.options.mode === "lazy-once") { - // for the lazy-once mode create a new async dependency block - // and add that block to this context - if (dependencies.length > 0) { - const block = new AsyncDependenciesBlock( - Object.assign({}, this.options.groupOptions, { - name: this.options.chunkName - }), - this - ); - for (const dep of dependencies) { - block.addDependency(dep); - } - this.addBlock(block); - } - } else if ( - this.options.mode === "weak" || - this.options.mode === "async-weak" - ) { - // we mark all dependencies as weak - for (const dep of dependencies) { - dep.weak = true; - } - this.dependencies = dependencies; - } else if (this.options.mode === "lazy") { - // if we are lazy create a new async dependency block per dependency - // and add all blocks to this context - let index = 0; - for (const dep of dependencies) { - let chunkName = this.options.chunkName; - if (chunkName) { - if (!/\[(index|request)\]/.test(chunkName)) { - chunkName += "[index]"; - } - chunkName = chunkName.replace(/\[index\]/g, index++); - chunkName = chunkName.replace( - /\[request\]/g, - Template.toPath(dep.userRequest) - ); - } - const block = new AsyncDependenciesBlock( - Object.assign({}, this.options.groupOptions, { - name: chunkName - }), - dep.module, - dep.loc, - dep.userRequest + apply(moduleTemplate) { + moduleTemplate.hooks.module.tap( + "EvalDevToolModuleTemplatePlugin", + (source, module) => { + const cacheEntry = cache.get(source); + if (cacheEntry !== undefined) return cacheEntry; + const content = source.source(); + const str = ModuleFilenameHelpers.createFilename( + module, + { + moduleFilenameTemplate: this.moduleFilenameTemplate, + namespace: this.namespace + }, + moduleTemplate.runtimeTemplate.requestShortener + ); + const footer = + "\n" + + this.sourceUrlComment.replace( + /\[url\]/g, + encodeURI(str) + .replace(/%2F/g, "/") + .replace(/%20/g, "_") + .replace(/%5E/g, "^") + .replace(/%5C/g, "\\") + .replace(/^\//, "") ); - block.addDependency(dep); - this.addBlock(block); - } - } else { - callback( - new Error(`Unsupported mode "${this.options.mode}" in context`) + const result = new RawSource( + `eval(${JSON.stringify(content + footer)});` ); - return; + cache.set(source, result); + return result; } - callback(); + ); + moduleTemplate.hooks.hash.tap("EvalDevToolModuleTemplatePlugin", hash => { + hash.update("EvalDevToolModuleTemplatePlugin"); + hash.update("2"); }); } +} - getUserRequestMap(dependencies) { - // if we filter first we get a new array - // therefor we dont need to create a clone of dependencies explicitly - // therefore the order of this is !important! - return dependencies - .filter(dependency => dependency.module) - .sort((a, b) => { - if (a.userRequest === b.userRequest) { - return 0; - } - return a.userRequest < b.userRequest ? -1 : 1; - }) - .reduce((map, dep) => { - map[dep.userRequest] = dep.module.id; - return map; - }, Object.create(null)); - } - - getFakeMap(dependencies) { - if (!this.options.namespaceObject) { - return 9; - } - // if we filter first we get a new array - // therefor we dont need to create a clone of dependencies explicitly - // therefore the order of this is !important! - let hasNonHarmony = false; - let hasNamespace = false; - let hasNamed = false; - const fakeMap = dependencies - .filter(dependency => dependency.module) - .sort((a, b) => { - return b.module.id - a.module.id; - }) - .reduce((map, dep) => { - const exportsType = - dep.module.buildMeta && dep.module.buildMeta.exportsType; - const id = dep.module.id; - if (!exportsType) { - map[id] = this.options.namespaceObject === "strict" ? 1 : 7; - hasNonHarmony = true; - } else if (exportsType === "namespace") { - map[id] = 9; - hasNamespace = true; - } else if (exportsType === "named") { - map[id] = 3; - hasNamed = true; - } - return map; - }, Object.create(null)); - if (!hasNamespace && hasNonHarmony && !hasNamed) { - return this.options.namespaceObject === "strict" ? 1 : 7; - } - if (hasNamespace && !hasNonHarmony && !hasNamed) { - return 9; - } - if (!hasNamespace && !hasNonHarmony && hasNamed) { - return 3; - } - if (!hasNamespace && !hasNonHarmony && !hasNamed) { - return 9; - } - return fakeMap; - } - - getFakeMapInitStatement(fakeMap) { - return typeof fakeMap === "object" - ? `var fakeMap = ${JSON.stringify(fakeMap, null, "\t")};` - : ""; - } +module.exports = EvalDevToolModuleTemplatePlugin; - getReturn(type) { - if (type === 9) { - return "__webpack_require__(id)"; - } - return `__webpack_require__.t(id, ${type})`; - } - getReturnModuleObjectSource(fakeMap, fakeMapDataExpression = "fakeMap[id]") { - if (typeof fakeMap === "number") { - return `return ${this.getReturn(fakeMap)};`; - } - return `return __webpack_require__.t(id, ${fakeMapDataExpression})`; - } +/***/ }), - getSyncSource(dependencies, id) { - const map = this.getUserRequestMap(dependencies); - const fakeMap = this.getFakeMap(dependencies); - const returnModuleObject = this.getReturnModuleObjectSource(fakeMap); +/***/ 51352: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - return `var map = ${JSON.stringify(map, null, "\t")}; -${this.getFakeMapInitStatement(fakeMap)} +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -function webpackContext(req) { - var id = webpackContextResolve(req); - ${returnModuleObject} -} -function webpackContextResolve(req) { - if(!__webpack_require__.o(map, req)) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - return map[req]; -} -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -module.exports = webpackContext; -webpackContext.id = ${JSON.stringify(id)};`; - } - getWeakSyncSource(dependencies, id) { - const map = this.getUserRequestMap(dependencies); - const fakeMap = this.getFakeMap(dependencies); - const returnModuleObject = this.getReturnModuleObjectSource(fakeMap); +const { RawSource } = __webpack_require__(53665); +const ModuleFilenameHelpers = __webpack_require__(71474); +const { absolutify } = __webpack_require__(94658); - return `var map = ${JSON.stringify(map, null, "\t")}; -${this.getFakeMapInitStatement(fakeMap)} +const cache = new WeakMap(); -function webpackContext(req) { - var id = webpackContextResolve(req); - if(!__webpack_require__.m[id]) { - var e = new Error("Module '" + req + "' ('" + id + "') is not available (weak dependency)"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - ${returnModuleObject} -} -function webpackContextResolve(req) { - if(!__webpack_require__.o(map, req)) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - return map[req]; -} -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -webpackContext.id = ${JSON.stringify(id)}; -module.exports = webpackContext;`; +class EvalSourceMapDevToolModuleTemplatePlugin { + constructor(compilation, options) { + this.compilation = compilation; + this.sourceMapComment = + options.append || "//# sourceURL=[module]\n//# sourceMappingURL=[url]"; + this.moduleFilenameTemplate = + options.moduleFilenameTemplate || + "webpack://[namespace]/[resource-path]?[hash]"; + this.namespace = options.namespace || ""; + this.options = options; } - getAsyncWeakSource(dependencies, id) { - const map = this.getUserRequestMap(dependencies); - const fakeMap = this.getFakeMap(dependencies); - const returnModuleObject = this.getReturnModuleObjectSource(fakeMap); + apply(moduleTemplate) { + const self = this; + const options = this.options; + const matchModule = ModuleFilenameHelpers.matchObject.bind( + ModuleFilenameHelpers, + options + ); + moduleTemplate.hooks.module.tap( + "EvalSourceMapDevToolModuleTemplatePlugin", + (source, module) => { + const cachedSource = cache.get(source); + if (cachedSource !== undefined) { + return cachedSource; + } - return `var map = ${JSON.stringify(map, null, "\t")}; -${this.getFakeMapInitStatement(fakeMap)} + if (!matchModule(module.resource)) { + return source; + } -function webpackAsyncContext(req) { - return webpackAsyncContextResolve(req).then(function(id) { - if(!__webpack_require__.m[id]) { - var e = new Error("Module '" + req + "' ('" + id + "') is not available (weak dependency)"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - ${returnModuleObject} - }); -} -function webpackAsyncContextResolve(req) { - // Here Promise.resolve().then() is used instead of new Promise() to prevent - // uncaught exception popping up in devtools - return Promise.resolve().then(function() { - if(!__webpack_require__.o(map, req)) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - return map[req]; - }); -} -webpackAsyncContext.keys = function webpackAsyncContextKeys() { - return Object.keys(map); -}; -webpackAsyncContext.resolve = webpackAsyncContextResolve; -webpackAsyncContext.id = ${JSON.stringify(id)}; -module.exports = webpackAsyncContext;`; - } - - getEagerSource(dependencies, id) { - const map = this.getUserRequestMap(dependencies); - const fakeMap = this.getFakeMap(dependencies); - const thenFunction = - fakeMap !== 9 - ? `function(id) { - ${this.getReturnModuleObjectSource(fakeMap)} - }` - : "__webpack_require__"; - return `var map = ${JSON.stringify(map, null, "\t")}; -${this.getFakeMapInitStatement(fakeMap)} - -function webpackAsyncContext(req) { - return webpackAsyncContextResolve(req).then(${thenFunction}); -} -function webpackAsyncContextResolve(req) { - // Here Promise.resolve().then() is used instead of new Promise() to prevent - // uncaught exception popping up in devtools - return Promise.resolve().then(function() { - if(!__webpack_require__.o(map, req)) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - return map[req]; - }); -} -webpackAsyncContext.keys = function webpackAsyncContextKeys() { - return Object.keys(map); -}; -webpackAsyncContext.resolve = webpackAsyncContextResolve; -webpackAsyncContext.id = ${JSON.stringify(id)}; -module.exports = webpackAsyncContext;`; - } - - getLazyOnceSource(block, dependencies, id, runtimeTemplate) { - const promise = runtimeTemplate.blockPromise({ - block, - message: "lazy-once context" - }); - const map = this.getUserRequestMap(dependencies); - const fakeMap = this.getFakeMap(dependencies); - const thenFunction = - fakeMap !== 9 - ? `function(id) { - ${this.getReturnModuleObjectSource(fakeMap)}; - }` - : "__webpack_require__"; - - return `var map = ${JSON.stringify(map, null, "\t")}; -${this.getFakeMapInitStatement(fakeMap)} - -function webpackAsyncContext(req) { - return webpackAsyncContextResolve(req).then(${thenFunction}); -} -function webpackAsyncContextResolve(req) { - return ${promise}.then(function() { - if(!__webpack_require__.o(map, req)) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - return map[req]; - }); -} -webpackAsyncContext.keys = function webpackAsyncContextKeys() { - return Object.keys(map); -}; -webpackAsyncContext.resolve = webpackAsyncContextResolve; -webpackAsyncContext.id = ${JSON.stringify(id)}; -module.exports = webpackAsyncContext;`; - } - - getLazySource(blocks, id) { - let hasMultipleOrNoChunks = false; - let hasNoChunk = true; - const fakeMap = this.getFakeMap(blocks.map(b => b.dependencies[0])); - const hasFakeMap = typeof fakeMap === "object"; - const map = blocks - .filter(block => block.dependencies[0].module) - .map(block => { - const chunks = block.chunkGroup ? block.chunkGroup.chunks : []; - if (chunks.length > 0) { - hasNoChunk = false; + /** @type {{ [key: string]: TODO; }} */ + let sourceMap; + let content; + if (source.sourceAndMap) { + const sourceAndMap = source.sourceAndMap(options); + sourceMap = sourceAndMap.map; + content = sourceAndMap.source; + } else { + sourceMap = source.map(options); + content = source.source(); } - if (chunks.length !== 1) { - hasMultipleOrNoChunks = true; + if (!sourceMap) { + return source; } - return { - dependency: block.dependencies[0], - block: block, - userRequest: block.dependencies[0].userRequest, - chunks - }; - }) - .sort((a, b) => { - if (a.userRequest === b.userRequest) return 0; - return a.userRequest < b.userRequest ? -1 : 1; - }) - .reduce((map, item) => { - const chunks = item.chunks; - if (hasNoChunk && !hasFakeMap) { - map[item.userRequest] = item.dependency.module.id; - } else { - const arrayStart = [item.dependency.module.id]; - if (typeof fakeMap === "object") { - arrayStart.push(fakeMap[item.dependency.module.id]); + // Clone (flat) the sourcemap to ensure that the mutations below do not persist. + sourceMap = Object.keys(sourceMap).reduce((obj, key) => { + obj[key] = sourceMap[key]; + return obj; + }, {}); + const context = this.compilation.compiler.options.context; + const modules = sourceMap.sources.map(source => { + if (source.startsWith("webpack://")) { + source = absolutify(context, source.slice(10)); } - map[item.userRequest] = arrayStart.concat( - chunks.map(chunk => chunk.id) + const module = self.compilation.findModule(source); + return module || source; + }); + let moduleFilenames = modules.map(module => { + return ModuleFilenameHelpers.createFilename( + module, + { + moduleFilenameTemplate: self.moduleFilenameTemplate, + namespace: self.namespace + }, + moduleTemplate.runtimeTemplate.requestShortener ); - } + }); + moduleFilenames = ModuleFilenameHelpers.replaceDuplicates( + moduleFilenames, + (filename, i, n) => { + for (let j = 0; j < n; j++) filename += "*"; + return filename; + } + ); + sourceMap.sources = moduleFilenames; + sourceMap.sourceRoot = options.sourceRoot || ""; + sourceMap.file = `${module.id}.js`; - return map; - }, Object.create(null)); + const footer = + self.sourceMapComment.replace( + /\[url\]/g, + `data:application/json;charset=utf-8;base64,${Buffer.from( + JSON.stringify(sourceMap), + "utf8" + ).toString("base64")}` + ) + `\n//# sourceURL=webpack-internal:///${module.id}\n`; // workaround for chrome bug - const shortMode = hasNoChunk && !hasFakeMap; - const chunksStartPosition = hasFakeMap ? 2 : 1; - const requestPrefix = hasNoChunk - ? "Promise.resolve()" - : hasMultipleOrNoChunks - ? `Promise.all(ids.slice(${chunksStartPosition}).map(__webpack_require__.e))` - : `__webpack_require__.e(ids[${chunksStartPosition}])`; - const returnModuleObject = this.getReturnModuleObjectSource( - fakeMap, - shortMode ? "invalid" : "ids[1]" - ); + const evalSource = new RawSource( + `eval(${JSON.stringify(content + footer)});` + ); - const webpackAsyncContext = - requestPrefix === "Promise.resolve()" - ? `${shortMode ? "" : ""} -function webpackAsyncContext(req) { - return Promise.resolve().then(function() { - if(!__webpack_require__.o(map, req)) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } + cache.set(source, evalSource); - ${shortMode ? "var id = map[req];" : "var ids = map[req], id = ids[0];"} - ${returnModuleObject} - }); -}` - : `function webpackAsyncContext(req) { - if(!__webpack_require__.o(map, req)) { - return Promise.resolve().then(function() { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - }); + return evalSource; + } + ); + moduleTemplate.hooks.hash.tap( + "EvalSourceMapDevToolModuleTemplatePlugin", + hash => { + hash.update("eval-source-map"); + hash.update("2"); + } + ); } +} +module.exports = EvalSourceMapDevToolModuleTemplatePlugin; - var ids = map[req], id = ids[0]; - return ${requestPrefix}.then(function() { - ${returnModuleObject} - }); -}`; - return `var map = ${JSON.stringify(map, null, "\t")}; -${webpackAsyncContext} -webpackAsyncContext.keys = function webpackAsyncContextKeys() { - return Object.keys(map); -}; -webpackAsyncContext.id = ${JSON.stringify(id)}; -module.exports = webpackAsyncContext;`; - } +/***/ }), - getSourceForEmptyContext(id) { - return `function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; -} -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = ${JSON.stringify(id)};`; - } +/***/ 99994: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - getSourceForEmptyAsyncContext(id) { - return `function webpackEmptyAsyncContext(req) { - // Here Promise.resolve().then() is used instead of new Promise() to prevent - // uncaught exception popping up in devtools - return Promise.resolve().then(function() { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - }); -} -webpackEmptyAsyncContext.keys = function() { return []; }; -webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext; -module.exports = webpackEmptyAsyncContext; -webpackEmptyAsyncContext.id = ${JSON.stringify(id)};`; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - getSourceString(asyncMode, runtimeTemplate) { - if (asyncMode === "lazy") { - if (this.blocks && this.blocks.length > 0) { - return this.getLazySource(this.blocks, this.id); - } - return this.getSourceForEmptyAsyncContext(this.id); - } - if (asyncMode === "eager") { - if (this.dependencies && this.dependencies.length > 0) { - return this.getEagerSource(this.dependencies, this.id); - } - return this.getSourceForEmptyAsyncContext(this.id); - } - if (asyncMode === "lazy-once") { - const block = this.blocks[0]; - if (block) { - return this.getLazyOnceSource( - block, - block.dependencies, - this.id, - runtimeTemplate - ); - } - return this.getSourceForEmptyAsyncContext(this.id); - } - if (asyncMode === "async-weak") { - if (this.dependencies && this.dependencies.length > 0) { - return this.getAsyncWeakSource(this.dependencies, this.id); - } - return this.getSourceForEmptyAsyncContext(this.id); - } - if (asyncMode === "weak") { - if (this.dependencies && this.dependencies.length > 0) { - return this.getWeakSyncSource(this.dependencies, this.id); - } - } - if (this.dependencies && this.dependencies.length > 0) { - return this.getSyncSource(this.dependencies, this.id); - } - return this.getSourceForEmptyContext(this.id); - } - getSource(sourceString) { - if (this.useSourceMap) { - return new OriginalSource(sourceString, this.identifier()); +const EvalSourceMapDevToolModuleTemplatePlugin = __webpack_require__(51352); +const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(24113); + +class EvalSourceMapDevToolPlugin { + constructor(options) { + if (arguments.length > 1) { + throw new Error( + "EvalSourceMapDevToolPlugin only takes one argument (pass an options object)" + ); } - return new RawSource(sourceString); + if (typeof options === "string") { + options = { + append: options + }; + } + if (!options) options = {}; + this.options = options; } - source(dependencyTemplates, runtimeTemplate) { - return this.getSource( - this.getSourceString(this.options.mode, runtimeTemplate) + apply(compiler) { + const options = this.options; + compiler.hooks.compilation.tap( + "EvalSourceMapDevToolPlugin", + compilation => { + new SourceMapDevToolModuleOptionsPlugin(options).apply(compilation); + new EvalSourceMapDevToolModuleTemplatePlugin( + compilation, + options + ).apply(compilation.moduleTemplates.javascript); + } ); } - - size() { - // base penalty - const initialSize = 160; - - // if we dont have dependencies we stop here. - return this.dependencies.reduce((size, dependency) => { - const element = /** @type {ContextElementDependency} */ (dependency); - return size + 5 + element.userRequest.length; - }, initialSize); - } } -// TODO remove in webpack 5 -Object.defineProperty(ContextModule.prototype, "recursive", { - configurable: false, - get: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @returns {boolean} is recursive - */ - function() { - return this.options.recursive; - }, - "ContextModule.recursive has been moved to ContextModule.options.recursive" - ), - set: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @param {boolean} value is recursive - * @returns {void} - */ - function(value) { - this.options.recursive = value; - }, - "ContextModule.recursive has been moved to ContextModule.options.recursive" - ) -}); - -// TODO remove in webpack 5 -Object.defineProperty(ContextModule.prototype, "regExp", { - configurable: false, - get: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @returns {RegExp} regular expression - */ - function() { - return this.options.regExp; - }, - "ContextModule.regExp has been moved to ContextModule.options.regExp" - ), - set: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @param {RegExp} value Regular expression - * @returns {void} - */ - function(value) { - this.options.regExp = value; - }, - "ContextModule.regExp has been moved to ContextModule.options.regExp" - ) -}); - -// TODO remove in webpack 5 -Object.defineProperty(ContextModule.prototype, "addon", { - configurable: false, - get: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @returns {string} addon - */ - function() { - return this.options.addon; - }, - "ContextModule.addon has been moved to ContextModule.options.addon" - ), - set: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @param {string} value addon - * @returns {void} - */ - function(value) { - this.options.addon = value; - }, - "ContextModule.addon has been moved to ContextModule.options.addon" - ) -}); - -// TODO remove in webpack 5 -Object.defineProperty(ContextModule.prototype, "async", { - configurable: false, - get: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @returns {boolean} is async - */ - function() { - return this.options.mode; - }, - "ContextModule.async has been moved to ContextModule.options.mode" - ), - set: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @param {ContextMode} value Context mode - * @returns {void} - */ - function(value) { - this.options.mode = value; - }, - "ContextModule.async has been moved to ContextModule.options.mode" - ) -}); - -// TODO remove in webpack 5 -Object.defineProperty(ContextModule.prototype, "chunkName", { - configurable: false, - get: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @returns {string} chunk name - */ - function() { - return this.options.chunkName; - }, - "ContextModule.chunkName has been moved to ContextModule.options.chunkName" - ), - set: util.deprecate( - /** - * @deprecated - * @this {ContextModule} - * @param {string} value chunk name - * @returns {void} - */ - function(value) { - this.options.chunkName = value; - }, - "ContextModule.chunkName has been moved to ContextModule.options.chunkName" - ) -}); - -module.exports = ContextModule; +module.exports = EvalSourceMapDevToolPlugin; /***/ }), -/***/ 88239: +/***/ 50471: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -58305,267 +56874,58 @@ module.exports = ContextModule; */ -const asyncLib = __webpack_require__(36386); -const path = __webpack_require__(85622); - -const { - Tapable, - AsyncSeriesWaterfallHook, - SyncWaterfallHook -} = __webpack_require__(92402); -const ContextModule = __webpack_require__(20090); -const ContextElementDependency = __webpack_require__(89079); - -/** @typedef {import("./Module")} Module */ +const { ConcatSource } = __webpack_require__(53665); -const EMPTY_RESOLVE_OPTIONS = {}; +/** @typedef {import("./Compilation")} Compilation */ -module.exports = class ContextModuleFactory extends Tapable { - constructor(resolverFactory) { - super(); - this.hooks = { - /** @type {AsyncSeriesWaterfallHook} */ - beforeResolve: new AsyncSeriesWaterfallHook(["data"]), - /** @type {AsyncSeriesWaterfallHook} */ - afterResolve: new AsyncSeriesWaterfallHook(["data"]), - /** @type {SyncWaterfallHook} */ - contextModuleFiles: new SyncWaterfallHook(["files"]), - /** @type {SyncWaterfallHook} */ - alternatives: new AsyncSeriesWaterfallHook(["modules"]) - }; - this._pluginCompat.tap("ContextModuleFactory", options => { - switch (options.name) { - case "before-resolve": - case "after-resolve": - case "alternatives": - options.async = true; - break; - } - }); - this.resolverFactory = resolverFactory; - } - - create(data, callback) { - const context = data.context; - const dependencies = data.dependencies; - const resolveOptions = data.resolveOptions; - const dependency = dependencies[0]; - this.hooks.beforeResolve.callAsync( - Object.assign( - { - context: context, - dependencies: dependencies, - resolveOptions - }, - dependency.options - ), - (err, beforeResolveResult) => { - if (err) return callback(err); - - // Ignored - if (!beforeResolveResult) return callback(); - - const context = beforeResolveResult.context; - const request = beforeResolveResult.request; - const resolveOptions = beforeResolveResult.resolveOptions; - - let loaders, - resource, - loadersPrefix = ""; - const idx = request.lastIndexOf("!"); - if (idx >= 0) { - let loadersRequest = request.substr(0, idx + 1); - let i; - for ( - i = 0; - i < loadersRequest.length && loadersRequest[i] === "!"; - i++ - ) { - loadersPrefix += "!"; - } - loadersRequest = loadersRequest - .substr(i) - .replace(/!+$/, "") - .replace(/!!+/g, "!"); - if (loadersRequest === "") { - loaders = []; - } else { - loaders = loadersRequest.split("!"); - } - resource = request.substr(idx + 1); - } else { - loaders = []; - resource = request; - } - - const contextResolver = this.resolverFactory.get( - "context", - resolveOptions || EMPTY_RESOLVE_OPTIONS - ); - const loaderResolver = this.resolverFactory.get( - "loader", - EMPTY_RESOLVE_OPTIONS - ); - - asyncLib.parallel( - [ - callback => { - contextResolver.resolve( - {}, - context, - resource, - {}, - (err, result) => { - if (err) return callback(err); - callback(null, result); - } - ); - }, - callback => { - asyncLib.map( - loaders, - (loader, callback) => { - loaderResolver.resolve( - {}, - context, - loader, - {}, - (err, result) => { - if (err) return callback(err); - callback(null, result); - } - ); - }, - callback - ); - } - ], - (err, result) => { - if (err) return callback(err); - - this.hooks.afterResolve.callAsync( - Object.assign( - { - addon: - loadersPrefix + - result[1].join("!") + - (result[1].length > 0 ? "!" : ""), - resource: result[0], - resolveDependencies: this.resolveDependencies.bind(this) - }, - beforeResolveResult - ), - (err, result) => { - if (err) return callback(err); - - // Ignored - if (!result) return callback(); +/** + * @param {string[]} accessor the accessor to convert to path + * @returns {string} the path + */ +const accessorToObjectAccess = accessor => { + return accessor.map(a => `[${JSON.stringify(a)}]`).join(""); +}; - return callback( - null, - new ContextModule(result.resolveDependencies, result) - ); - } - ); - } - ); - } - ); +class ExportPropertyMainTemplatePlugin { + /** + * @param {string|string[]} property the name of the property to export + */ + constructor(property) { + this.property = property; } - resolveDependencies(fs, options, callback) { - const cmf = this; - let resource = options.resource; - let resourceQuery = options.resourceQuery; - let recursive = options.recursive; - let regExp = options.regExp; - let include = options.include; - let exclude = options.exclude; - if (!regExp || !resource) return callback(null, []); - - const addDirectory = (directory, callback) => { - fs.readdir(directory, (err, files) => { - if (err) return callback(err); - files = cmf.hooks.contextModuleFiles.call(files); - if (!files || files.length === 0) return callback(null, []); - asyncLib.map( - files.filter(p => p.indexOf(".") !== 0), - (segment, callback) => { - const subResource = path.join(directory, segment); - - if (!exclude || !subResource.match(exclude)) { - fs.stat(subResource, (err, stat) => { - if (err) { - if (err.code === "ENOENT") { - // ENOENT is ok here because the file may have been deleted between - // the readdir and stat calls. - return callback(); - } else { - return callback(err); - } - } - - if (stat.isDirectory()) { - if (!recursive) return callback(); - addDirectory.call(this, subResource, callback); - } else if ( - stat.isFile() && - (!include || subResource.match(include)) - ) { - const obj = { - context: resource, - request: - "." + - subResource.substr(resource.length).replace(/\\/g, "/") - }; - - this.hooks.alternatives.callAsync( - [obj], - (err, alternatives) => { - if (err) return callback(err); - alternatives = alternatives - .filter(obj => regExp.test(obj.request)) - .map(obj => { - const dep = new ContextElementDependency( - obj.request + resourceQuery, - obj.request - ); - dep.optional = true; - return dep; - }); - callback(null, alternatives); - } - ); - } else { - callback(); - } - }); - } else { - callback(); - } - }, - (err, result) => { - if (err) return callback(err); - - if (!result) return callback(null, []); + /** + * @param {Compilation} compilation the compilation instance + * @returns {void} + */ + apply(compilation) { + const { mainTemplate, chunkTemplate } = compilation; - callback( - null, - result.filter(Boolean).reduce((a, i) => a.concat(i), []) - ); - } - ); - }); + const onRenderWithEntry = (source, chunk, hash) => { + const postfix = `${accessorToObjectAccess([].concat(this.property))}`; + return new ConcatSource(source, postfix); }; - addDirectory(resource, callback); + for (const template of [mainTemplate, chunkTemplate]) { + template.hooks.renderWithEntry.tap( + "ExportPropertyMainTemplatePlugin", + onRenderWithEntry + ); + } + + mainTemplate.hooks.hash.tap("ExportPropertyMainTemplatePlugin", hash => { + hash.update("export property"); + hash.update(`${this.property}`); + }); } -}; +} + +module.exports = ExportPropertyMainTemplatePlugin; /***/ }), -/***/ 27295: +/***/ 17270: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -58575,138 +56935,93 @@ module.exports = class ContextModuleFactory extends Tapable { */ -const path = __webpack_require__(85622); -const ContextElementDependency = __webpack_require__(89079); - -class ContextReplacementPlugin { - constructor( - resourceRegExp, - newContentResource, - newContentRecursive, - newContentRegExp - ) { - this.resourceRegExp = resourceRegExp; +const Template = __webpack_require__(96066); +const ConstDependency = __webpack_require__(71101); +const ParserHelpers = __webpack_require__(23999); +const NullFactory = __webpack_require__(40438); - if (typeof newContentResource === "function") { - this.newContentCallback = newContentResource; - } else if ( - typeof newContentResource === "string" && - typeof newContentRecursive === "object" - ) { - this.newContentResource = newContentResource; - this.newContentCreateContextMap = (fs, callback) => { - callback(null, newContentRecursive); - }; - } else if ( - typeof newContentResource === "string" && - typeof newContentRecursive === "function" - ) { - this.newContentResource = newContentResource; - this.newContentCreateContextMap = newContentRecursive; - } else { - if (typeof newContentResource !== "string") { - newContentRegExp = newContentRecursive; - newContentRecursive = newContentResource; - newContentResource = undefined; - } - if (typeof newContentRecursive !== "boolean") { - newContentRegExp = newContentRecursive; - newContentRecursive = undefined; - } - this.newContentResource = newContentResource; - this.newContentRecursive = newContentRecursive; - this.newContentRegExp = newContentRegExp; - } - } +const REPLACEMENTS = { + // eslint-disable-next-line camelcase + __webpack_hash__: "__webpack_require__.h", + // eslint-disable-next-line camelcase + __webpack_chunkname__: "__webpack_require__.cn" +}; +const REPLACEMENT_TYPES = { + // eslint-disable-next-line camelcase + __webpack_hash__: "string", + // eslint-disable-next-line camelcase + __webpack_chunkname__: "string" +}; +class ExtendedAPIPlugin { apply(compiler) { - const resourceRegExp = this.resourceRegExp; - const newContentCallback = this.newContentCallback; - const newContentResource = this.newContentResource; - const newContentRecursive = this.newContentRecursive; - const newContentRegExp = this.newContentRegExp; - const newContentCreateContextMap = this.newContentCreateContextMap; + compiler.hooks.compilation.tap( + "ExtendedAPIPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(ConstDependency, new NullFactory()); + compilation.dependencyTemplates.set( + ConstDependency, + new ConstDependency.Template() + ); - compiler.hooks.contextModuleFactory.tap("ContextReplacementPlugin", cmf => { - cmf.hooks.beforeResolve.tap("ContextReplacementPlugin", result => { - if (!result) return; - if (resourceRegExp.test(result.request)) { - if (newContentResource !== undefined) { - result.request = newContentResource; - } - if (newContentRecursive !== undefined) { - result.recursive = newContentRecursive; - } - if (newContentRegExp !== undefined) { - result.regExp = newContentRegExp; - } - if (typeof newContentCallback === "function") { - newContentCallback(result); - } else { - for (const d of result.dependencies) { - if (d.critical) d.critical = false; - } - } - } - return result; - }); - cmf.hooks.afterResolve.tap("ContextReplacementPlugin", result => { - if (!result) return; - if (resourceRegExp.test(result.resource)) { - if (newContentResource !== undefined) { - result.resource = path.resolve(result.resource, newContentResource); - } - if (newContentRecursive !== undefined) { - result.recursive = newContentRecursive; - } - if (newContentRegExp !== undefined) { - result.regExp = newContentRegExp; - } - if (typeof newContentCreateContextMap === "function") { - result.resolveDependencies = createResolveDependenciesFromContextMap( - newContentCreateContextMap + const mainTemplate = compilation.mainTemplate; + mainTemplate.hooks.requireExtensions.tap( + "ExtendedAPIPlugin", + (source, chunk, hash) => { + const buf = [source]; + buf.push(""); + buf.push("// __webpack_hash__"); + buf.push(`${mainTemplate.requireFn}.h = ${JSON.stringify(hash)};`); + buf.push(""); + buf.push("// __webpack_chunkname__"); + buf.push( + `${mainTemplate.requireFn}.cn = ${JSON.stringify(chunk.name)};` ); + return Template.asString(buf); } - if (typeof newContentCallback === "function") { - const origResource = result.resource; - newContentCallback(result); - if (result.resource !== origResource) { - result.resource = path.resolve(origResource, result.resource); - } - } else { - for (const d of result.dependencies) { - if (d.critical) d.critical = false; - } - } - } - return result; - }); - }); + ); + mainTemplate.hooks.globalHash.tap("ExtendedAPIPlugin", () => true); + + const handler = (parser, parserOptions) => { + Object.keys(REPLACEMENTS).forEach(key => { + parser.hooks.expression + .for(key) + .tap( + "ExtendedAPIPlugin", + ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + REPLACEMENTS[key] + ) + ); + parser.hooks.evaluateTypeof + .for(key) + .tap( + "ExtendedAPIPlugin", + ParserHelpers.evaluateToString(REPLACEMENT_TYPES[key]) + ); + }); + }; + + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("ExtendedAPIPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("ExtendedAPIPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/esm") + .tap("ExtendedAPIPlugin", handler); + } + ); } } -const createResolveDependenciesFromContextMap = createContextMap => { - const resolveDependenciesFromContextMap = (fs, options, callback) => { - createContextMap(fs, (err, map) => { - if (err) return callback(err); - const dependencies = Object.keys(map).map(key => { - return new ContextElementDependency( - map[key] + options.resourceQuery, - key - ); - }); - callback(null, dependencies); - }); - }; - return resolveDependenciesFromContextMap; -}; - -module.exports = ContextReplacementPlugin; +module.exports = ExtendedAPIPlugin; /***/ }), -/***/ 97374: +/***/ 17204: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -58716,393 +57031,160 @@ module.exports = ContextReplacementPlugin; */ -const ConstDependency = __webpack_require__(71101); -const BasicEvaluatedExpression = __webpack_require__(96770); -const ParserHelpers = __webpack_require__(23999); -const NullFactory = __webpack_require__(40438); +const { OriginalSource, RawSource } = __webpack_require__(53665); +const Module = __webpack_require__(75993); +const WebpackMissingModule = __webpack_require__(75386); +const Template = __webpack_require__(96066); -/** @typedef {import("./Compiler")} Compiler */ -/** @typedef {import("./Parser")} Parser */ -/** @typedef {null|undefined|RegExp|Function|string|number} CodeValuePrimitive */ -/** @typedef {CodeValuePrimitive|Record|RuntimeValue} CodeValue */ +/** @typedef {import("./util/createHash").Hash} Hash */ -class RuntimeValue { - constructor(fn, fileDependencies) { - this.fn = fn; - this.fileDependencies = fileDependencies || []; +class ExternalModule extends Module { + constructor(request, type, userRequest) { + super("javascript/dynamic", null); + + // Info from Factory + this.request = request; + this.externalType = type; + this.userRequest = userRequest; + this.external = true; } - exec(parser) { - if (this.fileDependencies === true) { - parser.state.module.buildInfo.cacheable = false; - } else { - for (const fileDependency of this.fileDependencies) { - parser.state.module.buildInfo.fileDependencies.add(fileDependency); - } - } + libIdent() { + return this.userRequest; + } - return this.fn({ module: parser.state.module }); + chunkCondition(chunk) { + return chunk.hasEntryModule(); } -} -const stringifyObj = (obj, parser) => { - return ( - "Object({" + - Object.keys(obj) - .map(key => { - const code = obj[key]; - return JSON.stringify(key) + ":" + toCode(code, parser); - }) - .join(",") + - "})" - ); -}; - -/** - * Convert code to a string that evaluates - * @param {CodeValue} code Code to evaluate - * @param {Parser} parser Parser - * @returns {string} code converted to string that evaluates - */ -const toCode = (code, parser) => { - if (code === null) { - return "null"; - } - if (code === undefined) { - return "undefined"; - } - if (code instanceof RuntimeValue) { - return toCode(code.exec(parser), parser); - } - if (code instanceof RegExp && code.toString) { - return code.toString(); - } - if (typeof code === "function" && code.toString) { - return "(" + code.toString() + ")"; - } - if (typeof code === "object") { - return stringifyObj(code, parser); + identifier() { + return "external " + JSON.stringify(this.request); } - return code + ""; -}; -class DefinePlugin { - /** - * Create a new define plugin - * @param {Record} definitions A map of global object definitions - */ - constructor(definitions) { - this.definitions = definitions; + readableIdentifier() { + return "external " + JSON.stringify(this.request); } - static runtimeValue(fn, fileDependencies) { - return new RuntimeValue(fn, fileDependencies); + needRebuild() { + return false; } - /** - * Apply the plugin - * @param {Compiler} compiler Webpack compiler - * @returns {void} - */ - apply(compiler) { - const definitions = this.definitions; - compiler.hooks.compilation.tap( - "DefinePlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set(ConstDependency, new NullFactory()); - compilation.dependencyTemplates.set( - ConstDependency, - new ConstDependency.Template() - ); - - /** - * Handler - * @param {Parser} parser Parser - * @returns {void} - */ - const handler = parser => { - /** - * Walk definitions - * @param {Object} definitions Definitions map - * @param {string} prefix Prefix string - * @returns {void} - */ - const walkDefinitions = (definitions, prefix) => { - Object.keys(definitions).forEach(key => { - const code = definitions[key]; - if ( - code && - typeof code === "object" && - !(code instanceof RuntimeValue) && - !(code instanceof RegExp) - ) { - walkDefinitions(code, prefix + key + "."); - applyObjectDefine(prefix + key, code); - return; - } - applyDefineKey(prefix, key); - applyDefine(prefix + key, code); - }); - }; - - /** - * Apply define key - * @param {string} prefix Prefix - * @param {string} key Key - * @returns {void} - */ - const applyDefineKey = (prefix, key) => { - const splittedKey = key.split("."); - splittedKey.slice(1).forEach((_, i) => { - const fullKey = prefix + splittedKey.slice(0, i + 1).join("."); - parser.hooks.canRename - .for(fullKey) - .tap("DefinePlugin", ParserHelpers.approve); - }); - }; - - /** - * Apply Code - * @param {string} key Key - * @param {CodeValue} code Code - * @returns {void} - */ - const applyDefine = (key, code) => { - const isTypeof = /^typeof\s+/.test(key); - if (isTypeof) key = key.replace(/^typeof\s+/, ""); - let recurse = false; - let recurseTypeof = false; - if (!isTypeof) { - parser.hooks.canRename - .for(key) - .tap("DefinePlugin", ParserHelpers.approve); - parser.hooks.evaluateIdentifier - .for(key) - .tap("DefinePlugin", expr => { - /** - * this is needed in case there is a recursion in the DefinePlugin - * to prevent an endless recursion - * e.g.: new DefinePlugin({ - * "a": "b", - * "b": "a" - * }); - */ - if (recurse) return; - recurse = true; - const res = parser.evaluate(toCode(code, parser)); - recurse = false; - res.setRange(expr.range); - return res; - }); - parser.hooks.expression.for(key).tap("DefinePlugin", expr => { - const strCode = toCode(code, parser); - if (/__webpack_require__/.test(strCode)) { - return ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - strCode - )(expr); - } else { - return ParserHelpers.toConstantDependency( - parser, - strCode - )(expr); - } - }); - } - parser.hooks.evaluateTypeof.for(key).tap("DefinePlugin", expr => { - /** - * this is needed in case there is a recursion in the DefinePlugin - * to prevent an endless recursion - * e.g.: new DefinePlugin({ - * "typeof a": "typeof b", - * "typeof b": "typeof a" - * }); - */ - if (recurseTypeof) return; - recurseTypeof = true; - const typeofCode = isTypeof - ? toCode(code, parser) - : "typeof (" + toCode(code, parser) + ")"; - const res = parser.evaluate(typeofCode); - recurseTypeof = false; - res.setRange(expr.range); - return res; - }); - parser.hooks.typeof.for(key).tap("DefinePlugin", expr => { - const typeofCode = isTypeof - ? toCode(code, parser) - : "typeof (" + toCode(code, parser) + ")"; - const res = parser.evaluate(typeofCode); - if (!res.isString()) return; - return ParserHelpers.toConstantDependency( - parser, - JSON.stringify(res.string) - ).bind(parser)(expr); - }); - }; - - /** - * Apply Object - * @param {string} key Key - * @param {Object} obj Object - * @returns {void} - */ - const applyObjectDefine = (key, obj) => { - parser.hooks.canRename - .for(key) - .tap("DefinePlugin", ParserHelpers.approve); - parser.hooks.evaluateIdentifier - .for(key) - .tap("DefinePlugin", expr => - new BasicEvaluatedExpression().setTruthy().setRange(expr.range) - ); - parser.hooks.evaluateTypeof.for(key).tap("DefinePlugin", expr => { - return ParserHelpers.evaluateToString("object")(expr); - }); - parser.hooks.expression.for(key).tap("DefinePlugin", expr => { - const strCode = stringifyObj(obj, parser); - - if (/__webpack_require__/.test(strCode)) { - return ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - strCode - )(expr); - } else { - return ParserHelpers.toConstantDependency( - parser, - strCode - )(expr); - } - }); - parser.hooks.typeof.for(key).tap("DefinePlugin", expr => { - return ParserHelpers.toConstantDependency( - parser, - JSON.stringify("object") - )(expr); - }); - }; - - walkDefinitions(definitions, ""); - }; - - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("DefinePlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("DefinePlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("DefinePlugin", handler); - } - ); + build(options, compilation, resolver, fs, callback) { + this.built = true; + this.buildMeta = {}; + this.buildInfo = {}; + callback(); } -} -module.exports = DefinePlugin; - - -/***/ }), - -/***/ 42173: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const { OriginalSource, RawSource } = __webpack_require__(53665); - -const Module = __webpack_require__(75993); -const WebpackMissingModule = __webpack_require__(75386); -const DelegatedSourceDependency = __webpack_require__(25930); -const DelegatedExportsDependency = __webpack_require__(53104); -/** @typedef {import("./dependencies/ModuleDependency")} ModuleDependency */ -/** @typedef {import("./util/createHash").Hash} Hash */ - -class DelegatedModule extends Module { - constructor(sourceRequest, data, type, userRequest, originalRequest) { - super("javascript/dynamic", null); - - // Info from Factory - this.sourceRequest = sourceRequest; - this.request = data.id; - this.type = type; - this.userRequest = userRequest; - this.originalRequest = originalRequest; - this.delegateData = data; - - // Build info - this.delegatedSourceDependency = undefined; - } + getSourceForGlobalVariableExternal(variableName, type) { + if (!Array.isArray(variableName)) { + // make it an array as the look up works the same basically + variableName = [variableName]; + } - libIdent(options) { - return typeof this.originalRequest === "string" - ? this.originalRequest - : this.originalRequest.libIdent(options); + // needed for e.g. window["some"]["thing"] + const objectLookup = variableName + .map(r => `[${JSON.stringify(r)}]`) + .join(""); + return `(function() { module.exports = ${type}${objectLookup}; }());`; } - identifier() { - return `delegated ${JSON.stringify(this.request)} from ${ - this.sourceRequest - }`; - } + getSourceForCommonJsExternal(moduleAndSpecifiers) { + if (!Array.isArray(moduleAndSpecifiers)) { + return `module.exports = require(${JSON.stringify( + moduleAndSpecifiers + )});`; + } - readableIdentifier() { - return `delegated ${this.userRequest} from ${this.sourceRequest}`; + const moduleName = moduleAndSpecifiers[0]; + const objectLookup = moduleAndSpecifiers + .slice(1) + .map(r => `[${JSON.stringify(r)}]`) + .join(""); + return `module.exports = require(${JSON.stringify( + moduleName + )})${objectLookup};`; } - needRebuild() { - return false; + checkExternalVariable(variableToCheck, request) { + return `if(typeof ${variableToCheck} === 'undefined') {${WebpackMissingModule.moduleCode( + request + )}}\n`; } - build(options, compilation, resolver, fs, callback) { - this.built = true; - this.buildMeta = Object.assign({}, this.delegateData.buildMeta); - this.buildInfo = {}; - this.delegatedSourceDependency = new DelegatedSourceDependency( - this.sourceRequest - ); - this.addDependency(this.delegatedSourceDependency); - this.addDependency( - new DelegatedExportsDependency(this, this.delegateData.exports || true) - ); - callback(); + getSourceForAmdOrUmdExternal(id, optional, request) { + const externalVariable = `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier( + `${id}` + )}__`; + const missingModuleError = optional + ? this.checkExternalVariable(externalVariable, request) + : ""; + return `${missingModuleError}module.exports = ${externalVariable};`; } - source(depTemplates, runtime) { - const dep = /** @type {DelegatedSourceDependency} */ (this.dependencies[0]); - const sourceModule = dep.module; - let str; - - if (!sourceModule) { - str = WebpackMissingModule.moduleCode(this.sourceRequest); - } else { - str = `module.exports = (${runtime.moduleExports({ - module: sourceModule, - request: dep.request - })})`; + getSourceForDefaultCase(optional, request) { + if (!Array.isArray(request)) { + // make it an array as the look up works the same basically + request = [request]; + } - switch (this.type) { - case "require": - str += `(${JSON.stringify(this.request)})`; - break; - case "object": - str += `[${JSON.stringify(this.request)}]`; - break; - } + const variableName = request[0]; + const missingModuleError = optional + ? this.checkExternalVariable(variableName, request.join(".")) + : ""; + const objectLookup = request + .slice(1) + .map(r => `[${JSON.stringify(r)}]`) + .join(""); + return `${missingModuleError}module.exports = ${variableName}${objectLookup};`; + } - str += ";"; + getSourceString(runtime) { + const request = + typeof this.request === "object" && !Array.isArray(this.request) + ? this.request[this.externalType] + : this.request; + switch (this.externalType) { + case "this": + case "window": + case "self": + return this.getSourceForGlobalVariableExternal( + request, + this.externalType + ); + case "global": + return this.getSourceForGlobalVariableExternal( + request, + runtime.outputOptions.globalObject + ); + case "commonjs": + case "commonjs2": + return this.getSourceForCommonJsExternal(request); + case "amd": + case "amd-require": + case "umd": + case "umd2": + case "system": + return this.getSourceForAmdOrUmdExternal( + this.id, + this.optional, + request + ); + default: + return this.getSourceForDefaultCase(this.optional, request); } + } + getSource(sourceString) { if (this.useSourceMap) { - return new OriginalSource(str, this.identifier()); - } else { - return new RawSource(str); + return new OriginalSource(sourceString, this.identifier()); } + + return new RawSource(sourceString); + } + + source(dependencyTemplates, runtime) { + return this.getSource(this.getSourceString(runtime)); } size() { @@ -59114,18 +57196,19 @@ class DelegatedModule extends Module { * @returns {void} */ updateHash(hash) { - hash.update(this.type); + hash.update(this.externalType); hash.update(JSON.stringify(this.request)); + hash.update(JSON.stringify(Boolean(this.optional))); super.updateHash(hash); } } -module.exports = DelegatedModule; +module.exports = ExternalModule; /***/ }), -/***/ 81002: +/***/ 67876: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -59135,232 +57218,192 @@ module.exports = DelegatedModule; */ -const DelegatedModule = __webpack_require__(42173); +const ExternalModule = __webpack_require__(17204); -// options.source -// options.type -// options.context -// options.scope -// options.content -class DelegatedModuleFactoryPlugin { - constructor(options) { - this.options = options; - options.type = options.type || "require"; - options.extensions = options.extensions || [ - "", - ".wasm", - ".mjs", - ".js", - ".json" - ]; +class ExternalModuleFactoryPlugin { + constructor(type, externals) { + this.type = type; + this.externals = externals; } apply(normalModuleFactory) { - const scope = this.options.scope; - if (scope) { - normalModuleFactory.hooks.factory.tap( - "DelegatedModuleFactoryPlugin", - factory => (data, callback) => { - const dependency = data.dependencies[0]; - const request = dependency.request; - if (request && request.indexOf(scope + "/") === 0) { - const innerRequest = "." + request.substr(scope.length); - let resolved; - if (innerRequest in this.options.content) { - resolved = this.options.content[innerRequest]; - return callback( - null, - new DelegatedModule( - this.options.source, - resolved, - this.options.type, - innerRequest, - request - ) - ); - } - for (let i = 0; i < this.options.extensions.length; i++) { - const extension = this.options.extensions[i]; - const requestPlusExt = innerRequest + extension; - if (requestPlusExt in this.options.content) { - resolved = this.options.content[requestPlusExt]; - return callback( - null, - new DelegatedModule( - this.options.source, - resolved, - this.options.type, - requestPlusExt, - request + extension - ) - ); - } - } + const globalType = this.type; + normalModuleFactory.hooks.factory.tap( + "ExternalModuleFactoryPlugin", + factory => (data, callback) => { + const context = data.context; + const dependency = data.dependencies[0]; + + const handleExternal = (value, type, callback) => { + if (typeof type === "function") { + callback = type; + type = undefined; } - return factory(data, callback); - } - ); - } else { - normalModuleFactory.hooks.module.tap( - "DelegatedModuleFactoryPlugin", - module => { - if (module.libIdent) { - const request = module.libIdent(this.options); - if (request && request in this.options.content) { - const resolved = this.options.content[request]; - return new DelegatedModule( - this.options.source, - resolved, - this.options.type, - request, - module - ); + if (value === false) return factory(data, callback); + if (value === true) value = dependency.request; + if (type === undefined && /^[a-z0-9]+ /.test(value)) { + const idx = value.indexOf(" "); + type = value.substr(0, idx); + value = value.substr(idx + 1); + } + callback( + null, + new ExternalModule(value, type || globalType, dependency.request) + ); + return true; + }; + + const handleExternals = (externals, callback) => { + if (typeof externals === "string") { + if (externals === dependency.request) { + return handleExternal(dependency.request, callback); + } + } else if (Array.isArray(externals)) { + let i = 0; + const next = () => { + let asyncFlag; + const handleExternalsAndCallback = (err, module) => { + if (err) return callback(err); + if (!module) { + if (asyncFlag) { + asyncFlag = false; + return; + } + return next(); + } + callback(null, module); + }; + + do { + asyncFlag = true; + if (i >= externals.length) return callback(); + handleExternals(externals[i++], handleExternalsAndCallback); + } while (!asyncFlag); + asyncFlag = false; + }; + + next(); + return; + } else if (externals instanceof RegExp) { + if (externals.test(dependency.request)) { + return handleExternal(dependency.request, callback); } + } else if (typeof externals === "function") { + externals.call( + null, + context, + dependency.request, + (err, value, type) => { + if (err) return callback(err); + if (value !== undefined) { + handleExternal(value, type, callback); + } else { + callback(); + } + } + ); + return; + } else if ( + typeof externals === "object" && + Object.prototype.hasOwnProperty.call(externals, dependency.request) + ) { + return handleExternal(externals[dependency.request], callback); } - return module; - } - ); - } + callback(); + }; + + handleExternals(this.externals, (err, module) => { + if (err) return callback(err); + if (!module) return handleExternal(false, callback); + return callback(null, module); + }); + } + ); } } -module.exports = DelegatedModuleFactoryPlugin; +module.exports = ExternalModuleFactoryPlugin; /***/ }), -/***/ 16071: +/***/ 75705: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ - + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -const DependenciesBlockVariable = __webpack_require__(82904); -/** @typedef {import("./ChunkGroup")} ChunkGroup */ -/** @typedef {import("./Dependency")} Dependency */ -/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ -/** @typedef {import("./DependenciesBlockVariable")} DependenciesBlockVariable */ -/** @typedef {(d: Dependency) => boolean} DependencyFilterFunction */ -/** @typedef {import("./util/createHash").Hash} Hash */ +const ExternalModuleFactoryPlugin = __webpack_require__(67876); -class DependenciesBlock { - constructor() { - /** @type {Dependency[]} */ - this.dependencies = []; - /** @type {AsyncDependenciesBlock[]} */ - this.blocks = []; - /** @type {DependenciesBlockVariable[]} */ - this.variables = []; +class ExternalsPlugin { + constructor(type, externals) { + this.type = type; + this.externals = externals; } - - /** - * Adds a DependencyBlock to DependencyBlock relationship. - * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting) - * - * @param {AsyncDependenciesBlock} block block being added - * @returns {void} - */ - addBlock(block) { - this.blocks.push(block); - block.parent = this; + apply(compiler) { + compiler.hooks.compile.tap("ExternalsPlugin", ({ normalModuleFactory }) => { + new ExternalModuleFactoryPlugin(this.type, this.externals).apply( + normalModuleFactory + ); + }); } +} - /** - * @param {string} name name of dependency - * @param {string} expression expression string for variable - * @param {Dependency[]} dependencies dependency instances tied to variable - * @returns {void} - */ - addVariable(name, expression, dependencies) { - for (let v of this.variables) { - if (v.name === name && v.expression === expression) { - return; - } - } - this.variables.push( - new DependenciesBlockVariable(name, expression, dependencies) - ); - } +module.exports = ExternalsPlugin; - /** - * @param {Dependency} dependency dependency being tied to block. - * This is an "edge" pointing to another "node" on module graph. - * @returns {void} - */ - addDependency(dependency) { - this.dependencies.push(dependency); - } - /** - * @param {Dependency} dependency dependency being removed - * @returns {void} - */ - removeDependency(dependency) { - const idx = this.dependencies.indexOf(dependency); - if (idx >= 0) { - this.dependencies.splice(idx, 1); - } - } +/***/ }), - /** - * @param {Hash} hash the hash used to track dependencies - * @returns {void} - */ - updateHash(hash) { - for (const dep of this.dependencies) dep.updateHash(hash); - for (const block of this.blocks) block.updateHash(hash); - for (const variable of this.variables) variable.updateHash(hash); - } +/***/ 47163: +/***/ (function(module) { - disconnect() { - for (const dep of this.dependencies) dep.disconnect(); - for (const block of this.blocks) block.disconnect(); - for (const variable of this.variables) variable.disconnect(); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - unseal() { - for (const block of this.blocks) block.unseal(); + + +/** @typedef {import("./Compiler")} Compiler */ + +class FlagAllModulesAsUsedPlugin { + constructor(explanation) { + this.explanation = explanation; } /** - * @param {DependencyFilterFunction} filter filter function for dependencies, gets passed all dependency ties from current instance - * @returns {boolean} returns boolean for filter + * @param {Compiler} compiler webpack compiler + * @returns {void} */ - hasDependencies(filter) { - if (filter) { - for (const dep of this.dependencies) { - if (filter(dep)) return true; - } - } else { - if (this.dependencies.length > 0) { - return true; + apply(compiler) { + compiler.hooks.compilation.tap( + "FlagAllModulesAsUsedPlugin", + compilation => { + compilation.hooks.optimizeDependencies.tap( + "FlagAllModulesAsUsedPlugin", + modules => { + for (const module of modules) { + module.used = true; + module.usedExports = true; + module.addReason(null, null, this.explanation); + } + } + ); } - } - - for (const block of this.blocks) { - if (block.hasDependencies(filter)) return true; - } - for (const variable of this.variables) { - if (variable.hasDependencies(filter)) return true; - } - return false; - } - - sortItems() { - for (const block of this.blocks) block.sortItems(); + ); } } -module.exports = DependenciesBlock; +module.exports = FlagAllModulesAsUsedPlugin; /***/ }), -/***/ 82904: +/***/ 73599: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -59370,78 +57413,180 @@ module.exports = DependenciesBlock; */ -const { RawSource, ReplaceSource } = __webpack_require__(53665); - -/** @typedef {import("./Dependency")} Dependency */ -/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate */ -/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ -/** @typedef {import("./util/createHash").Hash} Hash */ -/** @typedef {(d: Dependency) => boolean} DependencyFilterFunction */ -/** @typedef {Map} DependencyTemplates */ +const Queue = __webpack_require__(38637); -class DependenciesBlockVariable { - /** - * Creates an instance of DependenciesBlockVariable. - * @param {string} name name of DependenciesBlockVariable - * @param {string} expression expression string - * @param {Dependency[]=} dependencies dependencies tied to this varaiable - */ - constructor(name, expression, dependencies) { - this.name = name; - this.expression = expression; - this.dependencies = dependencies || []; +const addToSet = (a, b) => { + for (const item of b) { + a.add(item); } +}; - /** - * @param {Hash} hash hash for instance to update - * @returns {void} - */ - updateHash(hash) { - hash.update(this.name); - hash.update(this.expression); - for (const d of this.dependencies) { - d.updateHash(hash); - } - } +class FlagDependencyExportsPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "FlagDependencyExportsPlugin", + compilation => { + compilation.hooks.finishModules.tap( + "FlagDependencyExportsPlugin", + modules => { + const dependencies = new Map(); - /** - * @param {DependencyTemplates} dependencyTemplates Dependency constructors and templates Map. - * @param {RuntimeTemplate} runtimeTemplate runtimeTemplate to generate expression souce - * @returns {ReplaceSource} returns constructed source for expression via templates - */ - expressionSource(dependencyTemplates, runtimeTemplate) { - const source = new ReplaceSource(new RawSource(this.expression)); - for (const dep of this.dependencies) { - const template = dependencyTemplates.get(dep.constructor); - if (!template) { - throw new Error(`No template for dependency: ${dep.constructor.name}`); - } - template.apply(dep, source, runtimeTemplate, dependencyTemplates); - } - return source; - } + const queue = new Queue(); - disconnect() { - for (const d of this.dependencies) { - d.disconnect(); - } - } + let module; + let moduleWithExports; + let moduleProvidedExports; + let providedExportsAreTemporary; - hasDependencies(filter) { - if (filter) { - return this.dependencies.some(filter); - } - return this.dependencies.length > 0; + const processDependenciesBlock = depBlock => { + for (const dep of depBlock.dependencies) { + if (processDependency(dep)) return true; + } + for (const variable of depBlock.variables) { + for (const dep of variable.dependencies) { + if (processDependency(dep)) return true; + } + } + for (const block of depBlock.blocks) { + if (processDependenciesBlock(block)) return true; + } + return false; + }; + + const processDependency = dep => { + const exportDesc = dep.getExports && dep.getExports(); + if (!exportDesc) return; + moduleWithExports = true; + const exports = exportDesc.exports; + // break early if it's only in the worst state + if (module.buildMeta.providedExports === true) { + return true; + } + // break if it should move to the worst state + if (exports === true) { + module.buildMeta.providedExports = true; + return true; + } + // merge in new exports + if (Array.isArray(exports)) { + addToSet(moduleProvidedExports, exports); + } + // store dependencies + const exportDeps = exportDesc.dependencies; + if (exportDeps) { + providedExportsAreTemporary = true; + for (const exportDependency of exportDeps) { + // add dependency for this module + const set = dependencies.get(exportDependency); + if (set === undefined) { + dependencies.set(exportDependency, new Set([module])); + } else { + set.add(module); + } + } + } + return false; + }; + + const notifyDependencies = () => { + const deps = dependencies.get(module); + if (deps !== undefined) { + for (const dep of deps) { + queue.enqueue(dep); + } + } + }; + + const notifyDependenciesIfDifferent = (set, array) => { + const deps = dependencies.get(module); + if (deps !== undefined) { + if (set.size === array.length) { + let i = 0; + let different = false; + for (const item of set) { + if (item !== array[i++]) { + different = true; + break; + } + } + if (!different) return; + } + for (const dep of deps) { + queue.enqueue(dep); + } + } + }; + + // Start with all modules without provided exports + for (const module of modules) { + if (module.buildInfo.temporaryProvidedExports) { + // Clear exports when they are temporary + // and recreate them + module.buildMeta.providedExports = null; + queue.enqueue(module); + } else if (!module.buildMeta.providedExports) { + queue.enqueue(module); + } + } + + while (queue.length > 0) { + module = queue.dequeue(); + + if (module.buildMeta.providedExports !== true) { + moduleWithExports = + module.buildMeta && module.buildMeta.exportsType; + moduleProvidedExports = new Set(); + providedExportsAreTemporary = false; + processDependenciesBlock(module); + module.buildInfo.temporaryProvidedExports = providedExportsAreTemporary; + if (!moduleWithExports) { + notifyDependencies(); + module.buildMeta.providedExports = true; + } else if (module.buildMeta.providedExports === true) { + notifyDependencies(); + } else if (!module.buildMeta.providedExports) { + notifyDependencies(); + module.buildMeta.providedExports = Array.from( + moduleProvidedExports + ); + } else { + notifyDependenciesIfDifferent( + moduleProvidedExports, + module.buildMeta.providedExports + ); + module.buildMeta.providedExports = Array.from( + moduleProvidedExports + ); + } + } + } + } + ); + const providedExportsCache = new WeakMap(); + compilation.hooks.rebuildModule.tap( + "FlagDependencyExportsPlugin", + module => { + providedExportsCache.set(module, module.buildMeta.providedExports); + } + ); + compilation.hooks.finishRebuildingModule.tap( + "FlagDependencyExportsPlugin", + module => { + module.buildMeta.providedExports = providedExportsCache.get(module); + } + ); + } + ); } } -module.exports = DependenciesBlockVariable; +module.exports = FlagDependencyExportsPlugin; /***/ }), -/***/ 57282: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 33632: +/***/ (function(module) { "use strict"; /* @@ -59450,94 +57595,121 @@ module.exports = DependenciesBlockVariable; */ -const util = __webpack_require__(31669); -const compareLocations = __webpack_require__(22562); -const DependencyReference = __webpack_require__(71722); - /** @typedef {import("./Module")} Module */ -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ -/** - * @typedef {Object} DependencyTemplate - * @property {function(Dependency, Source, RuntimeTemplate, Map): void} apply - */ +/** @typedef {false | true | string[]} UsedExports */ -/** @typedef {Object} SourcePosition - * @property {number} line - * @property {number=} column - */ +const addToSet = (a, b) => { + for (const item of b) { + if (!a.includes(item)) a.push(item); + } + return a; +}; -/** @typedef {Object} RealDependencyLocation - * @property {SourcePosition} start - * @property {SourcePosition=} end - * @property {number=} index - */ +const isSubset = (biggerSet, subset) => { + if (biggerSet === true) return true; + if (subset === true) return false; + return subset.every(item => biggerSet.indexOf(item) >= 0); +}; -/** @typedef {Object} SynteticDependencyLocation - * @property {string} name - * @property {number=} index - */ - -/** @typedef {SynteticDependencyLocation|RealDependencyLocation} DependencyLocation */ - -class Dependency { - constructor() { - /** @type {Module|null} */ - this.module = null; - // TODO remove in webpack 5 - /** @type {boolean} */ - this.weak = false; - /** @type {boolean} */ - this.optional = false; - /** @type {DependencyLocation} */ - this.loc = undefined; - } +class FlagDependencyUsagePlugin { + apply(compiler) { + compiler.hooks.compilation.tap("FlagDependencyUsagePlugin", compilation => { + compilation.hooks.optimizeDependencies.tap( + "FlagDependencyUsagePlugin", + modules => { + const processModule = (module, usedExports) => { + module.used = true; + if (module.usedExports === true) return; + if (usedExports === true) { + module.usedExports = true; + } else if (Array.isArray(usedExports)) { + const old = module.usedExports ? module.usedExports.length : -1; + module.usedExports = addToSet( + module.usedExports || [], + usedExports + ); + if (module.usedExports.length === old) { + return; + } + } else if (Array.isArray(module.usedExports)) { + return; + } else { + module.usedExports = false; + } - getResourceIdentifier() { - return null; - } + // for a module without side effects we stop tracking usage here when no export is used + // This module won't be evaluated in this case + if (module.factoryMeta.sideEffectFree) { + if (module.usedExports === false) return; + if ( + Array.isArray(module.usedExports) && + module.usedExports.length === 0 + ) + return; + } - // Returns the referenced module and export - getReference() { - if (!this.module) return null; - return new DependencyReference(this.module, true, this.weak); - } + queue.push([module, module, module.usedExports]); + }; - // Returns the exported names - getExports() { - return null; - } + const processDependenciesBlock = (module, depBlock, usedExports) => { + for (const dep of depBlock.dependencies) { + processDependency(module, dep); + } + for (const variable of depBlock.variables) { + for (const dep of variable.dependencies) { + processDependency(module, dep); + } + } + for (const block of depBlock.blocks) { + queue.push([module, block, usedExports]); + } + }; - getWarnings() { - return null; - } + const processDependency = (module, dep) => { + const reference = compilation.getDependencyReference(module, dep); + if (!reference) return; + const referenceModule = reference.module; + const importedNames = reference.importedNames; + const oldUsed = referenceModule.used; + const oldUsedExports = referenceModule.usedExports; + if ( + !oldUsed || + (importedNames && + (!oldUsedExports || !isSubset(oldUsedExports, importedNames))) + ) { + processModule(referenceModule, importedNames); + } + }; - getErrors() { - return null; - } + for (const module of modules) { + if (!module.used) module.used = false; + } - updateHash(hash) { - hash.update((this.module && this.module.id) + ""); - } + /** @type {[Module, DependenciesBlock, UsedExports][]} */ + const queue = []; + for (const preparedEntrypoint of compilation._preparedEntrypoints) { + if (preparedEntrypoint.module) { + processModule(preparedEntrypoint.module, true); + } + } - disconnect() { - this.module = null; + while (queue.length) { + const queueItem = queue.pop(); + processDependenciesBlock(queueItem[0], queueItem[1], queueItem[2]); + } + } + ); + }); } } - -// TODO remove in webpack 5 -Dependency.compare = util.deprecate( - (a, b) => compareLocations(a.loc, b.loc), - "Dependency.compare is deprecated and will be removed in the next major version" -); - -module.exports = Dependency; +module.exports = FlagDependencyUsagePlugin; /***/ }), -/***/ 6659: +/***/ 31221: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -59547,221 +57719,299 @@ module.exports = Dependency; */ -const DllEntryDependency = __webpack_require__(66279); -const SingleEntryDependency = __webpack_require__(84828); -const DllModuleFactory = __webpack_require__(62468); - -class DllEntryPlugin { - constructor(context, entries, name) { - this.context = context; - this.entries = entries; - this.name = name; - } +const FunctionModuleTemplatePlugin = __webpack_require__(18864); +class FunctionModulePlugin { apply(compiler) { - compiler.hooks.compilation.tap( - "DllEntryPlugin", - (compilation, { normalModuleFactory }) => { - const dllModuleFactory = new DllModuleFactory(); - compilation.dependencyFactories.set( - DllEntryDependency, - dllModuleFactory - ); - compilation.dependencyFactories.set( - SingleEntryDependency, - normalModuleFactory - ); - } - ); - compiler.hooks.make.tapAsync("DllEntryPlugin", (compilation, callback) => { - compilation.addEntry( - this.context, - new DllEntryDependency( - this.entries.map((e, idx) => { - const dep = new SingleEntryDependency(e); - dep.loc = { - name: this.name, - index: idx - }; - return dep; - }), - this.name - ), - this.name, - callback + compiler.hooks.compilation.tap("FunctionModulePlugin", compilation => { + new FunctionModuleTemplatePlugin().apply( + compilation.moduleTemplates.javascript ); }); } } -module.exports = DllEntryPlugin; +module.exports = FunctionModulePlugin; /***/ }), -/***/ 24803: +/***/ 18864: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra - */ +*/ -const { RawSource } = __webpack_require__(53665); -const Module = __webpack_require__(75993); +const { ConcatSource } = __webpack_require__(53665); +const Template = __webpack_require__(96066); -/** @typedef {import("./util/createHash").Hash} Hash */ +class FunctionModuleTemplatePlugin { + apply(moduleTemplate) { + moduleTemplate.hooks.render.tap( + "FunctionModuleTemplatePlugin", + (moduleSource, module) => { + const source = new ConcatSource(); + const args = [module.moduleArgument]; + // TODO remove HACK checking type for javascript + if (module.type && module.type.startsWith("javascript")) { + args.push(module.exportsArgument); + if (module.hasDependencies(d => d.requireWebpackRequire !== false)) { + args.push("__webpack_require__"); + } + } else if (module.type && module.type.startsWith("json")) { + // no additional arguments needed + } else { + args.push(module.exportsArgument, "__webpack_require__"); + } + source.add("/***/ (function(" + args.join(", ") + ") {\n\n"); + if (module.buildInfo.strict) source.add('"use strict";\n'); + source.add(moduleSource); + source.add("\n\n/***/ })"); + return source; + } + ); -class DllModule extends Module { - constructor(context, dependencies, name, type) { - super("javascript/dynamic", context); + moduleTemplate.hooks.package.tap( + "FunctionModuleTemplatePlugin", + (moduleSource, module) => { + if (moduleTemplate.runtimeTemplate.outputOptions.pathinfo) { + const source = new ConcatSource(); + const req = module.readableIdentifier( + moduleTemplate.runtimeTemplate.requestShortener + ); + const reqStr = req.replace(/\*\//g, "*_/"); + const reqStrStar = "*".repeat(reqStr.length); + source.add("/*!****" + reqStrStar + "****!*\\\n"); + source.add(" !*** " + reqStr + " ***!\n"); + source.add(" \\****" + reqStrStar + "****/\n"); + if ( + Array.isArray(module.buildMeta.providedExports) && + module.buildMeta.providedExports.length === 0 + ) { + source.add(Template.toComment("no exports provided") + "\n"); + } else if (Array.isArray(module.buildMeta.providedExports)) { + source.add( + Template.toComment( + "exports provided: " + + module.buildMeta.providedExports.join(", ") + ) + "\n" + ); + } else if (module.buildMeta.providedExports) { + source.add(Template.toComment("no static exports found") + "\n"); + } + if ( + Array.isArray(module.usedExports) && + module.usedExports.length === 0 + ) { + source.add(Template.toComment("no exports used") + "\n"); + } else if (Array.isArray(module.usedExports)) { + source.add( + Template.toComment( + "exports used: " + module.usedExports.join(", ") + ) + "\n" + ); + } else if (module.usedExports) { + source.add(Template.toComment("all exports used") + "\n"); + } + if (module.optimizationBailout) { + for (const text of module.optimizationBailout) { + let code; + if (typeof text === "function") { + code = text(moduleTemplate.runtimeTemplate.requestShortener); + } else { + code = text; + } + source.add(Template.toComment(`${code}`) + "\n"); + } + } + source.add(moduleSource); + return source; + } + return moduleSource; + } + ); - // Info from Factory - this.dependencies = dependencies; - this.name = name; - this.type = type; + moduleTemplate.hooks.hash.tap("FunctionModuleTemplatePlugin", hash => { + hash.update("FunctionModuleTemplatePlugin"); + hash.update("2"); + }); } +} +module.exports = FunctionModuleTemplatePlugin; - identifier() { - return `dll ${this.name}`; - } - readableIdentifier() { - return `dll ${this.name}`; - } +/***/ }), - build(options, compilation, resolver, fs, callback) { - this.built = true; - this.buildMeta = {}; - this.buildInfo = {}; - return callback(); - } +/***/ 39172: +/***/ (function(module) { - source() { - return new RawSource("module.exports = __webpack_require__;"); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +/** @typedef {import("./NormalModule")} NormalModule */ +/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate */ + +/** + * + */ +class Generator { + static byType(map) { + return new ByTypeGenerator(map); } - needRebuild() { - return false; + /** + * @abstract + * @param {NormalModule} module module for which the code should be generated + * @param {Map} dependencyTemplates mapping from dependencies to templates + * @param {RuntimeTemplate} runtimeTemplate the runtime template + * @param {string} type which kind of code should be generated + * @returns {Source} generated code + */ + generate(module, dependencyTemplates, runtimeTemplate, type) { + throw new Error("Generator.generate: must be overridden"); } +} - size() { - return 12; +class ByTypeGenerator extends Generator { + constructor(map) { + super(); + this.map = map; } /** - * @param {Hash} hash the hash used to track dependencies - * @returns {void} + * @param {NormalModule} module module for which the code should be generated + * @param {Map} dependencyTemplates mapping from dependencies to templates + * @param {RuntimeTemplate} runtimeTemplate the runtime template + * @param {string} type which kind of code should be generated + * @returns {Source} generated code */ - updateHash(hash) { - hash.update("dll module"); - hash.update(this.name || ""); - super.updateHash(hash); + generate(module, dependencyTemplates, runtimeTemplate, type) { + const generator = this.map[type]; + if (!generator) { + throw new Error(`Generator.byType: no generator specified for ${type}`); + } + return generator.generate( + module, + dependencyTemplates, + runtimeTemplate, + type + ); } } -module.exports = DllModule; +module.exports = Generator; /***/ }), -/***/ 62468: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 32973: +/***/ (function(__unused_webpack_module, exports) { -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +/** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("./ChunkGroup")} ChunkGroup */ +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ +/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ +/** + * @param {ChunkGroup} chunkGroup the ChunkGroup to connect + * @param {Chunk} chunk chunk to tie to ChunkGroup + * @returns {void} + */ +const connectChunkGroupAndChunk = (chunkGroup, chunk) => { + if (chunkGroup.pushChunk(chunk)) { + chunk.addGroup(chunkGroup); + } +}; -const { Tapable } = __webpack_require__(92402); -const DllModule = __webpack_require__(24803); +/** + * @param {ChunkGroup} parent parent ChunkGroup to connect + * @param {ChunkGroup} child child ChunkGroup to connect + * @returns {void} + */ +const connectChunkGroupParentAndChild = (parent, child) => { + if (parent.addChild(child)) { + child.addParent(parent); + } +}; -class DllModuleFactory extends Tapable { - constructor() { - super(); - this.hooks = {}; +/** + * @param {Chunk} chunk Chunk to connect to Module + * @param {Module} module Module to connect to Chunk + * @returns {void} + */ +const connectChunkAndModule = (chunk, module) => { + if (module.addChunk(chunk)) { + chunk.addModule(module); } - create(data, callback) { - const dependency = data.dependencies[0]; - callback( - null, - new DllModule( - data.context, - dependency.dependencies, - dependency.name, - dependency.type - ) - ); +}; + +/** + * @param {Chunk} chunk Chunk being disconnected + * @param {Module} module Module being disconnected + * @returns {void} + */ +const disconnectChunkAndModule = (chunk, module) => { + chunk.removeModule(module); + module.removeChunk(chunk); +}; + +/** + * @param {AsyncDependenciesBlock} depBlock DepBlock being tied to ChunkGroup + * @param {ChunkGroup} chunkGroup ChunkGroup being tied to DepBlock + * @returns {void} + */ +const connectDependenciesBlockAndChunkGroup = (depBlock, chunkGroup) => { + if (chunkGroup.addBlock(depBlock)) { + depBlock.chunkGroup = chunkGroup; } -} +}; -module.exports = DllModuleFactory; +exports.connectChunkGroupAndChunk = connectChunkGroupAndChunk; +exports.connectChunkGroupParentAndChild = connectChunkGroupParentAndChild; +exports.connectChunkAndModule = connectChunkAndModule; +exports.disconnectChunkAndModule = disconnectChunkAndModule; +exports.connectDependenciesBlockAndChunkGroup = connectDependenciesBlockAndChunkGroup; /***/ }), -/***/ 45255: +/***/ 30327: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ - - -const DllEntryPlugin = __webpack_require__(6659); -const FlagAllModulesAsUsedPlugin = __webpack_require__(47163); -const LibManifestPlugin = __webpack_require__(30735); +*/ -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(7303); -/** @typedef {import("../declarations/plugins/DllPlugin").DllPluginOptions} DllPluginOptions */ +const WebpackError = __webpack_require__(97391); -class DllPlugin { - /** - * @param {DllPluginOptions} options options object - */ - constructor(options) { - validateOptions(schema, options, "Dll Plugin"); - this.options = options; - } +module.exports = class HarmonyLinkingError extends WebpackError { + /** @param {string} message Error message */ + constructor(message) { + super(message); + this.name = "HarmonyLinkingError"; + this.hideStack = true; - apply(compiler) { - compiler.hooks.entryOption.tap("DllPlugin", (context, entry) => { - const itemToPlugin = (item, name) => { - if (Array.isArray(item)) { - return new DllEntryPlugin(context, item, name); - } - throw new Error("DllPlugin: supply an Array as entry"); - }; - if (typeof entry === "object" && !Array.isArray(entry)) { - Object.keys(entry).forEach(name => { - itemToPlugin(entry[name], name).apply(compiler); - }); - } else { - itemToPlugin(entry, "main").apply(compiler); - } - return true; - }); - new LibManifestPlugin(this.options).apply(compiler); - if (!this.options.entryOnly) { - new FlagAllModulesAsUsedPlugin("DllPlugin").apply(compiler); - } + Error.captureStackTrace(this, this.constructor); } -} - -module.exports = DllPlugin; +}; /***/ }), -/***/ 86231: +/***/ 50268: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -59770,671 +58020,797 @@ module.exports = DllPlugin; Author Tobias Koppers @sokra */ - -const parseJson = __webpack_require__(48335); -const DelegatedSourceDependency = __webpack_require__(25930); -const DelegatedModuleFactoryPlugin = __webpack_require__(81002); -const ExternalModuleFactoryPlugin = __webpack_require__(67876); -const DelegatedExportsDependency = __webpack_require__(53104); -const NullFactory = __webpack_require__(40438); -const makePathsRelative = __webpack_require__(94658).makePathsRelative; -const WebpackError = __webpack_require__(97391); +const createHash = __webpack_require__(15660); const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(61112); +const schema = __webpack_require__(45843); -/** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptions} DllReferencePluginOptions */ -/** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptionsManifest} DllReferencePluginOptionsManifest */ +/** @typedef {import("../declarations/plugins/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions} HashedModuleIdsPluginOptions */ -class DllReferencePlugin { +class HashedModuleIdsPlugin { /** - * @param {DllReferencePluginOptions} options options object + * @param {HashedModuleIdsPluginOptions=} options options object */ constructor(options) { - validateOptions(schema, options, "Dll Reference Plugin"); - this.options = options; - } + if (!options) options = {}; - apply(compiler) { - compiler.hooks.compilation.tap( - "DllReferencePlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set( - DelegatedSourceDependency, - normalModuleFactory - ); - compilation.dependencyFactories.set( - DelegatedExportsDependency, - new NullFactory() - ); - } - ); + validateOptions(schema, options, "Hashed Module Ids Plugin"); - compiler.hooks.beforeCompile.tapAsync( - "DllReferencePlugin", - (params, callback) => { - if ("manifest" in this.options) { - const manifest = this.options.manifest; - if (typeof manifest === "string") { - params.compilationDependencies.add(manifest); - compiler.inputFileSystem.readFile(manifest, (err, result) => { - if (err) return callback(err); - // Catch errors parsing the manifest so that blank - // or malformed manifest files don't kill the process. - try { - params["dll reference " + manifest] = parseJson( - result.toString("utf-8") - ); - } catch (e) { - // Store the error in the params so that it can - // be added as a compilation error later on. - const manifestPath = makePathsRelative( - compiler.options.context, - manifest - ); - params[ - "dll reference parse error " + manifest - ] = new DllManifestError(manifestPath, e.message); - } - return callback(); - }); - return; - } - } - return callback(); - } + /** @type {HashedModuleIdsPluginOptions} */ + this.options = Object.assign( + { + context: null, + hashFunction: "md4", + hashDigest: "base64", + hashDigestLength: 4 + }, + options ); + } - compiler.hooks.compile.tap("DllReferencePlugin", params => { - let name = this.options.name; - let sourceType = this.options.sourceType; - let content = - "content" in this.options ? this.options.content : undefined; - if ("manifest" in this.options) { - let manifestParameter = this.options.manifest; - let manifest; - if (typeof manifestParameter === "string") { - // If there was an error parsing the manifest - // file, exit now because the error will be added - // as a compilation error in the "compilation" hook. - if (params["dll reference parse error " + manifestParameter]) { - return; + apply(compiler) { + const options = this.options; + compiler.hooks.compilation.tap("HashedModuleIdsPlugin", compilation => { + const usedIds = new Set(); + compilation.hooks.beforeModuleIds.tap( + "HashedModuleIdsPlugin", + modules => { + for (const module of modules) { + if (module.id === null && module.libIdent) { + const id = module.libIdent({ + context: this.options.context || compiler.options.context + }); + const hash = createHash(options.hashFunction); + hash.update(id); + const hashId = /** @type {string} */ (hash.digest( + options.hashDigest + )); + let len = options.hashDigestLength; + while (usedIds.has(hashId.substr(0, len))) len++; + module.id = hashId.substr(0, len); + usedIds.add(module.id); + } } - manifest = - /** @type {DllReferencePluginOptionsManifest} */ (params[ - "dll reference " + manifestParameter - ]); - } else { - manifest = manifestParameter; - } - if (manifest) { - if (!name) name = manifest.name; - if (!sourceType) sourceType = manifest.type; - if (!content) content = manifest.content; } - } - const externals = {}; - const source = "dll-reference " + name; - externals[source] = name; - const normalModuleFactory = params.normalModuleFactory; - new ExternalModuleFactoryPlugin(sourceType || "var", externals).apply( - normalModuleFactory ); - new DelegatedModuleFactoryPlugin({ - source: source, - type: this.options.type, - scope: this.options.scope, - context: this.options.context || compiler.options.context, - content, - extensions: this.options.extensions - }).apply(normalModuleFactory); }); - - compiler.hooks.compilation.tap( - "DllReferencePlugin", - (compilation, params) => { - if ("manifest" in this.options) { - let manifest = this.options.manifest; - if (typeof manifest === "string") { - // If there was an error parsing the manifest file, add the - // error as a compilation error to make the compilation fail. - let e = params["dll reference parse error " + manifest]; - if (e) { - compilation.errors.push(e); - } - } - } - } - ); - } -} - -class DllManifestError extends WebpackError { - constructor(filename, message) { - super(); - - this.name = "DllManifestError"; - this.message = `Dll manifest ${filename}\n${message}`; - - Error.captureStackTrace(this, this.constructor); } } -module.exports = DllReferencePlugin; +module.exports = HashedModuleIdsPlugin; /***/ }), -/***/ 49784: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 65217: +/***/ (function(module) { -"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Naoyuki Kanezawa @nkzawa + Author Tobias Koppers @sokra */ +// eslint-disable no-unused-vars +var $hash$ = undefined; +var $requestTimeout$ = undefined; +var installedModules = undefined; +var $require$ = undefined; +var hotDownloadManifest = undefined; +var hotDownloadUpdateChunk = undefined; +var hotDisposeChunk = undefined; +var modules = undefined; +var chunkId = undefined; +module.exports = function() { + var hotApplyOnUpdate = true; + // eslint-disable-next-line no-unused-vars + var hotCurrentHash = $hash$; + var hotRequestTimeout = $requestTimeout$; + var hotCurrentModuleData = {}; + var hotCurrentChildModule; + // eslint-disable-next-line no-unused-vars + var hotCurrentParents = []; + // eslint-disable-next-line no-unused-vars + var hotCurrentParentsTemp = []; -const MultiEntryDependency = __webpack_require__(7791); -const SingleEntryDependency = __webpack_require__(84828); -const MultiModuleFactory = __webpack_require__(24005); -const MultiEntryPlugin = __webpack_require__(98046); -const SingleEntryPlugin = __webpack_require__(19070); - -/** @typedef {import("../declarations/WebpackOptions").EntryDynamic} EntryDynamic */ -/** @typedef {import("../declarations/WebpackOptions").EntryStatic} EntryStatic */ -/** @typedef {import("./Compiler")} Compiler */ - -class DynamicEntryPlugin { - /** - * @param {string} context the context path - * @param {EntryDynamic} entry the entry value - */ - constructor(context, entry) { - this.context = context; - this.entry = entry; - } - - /** - * @param {Compiler} compiler the compiler instance - * @returns {void} - */ - apply(compiler) { - compiler.hooks.compilation.tap( - "DynamicEntryPlugin", - (compilation, { normalModuleFactory }) => { - const multiModuleFactory = new MultiModuleFactory(); - - compilation.dependencyFactories.set( - MultiEntryDependency, - multiModuleFactory - ); - compilation.dependencyFactories.set( - SingleEntryDependency, - normalModuleFactory + // eslint-disable-next-line no-unused-vars + function hotCreateRequire(moduleId) { + var me = installedModules[moduleId]; + if (!me) return $require$; + var fn = function(request) { + if (me.hot.active) { + if (installedModules[request]) { + if (installedModules[request].parents.indexOf(moduleId) === -1) { + installedModules[request].parents.push(moduleId); + } + } else { + hotCurrentParents = [moduleId]; + hotCurrentChildModule = request; + } + if (me.children.indexOf(request) === -1) { + me.children.push(request); + } + } else { + console.warn( + "[HMR] unexpected require(" + + request + + ") from disposed module " + + moduleId ); + hotCurrentParents = []; } - ); - - compiler.hooks.make.tapAsync( - "DynamicEntryPlugin", - (compilation, callback) => { - /** - * @param {string|string[]} entry entry value or array of entry values - * @param {string} name name of entry - * @returns {Promise} returns the promise resolving the Compilation#addEntry function - */ - const addEntry = (entry, name) => { - const dep = DynamicEntryPlugin.createDependency(entry, name); - return new Promise((resolve, reject) => { - compilation.addEntry(this.context, dep, name, err => { - if (err) return reject(err); - resolve(); - }); - }); - }; + return $require$(request); + }; + var ObjectFactory = function ObjectFactory(name) { + return { + configurable: true, + enumerable: true, + get: function() { + return $require$[name]; + }, + set: function(value) { + $require$[name] = value; + } + }; + }; + for (var name in $require$) { + if ( + Object.prototype.hasOwnProperty.call($require$, name) && + name !== "e" && + name !== "t" + ) { + Object.defineProperty(fn, name, ObjectFactory(name)); + } + } + fn.e = function(chunkId) { + if (hotStatus === "ready") hotSetStatus("prepare"); + hotChunksLoading++; + return $require$.e(chunkId).then(finishChunkLoading, function(err) { + finishChunkLoading(); + throw err; + }); - Promise.resolve(this.entry()).then(entry => { - if (typeof entry === "string" || Array.isArray(entry)) { - addEntry(entry, "main").then(() => callback(), callback); - } else if (typeof entry === "object") { - Promise.all( - Object.keys(entry).map(name => { - return addEntry(entry[name], name); - }) - ).then(() => callback(), callback); + function finishChunkLoading() { + hotChunksLoading--; + if (hotStatus === "prepare") { + if (!hotWaitingFilesMap[chunkId]) { + hotEnsureUpdateChunk(chunkId); } - }); + if (hotChunksLoading === 0 && hotWaitingFiles === 0) { + hotUpdateDownloaded(); + } + } } - ); - } -} - -module.exports = DynamicEntryPlugin; -/** - * @param {string|string[]} entry entry value or array of entry paths - * @param {string} name name of entry - * @returns {SingleEntryDependency|MultiEntryDependency} returns dep - */ -DynamicEntryPlugin.createDependency = (entry, name) => { - if (Array.isArray(entry)) { - return MultiEntryPlugin.createDependency(entry, name); - } else { - return SingleEntryPlugin.createDependency(entry, name); + }; + fn.t = function(value, mode) { + if (mode & 1) value = fn(value); + return $require$.t(value, mode & ~1); + }; + return fn; } -}; + // eslint-disable-next-line no-unused-vars + function hotCreateModule(moduleId) { + var hot = { + // private stuff + _acceptedDependencies: {}, + _declinedDependencies: {}, + _selfAccepted: false, + _selfDeclined: false, + _selfInvalidated: false, + _disposeHandlers: [], + _main: hotCurrentChildModule !== moduleId, -/***/ }), + // Module API + active: true, + accept: function(dep, callback) { + if (dep === undefined) hot._selfAccepted = true; + else if (typeof dep === "function") hot._selfAccepted = dep; + else if (typeof dep === "object") + for (var i = 0; i < dep.length; i++) + hot._acceptedDependencies[dep[i]] = callback || function() {}; + else hot._acceptedDependencies[dep] = callback || function() {}; + }, + decline: function(dep) { + if (dep === undefined) hot._selfDeclined = true; + else if (typeof dep === "object") + for (var i = 0; i < dep.length; i++) + hot._declinedDependencies[dep[i]] = true; + else hot._declinedDependencies[dep] = true; + }, + dispose: function(callback) { + hot._disposeHandlers.push(callback); + }, + addDisposeHandler: function(callback) { + hot._disposeHandlers.push(callback); + }, + removeDisposeHandler: function(callback) { + var idx = hot._disposeHandlers.indexOf(callback); + if (idx >= 0) hot._disposeHandlers.splice(idx, 1); + }, + invalidate: function() { + this._selfInvalidated = true; + switch (hotStatus) { + case "idle": + hotUpdate = {}; + hotUpdate[moduleId] = modules[moduleId]; + hotSetStatus("ready"); + break; + case "ready": + hotApplyInvalidatedModule(moduleId); + break; + case "prepare": + case "check": + case "dispose": + case "apply": + (hotQueuedInvalidatedModules = + hotQueuedInvalidatedModules || []).push(moduleId); + break; + default: + // ignore requests in error states + break; + } + }, -/***/ 99531: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Management API + check: hotCheck, + apply: hotApply, + status: function(l) { + if (!l) return hotStatus; + hotStatusHandlers.push(l); + }, + addStatusHandler: function(l) { + hotStatusHandlers.push(l); + }, + removeStatusHandler: function(l) { + var idx = hotStatusHandlers.indexOf(l); + if (idx >= 0) hotStatusHandlers.splice(idx, 1); + }, -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + //inherit from previous dispose call + data: hotCurrentModuleData[moduleId] + }; + hotCurrentChildModule = undefined; + return hot; + } + var hotStatusHandlers = []; + var hotStatus = "idle"; -const WebpackError = __webpack_require__(97391); + function hotSetStatus(newStatus) { + hotStatus = newStatus; + for (var i = 0; i < hotStatusHandlers.length; i++) + hotStatusHandlers[i].call(null, newStatus); + } -class EntryModuleNotFoundError extends WebpackError { - constructor(err) { - super("Entry module not found: " + err); + // while downloading + var hotWaitingFiles = 0; + var hotChunksLoading = 0; + var hotWaitingFilesMap = {}; + var hotRequestedFilesMap = {}; + var hotAvailableFilesMap = {}; + var hotDeferred; - this.name = "EntryModuleNotFoundError"; - this.details = err.details; - this.error = err; + // The update info + var hotUpdate, hotUpdateNewHash, hotQueuedInvalidatedModules; - Error.captureStackTrace(this, this.constructor); + function toModuleId(id) { + var isNumber = +id + "" === id; + return isNumber ? +id : id; } -} - -module.exports = EntryModuleNotFoundError; - -/***/ }), + function hotCheck(apply) { + if (hotStatus !== "idle") { + throw new Error("check() is only allowed in idle status"); + } + hotApplyOnUpdate = apply; + hotSetStatus("check"); + return hotDownloadManifest(hotRequestTimeout).then(function(update) { + if (!update) { + hotSetStatus(hotApplyInvalidatedModules() ? "ready" : "idle"); + return null; + } + hotRequestedFilesMap = {}; + hotWaitingFilesMap = {}; + hotAvailableFilesMap = update.c; + hotUpdateNewHash = update.h; -/***/ 14604: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + hotSetStatus("prepare"); + var promise = new Promise(function(resolve, reject) { + hotDeferred = { + resolve: resolve, + reject: reject + }; + }); + hotUpdate = {}; + /*foreachInstalledChunks*/ + // eslint-disable-next-line no-lone-blocks + { + hotEnsureUpdateChunk(chunkId); + } + if ( + hotStatus === "prepare" && + hotChunksLoading === 0 && + hotWaitingFiles === 0 + ) { + hotUpdateDownloaded(); + } + return promise; + }); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const SingleEntryPlugin = __webpack_require__(19070); -const MultiEntryPlugin = __webpack_require__(98046); -const DynamicEntryPlugin = __webpack_require__(49784); - -/** @typedef {import("../declarations/WebpackOptions").EntryItem} EntryItem */ -/** @typedef {import("./Compiler")} Compiler */ - -/** - * @param {string} context context path - * @param {EntryItem} item entry array or single path - * @param {string} name entry key name - * @returns {SingleEntryPlugin | MultiEntryPlugin} returns either a single or multi entry plugin - */ -const itemToPlugin = (context, item, name) => { - if (Array.isArray(item)) { - return new MultiEntryPlugin(context, item, name); - } - return new SingleEntryPlugin(context, item, name); -}; - -module.exports = class EntryOptionPlugin { - /** - * @param {Compiler} compiler the compiler instance one is tapping into - * @returns {void} - */ - apply(compiler) { - compiler.hooks.entryOption.tap("EntryOptionPlugin", (context, entry) => { - if (typeof entry === "string" || Array.isArray(entry)) { - itemToPlugin(context, entry, "main").apply(compiler); - } else if (typeof entry === "object") { - for (const name of Object.keys(entry)) { - itemToPlugin(context, entry[name], name).apply(compiler); - } - } else if (typeof entry === "function") { - new DynamicEntryPlugin(context, entry).apply(compiler); + // eslint-disable-next-line no-unused-vars + function hotAddUpdateChunk(chunkId, moreModules) { + if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) + return; + hotRequestedFilesMap[chunkId] = false; + for (var moduleId in moreModules) { + if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { + hotUpdate[moduleId] = moreModules[moduleId]; } - return true; - }); - } -}; - - -/***/ }), - -/***/ 71931: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const ChunkGroup = __webpack_require__(52911); - -/** @typedef {import("./Chunk")} Chunk */ - -/** - * Entrypoint serves as an encapsulation primitive for chunks that are - * a part of a single ChunkGroup. They represent all bundles that need to be loaded for a - * single instance of a page. Multi-page application architectures will typically yield multiple Entrypoint objects - * inside of the compilation, whereas a Single Page App may only contain one with many lazy-loaded chunks. - */ -class Entrypoint extends ChunkGroup { - /** - * Creates an instance of Entrypoint. - * @param {string} name the name of the entrypoint - */ - constructor(name) { - super(name); - /** @type {Chunk=} */ - this.runtimeChunk = undefined; - } - - /** - * isInitial will always return true for Entrypoint ChunkGroup. - * @returns {true} returns true as all entrypoints are initial ChunkGroups - */ - isInitial() { - return true; + } + if (--hotWaitingFiles === 0 && hotChunksLoading === 0) { + hotUpdateDownloaded(); + } } - /** - * Sets the runtimeChunk for an entrypoint. - * @param {Chunk} chunk the chunk being set as the runtime chunk. - * @returns {void} - */ - setRuntimeChunk(chunk) { - this.runtimeChunk = chunk; + function hotEnsureUpdateChunk(chunkId) { + if (!hotAvailableFilesMap[chunkId]) { + hotWaitingFilesMap[chunkId] = true; + } else { + hotRequestedFilesMap[chunkId] = true; + hotWaitingFiles++; + hotDownloadUpdateChunk(chunkId); + } } - /** - * Fetches the chunk reference containing the webpack bootstrap code - * @returns {Chunk} returns the runtime chunk or first chunk in `this.chunks` - */ - getRuntimeChunk() { - return this.runtimeChunk || this.chunks[0]; + function hotUpdateDownloaded() { + hotSetStatus("ready"); + var deferred = hotDeferred; + hotDeferred = null; + if (!deferred) return; + if (hotApplyOnUpdate) { + // Wrap deferred object in Promise to mark it as a well-handled Promise to + // avoid triggering uncaught exception warning in Chrome. + // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 + Promise.resolve() + .then(function() { + return hotApply(hotApplyOnUpdate); + }) + .then( + function(result) { + deferred.resolve(result); + }, + function(err) { + deferred.reject(err); + } + ); + } else { + var outdatedModules = []; + for (var id in hotUpdate) { + if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { + outdatedModules.push(toModuleId(id)); + } + } + deferred.resolve(outdatedModules); + } } - /** - * @param {Chunk} oldChunk chunk to be replaced - * @param {Chunk} newChunk New chunk that will be replaced with - * @returns {boolean} returns true if the replacement was successful - */ - replaceChunk(oldChunk, newChunk) { - if (this.runtimeChunk === oldChunk) this.runtimeChunk = newChunk; - return super.replaceChunk(oldChunk, newChunk); + function hotApply(options) { + if (hotStatus !== "ready") + throw new Error("apply() is only allowed in ready status"); + options = options || {}; + return hotApplyInternal(options); } -} - -module.exports = Entrypoint; - - -/***/ }), - -/***/ 6098: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Authors Simen Brekken @simenbrekken, Einar Löve @einarlove -*/ + function hotApplyInternal(options) { + hotApplyInvalidatedModules(); + var cb; + var i; + var j; + var module; + var moduleId; -/** @typedef {import("./Compiler")} Compiler */ + function getAffectedStuff(updateModuleId) { + var outdatedModules = [updateModuleId]; + var outdatedDependencies = {}; -const WebpackError = __webpack_require__(97391); -const DefinePlugin = __webpack_require__(97374); + var queue = outdatedModules.map(function(id) { + return { + chain: [id], + id: id + }; + }); + while (queue.length > 0) { + var queueItem = queue.pop(); + var moduleId = queueItem.id; + var chain = queueItem.chain; + module = installedModules[moduleId]; + if ( + !module || + (module.hot._selfAccepted && !module.hot._selfInvalidated) + ) + continue; + if (module.hot._selfDeclined) { + return { + type: "self-declined", + chain: chain, + moduleId: moduleId + }; + } + if (module.hot._main) { + return { + type: "unaccepted", + chain: chain, + moduleId: moduleId + }; + } + for (var i = 0; i < module.parents.length; i++) { + var parentId = module.parents[i]; + var parent = installedModules[parentId]; + if (!parent) continue; + if (parent.hot._declinedDependencies[moduleId]) { + return { + type: "declined", + chain: chain.concat([parentId]), + moduleId: moduleId, + parentId: parentId + }; + } + if (outdatedModules.indexOf(parentId) !== -1) continue; + if (parent.hot._acceptedDependencies[moduleId]) { + if (!outdatedDependencies[parentId]) + outdatedDependencies[parentId] = []; + addAllToSet(outdatedDependencies[parentId], [moduleId]); + continue; + } + delete outdatedDependencies[parentId]; + outdatedModules.push(parentId); + queue.push({ + chain: chain.concat([parentId]), + id: parentId + }); + } + } -const needsEnvVarFix = - ["8", "9"].indexOf(process.versions.node.split(".")[0]) >= 0 && - process.platform === "win32"; + return { + type: "accepted", + moduleId: updateModuleId, + outdatedModules: outdatedModules, + outdatedDependencies: outdatedDependencies + }; + } -class EnvironmentPlugin { - constructor(...keys) { - if (keys.length === 1 && Array.isArray(keys[0])) { - this.keys = keys[0]; - this.defaultValues = {}; - } else if (keys.length === 1 && keys[0] && typeof keys[0] === "object") { - this.keys = Object.keys(keys[0]); - this.defaultValues = keys[0]; - } else { - this.keys = keys; - this.defaultValues = {}; + function addAllToSet(a, b) { + for (var i = 0; i < b.length; i++) { + var item = b[i]; + if (a.indexOf(item) === -1) a.push(item); + } } - } - /** - * @param {Compiler} compiler webpack compiler instance - * @returns {void} - */ - apply(compiler) { - const definitions = this.keys.reduce((defs, key) => { - // TODO remove once the fix has made its way into Node 8. - // Work around https://github.com/nodejs/node/pull/18463, - // affecting Node 8 & 9 by performing an OS-level - // operation that always succeeds before reading - // environment variables: - if (needsEnvVarFix) __webpack_require__(12087).cpus(); + // at begin all updates modules are outdated + // the "outdated" status can propagate to parents if they don't accept the children + var outdatedDependencies = {}; + var outdatedModules = []; + var appliedUpdate = {}; - const value = - process.env[key] !== undefined - ? process.env[key] - : this.defaultValues[key]; + var warnUnexpectedRequire = function warnUnexpectedRequire() { + console.warn( + "[HMR] unexpected require(" + result.moduleId + ") to disposed module" + ); + }; - if (value === undefined) { - compiler.hooks.thisCompilation.tap("EnvironmentPlugin", compilation => { - const error = new WebpackError( - `EnvironmentPlugin - ${key} environment variable is undefined.\n\n` + - "You can pass an object with default values to suppress this warning.\n" + - "See https://webpack.js.org/plugins/environment-plugin for example." - ); + for (var id in hotUpdate) { + if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { + moduleId = toModuleId(id); + /** @type {TODO} */ + var result; + if (hotUpdate[id]) { + result = getAffectedStuff(moduleId); + } else { + result = { + type: "disposed", + moduleId: id + }; + } + /** @type {Error|false} */ + var abortError = false; + var doApply = false; + var doDispose = false; + var chainInfo = ""; + if (result.chain) { + chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); + } + switch (result.type) { + case "self-declined": + if (options.onDeclined) options.onDeclined(result); + if (!options.ignoreDeclined) + abortError = new Error( + "Aborted because of self decline: " + + result.moduleId + + chainInfo + ); + break; + case "declined": + if (options.onDeclined) options.onDeclined(result); + if (!options.ignoreDeclined) + abortError = new Error( + "Aborted because of declined dependency: " + + result.moduleId + + " in " + + result.parentId + + chainInfo + ); + break; + case "unaccepted": + if (options.onUnaccepted) options.onUnaccepted(result); + if (!options.ignoreUnaccepted) + abortError = new Error( + "Aborted because " + moduleId + " is not accepted" + chainInfo + ); + break; + case "accepted": + if (options.onAccepted) options.onAccepted(result); + doApply = true; + break; + case "disposed": + if (options.onDisposed) options.onDisposed(result); + doDispose = true; + break; + default: + throw new Error("Unexception type " + result.type); + } + if (abortError) { + hotSetStatus("abort"); + return Promise.reject(abortError); + } + if (doApply) { + appliedUpdate[moduleId] = hotUpdate[moduleId]; + addAllToSet(outdatedModules, result.outdatedModules); + for (moduleId in result.outdatedDependencies) { + if ( + Object.prototype.hasOwnProperty.call( + result.outdatedDependencies, + moduleId + ) + ) { + if (!outdatedDependencies[moduleId]) + outdatedDependencies[moduleId] = []; + addAllToSet( + outdatedDependencies[moduleId], + result.outdatedDependencies[moduleId] + ); + } + } + } + if (doDispose) { + addAllToSet(outdatedModules, [result.moduleId]); + appliedUpdate[moduleId] = warnUnexpectedRequire; + } + } + } - error.name = "EnvVariableNotDefinedError"; - compilation.warnings.push(error); + // Store self accepted outdated modules to require them later by the module system + var outdatedSelfAcceptedModules = []; + for (i = 0; i < outdatedModules.length; i++) { + moduleId = outdatedModules[i]; + if ( + installedModules[moduleId] && + installedModules[moduleId].hot._selfAccepted && + // removed self-accepted modules should not be required + appliedUpdate[moduleId] !== warnUnexpectedRequire && + // when called invalidate self-accepting is not possible + !installedModules[moduleId].hot._selfInvalidated + ) { + outdatedSelfAcceptedModules.push({ + module: moduleId, + parents: installedModules[moduleId].parents.slice(), + errorHandler: installedModules[moduleId].hot._selfAccepted }); } + } - defs[`process.env.${key}`] = - value === undefined ? "undefined" : JSON.stringify(value); - - return defs; - }, {}); + // Now in "dispose" phase + hotSetStatus("dispose"); + Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { + if (hotAvailableFilesMap[chunkId] === false) { + hotDisposeChunk(chunkId); + } + }); - new DefinePlugin(definitions).apply(compiler); - } -} + var idx; + var queue = outdatedModules.slice(); + while (queue.length > 0) { + moduleId = queue.pop(); + module = installedModules[moduleId]; + if (!module) continue; -module.exports = EnvironmentPlugin; + var data = {}; + // Call dispose handlers + var disposeHandlers = module.hot._disposeHandlers; + for (j = 0; j < disposeHandlers.length; j++) { + cb = disposeHandlers[j]; + cb(data); + } + hotCurrentModuleData[moduleId] = data; -/***/ }), + // disable module (this disables requires from this module) + module.hot.active = false; -/***/ 80140: -/***/ (function(__unused_webpack_module, exports) { + // remove module from cache + delete installedModules[moduleId]; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // when disposing there is no need to call dispose handler + delete outdatedDependencies[moduleId]; + // remove "parents" references from all children + for (j = 0; j < module.children.length; j++) { + var child = installedModules[module.children[j]]; + if (!child) continue; + idx = child.parents.indexOf(moduleId); + if (idx >= 0) { + child.parents.splice(idx, 1); + } + } + } -const loaderFlag = "LOADER_EXECUTION"; + // remove outdated dependency from module children + var dependency; + var moduleOutdatedDependencies; + for (moduleId in outdatedDependencies) { + if ( + Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) + ) { + module = installedModules[moduleId]; + if (module) { + moduleOutdatedDependencies = outdatedDependencies[moduleId]; + for (j = 0; j < moduleOutdatedDependencies.length; j++) { + dependency = moduleOutdatedDependencies[j]; + idx = module.children.indexOf(dependency); + if (idx >= 0) module.children.splice(idx, 1); + } + } + } + } -const webpackOptionsFlag = "WEBPACK_OPTIONS"; + // Now in "apply" phase + hotSetStatus("apply"); -exports.cutOffByFlag = (stack, flag) => { - stack = stack.split("\n"); - for (let i = 0; i < stack.length; i++) { - if (stack[i].includes(flag)) { - stack.length = i; + if (hotUpdateNewHash !== undefined) { + hotCurrentHash = hotUpdateNewHash; + hotUpdateNewHash = undefined; } - } - return stack.join("\n"); -}; - -exports.cutOffLoaderExecution = stack => - exports.cutOffByFlag(stack, loaderFlag); + hotUpdate = undefined; -exports.cutOffWebpackOptions = stack => - exports.cutOffByFlag(stack, webpackOptionsFlag); + // insert new code + for (moduleId in appliedUpdate) { + if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { + modules[moduleId] = appliedUpdate[moduleId]; + } + } -exports.cutOffMultilineMessage = (stack, message) => { - stack = stack.split("\n"); - message = message.split("\n"); - - return stack - .reduce( - (acc, line, idx) => - line.includes(message[idx]) ? acc : acc.concat(line), - [] - ) - .join("\n"); -}; - -exports.cutOffMessage = (stack, message) => { - const nextLine = stack.indexOf("\n"); - if (nextLine === -1) { - return stack === message ? "" : stack; - } else { - const firstLine = stack.substr(0, nextLine); - return firstLine === message ? stack.substr(nextLine + 1) : stack; - } -}; - -exports.cleanUp = (stack, message) => { - stack = exports.cutOffLoaderExecution(stack); - stack = exports.cutOffMessage(stack, message); - return stack; -}; - -exports.cleanUpWebpackOptions = (stack, message) => { - stack = exports.cutOffWebpackOptions(stack); - stack = exports.cutOffMultilineMessage(stack, message); - return stack; -}; - - -/***/ }), - -/***/ 65200: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // call accept handlers + var error = null; + for (moduleId in outdatedDependencies) { + if ( + Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) + ) { + module = installedModules[moduleId]; + if (module) { + moduleOutdatedDependencies = outdatedDependencies[moduleId]; + var callbacks = []; + for (i = 0; i < moduleOutdatedDependencies.length; i++) { + dependency = moduleOutdatedDependencies[i]; + cb = module.hot._acceptedDependencies[dependency]; + if (cb) { + if (callbacks.indexOf(cb) !== -1) continue; + callbacks.push(cb); + } + } + for (i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + try { + cb(moduleOutdatedDependencies); + } catch (err) { + if (options.onErrored) { + options.onErrored({ + type: "accept-errored", + moduleId: moduleId, + dependencyId: moduleOutdatedDependencies[i], + error: err + }); + } + if (!options.ignoreErrored) { + if (!error) error = err; + } + } + } + } + } + } + // Load self accepted modules + for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { + var item = outdatedSelfAcceptedModules[i]; + moduleId = item.module; + hotCurrentParents = item.parents; + hotCurrentChildModule = moduleId; + try { + $require$(moduleId); + } catch (err) { + if (typeof item.errorHandler === "function") { + try { + item.errorHandler(err); + } catch (err2) { + if (options.onErrored) { + options.onErrored({ + type: "self-accept-error-handler-errored", + moduleId: moduleId, + error: err2, + originalError: err + }); + } + if (!options.ignoreErrored) { + if (!error) error = err2; + } + if (!error) error = err; + } + } else { + if (options.onErrored) { + options.onErrored({ + type: "self-accept-errored", + moduleId: moduleId, + error: err + }); + } + if (!options.ignoreErrored) { + if (!error) error = err; + } + } + } + } -const EvalDevToolModuleTemplatePlugin = __webpack_require__(24157); + // handle errors in accept handlers and self accepted module load + if (error) { + hotSetStatus("fail"); + return Promise.reject(error); + } -class EvalDevToolModulePlugin { - constructor(options) { - this.sourceUrlComment = options.sourceUrlComment; - this.moduleFilenameTemplate = options.moduleFilenameTemplate; - this.namespace = options.namespace; - } + if (hotQueuedInvalidatedModules) { + return hotApplyInternal(options).then(function(list) { + outdatedModules.forEach(function(moduleId) { + if (list.indexOf(moduleId) < 0) list.push(moduleId); + }); + return list; + }); + } - apply(compiler) { - compiler.hooks.compilation.tap("EvalDevToolModulePlugin", compilation => { - new EvalDevToolModuleTemplatePlugin({ - sourceUrlComment: this.sourceUrlComment, - moduleFilenameTemplate: this.moduleFilenameTemplate, - namespace: this.namespace - }).apply(compilation.moduleTemplates.javascript); + hotSetStatus("idle"); + return new Promise(function(resolve) { + resolve(outdatedModules); }); } -} - -module.exports = EvalDevToolModulePlugin; - - -/***/ }), - -/***/ 24157: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const { RawSource } = __webpack_require__(53665); -const ModuleFilenameHelpers = __webpack_require__(71474); - -const cache = new WeakMap(); -class EvalDevToolModuleTemplatePlugin { - constructor(options) { - this.sourceUrlComment = options.sourceUrlComment || "\n//# sourceURL=[url]"; - this.moduleFilenameTemplate = - options.moduleFilenameTemplate || - "webpack://[namespace]/[resourcePath]?[loaders]"; - this.namespace = options.namespace || ""; + function hotApplyInvalidatedModules() { + if (hotQueuedInvalidatedModules) { + if (!hotUpdate) hotUpdate = {}; + hotQueuedInvalidatedModules.forEach(hotApplyInvalidatedModule); + hotQueuedInvalidatedModules = undefined; + return true; + } } - apply(moduleTemplate) { - moduleTemplate.hooks.module.tap( - "EvalDevToolModuleTemplatePlugin", - (source, module) => { - const cacheEntry = cache.get(source); - if (cacheEntry !== undefined) return cacheEntry; - const content = source.source(); - const str = ModuleFilenameHelpers.createFilename( - module, - { - moduleFilenameTemplate: this.moduleFilenameTemplate, - namespace: this.namespace - }, - moduleTemplate.runtimeTemplate.requestShortener - ); - const footer = - "\n" + - this.sourceUrlComment.replace( - /\[url\]/g, - encodeURI(str) - .replace(/%2F/g, "/") - .replace(/%20/g, "_") - .replace(/%5E/g, "^") - .replace(/%5C/g, "\\") - .replace(/^\//, "") - ); - const result = new RawSource( - `eval(${JSON.stringify(content + footer)});` - ); - cache.set(source, result); - return result; - } - ); - moduleTemplate.hooks.hash.tap("EvalDevToolModuleTemplatePlugin", hash => { - hash.update("EvalDevToolModuleTemplatePlugin"); - hash.update("2"); - }); + function hotApplyInvalidatedModule(moduleId) { + if (!Object.prototype.hasOwnProperty.call(hotUpdate, moduleId)) + hotUpdate[moduleId] = modules[moduleId]; } -} - -module.exports = EvalDevToolModuleTemplatePlugin; +}; /***/ }), -/***/ 51352: +/***/ 69575: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -60444,174 +58820,430 @@ module.exports = EvalDevToolModuleTemplatePlugin; */ +const { SyncBailHook } = __webpack_require__(92402); const { RawSource } = __webpack_require__(53665); -const ModuleFilenameHelpers = __webpack_require__(71474); -const { absolutify } = __webpack_require__(94658); - -const cache = new WeakMap(); +const Template = __webpack_require__(96066); +const ModuleHotAcceptDependency = __webpack_require__(29018); +const ModuleHotDeclineDependency = __webpack_require__(60482); +const ConstDependency = __webpack_require__(71101); +const NullFactory = __webpack_require__(40438); +const ParserHelpers = __webpack_require__(23999); -class EvalSourceMapDevToolModuleTemplatePlugin { - constructor(compilation, options) { - this.compilation = compilation; - this.sourceMapComment = - options.append || "//# sourceURL=[module]\n//# sourceMappingURL=[url]"; - this.moduleFilenameTemplate = - options.moduleFilenameTemplate || - "webpack://[namespace]/[resource-path]?[hash]"; - this.namespace = options.namespace || ""; - this.options = options; +module.exports = class HotModuleReplacementPlugin { + constructor(options) { + this.options = options || {}; + this.multiStep = this.options.multiStep; + this.fullBuildTimeout = this.options.fullBuildTimeout || 200; + this.requestTimeout = this.options.requestTimeout || 10000; } - apply(moduleTemplate) { - const self = this; - const options = this.options; - const matchModule = ModuleFilenameHelpers.matchObject.bind( - ModuleFilenameHelpers, - options + apply(compiler) { + const multiStep = this.multiStep; + const fullBuildTimeout = this.fullBuildTimeout; + const requestTimeout = this.requestTimeout; + const hotUpdateChunkFilename = + compiler.options.output.hotUpdateChunkFilename; + const hotUpdateMainFilename = compiler.options.output.hotUpdateMainFilename; + compiler.hooks.additionalPass.tapAsync( + "HotModuleReplacementPlugin", + callback => { + if (multiStep) return setTimeout(callback, fullBuildTimeout); + return callback(); + } ); - moduleTemplate.hooks.module.tap( - "EvalSourceMapDevToolModuleTemplatePlugin", - (source, module) => { - const cachedSource = cache.get(source); - if (cachedSource !== undefined) { - return cachedSource; - } - - if (!matchModule(module.resource)) { - return source; - } - - /** @type {{ [key: string]: TODO; }} */ - let sourceMap; - let content; - if (source.sourceAndMap) { - const sourceAndMap = source.sourceAndMap(options); - sourceMap = sourceAndMap.map; - content = sourceAndMap.source; - } else { - sourceMap = source.map(options); - content = source.source(); - } - if (!sourceMap) { - return source; - } - // Clone (flat) the sourcemap to ensure that the mutations below do not persist. - sourceMap = Object.keys(sourceMap).reduce((obj, key) => { - obj[key] = sourceMap[key]; - return obj; - }, {}); - const context = this.compilation.compiler.options.context; - const modules = sourceMap.sources.map(source => { - if (source.startsWith("webpack://")) { - source = absolutify(context, source.slice(10)); - } - const module = self.compilation.findModule(source); - return module || source; - }); - let moduleFilenames = modules.map(module => { - return ModuleFilenameHelpers.createFilename( - module, - { - moduleFilenameTemplate: self.moduleFilenameTemplate, - namespace: self.namespace - }, - moduleTemplate.runtimeTemplate.requestShortener - ); - }); - moduleFilenames = ModuleFilenameHelpers.replaceDuplicates( - moduleFilenames, - (filename, i, n) => { - for (let j = 0; j < n; j++) filename += "*"; - return filename; - } + const addParserPlugins = (parser, parserOptions) => { + parser.hooks.expression + .for("__webpack_hash__") + .tap( + "HotModuleReplacementPlugin", + ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + "__webpack_require__.h()" + ) ); - sourceMap.sources = moduleFilenames; - sourceMap.sourceRoot = options.sourceRoot || ""; - sourceMap.file = `${module.id}.js`; - - const footer = - self.sourceMapComment.replace( - /\[url\]/g, - `data:application/json;charset=utf-8;base64,${Buffer.from( - JSON.stringify(sourceMap), - "utf8" - ).toString("base64")}` - ) + `\n//# sourceURL=webpack-internal:///${module.id}\n`; // workaround for chrome bug - - const evalSource = new RawSource( - `eval(${JSON.stringify(content + footer)});` + parser.hooks.evaluateTypeof + .for("__webpack_hash__") + .tap( + "HotModuleReplacementPlugin", + ParserHelpers.evaluateToString("string") ); - - cache.set(source, evalSource); - - return evalSource; + parser.hooks.evaluateIdentifier.for("module.hot").tap( + { + name: "HotModuleReplacementPlugin", + before: "NodeStuffPlugin" + }, + expr => { + return ParserHelpers.evaluateToIdentifier( + "module.hot", + !!parser.state.compilation.hotUpdateChunkTemplate + )(expr); + } + ); + // TODO webpack 5: refactor this, no custom hooks + if (!parser.hooks.hotAcceptCallback) { + parser.hooks.hotAcceptCallback = new SyncBailHook([ + "expression", + "requests" + ]); } - ); - moduleTemplate.hooks.hash.tap( - "EvalSourceMapDevToolModuleTemplatePlugin", - hash => { - hash.update("eval-source-map"); - hash.update("2"); + if (!parser.hooks.hotAcceptWithoutCallback) { + parser.hooks.hotAcceptWithoutCallback = new SyncBailHook([ + "expression", + "requests" + ]); } - ); - } -} -module.exports = EvalSourceMapDevToolModuleTemplatePlugin; - + parser.hooks.call + .for("module.hot.accept") + .tap("HotModuleReplacementPlugin", expr => { + if (!parser.state.compilation.hotUpdateChunkTemplate) { + return false; + } + if (expr.arguments.length >= 1) { + const arg = parser.evaluateExpression(expr.arguments[0]); + let params = []; + let requests = []; + if (arg.isString()) { + params = [arg]; + } else if (arg.isArray()) { + params = arg.items.filter(param => param.isString()); + } + if (params.length > 0) { + params.forEach((param, idx) => { + const request = param.string; + const dep = new ModuleHotAcceptDependency(request, param.range); + dep.optional = true; + dep.loc = Object.create(expr.loc); + dep.loc.index = idx; + parser.state.module.addDependency(dep); + requests.push(request); + }); + if (expr.arguments.length > 1) { + parser.hooks.hotAcceptCallback.call( + expr.arguments[1], + requests + ); + parser.walkExpression(expr.arguments[1]); // other args are ignored + return true; + } else { + parser.hooks.hotAcceptWithoutCallback.call(expr, requests); + return true; + } + } + } + }); + parser.hooks.call + .for("module.hot.decline") + .tap("HotModuleReplacementPlugin", expr => { + if (!parser.state.compilation.hotUpdateChunkTemplate) { + return false; + } + if (expr.arguments.length === 1) { + const arg = parser.evaluateExpression(expr.arguments[0]); + let params = []; + if (arg.isString()) { + params = [arg]; + } else if (arg.isArray()) { + params = arg.items.filter(param => param.isString()); + } + params.forEach((param, idx) => { + const dep = new ModuleHotDeclineDependency( + param.string, + param.range + ); + dep.optional = true; + dep.loc = Object.create(expr.loc); + dep.loc.index = idx; + parser.state.module.addDependency(dep); + }); + } + }); + parser.hooks.expression + .for("module.hot") + .tap("HotModuleReplacementPlugin", ParserHelpers.skipTraversal); + }; -/***/ }), + compiler.hooks.compilation.tap( + "HotModuleReplacementPlugin", + (compilation, { normalModuleFactory }) => { + // This applies the HMR plugin only to the targeted compiler + // It should not affect child compilations + if (compilation.compiler !== compiler) return; -/***/ 99994: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + const hotUpdateChunkTemplate = compilation.hotUpdateChunkTemplate; + if (!hotUpdateChunkTemplate) return; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + compilation.dependencyFactories.set(ConstDependency, new NullFactory()); + compilation.dependencyTemplates.set( + ConstDependency, + new ConstDependency.Template() + ); + compilation.dependencyFactories.set( + ModuleHotAcceptDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + ModuleHotAcceptDependency, + new ModuleHotAcceptDependency.Template() + ); -const EvalSourceMapDevToolModuleTemplatePlugin = __webpack_require__(51352); -const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(24113); + compilation.dependencyFactories.set( + ModuleHotDeclineDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + ModuleHotDeclineDependency, + new ModuleHotDeclineDependency.Template() + ); -class EvalSourceMapDevToolPlugin { - constructor(options) { - if (arguments.length > 1) { - throw new Error( - "EvalSourceMapDevToolPlugin only takes one argument (pass an options object)" - ); - } - if (typeof options === "string") { - options = { - append: options - }; - } - if (!options) options = {}; - this.options = options; - } + compilation.hooks.record.tap( + "HotModuleReplacementPlugin", + (compilation, records) => { + if (records.hash === compilation.hash) return; + records.hash = compilation.hash; + records.moduleHashs = {}; + for (const module of compilation.modules) { + const identifier = module.identifier(); + records.moduleHashs[identifier] = module.hash; + } + records.chunkHashs = {}; + for (const chunk of compilation.chunks) { + records.chunkHashs[chunk.id] = chunk.hash; + } + records.chunkModuleIds = {}; + for (const chunk of compilation.chunks) { + records.chunkModuleIds[chunk.id] = Array.from( + chunk.modulesIterable, + m => m.id + ); + } + } + ); + let initialPass = false; + let recompilation = false; + compilation.hooks.afterHash.tap("HotModuleReplacementPlugin", () => { + let records = compilation.records; + if (!records) { + initialPass = true; + return; + } + if (!records.hash) initialPass = true; + const preHash = records.preHash || "x"; + const prepreHash = records.prepreHash || "x"; + if (preHash === compilation.hash) { + recompilation = true; + compilation.modifyHash(prepreHash); + return; + } + records.prepreHash = records.hash || "x"; + records.preHash = compilation.hash; + compilation.modifyHash(records.prepreHash); + }); + compilation.hooks.shouldGenerateChunkAssets.tap( + "HotModuleReplacementPlugin", + () => { + if (multiStep && !recompilation && !initialPass) return false; + } + ); + compilation.hooks.needAdditionalPass.tap( + "HotModuleReplacementPlugin", + () => { + if (multiStep && !recompilation && !initialPass) return true; + } + ); + compilation.hooks.additionalChunkAssets.tap( + "HotModuleReplacementPlugin", + () => { + const records = compilation.records; + if (records.hash === compilation.hash) return; + if ( + !records.moduleHashs || + !records.chunkHashs || + !records.chunkModuleIds + ) + return; + for (const module of compilation.modules) { + const identifier = module.identifier(); + let hash = module.hash; + module.hotUpdate = records.moduleHashs[identifier] !== hash; + } + const hotUpdateMainContent = { + h: compilation.hash, + c: {} + }; + for (const key of Object.keys(records.chunkHashs)) { + const chunkId = isNaN(+key) ? key : +key; + const currentChunk = compilation.chunks.find( + chunk => `${chunk.id}` === key + ); + if (currentChunk) { + const newModules = currentChunk + .getModules() + .filter(module => module.hotUpdate); + const allModules = new Set(); + for (const module of currentChunk.modulesIterable) { + allModules.add(module.id); + } + const removedModules = records.chunkModuleIds[chunkId].filter( + id => !allModules.has(id) + ); + if (newModules.length > 0 || removedModules.length > 0) { + const source = hotUpdateChunkTemplate.render( + chunkId, + newModules, + removedModules, + compilation.hash, + compilation.moduleTemplates.javascript, + compilation.dependencyTemplates + ); + const { + path: filename, + info: assetInfo + } = compilation.getPathWithInfo(hotUpdateChunkFilename, { + hash: records.hash, + chunk: currentChunk + }); + compilation.additionalChunkAssets.push(filename); + compilation.emitAsset( + filename, + source, + Object.assign({ hotModuleReplacement: true }, assetInfo) + ); + hotUpdateMainContent.c[chunkId] = true; + currentChunk.files.push(filename); + compilation.hooks.chunkAsset.call(currentChunk, filename); + } + } else { + hotUpdateMainContent.c[chunkId] = false; + } + } + const source = new RawSource(JSON.stringify(hotUpdateMainContent)); + const { + path: filename, + info: assetInfo + } = compilation.getPathWithInfo(hotUpdateMainFilename, { + hash: records.hash + }); + compilation.emitAsset( + filename, + source, + Object.assign({ hotModuleReplacement: true }, assetInfo) + ); + } + ); - apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap( - "EvalSourceMapDevToolPlugin", - compilation => { - new SourceMapDevToolModuleOptionsPlugin(options).apply(compilation); - new EvalSourceMapDevToolModuleTemplatePlugin( - compilation, - options - ).apply(compilation.moduleTemplates.javascript); + const mainTemplate = compilation.mainTemplate; + + mainTemplate.hooks.hash.tap("HotModuleReplacementPlugin", hash => { + hash.update("HotMainTemplateDecorator"); + }); + + mainTemplate.hooks.moduleRequire.tap( + "HotModuleReplacementPlugin", + (_, chunk, hash, varModuleId) => { + return `hotCreateRequire(${varModuleId})`; + } + ); + + mainTemplate.hooks.requireExtensions.tap( + "HotModuleReplacementPlugin", + source => { + const buf = [source]; + buf.push(""); + buf.push("// __webpack_hash__"); + buf.push( + mainTemplate.requireFn + + ".h = function() { return hotCurrentHash; };" + ); + return Template.asString(buf); + } + ); + + const needChunkLoadingCode = chunk => { + for (const chunkGroup of chunk.groupsIterable) { + if (chunkGroup.chunks.length > 1) return true; + if (chunkGroup.getNumberOfChildren() > 0) return true; + } + return false; + }; + + mainTemplate.hooks.bootstrap.tap( + "HotModuleReplacementPlugin", + (source, chunk, hash) => { + source = mainTemplate.hooks.hotBootstrap.call(source, chunk, hash); + return Template.asString([ + source, + "", + hotInitCode + .replace(/\$require\$/g, mainTemplate.requireFn) + .replace(/\$hash\$/g, JSON.stringify(hash)) + .replace(/\$requestTimeout\$/g, requestTimeout) + .replace( + /\/\*foreachInstalledChunks\*\//g, + needChunkLoadingCode(chunk) + ? "for(var chunkId in installedChunks)" + : `var chunkId = ${JSON.stringify(chunk.id)};` + ) + ]); + } + ); + + mainTemplate.hooks.globalHash.tap( + "HotModuleReplacementPlugin", + () => true + ); + + mainTemplate.hooks.currentHash.tap( + "HotModuleReplacementPlugin", + (_, length) => { + if (isFinite(length)) { + return `hotCurrentHash.substr(0, ${length})`; + } else { + return "hotCurrentHash"; + } + } + ); + + mainTemplate.hooks.moduleObj.tap( + "HotModuleReplacementPlugin", + (source, chunk, hash, varModuleId) => { + return Template.asString([ + `${source},`, + `hot: hotCreateModule(${varModuleId}),`, + "parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp),", + "children: []" + ]); + } + ); + + // TODO add HMR support for javascript/esm + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("HotModuleReplacementPlugin", addParserPlugins); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("HotModuleReplacementPlugin", addParserPlugins); + + compilation.hooks.normalModuleLoader.tap( + "HotModuleReplacementPlugin", + context => { + context.hot = true; + } + ); } ); } -} +}; -module.exports = EvalSourceMapDevToolPlugin; +const hotInitCode = Template.getFunctionContent( + __webpack_require__(65217) +); /***/ }), -/***/ 50471: +/***/ 26782: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -60621,58 +59253,22 @@ module.exports = EvalSourceMapDevToolPlugin; */ -const { ConcatSource } = __webpack_require__(53665); - -/** @typedef {import("./Compilation")} Compilation */ - -/** - * @param {string[]} accessor the accessor to convert to path - * @returns {string} the path - */ -const accessorToObjectAccess = accessor => { - return accessor.map(a => `[${JSON.stringify(a)}]`).join(""); -}; - -class ExportPropertyMainTemplatePlugin { - /** - * @param {string|string[]} property the name of the property to export - */ - constructor(property) { - this.property = property; - } - - /** - * @param {Compilation} compilation the compilation instance - * @returns {void} - */ - apply(compilation) { - const { mainTemplate, chunkTemplate } = compilation; - - const onRenderWithEntry = (source, chunk, hash) => { - const postfix = `${accessorToObjectAccess([].concat(this.property))}`; - return new ConcatSource(source, postfix); - }; - - for (const template of [mainTemplate, chunkTemplate]) { - template.hooks.renderWithEntry.tap( - "ExportPropertyMainTemplatePlugin", - onRenderWithEntry - ); - } +const Chunk = __webpack_require__(2919); - mainTemplate.hooks.hash.tap("ExportPropertyMainTemplatePlugin", hash => { - hash.update("export property"); - hash.update(`${this.property}`); - }); +class HotUpdateChunk extends Chunk { + constructor() { + super(); + /** @type {(string|number)[]} */ + this.removedModules = undefined; } } -module.exports = ExportPropertyMainTemplatePlugin; +module.exports = HotUpdateChunk; /***/ }), -/***/ 17270: +/***/ 66062: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -60683,92 +59279,82 @@ module.exports = ExportPropertyMainTemplatePlugin; const Template = __webpack_require__(96066); -const ConstDependency = __webpack_require__(71101); -const ParserHelpers = __webpack_require__(23999); -const NullFactory = __webpack_require__(40438); - -const REPLACEMENTS = { - // eslint-disable-next-line camelcase - __webpack_hash__: "__webpack_require__.h", - // eslint-disable-next-line camelcase - __webpack_chunkname__: "__webpack_require__.cn" -}; -const REPLACEMENT_TYPES = { - // eslint-disable-next-line camelcase - __webpack_hash__: "string", - // eslint-disable-next-line camelcase - __webpack_chunkname__: "string" -}; - -class ExtendedAPIPlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "ExtendedAPIPlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set(ConstDependency, new NullFactory()); - compilation.dependencyTemplates.set( - ConstDependency, - new ConstDependency.Template() - ); - - const mainTemplate = compilation.mainTemplate; - mainTemplate.hooks.requireExtensions.tap( - "ExtendedAPIPlugin", - (source, chunk, hash) => { - const buf = [source]; - buf.push(""); - buf.push("// __webpack_hash__"); - buf.push(`${mainTemplate.requireFn}.h = ${JSON.stringify(hash)};`); - buf.push(""); - buf.push("// __webpack_chunkname__"); - buf.push( - `${mainTemplate.requireFn}.cn = ${JSON.stringify(chunk.name)};` - ); - return Template.asString(buf); - } - ); - mainTemplate.hooks.globalHash.tap("ExtendedAPIPlugin", () => true); +const HotUpdateChunk = __webpack_require__(26782); +const { Tapable, SyncWaterfallHook, SyncHook } = __webpack_require__(92402); - const handler = (parser, parserOptions) => { - Object.keys(REPLACEMENTS).forEach(key => { - parser.hooks.expression - .for(key) - .tap( - "ExtendedAPIPlugin", - ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - REPLACEMENTS[key] - ) - ); - parser.hooks.evaluateTypeof - .for(key) - .tap( - "ExtendedAPIPlugin", - ParserHelpers.evaluateToString(REPLACEMENT_TYPES[key]) - ); - }); - }; +module.exports = class HotUpdateChunkTemplate extends Tapable { + constructor(outputOptions) { + super(); + this.outputOptions = outputOptions || {}; + this.hooks = { + modules: new SyncWaterfallHook([ + "source", + "modules", + "removedModules", + "moduleTemplate", + "dependencyTemplates" + ]), + render: new SyncWaterfallHook([ + "source", + "modules", + "removedModules", + "hash", + "id", + "moduleTemplate", + "dependencyTemplates" + ]), + hash: new SyncHook(["hash"]) + }; + } - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ExtendedAPIPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ExtendedAPIPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ExtendedAPIPlugin", handler); - } + render( + id, + modules, + removedModules, + hash, + moduleTemplate, + dependencyTemplates + ) { + const hotUpdateChunk = new HotUpdateChunk(); + hotUpdateChunk.id = id; + hotUpdateChunk.setModules(modules); + hotUpdateChunk.removedModules = removedModules; + const modulesSource = Template.renderChunkModules( + hotUpdateChunk, + m => typeof m.source === "function", + moduleTemplate, + dependencyTemplates + ); + const core = this.hooks.modules.call( + modulesSource, + modules, + removedModules, + moduleTemplate, + dependencyTemplates + ); + const source = this.hooks.render.call( + core, + modules, + removedModules, + hash, + id, + moduleTemplate, + dependencyTemplates ); + return source; } -} -module.exports = ExtendedAPIPlugin; + updateHash(hash) { + hash.update("HotUpdateChunkTemplate"); + hash.update("1"); + this.hooks.hash.call(hash); + } +}; /***/ }), -/***/ 17204: +/***/ 41364: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -60778,184 +59364,96 @@ module.exports = ExtendedAPIPlugin; */ -const { OriginalSource, RawSource } = __webpack_require__(53665); -const Module = __webpack_require__(75993); -const WebpackMissingModule = __webpack_require__(75386); -const Template = __webpack_require__(96066); +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(69667); -/** @typedef {import("./util/createHash").Hash} Hash */ +/** @typedef {import("../declarations/plugins/IgnorePlugin").IgnorePluginOptions} IgnorePluginOptions */ +/** @typedef {import("./Compiler")} Compiler */ -class ExternalModule extends Module { - constructor(request, type, userRequest) { - super("javascript/dynamic", null); +class IgnorePlugin { + /** + * @param {IgnorePluginOptions} options IgnorePlugin options + */ + constructor(options) { + // TODO webpack 5 remove this compat-layer + if (arguments.length > 1 || options instanceof RegExp) { + options = { + resourceRegExp: arguments[0], + contextRegExp: arguments[1] + }; + } - // Info from Factory - this.request = request; - this.externalType = type; - this.userRequest = userRequest; - this.external = true; - } + validateOptions(schema, options, "IgnorePlugin"); + this.options = options; - libIdent() { - return this.userRequest; + /** @private @type {Function} */ + this.checkIgnore = this.checkIgnore.bind(this); } - chunkCondition(chunk) { - return chunk.hasEntryModule(); - } + /** + * Note that if "contextRegExp" is given, both the "resourceRegExp" + * and "contextRegExp" have to match. + * + * @param {TODO} result result + * @returns {TODO|null} returns result or null if result should be ignored + */ + checkIgnore(result) { + if (!result) return result; - identifier() { - return "external " + JSON.stringify(this.request); - } - - readableIdentifier() { - return "external " + JSON.stringify(this.request); - } - - needRebuild() { - return false; - } - - build(options, compilation, resolver, fs, callback) { - this.built = true; - this.buildMeta = {}; - this.buildInfo = {}; - callback(); - } - - getSourceForGlobalVariableExternal(variableName, type) { - if (!Array.isArray(variableName)) { - // make it an array as the look up works the same basically - variableName = [variableName]; - } - - // needed for e.g. window["some"]["thing"] - const objectLookup = variableName - .map(r => `[${JSON.stringify(r)}]`) - .join(""); - return `(function() { module.exports = ${type}${objectLookup}; }());`; - } - - getSourceForCommonJsExternal(moduleAndSpecifiers) { - if (!Array.isArray(moduleAndSpecifiers)) { - return `module.exports = require(${JSON.stringify( - moduleAndSpecifiers - )});`; - } - - const moduleName = moduleAndSpecifiers[0]; - const objectLookup = moduleAndSpecifiers - .slice(1) - .map(r => `[${JSON.stringify(r)}]`) - .join(""); - return `module.exports = require(${JSON.stringify( - moduleName - )})${objectLookup};`; - } - - checkExternalVariable(variableToCheck, request) { - return `if(typeof ${variableToCheck} === 'undefined') {${WebpackMissingModule.moduleCode( - request - )}}\n`; - } - - getSourceForAmdOrUmdExternal(id, optional, request) { - const externalVariable = `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier( - `${id}` - )}__`; - const missingModuleError = optional - ? this.checkExternalVariable(externalVariable, request) - : ""; - return `${missingModuleError}module.exports = ${externalVariable};`; - } - - getSourceForDefaultCase(optional, request) { - if (!Array.isArray(request)) { - // make it an array as the look up works the same basically - request = [request]; - } - - const variableName = request[0]; - const missingModuleError = optional - ? this.checkExternalVariable(variableName, request.join(".")) - : ""; - const objectLookup = request - .slice(1) - .map(r => `[${JSON.stringify(r)}]`) - .join(""); - return `${missingModuleError}module.exports = ${variableName}${objectLookup};`; - } - - getSourceString(runtime) { - const request = - typeof this.request === "object" && !Array.isArray(this.request) - ? this.request[this.externalType] - : this.request; - switch (this.externalType) { - case "this": - case "window": - case "self": - return this.getSourceForGlobalVariableExternal( - request, - this.externalType - ); - case "global": - return this.getSourceForGlobalVariableExternal( - request, - runtime.outputOptions.globalObject - ); - case "commonjs": - case "commonjs2": - return this.getSourceForCommonJsExternal(request); - case "amd": - case "amd-require": - case "umd": - case "umd2": - case "system": - return this.getSourceForAmdOrUmdExternal( - this.id, - this.optional, - request - ); - default: - return this.getSourceForDefaultCase(this.optional, request); + if ( + "checkResource" in this.options && + this.options.checkResource && + this.options.checkResource(result.request, result.context) + ) { + // TODO webpack 5 remove checkContext, as checkResource already gets context + if ("checkContext" in this.options && this.options.checkContext) { + if (this.options.checkContext(result.context)) { + return null; + } + } else { + return null; + } } - } - getSource(sourceString) { - if (this.useSourceMap) { - return new OriginalSource(sourceString, this.identifier()); + if ( + "resourceRegExp" in this.options && + this.options.resourceRegExp && + this.options.resourceRegExp.test(result.request) + ) { + if ("contextRegExp" in this.options && this.options.contextRegExp) { + // if "contextRegExp" is given, + // both the "resourceRegExp" and "contextRegExp" have to match. + if (this.options.contextRegExp.test(result.context)) { + return null; + } + } else { + return null; + } } - return new RawSource(sourceString); - } - - source(dependencyTemplates, runtime) { - return this.getSource(this.getSourceString(runtime)); - } - - size() { - return 42; + return result; } /** - * @param {Hash} hash the hash used to track dependencies + * @param {Compiler} compiler Webpack Compiler * @returns {void} */ - updateHash(hash) { - hash.update(this.externalType); - hash.update(JSON.stringify(this.request)); - hash.update(JSON.stringify(Boolean(this.optional))); - super.updateHash(hash); + apply(compiler) { + compiler.hooks.normalModuleFactory.tap("IgnorePlugin", nmf => { + nmf.hooks.beforeResolve.tap("IgnorePlugin", this.checkIgnore); + }); + compiler.hooks.contextModuleFactory.tap("IgnorePlugin", cmf => { + cmf.hooks.beforeResolve.tap("IgnorePlugin", this.checkIgnore); + }); } } -module.exports = ExternalModule; +module.exports = IgnorePlugin; /***/ }), -/***/ 67876: +/***/ 98509: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -60965,147 +59463,235 @@ module.exports = ExternalModule; */ -const ExternalModule = __webpack_require__(17204); +const { RawSource, ReplaceSource } = __webpack_require__(53665); -class ExternalModuleFactoryPlugin { - constructor(type, externals) { - this.type = type; - this.externals = externals; +// TODO: clean up this file +// replace with newer constructs + +// TODO: remove DependencyVariables and replace them with something better + +class JavascriptGenerator { + generate(module, dependencyTemplates, runtimeTemplate) { + const originalSource = module.originalSource(); + if (!originalSource) { + return new RawSource("throw new Error('No source available');"); + } + + const source = new ReplaceSource(originalSource); + + this.sourceBlock( + module, + module, + [], + dependencyTemplates, + source, + runtimeTemplate + ); + + return source; } - apply(normalModuleFactory) { - const globalType = this.type; - normalModuleFactory.hooks.factory.tap( - "ExternalModuleFactoryPlugin", - factory => (data, callback) => { - const context = data.context; - const dependency = data.dependencies[0]; + sourceBlock( + module, + block, + availableVars, + dependencyTemplates, + source, + runtimeTemplate + ) { + for (const dependency of block.dependencies) { + this.sourceDependency( + dependency, + dependencyTemplates, + source, + runtimeTemplate + ); + } - const handleExternal = (value, type, callback) => { - if (typeof type === "function") { - callback = type; - type = undefined; - } - if (value === false) return factory(data, callback); - if (value === true) value = dependency.request; - if (type === undefined && /^[a-z0-9]+ /.test(value)) { - const idx = value.indexOf(" "); - type = value.substr(0, idx); - value = value.substr(idx + 1); - } - callback( - null, - new ExternalModule(value, type || globalType, dependency.request) + /** + * Get the variables of all blocks that we need to inject. + * These will contain the variable name and its expression. + * The name will be added as a parameter in a IIFE the expression as its value. + */ + const vars = block.variables.reduce((result, value) => { + const variable = this.sourceVariables( + value, + availableVars, + dependencyTemplates, + runtimeTemplate + ); + + if (variable) { + result.push(variable); + } + + return result; + }, []); + + /** + * if we actually have variables + * this is important as how #splitVariablesInUniqueNamedChunks works + * it will always return an array in an array which would lead to a IIFE wrapper around + * a module if we do this with an empty vars array. + */ + if (vars.length > 0) { + /** + * Split all variables up into chunks of unique names. + * e.g. imagine you have the following variable names that need to be injected: + * [foo, bar, baz, foo, some, more] + * we can not inject "foo" twice, therefore we just make two IIFEs like so: + * (function(foo, bar, baz){ + * (function(foo, some, more){ + * … + * }(…)); + * }(…)); + * + * "splitVariablesInUniqueNamedChunks" splits the variables shown above up to this: + * [[foo, bar, baz], [foo, some, more]] + */ + const injectionVariableChunks = this.splitVariablesInUniqueNamedChunks( + vars + ); + + // create all the beginnings of IIFEs + const functionWrapperStarts = injectionVariableChunks.map( + variableChunk => { + return this.variableInjectionFunctionWrapperStartCode( + variableChunk.map(variable => variable.name) ); - return true; - }; + } + ); - const handleExternals = (externals, callback) => { - if (typeof externals === "string") { - if (externals === dependency.request) { - return handleExternal(dependency.request, callback); - } - } else if (Array.isArray(externals)) { - let i = 0; - const next = () => { - let asyncFlag; - const handleExternalsAndCallback = (err, module) => { - if (err) return callback(err); - if (!module) { - if (asyncFlag) { - asyncFlag = false; - return; - } - return next(); - } - callback(null, module); - }; + // and all the ends + const functionWrapperEnds = injectionVariableChunks.map(variableChunk => { + return this.variableInjectionFunctionWrapperEndCode( + module, + variableChunk.map(variable => variable.expression), + block + ); + }); - do { - asyncFlag = true; - if (i >= externals.length) return callback(); - handleExternals(externals[i++], handleExternalsAndCallback); - } while (!asyncFlag); - asyncFlag = false; - }; + // join them to one big string + const varStartCode = functionWrapperStarts.join(""); - next(); - return; - } else if (externals instanceof RegExp) { - if (externals.test(dependency.request)) { - return handleExternal(dependency.request, callback); - } - } else if (typeof externals === "function") { - externals.call( - null, - context, - dependency.request, - (err, value, type) => { - if (err) return callback(err); - if (value !== undefined) { - handleExternal(value, type, callback); - } else { - callback(); - } - } - ); - return; - } else if ( - typeof externals === "object" && - Object.prototype.hasOwnProperty.call(externals, dependency.request) - ) { - return handleExternal(externals[dependency.request], callback); - } - callback(); - }; + // reverse the ends first before joining them, as the last added must be the inner most + const varEndCode = functionWrapperEnds.reverse().join(""); - handleExternals(this.externals, (err, module) => { - if (err) return callback(err); - if (!module) return handleExternal(false, callback); - return callback(null, module); - }); + // if we have anything, add it to the source + if (varStartCode && varEndCode) { + const start = block.range ? block.range[0] : -10; + const end = block.range + ? block.range[1] + : module.originalSource().size() + 1; + source.insert(start + 0.5, varStartCode); + source.insert(end + 0.5, "\n/* WEBPACK VAR INJECTION */" + varEndCode); } - ); - } -} -module.exports = ExternalModuleFactoryPlugin; + } + for (const childBlock of block.blocks) { + this.sourceBlock( + module, + childBlock, + availableVars.concat(vars), + dependencyTemplates, + source, + runtimeTemplate + ); + } + } -/***/ }), + sourceDependency(dependency, dependencyTemplates, source, runtimeTemplate) { + const template = dependencyTemplates.get(dependency.constructor); + if (!template) { + throw new Error( + "No template for dependency: " + dependency.constructor.name + ); + } + template.apply(dependency, source, runtimeTemplate, dependencyTemplates); + } -/***/ 75705: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + sourceVariables( + variable, + availableVars, + dependencyTemplates, + runtimeTemplate + ) { + const name = variable.name; + const expr = variable.expressionSource( + dependencyTemplates, + runtimeTemplate + ); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + if ( + availableVars.some( + v => v.name === name && v.expression.source() === expr.source() + ) + ) { + return; + } + return { + name: name, + expression: expr + }; + } + /* + * creates the start part of a IIFE around the module to inject a variable name + * (function(…){ <- this part + * }.call(…)) + */ + variableInjectionFunctionWrapperStartCode(varNames) { + const args = varNames.join(", "); + return `/* WEBPACK VAR INJECTION */(function(${args}) {`; + } -const ExternalModuleFactoryPlugin = __webpack_require__(67876); + contextArgument(module, block) { + if (this === block) { + return module.exportsArgument; + } + return "this"; + } -class ExternalsPlugin { - constructor(type, externals) { - this.type = type; - this.externals = externals; + /* + * creates the end part of a IIFE around the module to inject a variable name + * (function(…){ + * }.call(…)) <- this part + */ + variableInjectionFunctionWrapperEndCode(module, varExpressions, block) { + const firstParam = this.contextArgument(module, block); + const furtherParams = varExpressions.map(e => e.source()).join(", "); + return `}.call(${firstParam}, ${furtherParams}))`; } - apply(compiler) { - compiler.hooks.compile.tap("ExternalsPlugin", ({ normalModuleFactory }) => { - new ExternalModuleFactoryPlugin(this.type, this.externals).apply( - normalModuleFactory + + splitVariablesInUniqueNamedChunks(vars) { + const startState = [[]]; + return vars.reduce((chunks, variable) => { + const current = chunks[chunks.length - 1]; + // check if variable with same name exists already + // if so create a new chunk of variables. + const variableNameAlreadyExists = current.some( + v => v.name === variable.name ); - }); + + if (variableNameAlreadyExists) { + // start new chunk with current variable + chunks.push([variable]); + } else { + // else add it to current chunk + current.push(variable); + } + return chunks; + }, startState); } } -module.exports = ExternalsPlugin; +module.exports = JavascriptGenerator; /***/ }), -/***/ 47163: -/***/ (function(module) { +/***/ 10339: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -61114,43 +59700,190 @@ module.exports = ExternalsPlugin; */ +const Parser = __webpack_require__(70558); +const Template = __webpack_require__(96066); +const { ConcatSource } = __webpack_require__(53665); +const JavascriptGenerator = __webpack_require__(98509); +const createHash = __webpack_require__(15660); -/** @typedef {import("./Compiler")} Compiler */ - -class FlagAllModulesAsUsedPlugin { - constructor(explanation) { - this.explanation = explanation; - } - - /** - * @param {Compiler} compiler webpack compiler - * @returns {void} - */ +class JavascriptModulesPlugin { apply(compiler) { compiler.hooks.compilation.tap( - "FlagAllModulesAsUsedPlugin", - compilation => { - compilation.hooks.optimizeDependencies.tap( - "FlagAllModulesAsUsedPlugin", - modules => { - for (const module of modules) { - module.used = true; - module.usedExports = true; - module.addReason(null, null, this.explanation); - } + "JavascriptModulesPlugin", + (compilation, { normalModuleFactory }) => { + normalModuleFactory.hooks.createParser + .for("javascript/auto") + .tap("JavascriptModulesPlugin", options => { + return new Parser(options, "auto"); + }); + normalModuleFactory.hooks.createParser + .for("javascript/dynamic") + .tap("JavascriptModulesPlugin", options => { + return new Parser(options, "script"); + }); + normalModuleFactory.hooks.createParser + .for("javascript/esm") + .tap("JavascriptModulesPlugin", options => { + return new Parser(options, "module"); + }); + normalModuleFactory.hooks.createGenerator + .for("javascript/auto") + .tap("JavascriptModulesPlugin", () => { + return new JavascriptGenerator(); + }); + normalModuleFactory.hooks.createGenerator + .for("javascript/dynamic") + .tap("JavascriptModulesPlugin", () => { + return new JavascriptGenerator(); + }); + normalModuleFactory.hooks.createGenerator + .for("javascript/esm") + .tap("JavascriptModulesPlugin", () => { + return new JavascriptGenerator(); + }); + compilation.mainTemplate.hooks.renderManifest.tap( + "JavascriptModulesPlugin", + (result, options) => { + const chunk = options.chunk; + const hash = options.hash; + const fullHash = options.fullHash; + const outputOptions = options.outputOptions; + const moduleTemplates = options.moduleTemplates; + const dependencyTemplates = options.dependencyTemplates; + + const filenameTemplate = + chunk.filenameTemplate || outputOptions.filename; + + const useChunkHash = compilation.mainTemplate.useChunkHash(chunk); + + result.push({ + render: () => + compilation.mainTemplate.render( + hash, + chunk, + moduleTemplates.javascript, + dependencyTemplates + ), + filenameTemplate, + pathOptions: { + noChunkHash: !useChunkHash, + contentHashType: "javascript", + chunk + }, + identifier: `chunk${chunk.id}`, + hash: useChunkHash ? chunk.hash : fullHash + }); + return result; + } + ); + compilation.mainTemplate.hooks.modules.tap( + "JavascriptModulesPlugin", + (source, chunk, hash, moduleTemplate, dependencyTemplates) => { + return Template.renderChunkModules( + chunk, + m => typeof m.source === "function", + moduleTemplate, + dependencyTemplates, + "/******/ " + ); + } + ); + compilation.chunkTemplate.hooks.renderManifest.tap( + "JavascriptModulesPlugin", + (result, options) => { + const chunk = options.chunk; + const outputOptions = options.outputOptions; + const moduleTemplates = options.moduleTemplates; + const dependencyTemplates = options.dependencyTemplates; + const filenameTemplate = + chunk.filenameTemplate || outputOptions.chunkFilename; + + result.push({ + render: () => + this.renderJavascript( + compilation.chunkTemplate, + chunk, + moduleTemplates.javascript, + dependencyTemplates + ), + filenameTemplate, + pathOptions: { + chunk, + contentHashType: "javascript" + }, + identifier: `chunk${chunk.id}`, + hash: chunk.hash + }); + + return result; } ); + compilation.hooks.contentHash.tap("JavascriptModulesPlugin", chunk => { + const outputOptions = compilation.outputOptions; + const { + hashSalt, + hashDigest, + hashDigestLength, + hashFunction + } = outputOptions; + const hash = createHash(hashFunction); + if (hashSalt) hash.update(hashSalt); + const template = chunk.hasRuntime() + ? compilation.mainTemplate + : compilation.chunkTemplate; + hash.update(`${chunk.id} `); + hash.update(chunk.ids ? chunk.ids.join(",") : ""); + template.updateHashForChunk( + hash, + chunk, + compilation.moduleTemplates.javascript, + compilation.dependencyTemplates + ); + for (const m of chunk.modulesIterable) { + if (typeof m.source === "function") { + hash.update(m.hash); + } + } + const digest = /** @type {string} */ (hash.digest(hashDigest)); + chunk.contentHash.javascript = digest.substr(0, hashDigestLength); + }); } ); } + + renderJavascript(chunkTemplate, chunk, moduleTemplate, dependencyTemplates) { + const moduleSources = Template.renderChunkModules( + chunk, + m => typeof m.source === "function", + moduleTemplate, + dependencyTemplates + ); + const core = chunkTemplate.hooks.modules.call( + moduleSources, + chunk, + moduleTemplate, + dependencyTemplates + ); + let source = chunkTemplate.hooks.render.call( + core, + chunk, + moduleTemplate, + dependencyTemplates + ); + if (chunk.hasEntryModule()) { + source = chunkTemplate.hooks.renderWithEntry.call(source, chunk); + } + chunk.rendered = true; + return new ConcatSource(source, ";"); + } } -module.exports = FlagAllModulesAsUsedPlugin; +module.exports = JavascriptModulesPlugin; /***/ }), -/***/ 73599: +/***/ 72806: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -61160,180 +59893,101 @@ module.exports = FlagAllModulesAsUsedPlugin; */ -const Queue = __webpack_require__(38637); +const { ConcatSource, RawSource } = __webpack_require__(53665); -const addToSet = (a, b) => { - for (const item of b) { - a.add(item); +const stringifySafe = data => { + const stringified = JSON.stringify(data); + if (!stringified) { + return undefined; // Invalid JSON } -}; -class FlagDependencyExportsPlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "FlagDependencyExportsPlugin", - compilation => { - compilation.hooks.finishModules.tap( - "FlagDependencyExportsPlugin", - modules => { - const dependencies = new Map(); + return stringified.replace(/\u2028|\u2029/g, str => + str === "\u2029" ? "\\u2029" : "\\u2028" + ); // invalid in JavaScript but valid JSON +}; - const queue = new Queue(); +class JsonGenerator { + generate(module, dependencyTemplates, runtimeTemplate) { + const source = new ConcatSource(); + const data = module.buildInfo.jsonData; + if (data === undefined) { + return new RawSource( + runtimeTemplate.missingModuleStatement({ + request: module.rawRequest + }) + ); + } + let finalJson; + if ( + Array.isArray(module.buildMeta.providedExports) && + !module.isUsed("default") + ) { + // Only some exports are used: We can optimize here, by only generating a part of the JSON + const reducedJson = {}; + for (const exportName of module.buildMeta.providedExports) { + if (exportName === "default") continue; + const used = module.isUsed(exportName); + if (used) { + reducedJson[used] = data[exportName]; + } + } + finalJson = reducedJson; + } else { + finalJson = data; + } + // Use JSON because JSON.parse() is much faster than JavaScript evaluation + const jsonSource = JSON.stringify(stringifySafe(finalJson)); + const jsonExpr = `JSON.parse(${jsonSource})`; + source.add(`${module.moduleArgument}.exports = ${jsonExpr};`); + return source; + } +} - let module; - let moduleWithExports; - let moduleProvidedExports; - let providedExportsAreTemporary; +module.exports = JsonGenerator; - const processDependenciesBlock = depBlock => { - for (const dep of depBlock.dependencies) { - if (processDependency(dep)) return true; - } - for (const variable of depBlock.variables) { - for (const dep of variable.dependencies) { - if (processDependency(dep)) return true; - } - } - for (const block of depBlock.blocks) { - if (processDependenciesBlock(block)) return true; - } - return false; - }; - const processDependency = dep => { - const exportDesc = dep.getExports && dep.getExports(); - if (!exportDesc) return; - moduleWithExports = true; - const exports = exportDesc.exports; - // break early if it's only in the worst state - if (module.buildMeta.providedExports === true) { - return true; - } - // break if it should move to the worst state - if (exports === true) { - module.buildMeta.providedExports = true; - return true; - } - // merge in new exports - if (Array.isArray(exports)) { - addToSet(moduleProvidedExports, exports); - } - // store dependencies - const exportDeps = exportDesc.dependencies; - if (exportDeps) { - providedExportsAreTemporary = true; - for (const exportDependency of exportDeps) { - // add dependency for this module - const set = dependencies.get(exportDependency); - if (set === undefined) { - dependencies.set(exportDependency, new Set([module])); - } else { - set.add(module); - } - } - } - return false; - }; +/***/ }), - const notifyDependencies = () => { - const deps = dependencies.get(module); - if (deps !== undefined) { - for (const dep of deps) { - queue.enqueue(dep); - } - } - }; +/***/ 2859: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - const notifyDependenciesIfDifferent = (set, array) => { - const deps = dependencies.get(module); - if (deps !== undefined) { - if (set.size === array.length) { - let i = 0; - let different = false; - for (const item of set) { - if (item !== array[i++]) { - different = true; - break; - } - } - if (!different) return; - } - for (const dep of deps) { - queue.enqueue(dep); - } - } - }; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // Start with all modules without provided exports - for (const module of modules) { - if (module.buildInfo.temporaryProvidedExports) { - // Clear exports when they are temporary - // and recreate them - module.buildMeta.providedExports = null; - queue.enqueue(module); - } else if (!module.buildMeta.providedExports) { - queue.enqueue(module); - } - } - while (queue.length > 0) { - module = queue.dequeue(); +const JsonParser = __webpack_require__(5807); +const JsonGenerator = __webpack_require__(72806); - if (module.buildMeta.providedExports !== true) { - moduleWithExports = - module.buildMeta && module.buildMeta.exportsType; - moduleProvidedExports = new Set(); - providedExportsAreTemporary = false; - processDependenciesBlock(module); - module.buildInfo.temporaryProvidedExports = providedExportsAreTemporary; - if (!moduleWithExports) { - notifyDependencies(); - module.buildMeta.providedExports = true; - } else if (module.buildMeta.providedExports === true) { - notifyDependencies(); - } else if (!module.buildMeta.providedExports) { - notifyDependencies(); - module.buildMeta.providedExports = Array.from( - moduleProvidedExports - ); - } else { - notifyDependenciesIfDifferent( - moduleProvidedExports, - module.buildMeta.providedExports - ); - module.buildMeta.providedExports = Array.from( - moduleProvidedExports - ); - } - } - } - } - ); - const providedExportsCache = new WeakMap(); - compilation.hooks.rebuildModule.tap( - "FlagDependencyExportsPlugin", - module => { - providedExportsCache.set(module, module.buildMeta.providedExports); - } - ); - compilation.hooks.finishRebuildingModule.tap( - "FlagDependencyExportsPlugin", - module => { - module.buildMeta.providedExports = providedExportsCache.get(module); - } - ); +class JsonModulesPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "JsonModulesPlugin", + (compilation, { normalModuleFactory }) => { + normalModuleFactory.hooks.createParser + .for("json") + .tap("JsonModulesPlugin", () => { + return new JsonParser(); + }); + normalModuleFactory.hooks.createGenerator + .for("json") + .tap("JsonModulesPlugin", () => { + return new JsonGenerator(); + }); } ); } } -module.exports = FlagDependencyExportsPlugin; +module.exports = JsonModulesPlugin; /***/ }), -/***/ 33632: -/***/ (function(module) { +/***/ 5807: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -61342,121 +59996,130 @@ module.exports = FlagDependencyExportsPlugin; */ -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ +const parseJson = __webpack_require__(48335); +const JsonExportsDependency = __webpack_require__(54396); -/** @typedef {false | true | string[]} UsedExports */ +class JsonParser { + constructor(options) { + this.options = options; + } -const addToSet = (a, b) => { - for (const item of b) { - if (!a.includes(item)) a.push(item); + parse(source, state) { + const data = parseJson(source[0] === "\ufeff" ? source.slice(1) : source); + state.module.buildInfo.jsonData = data; + state.module.buildMeta.exportsType = "named"; + if (typeof data === "object" && data) { + state.module.addDependency(new JsonExportsDependency(Object.keys(data))); + } + state.module.addDependency(new JsonExportsDependency(["default"])); + return state; } - return a; -}; +} -const isSubset = (biggerSet, subset) => { - if (biggerSet === true) return true; - if (subset === true) return false; - return subset.every(item => biggerSet.indexOf(item) >= 0); -}; +module.exports = JsonParser; -class FlagDependencyUsagePlugin { - apply(compiler) { - compiler.hooks.compilation.tap("FlagDependencyUsagePlugin", compilation => { - compilation.hooks.optimizeDependencies.tap( - "FlagDependencyUsagePlugin", - modules => { - const processModule = (module, usedExports) => { - module.used = true; - if (module.usedExports === true) return; - if (usedExports === true) { - module.usedExports = true; - } else if (Array.isArray(usedExports)) { - const old = module.usedExports ? module.usedExports.length : -1; - module.usedExports = addToSet( - module.usedExports || [], - usedExports - ); - if (module.usedExports.length === old) { - return; - } - } else if (Array.isArray(module.usedExports)) { - return; - } else { - module.usedExports = false; - } - // for a module without side effects we stop tracking usage here when no export is used - // This module won't be evaluated in this case - if (module.factoryMeta.sideEffectFree) { - if (module.usedExports === false) return; - if ( - Array.isArray(module.usedExports) && - module.usedExports.length === 0 - ) - return; - } +/***/ }), - queue.push([module, module, module.usedExports]); - }; +/***/ 30735: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - const processDependenciesBlock = (module, depBlock, usedExports) => { - for (const dep of depBlock.dependencies) { - processDependency(module, dep); - } - for (const variable of depBlock.variables) { - for (const dep of variable.dependencies) { - processDependency(module, dep); - } - } - for (const block of depBlock.blocks) { - queue.push([module, block, usedExports]); - } - }; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - const processDependency = (module, dep) => { - const reference = compilation.getDependencyReference(module, dep); - if (!reference) return; - const referenceModule = reference.module; - const importedNames = reference.importedNames; - const oldUsed = referenceModule.used; - const oldUsedExports = referenceModule.usedExports; - if ( - !oldUsed || - (importedNames && - (!oldUsedExports || !isSubset(oldUsedExports, importedNames))) - ) { - processModule(referenceModule, importedNames); - } - }; - for (const module of modules) { - if (!module.used) module.used = false; - } +const path = __webpack_require__(85622); +const asyncLib = __webpack_require__(36386); +const SingleEntryDependency = __webpack_require__(84828); - /** @type {[Module, DependenciesBlock, UsedExports][]} */ - const queue = []; - for (const preparedEntrypoint of compilation._preparedEntrypoints) { - if (preparedEntrypoint.module) { - processModule(preparedEntrypoint.module, true); - } - } +class LibManifestPlugin { + constructor(options) { + this.options = options; + } - while (queue.length) { - const queueItem = queue.pop(); - processDependenciesBlock(queueItem[0], queueItem[1], queueItem[2]); - } - } - ); - }); + apply(compiler) { + compiler.hooks.emit.tapAsync( + "LibManifestPlugin", + (compilation, callback) => { + asyncLib.forEach( + compilation.chunks, + (chunk, callback) => { + if (!chunk.isOnlyInitial()) { + callback(); + return; + } + const targetPath = compilation.getPath(this.options.path, { + hash: compilation.hash, + chunk + }); + const name = + this.options.name && + compilation.getPath(this.options.name, { + hash: compilation.hash, + chunk + }); + const manifest = { + name, + type: this.options.type, + content: Array.from(chunk.modulesIterable, module => { + if ( + this.options.entryOnly && + !module.reasons.some( + r => r.dependency instanceof SingleEntryDependency + ) + ) { + return; + } + if (module.libIdent) { + const ident = module.libIdent({ + context: this.options.context || compiler.options.context + }); + if (ident) { + return { + ident, + data: { + id: module.id, + buildMeta: module.buildMeta + } + }; + } + } + }) + .filter(Boolean) + .reduce((obj, item) => { + obj[item.ident] = item.data; + return obj; + }, Object.create(null)) + }; + // Apply formatting to content if format flag is true; + const manifestContent = this.options.format + ? JSON.stringify(manifest, null, 2) + : JSON.stringify(manifest); + const content = Buffer.from(manifestContent, "utf8"); + compiler.outputFileSystem.mkdirp(path.dirname(targetPath), err => { + if (err) return callback(err); + compiler.outputFileSystem.writeFile( + targetPath, + content, + callback + ); + }); + }, + callback + ); + } + ); } } -module.exports = FlagDependencyUsagePlugin; +module.exports = LibManifestPlugin; /***/ }), -/***/ 31221: +/***/ 65237: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -61466,24 +60129,191 @@ module.exports = FlagDependencyUsagePlugin; */ -const FunctionModuleTemplatePlugin = __webpack_require__(18864); +const SetVarMainTemplatePlugin = __webpack_require__(37098); -class FunctionModulePlugin { +/** @typedef {import("../declarations/WebpackOptions").LibraryCustomUmdObject} LibraryCustomUmdObject */ +/** @typedef {import("./Compiler")} Compiler */ + +/** + * @param {string[]} accessor the accessor to convert to path + * @returns {string} the path + */ +const accessorToObjectAccess = accessor => { + return accessor.map(a => `[${JSON.stringify(a)}]`).join(""); +}; + +/** + * @param {string=} base the path prefix + * @param {string|string[]|LibraryCustomUmdObject} accessor the accessor + * @param {"amd" | "commonjs" | "root"} umdProperty property used when a custom umd object is provided + * @param {string=} joinWith the element separator + * @returns {string} the path + */ +const accessorAccess = (base, accessor, umdProperty, joinWith = "; ") => { + const normalizedAccessor = + typeof accessor === "object" && !Array.isArray(accessor) + ? accessor[umdProperty] + : accessor; + const accessors = Array.isArray(normalizedAccessor) + ? normalizedAccessor + : [normalizedAccessor]; + return accessors + .map((_, idx) => { + const a = base + ? base + accessorToObjectAccess(accessors.slice(0, idx + 1)) + : accessors[0] + accessorToObjectAccess(accessors.slice(1, idx + 1)); + if (idx === accessors.length - 1) return a; + if (idx === 0 && base === undefined) { + return `${a} = typeof ${a} === "object" ? ${a} : {}`; + } + return `${a} = ${a} || {}`; + }) + .join(joinWith); +}; + +class LibraryTemplatePlugin { + /** + * @param {string|string[]|LibraryCustomUmdObject} name name of library + * @param {string} target type of library + * @param {boolean} umdNamedDefine setting this to true will name the UMD module + * @param {string|TODO} auxiliaryComment comment in the UMD wrapper + * @param {string|string[]} exportProperty which export should be exposed as library + */ + constructor(name, target, umdNamedDefine, auxiliaryComment, exportProperty) { + this.name = name; + this.target = target; + this.umdNamedDefine = umdNamedDefine; + this.auxiliaryComment = auxiliaryComment; + this.exportProperty = exportProperty; + } + + /** + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { - compiler.hooks.compilation.tap("FunctionModulePlugin", compilation => { - new FunctionModuleTemplatePlugin().apply( - compilation.moduleTemplates.javascript - ); + compiler.hooks.thisCompilation.tap("LibraryTemplatePlugin", compilation => { + if (this.exportProperty) { + const ExportPropertyMainTemplatePlugin = __webpack_require__(50471); + new ExportPropertyMainTemplatePlugin(this.exportProperty).apply( + compilation + ); + } + switch (this.target) { + case "var": + if ( + !this.name || + (typeof this.name === "object" && !Array.isArray(this.name)) + ) { + throw new Error( + "library name must be set and not an UMD custom object for non-UMD target" + ); + } + new SetVarMainTemplatePlugin( + `var ${accessorAccess(undefined, this.name, "root")}`, + false + ).apply(compilation); + break; + case "assign": + new SetVarMainTemplatePlugin( + accessorAccess(undefined, this.name, "root"), + false + ).apply(compilation); + break; + case "this": + case "self": + case "window": + if (this.name) { + new SetVarMainTemplatePlugin( + accessorAccess(this.target, this.name, "root"), + false + ).apply(compilation); + } else { + new SetVarMainTemplatePlugin(this.target, true).apply(compilation); + } + break; + case "global": + if (this.name) { + new SetVarMainTemplatePlugin( + accessorAccess( + compilation.runtimeTemplate.outputOptions.globalObject, + this.name, + "root" + ), + false + ).apply(compilation); + } else { + new SetVarMainTemplatePlugin( + compilation.runtimeTemplate.outputOptions.globalObject, + true + ).apply(compilation); + } + break; + case "commonjs": + if (this.name) { + new SetVarMainTemplatePlugin( + accessorAccess("exports", this.name, "commonjs"), + false + ).apply(compilation); + } else { + new SetVarMainTemplatePlugin("exports", true).apply(compilation); + } + break; + case "commonjs2": + case "commonjs-module": + new SetVarMainTemplatePlugin("module.exports", false).apply( + compilation + ); + break; + case "amd": + case "amd-require": { + const AmdMainTemplatePlugin = __webpack_require__(9701); + if (this.name && typeof this.name !== "string") { + throw new Error("library name must be a string for amd target"); + } + new AmdMainTemplatePlugin({ + name: this.name, + requireAsWrapper: this.target === "amd-require" + }).apply(compilation); + break; + } + case "umd": + case "umd2": { + const UmdMainTemplatePlugin = __webpack_require__(75374); + new UmdMainTemplatePlugin(this.name, { + optionalAmdExternalAsGlobal: this.target === "umd2", + namedDefine: this.umdNamedDefine, + auxiliaryComment: this.auxiliaryComment + }).apply(compilation); + break; + } + case "jsonp": { + const JsonpExportMainTemplatePlugin = __webpack_require__(13732); + if (typeof this.name !== "string") + throw new Error("library name must be a string for jsonp target"); + new JsonpExportMainTemplatePlugin(this.name).apply(compilation); + break; + } + case "system": { + const SystemMainTemplatePlugin = __webpack_require__(97365); + new SystemMainTemplatePlugin({ + name: this.name + }).apply(compilation); + break; + } + default: + throw new Error(`${this.target} is not a valid Library target`); + } }); } } -module.exports = FunctionModulePlugin; +module.exports = LibraryTemplatePlugin; /***/ }), -/***/ 18864: +/***/ 48775: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -61493,107 +60323,63 @@ module.exports = FunctionModulePlugin; */ -const { ConcatSource } = __webpack_require__(53665); -const Template = __webpack_require__(96066); +const ModuleFilenameHelpers = __webpack_require__(71474); -class FunctionModuleTemplatePlugin { - apply(moduleTemplate) { - moduleTemplate.hooks.render.tap( - "FunctionModuleTemplatePlugin", - (moduleSource, module) => { - const source = new ConcatSource(); - const args = [module.moduleArgument]; - // TODO remove HACK checking type for javascript - if (module.type && module.type.startsWith("javascript")) { - args.push(module.exportsArgument); - if (module.hasDependencies(d => d.requireWebpackRequire !== false)) { - args.push("__webpack_require__"); - } - } else if (module.type && module.type.startsWith("json")) { - // no additional arguments needed - } else { - args.push(module.exportsArgument, "__webpack_require__"); - } - source.add("/***/ (function(" + args.join(", ") + ") {\n\n"); - if (module.buildInfo.strict) source.add('"use strict";\n'); - source.add(moduleSource); - source.add("\n\n/***/ })"); - return source; - } - ); +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(4994); - moduleTemplate.hooks.package.tap( - "FunctionModuleTemplatePlugin", - (moduleSource, module) => { - if (moduleTemplate.runtimeTemplate.outputOptions.pathinfo) { - const source = new ConcatSource(); - const req = module.readableIdentifier( - moduleTemplate.runtimeTemplate.requestShortener - ); - const reqStr = req.replace(/\*\//g, "*_/"); - const reqStrStar = "*".repeat(reqStr.length); - source.add("/*!****" + reqStrStar + "****!*\\\n"); - source.add(" !*** " + reqStr + " ***!\n"); - source.add(" \\****" + reqStrStar + "****/\n"); - if ( - Array.isArray(module.buildMeta.providedExports) && - module.buildMeta.providedExports.length === 0 - ) { - source.add(Template.toComment("no exports provided") + "\n"); - } else if (Array.isArray(module.buildMeta.providedExports)) { - source.add( - Template.toComment( - "exports provided: " + - module.buildMeta.providedExports.join(", ") - ) + "\n" - ); - } else if (module.buildMeta.providedExports) { - source.add(Template.toComment("no static exports found") + "\n"); - } +/** @typedef {import("../declarations/plugins/LoaderOptionsPlugin").LoaderOptionsPluginOptions} LoaderOptionsPluginOptions */ + +class LoaderOptionsPlugin { + /** + * @param {LoaderOptionsPluginOptions} options options object + */ + constructor(options) { + validateOptions(schema, options || {}, "Loader Options Plugin"); + + if (typeof options !== "object") options = {}; + if (!options.test) { + options.test = { + test: () => true + }; + } + this.options = options; + } + + apply(compiler) { + const options = this.options; + compiler.hooks.compilation.tap("LoaderOptionsPlugin", compilation => { + compilation.hooks.normalModuleLoader.tap( + "LoaderOptionsPlugin", + (context, module) => { + const resource = module.resource; + if (!resource) return; + const i = resource.indexOf("?"); if ( - Array.isArray(module.usedExports) && - module.usedExports.length === 0 + ModuleFilenameHelpers.matchObject( + options, + i < 0 ? resource : resource.substr(0, i) + ) ) { - source.add(Template.toComment("no exports used") + "\n"); - } else if (Array.isArray(module.usedExports)) { - source.add( - Template.toComment( - "exports used: " + module.usedExports.join(", ") - ) + "\n" - ); - } else if (module.usedExports) { - source.add(Template.toComment("all exports used") + "\n"); - } - if (module.optimizationBailout) { - for (const text of module.optimizationBailout) { - let code; - if (typeof text === "function") { - code = text(moduleTemplate.runtimeTemplate.requestShortener); - } else { - code = text; + for (const key of Object.keys(options)) { + if (key === "include" || key === "exclude" || key === "test") { + continue; } - source.add(Template.toComment(`${code}`) + "\n"); + context[key] = options[key]; } } - source.add(moduleSource); - return source; } - return moduleSource; - } - ); - - moduleTemplate.hooks.hash.tap("FunctionModuleTemplatePlugin", hash => { - hash.update("FunctionModuleTemplatePlugin"); - hash.update("2"); + ); }); } } -module.exports = FunctionModuleTemplatePlugin; + +module.exports = LoaderOptionsPlugin; /***/ }), -/***/ 39172: +/***/ 95154: /***/ (function(module) { "use strict"; @@ -61603,1394 +60389,1120 @@ module.exports = FunctionModuleTemplatePlugin; */ -/** @typedef {import("./NormalModule")} NormalModule */ -/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate */ - -/** - * - */ -class Generator { - static byType(map) { - return new ByTypeGenerator(map); +class LoaderTargetPlugin { + constructor(target) { + this.target = target; } - /** - * @abstract - * @param {NormalModule} module module for which the code should be generated - * @param {Map} dependencyTemplates mapping from dependencies to templates - * @param {RuntimeTemplate} runtimeTemplate the runtime template - * @param {string} type which kind of code should be generated - * @returns {Source} generated code - */ - generate(module, dependencyTemplates, runtimeTemplate, type) { - throw new Error("Generator.generate: must be overridden"); + apply(compiler) { + compiler.hooks.compilation.tap("LoaderTargetPlugin", compilation => { + compilation.hooks.normalModuleLoader.tap( + "LoaderTargetPlugin", + loaderContext => { + loaderContext.target = this.target; + } + ); + }); } } -class ByTypeGenerator extends Generator { - constructor(map) { - super(); - this.map = map; - } +module.exports = LoaderTargetPlugin; - /** - * @param {NormalModule} module module for which the code should be generated - * @param {Map} dependencyTemplates mapping from dependencies to templates - * @param {RuntimeTemplate} runtimeTemplate the runtime template - * @param {string} type which kind of code should be generated - * @returns {Source} generated code - */ - generate(module, dependencyTemplates, runtimeTemplate, type) { - const generator = this.map[type]; - if (!generator) { - throw new Error(`Generator.byType: no generator specified for ${type}`); - } - return generator.generate( - module, - dependencyTemplates, - runtimeTemplate, - type - ); - } -} -module.exports = Generator; +/***/ }), +/***/ 43626: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -/***/ }), +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -/***/ 32973: -/***/ (function(__unused_webpack_module, exports) { +const { + ConcatSource, + OriginalSource, + PrefixSource, + RawSource +} = __webpack_require__(53665); +const { + Tapable, + SyncWaterfallHook, + SyncHook, + SyncBailHook +} = __webpack_require__(92402); +const Template = __webpack_require__(96066); + +/** @typedef {import("webpack-sources").ConcatSource} ConcatSource */ +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("./ModuleTemplate")} ModuleTemplate */ /** @typedef {import("./Chunk")} Chunk */ -/** @typedef {import("./ChunkGroup")} ChunkGroup */ -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ -/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ +/** @typedef {import("./Module")} Module} */ +/** @typedef {import("./util/createHash").Hash} Hash} */ +/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate} */ /** - * @param {ChunkGroup} chunkGroup the ChunkGroup to connect - * @param {Chunk} chunk chunk to tie to ChunkGroup - * @returns {void} + * @typedef {Object} RenderManifestOptions + * @property {Chunk} chunk the chunk used to render + * @property {string} hash + * @property {string} fullHash + * @property {TODO} outputOptions + * @property {{javascript: ModuleTemplate, webassembly: ModuleTemplate}} moduleTemplates + * @property {Map} dependencyTemplates */ -const connectChunkGroupAndChunk = (chunkGroup, chunk) => { - if (chunkGroup.pushChunk(chunk)) { - chunk.addGroup(chunkGroup); - } -}; -/** - * @param {ChunkGroup} parent parent ChunkGroup to connect - * @param {ChunkGroup} child child ChunkGroup to connect - * @returns {void} - */ -const connectChunkGroupParentAndChild = (parent, child) => { - if (parent.addChild(child)) { - child.addParent(parent); - } -}; - -/** - * @param {Chunk} chunk Chunk to connect to Module - * @param {Module} module Module to connect to Chunk - * @returns {void} - */ -const connectChunkAndModule = (chunk, module) => { - if (module.addChunk(chunk)) { - chunk.addModule(module); - } -}; - -/** - * @param {Chunk} chunk Chunk being disconnected - * @param {Module} module Module being disconnected - * @returns {void} - */ -const disconnectChunkAndModule = (chunk, module) => { - chunk.removeModule(module); - module.removeChunk(chunk); -}; +// require function shortcuts: +// __webpack_require__.s = the module id of the entry point +// __webpack_require__.c = the module cache +// __webpack_require__.m = the module functions +// __webpack_require__.p = the bundle public path +// __webpack_require__.i = the identity function used for harmony imports +// __webpack_require__.e = the chunk ensure function +// __webpack_require__.d = the exported property define getter function +// __webpack_require__.o = Object.prototype.hasOwnProperty.call +// __webpack_require__.r = define compatibility on export +// __webpack_require__.t = create a fake namespace object +// __webpack_require__.n = compatibility get default export +// __webpack_require__.h = the webpack hash +// __webpack_require__.w = an object containing all installed WebAssembly.Instance export objects keyed by module id +// __webpack_require__.oe = the uncaught error handler for the webpack runtime +// __webpack_require__.nc = the script nonce -/** - * @param {AsyncDependenciesBlock} depBlock DepBlock being tied to ChunkGroup - * @param {ChunkGroup} chunkGroup ChunkGroup being tied to DepBlock - * @returns {void} - */ -const connectDependenciesBlockAndChunkGroup = (depBlock, chunkGroup) => { - if (chunkGroup.addBlock(depBlock)) { - depBlock.chunkGroup = chunkGroup; - } -}; +module.exports = class MainTemplate extends Tapable { + /** + * + * @param {TODO=} outputOptions output options for the MainTemplate + */ + constructor(outputOptions) { + super(); + /** @type {TODO?} */ + this.outputOptions = outputOptions || {}; + this.hooks = { + /** @type {SyncWaterfallHook} */ + renderManifest: new SyncWaterfallHook(["result", "options"]), + modules: new SyncWaterfallHook([ + "modules", + "chunk", + "hash", + "moduleTemplate", + "dependencyTemplates" + ]), + moduleObj: new SyncWaterfallHook([ + "source", + "chunk", + "hash", + "moduleIdExpression" + ]), + requireEnsure: new SyncWaterfallHook([ + "source", + "chunk", + "hash", + "chunkIdExpression" + ]), + bootstrap: new SyncWaterfallHook([ + "source", + "chunk", + "hash", + "moduleTemplate", + "dependencyTemplates" + ]), + localVars: new SyncWaterfallHook(["source", "chunk", "hash"]), + require: new SyncWaterfallHook(["source", "chunk", "hash"]), + requireExtensions: new SyncWaterfallHook(["source", "chunk", "hash"]), + /** @type {SyncWaterfallHook} */ + beforeStartup: new SyncWaterfallHook(["source", "chunk", "hash"]), + /** @type {SyncWaterfallHook} */ + startup: new SyncWaterfallHook(["source", "chunk", "hash"]), + /** @type {SyncWaterfallHook} */ + afterStartup: new SyncWaterfallHook(["source", "chunk", "hash"]), + render: new SyncWaterfallHook([ + "source", + "chunk", + "hash", + "moduleTemplate", + "dependencyTemplates" + ]), + renderWithEntry: new SyncWaterfallHook(["source", "chunk", "hash"]), + moduleRequire: new SyncWaterfallHook([ + "source", + "chunk", + "hash", + "moduleIdExpression" + ]), + addModule: new SyncWaterfallHook([ + "source", + "chunk", + "hash", + "moduleIdExpression", + "moduleExpression" + ]), + currentHash: new SyncWaterfallHook(["source", "requestedLength"]), + assetPath: new SyncWaterfallHook(["path", "options", "assetInfo"]), + hash: new SyncHook(["hash"]), + hashForChunk: new SyncHook(["hash", "chunk"]), + globalHashPaths: new SyncWaterfallHook(["paths"]), + globalHash: new SyncBailHook(["chunk", "paths"]), -exports.connectChunkGroupAndChunk = connectChunkGroupAndChunk; -exports.connectChunkGroupParentAndChild = connectChunkGroupParentAndChild; -exports.connectChunkAndModule = connectChunkAndModule; -exports.disconnectChunkAndModule = disconnectChunkAndModule; -exports.connectDependenciesBlockAndChunkGroup = connectDependenciesBlockAndChunkGroup; + // TODO this should be moved somewhere else + // It's weird here + hotBootstrap: new SyncWaterfallHook(["source", "chunk", "hash"]) + }; + this.hooks.startup.tap("MainTemplate", (source, chunk, hash) => { + /** @type {string[]} */ + const buf = []; + if (chunk.entryModule) { + buf.push("// Load entry module and return exports"); + buf.push( + `return ${this.renderRequireFunctionForModule( + hash, + chunk, + JSON.stringify(chunk.entryModule.id) + )}(${this.requireFn}.s = ${JSON.stringify(chunk.entryModule.id)});` + ); + } + return Template.asString(buf); + }); + this.hooks.render.tap( + "MainTemplate", + (bootstrapSource, chunk, hash, moduleTemplate, dependencyTemplates) => { + const source = new ConcatSource(); + source.add("/******/ (function(modules) { // webpackBootstrap\n"); + source.add(new PrefixSource("/******/", bootstrapSource)); + source.add("/******/ })\n"); + source.add( + "/************************************************************************/\n" + ); + source.add("/******/ ("); + source.add( + this.hooks.modules.call( + new RawSource(""), + chunk, + hash, + moduleTemplate, + dependencyTemplates + ) + ); + source.add(")"); + return source; + } + ); + this.hooks.localVars.tap("MainTemplate", (source, chunk, hash) => { + return Template.asString([ + source, + "// The module cache", + "var installedModules = {};" + ]); + }); + this.hooks.require.tap("MainTemplate", (source, chunk, hash) => { + return Template.asString([ + source, + "// Check if module is in cache", + "if(installedModules[moduleId]) {", + Template.indent("return installedModules[moduleId].exports;"), + "}", + "// Create a new module (and put it into the cache)", + "var module = installedModules[moduleId] = {", + Template.indent(this.hooks.moduleObj.call("", chunk, hash, "moduleId")), + "};", + "", + Template.asString( + outputOptions.strictModuleExceptionHandling + ? [ + "// Execute the module function", + "var threw = true;", + "try {", + Template.indent([ + `modules[moduleId].call(module.exports, module, module.exports, ${this.renderRequireFunctionForModule( + hash, + chunk, + "moduleId" + )});`, + "threw = false;" + ]), + "} finally {", + Template.indent([ + "if(threw) delete installedModules[moduleId];" + ]), + "}" + ] + : [ + "// Execute the module function", + `modules[moduleId].call(module.exports, module, module.exports, ${this.renderRequireFunctionForModule( + hash, + chunk, + "moduleId" + )});` + ] + ), + "", + "// Flag the module as loaded", + "module.l = true;", + "", + "// Return the exports of the module", + "return module.exports;" + ]); + }); + this.hooks.moduleObj.tap( + "MainTemplate", + (source, chunk, hash, varModuleId) => { + return Template.asString(["i: moduleId,", "l: false,", "exports: {}"]); + } + ); + this.hooks.requireExtensions.tap("MainTemplate", (source, chunk, hash) => { + const buf = []; + const chunkMaps = chunk.getChunkMaps(); + // Check if there are non initial chunks which need to be imported using require-ensure + if (Object.keys(chunkMaps.hash).length) { + buf.push("// This file contains only the entry chunk."); + buf.push("// The chunk loading function for additional chunks"); + buf.push(`${this.requireFn}.e = function requireEnsure(chunkId) {`); + buf.push(Template.indent("var promises = [];")); + buf.push( + Template.indent( + this.hooks.requireEnsure.call("", chunk, hash, "chunkId") + ) + ); + buf.push(Template.indent("return Promise.all(promises);")); + buf.push("};"); + } else if ( + chunk.hasModuleInGraph(m => + m.blocks.some(b => b.chunkGroup && b.chunkGroup.chunks.length > 0) + ) + ) { + // There async blocks in the graph, so we need to add an empty requireEnsure + // function anyway. This can happen with multiple entrypoints. + buf.push("// The chunk loading function for additional chunks"); + buf.push("// Since all referenced chunks are already included"); + buf.push("// in this file, this function is empty here."); + buf.push(`${this.requireFn}.e = function requireEnsure() {`); + buf.push(Template.indent("return Promise.resolve();")); + buf.push("};"); + } + buf.push(""); + buf.push("// expose the modules object (__webpack_modules__)"); + buf.push(`${this.requireFn}.m = modules;`); + buf.push(""); + buf.push("// expose the module cache"); + buf.push(`${this.requireFn}.c = installedModules;`); -/***/ }), + buf.push(""); + buf.push("// define getter function for harmony exports"); + buf.push(`${this.requireFn}.d = function(exports, name, getter) {`); + buf.push( + Template.indent([ + `if(!${this.requireFn}.o(exports, name)) {`, + Template.indent([ + "Object.defineProperty(exports, name, { enumerable: true, get: getter });" + ]), + "}" + ]) + ); + buf.push("};"); -/***/ 30327: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + buf.push(""); + buf.push("// define __esModule on exports"); + buf.push(`${this.requireFn}.r = function(exports) {`); + buf.push( + Template.indent([ + "if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {", + Template.indent([ + "Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });" + ]), + "}", + "Object.defineProperty(exports, '__esModule', { value: true });" + ]) + ); + buf.push("};"); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php -*/ + buf.push(""); + buf.push("// create a fake namespace object"); + buf.push("// mode & 1: value is a module id, require it"); + buf.push("// mode & 2: merge all properties of value into the ns"); + buf.push("// mode & 4: return value when already ns object"); + buf.push("// mode & 8|1: behave like require"); + buf.push(`${this.requireFn}.t = function(value, mode) {`); + buf.push( + Template.indent([ + `if(mode & 1) value = ${this.requireFn}(value);`, + `if(mode & 8) return value;`, + "if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;", + "var ns = Object.create(null);", + `${this.requireFn}.r(ns);`, + "Object.defineProperty(ns, 'default', { enumerable: true, value: value });", + "if(mode & 2 && typeof value != 'string') for(var key in value) " + + `${this.requireFn}.d(ns, key, function(key) { ` + + "return value[key]; " + + "}.bind(null, key));", + "return ns;" + ]) + ); + buf.push("};"); + buf.push(""); + buf.push( + "// getDefaultExport function for compatibility with non-harmony modules" + ); + buf.push(this.requireFn + ".n = function(module) {"); + buf.push( + Template.indent([ + "var getter = module && module.__esModule ?", + Template.indent([ + "function getDefault() { return module['default']; } :", + "function getModuleExports() { return module; };" + ]), + `${this.requireFn}.d(getter, 'a', getter);`, + "return getter;" + ]) + ); + buf.push("};"); -const WebpackError = __webpack_require__(97391); + buf.push(""); + buf.push("// Object.prototype.hasOwnProperty.call"); + buf.push( + `${this.requireFn}.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };` + ); -module.exports = class HarmonyLinkingError extends WebpackError { - /** @param {string} message Error message */ - constructor(message) { - super(message); - this.name = "HarmonyLinkingError"; - this.hideStack = true; + const publicPath = this.getPublicPath({ + hash: hash + }); + buf.push(""); + buf.push("// __webpack_public_path__"); + buf.push(`${this.requireFn}.p = ${JSON.stringify(publicPath)};`); + return Template.asString(buf); + }); - Error.captureStackTrace(this, this.constructor); + this.requireFn = "__webpack_require__"; } -}; - - -/***/ }), - -/***/ 50268: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -const createHash = __webpack_require__(15660); + /** + * + * @param {RenderManifestOptions} options render manifest options + * @returns {TODO[]} returns render manifest + */ + getRenderManifest(options) { + const result = []; -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(45843); + this.hooks.renderManifest.call(result, options); -/** @typedef {import("../declarations/plugins/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions} HashedModuleIdsPluginOptions */ + return result; + } -class HashedModuleIdsPlugin { /** - * @param {HashedModuleIdsPluginOptions=} options options object + * TODO webpack 5: remove moduleTemplate and dependencyTemplates + * @param {string} hash hash to be used for render call + * @param {Chunk} chunk Chunk instance + * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render + * @param {Map} dependencyTemplates dependency templates + * @returns {string[]} the generated source of the bootstrap code */ - constructor(options) { - if (!options) options = {}; + renderBootstrap(hash, chunk, moduleTemplate, dependencyTemplates) { + const buf = []; + buf.push( + this.hooks.bootstrap.call( + "", + chunk, + hash, + moduleTemplate, + dependencyTemplates + ) + ); + buf.push(this.hooks.localVars.call("", chunk, hash)); + buf.push(""); + buf.push("// The require function"); + buf.push(`function ${this.requireFn}(moduleId) {`); + buf.push(Template.indent(this.hooks.require.call("", chunk, hash))); + buf.push("}"); + buf.push(""); + buf.push( + Template.asString(this.hooks.requireExtensions.call("", chunk, hash)) + ); + buf.push(""); + buf.push(Template.asString(this.hooks.beforeStartup.call("", chunk, hash))); + const afterStartupCode = Template.asString( + this.hooks.afterStartup.call("", chunk, hash) + ); + if (afterStartupCode) { + // TODO webpack 5: this is a bit hacky to avoid a breaking change + // change it to a better way + buf.push("var startupResult = (function() {"); + } + buf.push(Template.asString(this.hooks.startup.call("", chunk, hash))); + if (afterStartupCode) { + buf.push("})();"); + buf.push(afterStartupCode); + buf.push("return startupResult;"); + } + return buf; + } - validateOptions(schema, options, "Hashed Module Ids Plugin"); + /** + * @param {string} hash hash to be used for render call + * @param {Chunk} chunk Chunk instance + * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render + * @param {Map} dependencyTemplates dependency templates + * @returns {ConcatSource} the newly generated source from rendering + */ + render(hash, chunk, moduleTemplate, dependencyTemplates) { + const buf = this.renderBootstrap( + hash, + chunk, + moduleTemplate, + dependencyTemplates + ); + let source = this.hooks.render.call( + new OriginalSource( + Template.prefix(buf, " \t") + "\n", + "webpack/bootstrap" + ), + chunk, + hash, + moduleTemplate, + dependencyTemplates + ); + if (chunk.hasEntryModule()) { + source = this.hooks.renderWithEntry.call(source, chunk, hash); + } + if (!source) { + throw new Error( + "Compiler error: MainTemplate plugin 'render' should return something" + ); + } + chunk.rendered = true; + return new ConcatSource(source, ";"); + } - /** @type {HashedModuleIdsPluginOptions} */ - this.options = Object.assign( - { - context: null, - hashFunction: "md4", - hashDigest: "base64", - hashDigestLength: 4 - }, - options + /** + * + * @param {string} hash hash for render fn + * @param {Chunk} chunk Chunk instance for require + * @param {(number|string)=} varModuleId module id + * @returns {TODO} the moduleRequire hook call return signature + */ + renderRequireFunctionForModule(hash, chunk, varModuleId) { + return this.hooks.moduleRequire.call( + this.requireFn, + chunk, + hash, + varModuleId ); } - apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap("HashedModuleIdsPlugin", compilation => { - const usedIds = new Set(); - compilation.hooks.beforeModuleIds.tap( - "HashedModuleIdsPlugin", - modules => { - for (const module of modules) { - if (module.id === null && module.libIdent) { - const id = module.libIdent({ - context: this.options.context || compiler.options.context - }); - const hash = createHash(options.hashFunction); - hash.update(id); - const hashId = /** @type {string} */ (hash.digest( - options.hashDigest - )); - let len = options.hashDigestLength; - while (usedIds.has(hashId.substr(0, len))) len++; - module.id = hashId.substr(0, len); - usedIds.add(module.id); - } - } - } - ); - }); + /** + * + * @param {string} hash hash for render add fn + * @param {Chunk} chunk Chunk instance for require add fn + * @param {(string|number)=} varModuleId module id + * @param {Module} varModule Module instance + * @returns {TODO} renderAddModule call + */ + renderAddModule(hash, chunk, varModuleId, varModule) { + return this.hooks.addModule.call( + `modules[${varModuleId}] = ${varModule};`, + chunk, + hash, + varModuleId, + varModule + ); } -} -module.exports = HashedModuleIdsPlugin; + /** + * + * @param {string} hash string hash + * @param {number=} length length + * @returns {string} call hook return + */ + renderCurrentHashCode(hash, length) { + length = length || Infinity; + return this.hooks.currentHash.call( + JSON.stringify(hash.substr(0, length)), + length + ); + } + + /** + * + * @param {object} options get public path options + * @returns {string} hook call + */ + getPublicPath(options) { + return this.hooks.assetPath.call( + this.outputOptions.publicPath || "", + options + ); + } + + getAssetPath(path, options) { + return this.hooks.assetPath.call(path, options); + } + + getAssetPathWithInfo(path, options) { + const assetInfo = {}; + // TODO webpack 5: refactor assetPath hook to receive { path, info } object + const newPath = this.hooks.assetPath.call(path, options, assetInfo); + return { path: newPath, info: assetInfo }; + } + + /** + * Updates hash with information from this template + * @param {Hash} hash the hash to update + * @returns {void} + */ + updateHash(hash) { + hash.update("maintemplate"); + hash.update("3"); + this.hooks.hash.call(hash); + } + + /** + * TODO webpack 5: remove moduleTemplate and dependencyTemplates + * Updates hash with chunk-specific information from this template + * @param {Hash} hash the hash to update + * @param {Chunk} chunk the chunk + * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render + * @param {Map} dependencyTemplates dependency templates + * @returns {void} + */ + updateHashForChunk(hash, chunk, moduleTemplate, dependencyTemplates) { + this.updateHash(hash); + this.hooks.hashForChunk.call(hash, chunk); + for (const line of this.renderBootstrap( + "0000", + chunk, + moduleTemplate, + dependencyTemplates + )) { + hash.update(line); + } + } + + useChunkHash(chunk) { + const paths = this.hooks.globalHashPaths.call([]); + return !this.hooks.globalHash.call(chunk, paths); + } +}; /***/ }), -/***/ 65217: -/***/ (function(module) { +/***/ 50332: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -// eslint-disable no-unused-vars -var $hash$ = undefined; -var $requestTimeout$ = undefined; -var installedModules = undefined; -var $require$ = undefined; -var hotDownloadManifest = undefined; -var hotDownloadUpdateChunk = undefined; -var hotDisposeChunk = undefined; -var modules = undefined; -var chunkId = undefined; +module.exports = __webpack_require__(32327); -module.exports = function() { - var hotApplyOnUpdate = true; - // eslint-disable-next-line no-unused-vars - var hotCurrentHash = $hash$; - var hotRequestTimeout = $requestTimeout$; - var hotCurrentModuleData = {}; - var hotCurrentChildModule; - // eslint-disable-next-line no-unused-vars - var hotCurrentParents = []; - // eslint-disable-next-line no-unused-vars - var hotCurrentParentsTemp = []; - // eslint-disable-next-line no-unused-vars - function hotCreateRequire(moduleId) { - var me = installedModules[moduleId]; - if (!me) return $require$; - var fn = function(request) { - if (me.hot.active) { - if (installedModules[request]) { - if (installedModules[request].parents.indexOf(moduleId) === -1) { - installedModules[request].parents.push(moduleId); - } - } else { - hotCurrentParents = [moduleId]; - hotCurrentChildModule = request; - } - if (me.children.indexOf(request) === -1) { - me.children.push(request); - } - } else { - console.warn( - "[HMR] unexpected require(" + - request + - ") from disposed module " + - moduleId - ); - hotCurrentParents = []; - } - return $require$(request); - }; - var ObjectFactory = function ObjectFactory(name) { - return { - configurable: true, - enumerable: true, - get: function() { - return $require$[name]; - }, - set: function(value) { - $require$[name] = value; - } - }; - }; - for (var name in $require$) { - if ( - Object.prototype.hasOwnProperty.call($require$, name) && - name !== "e" && - name !== "t" - ) { - Object.defineProperty(fn, name, ObjectFactory(name)); - } - } - fn.e = function(chunkId) { - if (hotStatus === "ready") hotSetStatus("prepare"); - hotChunksLoading++; - return $require$.e(chunkId).then(finishChunkLoading, function(err) { - finishChunkLoading(); - throw err; - }); +/***/ }), - function finishChunkLoading() { - hotChunksLoading--; - if (hotStatus === "prepare") { - if (!hotWaitingFilesMap[chunkId]) { - hotEnsureUpdateChunk(chunkId); - } - if (hotChunksLoading === 0 && hotWaitingFiles === 0) { - hotUpdateDownloaded(); - } - } - } - }; - fn.t = function(value, mode) { - if (mode & 1) value = fn(value); - return $require$.t(value, mode & ~1); - }; - return fn; - } +/***/ 75993: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // eslint-disable-next-line no-unused-vars - function hotCreateModule(moduleId) { - var hot = { - // private stuff - _acceptedDependencies: {}, - _declinedDependencies: {}, - _selfAccepted: false, - _selfDeclined: false, - _selfInvalidated: false, - _disposeHandlers: [], - _main: hotCurrentChildModule !== moduleId, +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // Module API - active: true, - accept: function(dep, callback) { - if (dep === undefined) hot._selfAccepted = true; - else if (typeof dep === "function") hot._selfAccepted = dep; - else if (typeof dep === "object") - for (var i = 0; i < dep.length; i++) - hot._acceptedDependencies[dep[i]] = callback || function() {}; - else hot._acceptedDependencies[dep] = callback || function() {}; - }, - decline: function(dep) { - if (dep === undefined) hot._selfDeclined = true; - else if (typeof dep === "object") - for (var i = 0; i < dep.length; i++) - hot._declinedDependencies[dep[i]] = true; - else hot._declinedDependencies[dep] = true; - }, - dispose: function(callback) { - hot._disposeHandlers.push(callback); - }, - addDisposeHandler: function(callback) { - hot._disposeHandlers.push(callback); - }, - removeDisposeHandler: function(callback) { - var idx = hot._disposeHandlers.indexOf(callback); - if (idx >= 0) hot._disposeHandlers.splice(idx, 1); - }, - invalidate: function() { - this._selfInvalidated = true; - switch (hotStatus) { - case "idle": - hotUpdate = {}; - hotUpdate[moduleId] = modules[moduleId]; - hotSetStatus("ready"); - break; - case "ready": - hotApplyInvalidatedModule(moduleId); - break; - case "prepare": - case "check": - case "dispose": - case "apply": - (hotQueuedInvalidatedModules = - hotQueuedInvalidatedModules || []).push(moduleId); - break; - default: - // ignore requests in error states - break; - } - }, - // Management API - check: hotCheck, - apply: hotApply, - status: function(l) { - if (!l) return hotStatus; - hotStatusHandlers.push(l); - }, - addStatusHandler: function(l) { - hotStatusHandlers.push(l); - }, - removeStatusHandler: function(l) { - var idx = hotStatusHandlers.indexOf(l); - if (idx >= 0) hotStatusHandlers.splice(idx, 1); - }, +const util = __webpack_require__(31669); - //inherit from previous dispose call - data: hotCurrentModuleData[moduleId] - }; - hotCurrentChildModule = undefined; - return hot; - } +const DependenciesBlock = __webpack_require__(16071); +const ModuleReason = __webpack_require__(44576); +const SortableSet = __webpack_require__(50071); +const Template = __webpack_require__(96066); - var hotStatusHandlers = []; - var hotStatus = "idle"; +/** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("./RequestShortener")} RequestShortener */ +/** @typedef {import("./WebpackError")} WebpackError */ +/** @typedef {import("./util/createHash").Hash} Hash */ - function hotSetStatus(newStatus) { - hotStatus = newStatus; - for (var i = 0; i < hotStatusHandlers.length; i++) - hotStatusHandlers[i].call(null, newStatus); - } +const EMPTY_RESOLVE_OPTIONS = {}; - // while downloading - var hotWaitingFiles = 0; - var hotChunksLoading = 0; - var hotWaitingFilesMap = {}; - var hotRequestedFilesMap = {}; - var hotAvailableFilesMap = {}; - var hotDeferred; +let debugId = 1000; - // The update info - var hotUpdate, hotUpdateNewHash, hotQueuedInvalidatedModules; +const sortById = (a, b) => { + return a.id - b.id; +}; - function toModuleId(id) { - var isNumber = +id + "" === id; - return isNumber ? +id : id; - } +const sortByDebugId = (a, b) => { + return a.debugId - b.debugId; +}; - function hotCheck(apply) { - if (hotStatus !== "idle") { - throw new Error("check() is only allowed in idle status"); - } - hotApplyOnUpdate = apply; - hotSetStatus("check"); - return hotDownloadManifest(hotRequestTimeout).then(function(update) { - if (!update) { - hotSetStatus(hotApplyInvalidatedModules() ? "ready" : "idle"); - return null; - } - hotRequestedFilesMap = {}; - hotWaitingFilesMap = {}; - hotAvailableFilesMap = update.c; - hotUpdateNewHash = update.h; +/** @typedef {(requestShortener: RequestShortener) => string} OptimizationBailoutFunction */ - hotSetStatus("prepare"); - var promise = new Promise(function(resolve, reject) { - hotDeferred = { - resolve: resolve, - reject: reject - }; - }); - hotUpdate = {}; - /*foreachInstalledChunks*/ - // eslint-disable-next-line no-lone-blocks - { - hotEnsureUpdateChunk(chunkId); - } - if ( - hotStatus === "prepare" && - hotChunksLoading === 0 && - hotWaitingFiles === 0 - ) { - hotUpdateDownloaded(); - } - return promise; - }); - } +class Module extends DependenciesBlock { + constructor(type, context = null) { + super(); + /** @type {string} */ + this.type = type; + /** @type {string} */ + this.context = context; - // eslint-disable-next-line no-unused-vars - function hotAddUpdateChunk(chunkId, moreModules) { - if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) - return; - hotRequestedFilesMap[chunkId] = false; - for (var moduleId in moreModules) { - if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { - hotUpdate[moduleId] = moreModules[moduleId]; - } - } - if (--hotWaitingFiles === 0 && hotChunksLoading === 0) { - hotUpdateDownloaded(); - } - } + // Unique Id + /** @type {number} */ + this.debugId = debugId++; - function hotEnsureUpdateChunk(chunkId) { - if (!hotAvailableFilesMap[chunkId]) { - hotWaitingFilesMap[chunkId] = true; - } else { - hotRequestedFilesMap[chunkId] = true; - hotWaitingFiles++; - hotDownloadUpdateChunk(chunkId); - } - } + // Hash + /** @type {string} */ + this.hash = undefined; + /** @type {string} */ + this.renderedHash = undefined; - function hotUpdateDownloaded() { - hotSetStatus("ready"); - var deferred = hotDeferred; - hotDeferred = null; - if (!deferred) return; - if (hotApplyOnUpdate) { - // Wrap deferred object in Promise to mark it as a well-handled Promise to - // avoid triggering uncaught exception warning in Chrome. - // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 - Promise.resolve() - .then(function() { - return hotApply(hotApplyOnUpdate); - }) - .then( - function(result) { - deferred.resolve(result); - }, - function(err) { - deferred.reject(err); - } - ); - } else { - var outdatedModules = []; - for (var id in hotUpdate) { - if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { - outdatedModules.push(toModuleId(id)); - } - } - deferred.resolve(outdatedModules); - } - } + // Info from Factory + /** @type {TODO} */ + this.resolveOptions = EMPTY_RESOLVE_OPTIONS; + /** @type {object} */ + this.factoryMeta = {}; - function hotApply(options) { - if (hotStatus !== "ready") - throw new Error("apply() is only allowed in ready status"); - options = options || {}; - return hotApplyInternal(options); - } + // Info from Build + /** @type {WebpackError[]} */ + this.warnings = []; + /** @type {WebpackError[]} */ + this.errors = []; + /** @type {object} */ + this.buildMeta = undefined; + /** @type {object} */ + this.buildInfo = undefined; - function hotApplyInternal(options) { - hotApplyInvalidatedModules(); + // Graph (per Compilation) + /** @type {ModuleReason[]} */ + this.reasons = []; + /** @type {SortableSet} */ + this._chunks = new SortableSet(undefined, sortById); - var cb; - var i; - var j; - var module; - var moduleId; + // Info from Compilation (per Compilation) + /** @type {number|string} */ + this.id = null; + /** @type {number} */ + this.index = null; + /** @type {number} */ + this.index2 = null; + /** @type {number} */ + this.depth = null; + /** @type {Module} */ + this.issuer = null; + /** @type {undefined | object} */ + this.profile = undefined; + /** @type {boolean} */ + this.prefetched = false; + /** @type {boolean} */ + this.built = false; - function getAffectedStuff(updateModuleId) { - var outdatedModules = [updateModuleId]; - var outdatedDependencies = {}; + // Info from Optimization (per Compilation) + /** @type {null | boolean} */ + this.used = null; + /** @type {false | true | string[]} */ + this.usedExports = null; + /** @type {(string | OptimizationBailoutFunction)[]} */ + this.optimizationBailout = []; - var queue = outdatedModules.map(function(id) { - return { - chain: [id], - id: id - }; - }); - while (queue.length > 0) { - var queueItem = queue.pop(); - var moduleId = queueItem.id; - var chain = queueItem.chain; - module = installedModules[moduleId]; - if ( - !module || - (module.hot._selfAccepted && !module.hot._selfInvalidated) - ) - continue; - if (module.hot._selfDeclined) { - return { - type: "self-declined", - chain: chain, - moduleId: moduleId - }; - } - if (module.hot._main) { - return { - type: "unaccepted", - chain: chain, - moduleId: moduleId - }; - } - for (var i = 0; i < module.parents.length; i++) { - var parentId = module.parents[i]; - var parent = installedModules[parentId]; - if (!parent) continue; - if (parent.hot._declinedDependencies[moduleId]) { - return { - type: "declined", - chain: chain.concat([parentId]), - moduleId: moduleId, - parentId: parentId - }; - } - if (outdatedModules.indexOf(parentId) !== -1) continue; - if (parent.hot._acceptedDependencies[moduleId]) { - if (!outdatedDependencies[parentId]) - outdatedDependencies[parentId] = []; - addAllToSet(outdatedDependencies[parentId], [moduleId]); - continue; - } - delete outdatedDependencies[parentId]; - outdatedModules.push(parentId); - queue.push({ - chain: chain.concat([parentId]), - id: parentId - }); - } - } + // delayed operations + /** @type {undefined | {oldChunk: Chunk, newChunks: Chunk[]}[] } */ + this._rewriteChunkInReasons = undefined; - return { - type: "accepted", - moduleId: updateModuleId, - outdatedModules: outdatedModules, - outdatedDependencies: outdatedDependencies - }; - } + /** @type {boolean} */ + this.useSourceMap = false; - function addAllToSet(a, b) { - for (var i = 0; i < b.length; i++) { - var item = b[i]; - if (a.indexOf(item) === -1) a.push(item); - } - } + // info from build + this._source = null; + } - // at begin all updates modules are outdated - // the "outdated" status can propagate to parents if they don't accept the children - var outdatedDependencies = {}; - var outdatedModules = []; - var appliedUpdate = {}; + get exportsArgument() { + return (this.buildInfo && this.buildInfo.exportsArgument) || "exports"; + } - var warnUnexpectedRequire = function warnUnexpectedRequire() { - console.warn( - "[HMR] unexpected require(" + result.moduleId + ") to disposed module" - ); - }; + get moduleArgument() { + return (this.buildInfo && this.buildInfo.moduleArgument) || "module"; + } - for (var id in hotUpdate) { - if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { - moduleId = toModuleId(id); - /** @type {TODO} */ - var result; - if (hotUpdate[id]) { - result = getAffectedStuff(moduleId); - } else { - result = { - type: "disposed", - moduleId: id - }; - } - /** @type {Error|false} */ - var abortError = false; - var doApply = false; - var doDispose = false; - var chainInfo = ""; - if (result.chain) { - chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); - } - switch (result.type) { - case "self-declined": - if (options.onDeclined) options.onDeclined(result); - if (!options.ignoreDeclined) - abortError = new Error( - "Aborted because of self decline: " + - result.moduleId + - chainInfo - ); - break; - case "declined": - if (options.onDeclined) options.onDeclined(result); - if (!options.ignoreDeclined) - abortError = new Error( - "Aborted because of declined dependency: " + - result.moduleId + - " in " + - result.parentId + - chainInfo - ); - break; - case "unaccepted": - if (options.onUnaccepted) options.onUnaccepted(result); - if (!options.ignoreUnaccepted) - abortError = new Error( - "Aborted because " + moduleId + " is not accepted" + chainInfo - ); - break; - case "accepted": - if (options.onAccepted) options.onAccepted(result); - doApply = true; - break; - case "disposed": - if (options.onDisposed) options.onDisposed(result); - doDispose = true; - break; - default: - throw new Error("Unexception type " + result.type); - } - if (abortError) { - hotSetStatus("abort"); - return Promise.reject(abortError); - } - if (doApply) { - appliedUpdate[moduleId] = hotUpdate[moduleId]; - addAllToSet(outdatedModules, result.outdatedModules); - for (moduleId in result.outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call( - result.outdatedDependencies, - moduleId - ) - ) { - if (!outdatedDependencies[moduleId]) - outdatedDependencies[moduleId] = []; - addAllToSet( - outdatedDependencies[moduleId], - result.outdatedDependencies[moduleId] - ); - } - } - } - if (doDispose) { - addAllToSet(outdatedModules, [result.moduleId]); - appliedUpdate[moduleId] = warnUnexpectedRequire; - } - } - } + disconnect() { + this.hash = undefined; + this.renderedHash = undefined; - // Store self accepted outdated modules to require them later by the module system - var outdatedSelfAcceptedModules = []; - for (i = 0; i < outdatedModules.length; i++) { - moduleId = outdatedModules[i]; - if ( - installedModules[moduleId] && - installedModules[moduleId].hot._selfAccepted && - // removed self-accepted modules should not be required - appliedUpdate[moduleId] !== warnUnexpectedRequire && - // when called invalidate self-accepting is not possible - !installedModules[moduleId].hot._selfInvalidated - ) { - outdatedSelfAcceptedModules.push({ - module: moduleId, - parents: installedModules[moduleId].parents.slice(), - errorHandler: installedModules[moduleId].hot._selfAccepted - }); - } - } + this.reasons.length = 0; + this._rewriteChunkInReasons = undefined; + this._chunks.clear(); - // Now in "dispose" phase - hotSetStatus("dispose"); - Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { - if (hotAvailableFilesMap[chunkId] === false) { - hotDisposeChunk(chunkId); - } - }); + this.id = null; + this.index = null; + this.index2 = null; + this.depth = null; + this.issuer = null; + this.profile = undefined; + this.prefetched = false; + this.built = false; - var idx; - var queue = outdatedModules.slice(); - while (queue.length > 0) { - moduleId = queue.pop(); - module = installedModules[moduleId]; - if (!module) continue; + this.used = null; + this.usedExports = null; + this.optimizationBailout.length = 0; + super.disconnect(); + } - var data = {}; + unseal() { + this.id = null; + this.index = null; + this.index2 = null; + this.depth = null; + this._chunks.clear(); + super.unseal(); + } - // Call dispose handlers - var disposeHandlers = module.hot._disposeHandlers; - for (j = 0; j < disposeHandlers.length; j++) { - cb = disposeHandlers[j]; - cb(data); - } - hotCurrentModuleData[moduleId] = data; + setChunks(chunks) { + this._chunks = new SortableSet(chunks, sortById); + } - // disable module (this disables requires from this module) - module.hot.active = false; + addChunk(chunk) { + if (this._chunks.has(chunk)) return false; + this._chunks.add(chunk); + return true; + } - // remove module from cache - delete installedModules[moduleId]; + removeChunk(chunk) { + if (this._chunks.delete(chunk)) { + chunk.removeModule(this); + return true; + } + return false; + } - // when disposing there is no need to call dispose handler - delete outdatedDependencies[moduleId]; + isInChunk(chunk) { + return this._chunks.has(chunk); + } - // remove "parents" references from all children - for (j = 0; j < module.children.length; j++) { - var child = installedModules[module.children[j]]; - if (!child) continue; - idx = child.parents.indexOf(moduleId); - if (idx >= 0) { - child.parents.splice(idx, 1); - } - } + isEntryModule() { + for (const chunk of this._chunks) { + if (chunk.entryModule === this) return true; } + return false; + } - // remove outdated dependency from module children - var dependency; - var moduleOutdatedDependencies; - for (moduleId in outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) - ) { - module = installedModules[moduleId]; - if (module) { - moduleOutdatedDependencies = outdatedDependencies[moduleId]; - for (j = 0; j < moduleOutdatedDependencies.length; j++) { - dependency = moduleOutdatedDependencies[j]; - idx = module.children.indexOf(dependency); - if (idx >= 0) module.children.splice(idx, 1); - } - } - } - } + get optional() { + return ( + this.reasons.length > 0 && + this.reasons.every(r => r.dependency && r.dependency.optional) + ); + } - // Now in "apply" phase - hotSetStatus("apply"); + /** + * @returns {Chunk[]} all chunks which contain the module + */ + getChunks() { + return Array.from(this._chunks); + } - if (hotUpdateNewHash !== undefined) { - hotCurrentHash = hotUpdateNewHash; - hotUpdateNewHash = undefined; - } - hotUpdate = undefined; + getNumberOfChunks() { + return this._chunks.size; + } - // insert new code - for (moduleId in appliedUpdate) { - if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { - modules[moduleId] = appliedUpdate[moduleId]; - } + get chunksIterable() { + return this._chunks; + } + + hasEqualsChunks(otherModule) { + if (this._chunks.size !== otherModule._chunks.size) return false; + this._chunks.sortWith(sortByDebugId); + otherModule._chunks.sortWith(sortByDebugId); + const a = this._chunks[Symbol.iterator](); + const b = otherModule._chunks[Symbol.iterator](); + // eslint-disable-next-line no-constant-condition + while (true) { + const aItem = a.next(); + const bItem = b.next(); + if (aItem.done) return true; + if (aItem.value !== bItem.value) return false; } + } - // call accept handlers - var error = null; - for (moduleId in outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) - ) { - module = installedModules[moduleId]; - if (module) { - moduleOutdatedDependencies = outdatedDependencies[moduleId]; - var callbacks = []; - for (i = 0; i < moduleOutdatedDependencies.length; i++) { - dependency = moduleOutdatedDependencies[i]; - cb = module.hot._acceptedDependencies[dependency]; - if (cb) { - if (callbacks.indexOf(cb) !== -1) continue; - callbacks.push(cb); - } - } - for (i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - try { - cb(moduleOutdatedDependencies); - } catch (err) { - if (options.onErrored) { - options.onErrored({ - type: "accept-errored", - moduleId: moduleId, - dependencyId: moduleOutdatedDependencies[i], - error: err - }); - } - if (!options.ignoreErrored) { - if (!error) error = err; - } - } - } - } + addReason(module, dependency, explanation) { + this.reasons.push(new ModuleReason(module, dependency, explanation)); + } + + removeReason(module, dependency) { + for (let i = 0; i < this.reasons.length; i++) { + let r = this.reasons[i]; + if (r.module === module && r.dependency === dependency) { + this.reasons.splice(i, 1); + return true; } } + return false; + } - // Load self accepted modules - for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { - var item = outdatedSelfAcceptedModules[i]; - moduleId = item.module; - hotCurrentParents = item.parents; - hotCurrentChildModule = moduleId; - try { - $require$(moduleId); - } catch (err) { - if (typeof item.errorHandler === "function") { - try { - item.errorHandler(err); - } catch (err2) { - if (options.onErrored) { - options.onErrored({ - type: "self-accept-error-handler-errored", - moduleId: moduleId, - error: err2, - originalError: err - }); - } - if (!options.ignoreErrored) { - if (!error) error = err2; - } - if (!error) error = err; - } - } else { - if (options.onErrored) { - options.onErrored({ - type: "self-accept-errored", - moduleId: moduleId, - error: err - }); - } - if (!options.ignoreErrored) { - if (!error) error = err; - } - } + hasReasonForChunk(chunk) { + if (this._rewriteChunkInReasons) { + for (const operation of this._rewriteChunkInReasons) { + this._doRewriteChunkInReasons(operation.oldChunk, operation.newChunks); } + this._rewriteChunkInReasons = undefined; } - - // handle errors in accept handlers and self accepted module load - if (error) { - hotSetStatus("fail"); - return Promise.reject(error); + for (let i = 0; i < this.reasons.length; i++) { + if (this.reasons[i].hasChunk(chunk)) return true; } + return false; + } - if (hotQueuedInvalidatedModules) { - return hotApplyInternal(options).then(function(list) { - outdatedModules.forEach(function(moduleId) { - if (list.indexOf(moduleId) < 0) list.push(moduleId); - }); - return list; - }); - } + hasReasons() { + return this.reasons.length > 0; + } - hotSetStatus("idle"); - return new Promise(function(resolve) { - resolve(outdatedModules); + rewriteChunkInReasons(oldChunk, newChunks) { + // This is expensive. Delay operation until we really need the data + if (this._rewriteChunkInReasons === undefined) { + this._rewriteChunkInReasons = []; + } + this._rewriteChunkInReasons.push({ + oldChunk, + newChunks }); } - function hotApplyInvalidatedModules() { - if (hotQueuedInvalidatedModules) { - if (!hotUpdate) hotUpdate = {}; - hotQueuedInvalidatedModules.forEach(hotApplyInvalidatedModule); - hotQueuedInvalidatedModules = undefined; - return true; + _doRewriteChunkInReasons(oldChunk, newChunks) { + for (let i = 0; i < this.reasons.length; i++) { + this.reasons[i].rewriteChunks(oldChunk, newChunks); } } - function hotApplyInvalidatedModule(moduleId) { - if (!Object.prototype.hasOwnProperty.call(hotUpdate, moduleId)) - hotUpdate[moduleId] = modules[moduleId]; - } -}; + /** + * @param {string=} exportName the name of the export + * @returns {boolean|string} false if the export isn't used, true if no exportName is provided and the module is used, or the name to access it if the export is used + */ + isUsed(exportName) { + if (!exportName) return this.used !== false; + if (this.used === null || this.usedExports === null) return exportName; + if (!this.used) return false; + if (!this.usedExports) return false; + if (this.usedExports === true) return exportName; + let idx = this.usedExports.indexOf(exportName); + if (idx < 0) return false; + // Mangle export name if possible + if (this.isProvided(exportName)) { + if (this.buildMeta.exportsType === "namespace") { + return Template.numberToIdentifer(idx); + } + if ( + this.buildMeta.exportsType === "named" && + !this.usedExports.includes("default") + ) { + return Template.numberToIdentifer(idx); + } + } + return exportName; + } -/***/ }), + isProvided(exportName) { + if (!Array.isArray(this.buildMeta.providedExports)) return null; + return this.buildMeta.providedExports.includes(exportName); + } -/***/ 69575: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + toString() { + return `Module[${this.id || this.debugId}]`; + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + needRebuild(fileTimestamps, contextTimestamps) { + return true; + } + /** + * @param {Hash} hash the hash used to track dependencies + * @returns {void} + */ + updateHash(hash) { + hash.update(`${this.id}`); + hash.update(JSON.stringify(this.usedExports)); + super.updateHash(hash); + } -const { SyncBailHook } = __webpack_require__(92402); -const { RawSource } = __webpack_require__(53665); -const Template = __webpack_require__(96066); -const ModuleHotAcceptDependency = __webpack_require__(29018); -const ModuleHotDeclineDependency = __webpack_require__(60482); -const ConstDependency = __webpack_require__(71101); -const NullFactory = __webpack_require__(40438); -const ParserHelpers = __webpack_require__(23999); + sortItems(sortChunks) { + super.sortItems(); + if (sortChunks) this._chunks.sort(); + this.reasons.sort((a, b) => { + if (a.module === b.module) return 0; + if (!a.module) return -1; + if (!b.module) return 1; + return sortById(a.module, b.module); + }); + if (Array.isArray(this.usedExports)) { + this.usedExports.sort(); + } + } -module.exports = class HotModuleReplacementPlugin { - constructor(options) { - this.options = options || {}; - this.multiStep = this.options.multiStep; - this.fullBuildTimeout = this.options.fullBuildTimeout || 200; - this.requestTimeout = this.options.requestTimeout || 10000; + unbuild() { + this.dependencies.length = 0; + this.blocks.length = 0; + this.variables.length = 0; + this.buildMeta = undefined; + this.buildInfo = undefined; + this.disconnect(); } - apply(compiler) { - const multiStep = this.multiStep; - const fullBuildTimeout = this.fullBuildTimeout; - const requestTimeout = this.requestTimeout; - const hotUpdateChunkFilename = - compiler.options.output.hotUpdateChunkFilename; - const hotUpdateMainFilename = compiler.options.output.hotUpdateMainFilename; - compiler.hooks.additionalPass.tapAsync( - "HotModuleReplacementPlugin", - callback => { - if (multiStep) return setTimeout(callback, fullBuildTimeout); - return callback(); - } - ); + get arguments() { + throw new Error("Module.arguments was removed, there is no replacement."); + } - const addParserPlugins = (parser, parserOptions) => { - parser.hooks.expression - .for("__webpack_hash__") - .tap( - "HotModuleReplacementPlugin", - ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - "__webpack_require__.h()" - ) - ); - parser.hooks.evaluateTypeof - .for("__webpack_hash__") - .tap( - "HotModuleReplacementPlugin", - ParserHelpers.evaluateToString("string") - ); - parser.hooks.evaluateIdentifier.for("module.hot").tap( - { - name: "HotModuleReplacementPlugin", - before: "NodeStuffPlugin" - }, - expr => { - return ParserHelpers.evaluateToIdentifier( - "module.hot", - !!parser.state.compilation.hotUpdateChunkTemplate - )(expr); - } - ); - // TODO webpack 5: refactor this, no custom hooks - if (!parser.hooks.hotAcceptCallback) { - parser.hooks.hotAcceptCallback = new SyncBailHook([ - "expression", - "requests" - ]); - } - if (!parser.hooks.hotAcceptWithoutCallback) { - parser.hooks.hotAcceptWithoutCallback = new SyncBailHook([ - "expression", - "requests" - ]); - } - parser.hooks.call - .for("module.hot.accept") - .tap("HotModuleReplacementPlugin", expr => { - if (!parser.state.compilation.hotUpdateChunkTemplate) { - return false; - } - if (expr.arguments.length >= 1) { - const arg = parser.evaluateExpression(expr.arguments[0]); - let params = []; - let requests = []; - if (arg.isString()) { - params = [arg]; - } else if (arg.isArray()) { - params = arg.items.filter(param => param.isString()); - } - if (params.length > 0) { - params.forEach((param, idx) => { - const request = param.string; - const dep = new ModuleHotAcceptDependency(request, param.range); - dep.optional = true; - dep.loc = Object.create(expr.loc); - dep.loc.index = idx; - parser.state.module.addDependency(dep); - requests.push(request); - }); - if (expr.arguments.length > 1) { - parser.hooks.hotAcceptCallback.call( - expr.arguments[1], - requests - ); - parser.walkExpression(expr.arguments[1]); // other args are ignored - return true; - } else { - parser.hooks.hotAcceptWithoutCallback.call(expr, requests); - return true; - } - } - } - }); - parser.hooks.call - .for("module.hot.decline") - .tap("HotModuleReplacementPlugin", expr => { - if (!parser.state.compilation.hotUpdateChunkTemplate) { - return false; - } - if (expr.arguments.length === 1) { - const arg = parser.evaluateExpression(expr.arguments[0]); - let params = []; - if (arg.isString()) { - params = [arg]; - } else if (arg.isArray()) { - params = arg.items.filter(param => param.isString()); - } - params.forEach((param, idx) => { - const dep = new ModuleHotDeclineDependency( - param.string, - param.range - ); - dep.optional = true; - dep.loc = Object.create(expr.loc); - dep.loc.index = idx; - parser.state.module.addDependency(dep); - }); - } - }); - parser.hooks.expression - .for("module.hot") - .tap("HotModuleReplacementPlugin", ParserHelpers.skipTraversal); - }; + set arguments(value) { + throw new Error("Module.arguments was removed, there is no replacement."); + } +} - compiler.hooks.compilation.tap( - "HotModuleReplacementPlugin", - (compilation, { normalModuleFactory }) => { - // This applies the HMR plugin only to the targeted compiler - // It should not affect child compilations - if (compilation.compiler !== compiler) return; +// TODO remove in webpack 5 +Object.defineProperty(Module.prototype, "forEachChunk", { + configurable: false, + value: util.deprecate( + /** + * @deprecated + * @param {function(any, any, Set): void} fn callback function + * @returns {void} + * @this {Module} + */ + function(fn) { + this._chunks.forEach(fn); + }, + "Module.forEachChunk: Use for(const chunk of module.chunksIterable) instead" + ) +}); - const hotUpdateChunkTemplate = compilation.hotUpdateChunkTemplate; - if (!hotUpdateChunkTemplate) return; +// TODO remove in webpack 5 +Object.defineProperty(Module.prototype, "mapChunks", { + configurable: false, + value: util.deprecate( + /** + * @deprecated + * @param {function(any, any): void} fn Mapper function + * @returns {Array} Array of chunks mapped + * @this {Module} + */ + function(fn) { + return Array.from(this._chunks, fn); + }, + "Module.mapChunks: Use Array.from(module.chunksIterable, fn) instead" + ) +}); - compilation.dependencyFactories.set(ConstDependency, new NullFactory()); - compilation.dependencyTemplates.set( - ConstDependency, - new ConstDependency.Template() - ); +// TODO remove in webpack 5 +Object.defineProperty(Module.prototype, "entry", { + configurable: false, + get() { + throw new Error("Module.entry was removed. Use Chunk.entryModule"); + }, + set() { + throw new Error("Module.entry was removed. Use Chunk.entryModule"); + } +}); - compilation.dependencyFactories.set( - ModuleHotAcceptDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - ModuleHotAcceptDependency, - new ModuleHotAcceptDependency.Template() - ); +// TODO remove in webpack 5 +Object.defineProperty(Module.prototype, "meta", { + configurable: false, + get: util.deprecate( + /** + * @deprecated + * @returns {void} + * @this {Module} + */ + function() { + return this.buildMeta; + }, + "Module.meta was renamed to Module.buildMeta" + ), + set: util.deprecate( + /** + * @deprecated + * @param {TODO} value Value + * @returns {void} + * @this {Module} + */ + function(value) { + this.buildMeta = value; + }, + "Module.meta was renamed to Module.buildMeta" + ) +}); - compilation.dependencyFactories.set( - ModuleHotDeclineDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - ModuleHotDeclineDependency, - new ModuleHotDeclineDependency.Template() - ); +/** @type {function(): string} */ +Module.prototype.identifier = null; - compilation.hooks.record.tap( - "HotModuleReplacementPlugin", - (compilation, records) => { - if (records.hash === compilation.hash) return; - records.hash = compilation.hash; - records.moduleHashs = {}; - for (const module of compilation.modules) { - const identifier = module.identifier(); - records.moduleHashs[identifier] = module.hash; - } - records.chunkHashs = {}; - for (const chunk of compilation.chunks) { - records.chunkHashs[chunk.id] = chunk.hash; - } - records.chunkModuleIds = {}; - for (const chunk of compilation.chunks) { - records.chunkModuleIds[chunk.id] = Array.from( - chunk.modulesIterable, - m => m.id - ); - } - } - ); - let initialPass = false; - let recompilation = false; - compilation.hooks.afterHash.tap("HotModuleReplacementPlugin", () => { - let records = compilation.records; - if (!records) { - initialPass = true; - return; - } - if (!records.hash) initialPass = true; - const preHash = records.preHash || "x"; - const prepreHash = records.prepreHash || "x"; - if (preHash === compilation.hash) { - recompilation = true; - compilation.modifyHash(prepreHash); - return; - } - records.prepreHash = records.hash || "x"; - records.preHash = compilation.hash; - compilation.modifyHash(records.prepreHash); - }); - compilation.hooks.shouldGenerateChunkAssets.tap( - "HotModuleReplacementPlugin", - () => { - if (multiStep && !recompilation && !initialPass) return false; - } - ); - compilation.hooks.needAdditionalPass.tap( - "HotModuleReplacementPlugin", - () => { - if (multiStep && !recompilation && !initialPass) return true; - } - ); - compilation.hooks.additionalChunkAssets.tap( - "HotModuleReplacementPlugin", - () => { - const records = compilation.records; - if (records.hash === compilation.hash) return; - if ( - !records.moduleHashs || - !records.chunkHashs || - !records.chunkModuleIds - ) - return; - for (const module of compilation.modules) { - const identifier = module.identifier(); - let hash = module.hash; - module.hotUpdate = records.moduleHashs[identifier] !== hash; - } - const hotUpdateMainContent = { - h: compilation.hash, - c: {} - }; - for (const key of Object.keys(records.chunkHashs)) { - const chunkId = isNaN(+key) ? key : +key; - const currentChunk = compilation.chunks.find( - chunk => `${chunk.id}` === key - ); - if (currentChunk) { - const newModules = currentChunk - .getModules() - .filter(module => module.hotUpdate); - const allModules = new Set(); - for (const module of currentChunk.modulesIterable) { - allModules.add(module.id); - } - const removedModules = records.chunkModuleIds[chunkId].filter( - id => !allModules.has(id) - ); - if (newModules.length > 0 || removedModules.length > 0) { - const source = hotUpdateChunkTemplate.render( - chunkId, - newModules, - removedModules, - compilation.hash, - compilation.moduleTemplates.javascript, - compilation.dependencyTemplates - ); - const { - path: filename, - info: assetInfo - } = compilation.getPathWithInfo(hotUpdateChunkFilename, { - hash: records.hash, - chunk: currentChunk - }); - compilation.additionalChunkAssets.push(filename); - compilation.emitAsset( - filename, - source, - Object.assign({ hotModuleReplacement: true }, assetInfo) - ); - hotUpdateMainContent.c[chunkId] = true; - currentChunk.files.push(filename); - compilation.hooks.chunkAsset.call(currentChunk, filename); - } - } else { - hotUpdateMainContent.c[chunkId] = false; - } - } - const source = new RawSource(JSON.stringify(hotUpdateMainContent)); - const { - path: filename, - info: assetInfo - } = compilation.getPathWithInfo(hotUpdateMainFilename, { - hash: records.hash - }); - compilation.emitAsset( - filename, - source, - Object.assign({ hotModuleReplacement: true }, assetInfo) - ); - } - ); +/** @type {function(RequestShortener): string} */ +Module.prototype.readableIdentifier = null; - const mainTemplate = compilation.mainTemplate; +Module.prototype.build = null; +Module.prototype.source = null; +Module.prototype.size = null; +Module.prototype.nameForCondition = null; +/** @type {null | function(Chunk): boolean} */ +Module.prototype.chunkCondition = null; +Module.prototype.updateCacheModule = null; - mainTemplate.hooks.hash.tap("HotModuleReplacementPlugin", hash => { - hash.update("HotMainTemplateDecorator"); - }); +module.exports = Module; - mainTemplate.hooks.moduleRequire.tap( - "HotModuleReplacementPlugin", - (_, chunk, hash, varModuleId) => { - return `hotCreateRequire(${varModuleId})`; - } - ); - mainTemplate.hooks.requireExtensions.tap( - "HotModuleReplacementPlugin", - source => { - const buf = [source]; - buf.push(""); - buf.push("// __webpack_hash__"); - buf.push( - mainTemplate.requireFn + - ".h = function() { return hotCurrentHash; };" - ); - return Template.asString(buf); - } - ); +/***/ }), - const needChunkLoadingCode = chunk => { - for (const chunkGroup of chunk.groupsIterable) { - if (chunkGroup.chunks.length > 1) return true; - if (chunkGroup.getNumberOfChildren() > 0) return true; - } - return false; - }; +/***/ 12072: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - mainTemplate.hooks.bootstrap.tap( - "HotModuleReplacementPlugin", - (source, chunk, hash) => { - source = mainTemplate.hooks.hotBootstrap.call(source, chunk, hash); - return Template.asString([ - source, - "", - hotInitCode - .replace(/\$require\$/g, mainTemplate.requireFn) - .replace(/\$hash\$/g, JSON.stringify(hash)) - .replace(/\$requestTimeout\$/g, requestTimeout) - .replace( - /\/\*foreachInstalledChunks\*\//g, - needChunkLoadingCode(chunk) - ? "for(var chunkId in installedChunks)" - : `var chunkId = ${JSON.stringify(chunk.id)};` - ) - ]); - } - ); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - mainTemplate.hooks.globalHash.tap( - "HotModuleReplacementPlugin", - () => true - ); - mainTemplate.hooks.currentHash.tap( - "HotModuleReplacementPlugin", - (_, length) => { - if (isFinite(length)) { - return `hotCurrentHash.substr(0, ${length})`; - } else { - return "hotCurrentHash"; - } - } - ); +const WebpackError = __webpack_require__(97391); +const { cutOffLoaderExecution } = __webpack_require__(80140); - mainTemplate.hooks.moduleObj.tap( - "HotModuleReplacementPlugin", - (source, chunk, hash, varModuleId) => { - return Template.asString([ - `${source},`, - `hot: hotCreateModule(${varModuleId}),`, - "parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp),", - "children: []" - ]); +class ModuleBuildError extends WebpackError { + constructor(module, err, { from = null } = {}) { + let message = "Module build failed"; + let details = undefined; + if (from) { + message += ` (from ${from}):\n`; + } else { + message += ": "; + } + if (err !== null && typeof err === "object") { + if (typeof err.stack === "string" && err.stack) { + const stack = cutOffLoaderExecution(err.stack); + if (!err.hideStack) { + message += stack; + } else { + details = stack; + if (typeof err.message === "string" && err.message) { + message += err.message; + } else { + message += err; } - ); + } + } else if (typeof err.message === "string" && err.message) { + message += err.message; + } else { + message += err; + } + } else { + message = err; + } - // TODO add HMR support for javascript/esm - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("HotModuleReplacementPlugin", addParserPlugins); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("HotModuleReplacementPlugin", addParserPlugins); + super(message); - compilation.hooks.normalModuleLoader.tap( - "HotModuleReplacementPlugin", - context => { - context.hot = true; - } - ); - } - ); + this.name = "ModuleBuildError"; + this.details = details; + this.module = module; + this.error = err; + + Error.captureStackTrace(this, this.constructor); } -}; +} -const hotInitCode = Template.getFunctionContent( - __webpack_require__(65217) -); +module.exports = ModuleBuildError; /***/ }), -/***/ 26782: +/***/ 14953: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63000,22 +61512,40 @@ const hotInitCode = Template.getFunctionContent( */ -const Chunk = __webpack_require__(2919); +const WebpackError = __webpack_require__(97391); -class HotUpdateChunk extends Chunk { - constructor() { - super(); - /** @type {(string|number)[]} */ - this.removedModules = undefined; +/** @typedef {import("./Module")} Module */ + +class ModuleDependencyError extends WebpackError { + /** + * Creates an instance of ModuleDependencyError. + * @param {Module} module module tied to dependency + * @param {Error} err error thrown + * @param {TODO} loc location of dependency + */ + constructor(module, err, loc) { + super(err.message); + + this.name = "ModuleDependencyError"; + this.details = err.stack + .split("\n") + .slice(1) + .join("\n"); + this.module = module; + this.loc = loc; + this.error = err; + this.origin = module.issuer; + + Error.captureStackTrace(this, this.constructor); } } -module.exports = HotUpdateChunk; +module.exports = ModuleDependencyError; /***/ }), -/***/ 66062: +/***/ 59136: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63025,83 +61555,30 @@ module.exports = HotUpdateChunk; */ -const Template = __webpack_require__(96066); -const HotUpdateChunk = __webpack_require__(26782); -const { Tapable, SyncWaterfallHook, SyncHook } = __webpack_require__(92402); +const WebpackError = __webpack_require__(97391); -module.exports = class HotUpdateChunkTemplate extends Tapable { - constructor(outputOptions) { - super(); - this.outputOptions = outputOptions || {}; - this.hooks = { - modules: new SyncWaterfallHook([ - "source", - "modules", - "removedModules", - "moduleTemplate", - "dependencyTemplates" - ]), - render: new SyncWaterfallHook([ - "source", - "modules", - "removedModules", - "hash", - "id", - "moduleTemplate", - "dependencyTemplates" - ]), - hash: new SyncHook(["hash"]) - }; - } +module.exports = class ModuleDependencyWarning extends WebpackError { + constructor(module, err, loc) { + super(err.message); - render( - id, - modules, - removedModules, - hash, - moduleTemplate, - dependencyTemplates - ) { - const hotUpdateChunk = new HotUpdateChunk(); - hotUpdateChunk.id = id; - hotUpdateChunk.setModules(modules); - hotUpdateChunk.removedModules = removedModules; - const modulesSource = Template.renderChunkModules( - hotUpdateChunk, - m => typeof m.source === "function", - moduleTemplate, - dependencyTemplates - ); - const core = this.hooks.modules.call( - modulesSource, - modules, - removedModules, - moduleTemplate, - dependencyTemplates - ); - const source = this.hooks.render.call( - core, - modules, - removedModules, - hash, - id, - moduleTemplate, - dependencyTemplates - ); - return source; - } + this.name = "ModuleDependencyWarning"; + this.details = err.stack + .split("\n") + .slice(1) + .join("\n"); + this.module = module; + this.loc = loc; + this.error = err; + this.origin = module.issuer; - updateHash(hash) { - hash.update("HotUpdateChunkTemplate"); - hash.update("1"); - this.hooks.hash.call(hash); + Error.captureStackTrace(this, this.constructor); } }; /***/ }), -/***/ 41364: +/***/ 82528: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63111,96 +61588,228 @@ module.exports = class HotUpdateChunkTemplate extends Tapable { */ -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(69667); - -/** @typedef {import("../declarations/plugins/IgnorePlugin").IgnorePluginOptions} IgnorePluginOptions */ -/** @typedef {import("./Compiler")} Compiler */ +const WebpackError = __webpack_require__(97391); +const { cleanUp } = __webpack_require__(80140); -class IgnorePlugin { - /** - * @param {IgnorePluginOptions} options IgnorePlugin options - */ - constructor(options) { - // TODO webpack 5 remove this compat-layer - if (arguments.length > 1 || options instanceof RegExp) { - options = { - resourceRegExp: arguments[0], - contextRegExp: arguments[1] - }; +class ModuleError extends WebpackError { + constructor(module, err, { from = null } = {}) { + let message = "Module Error"; + if (from) { + message += ` (from ${from}):\n`; + } else { + message += ": "; } + if (err && typeof err === "object" && err.message) { + message += err.message; + } else if (err) { + message += err; + } + super(message); + this.name = "ModuleError"; + this.module = module; + this.error = err; + this.details = + err && typeof err === "object" && err.stack + ? cleanUp(err.stack, this.message) + : undefined; - validateOptions(schema, options, "IgnorePlugin"); - this.options = options; - - /** @private @type {Function} */ - this.checkIgnore = this.checkIgnore.bind(this); + Error.captureStackTrace(this, this.constructor); } +} - /** - * Note that if "contextRegExp" is given, both the "resourceRegExp" - * and "contextRegExp" have to match. - * - * @param {TODO} result result - * @returns {TODO|null} returns result or null if result should be ignored - */ - checkIgnore(result) { - if (!result) return result; +module.exports = ModuleError; - if ( - "checkResource" in this.options && - this.options.checkResource && - this.options.checkResource(result.request, result.context) - ) { - // TODO webpack 5 remove checkContext, as checkResource already gets context - if ("checkContext" in this.options && this.options.checkContext) { - if (this.options.checkContext(result.context)) { - return null; - } - } else { - return null; - } - } - if ( - "resourceRegExp" in this.options && - this.options.resourceRegExp && - this.options.resourceRegExp.test(result.request) - ) { - if ("contextRegExp" in this.options && this.options.contextRegExp) { - // if "contextRegExp" is given, - // both the "resourceRegExp" and "contextRegExp" have to match. - if (this.options.contextRegExp.test(result.context)) { - return null; - } - } else { - return null; - } - } +/***/ }), - return result; +/***/ 71474: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const createHash = __webpack_require__(15660); + +const ModuleFilenameHelpers = exports; + +ModuleFilenameHelpers.ALL_LOADERS_RESOURCE = "[all-loaders][resource]"; +ModuleFilenameHelpers.REGEXP_ALL_LOADERS_RESOURCE = /\[all-?loaders\]\[resource\]/gi; +ModuleFilenameHelpers.LOADERS_RESOURCE = "[loaders][resource]"; +ModuleFilenameHelpers.REGEXP_LOADERS_RESOURCE = /\[loaders\]\[resource\]/gi; +ModuleFilenameHelpers.RESOURCE = "[resource]"; +ModuleFilenameHelpers.REGEXP_RESOURCE = /\[resource\]/gi; +ModuleFilenameHelpers.ABSOLUTE_RESOURCE_PATH = "[absolute-resource-path]"; +ModuleFilenameHelpers.REGEXP_ABSOLUTE_RESOURCE_PATH = /\[abs(olute)?-?resource-?path\]/gi; +ModuleFilenameHelpers.RESOURCE_PATH = "[resource-path]"; +ModuleFilenameHelpers.REGEXP_RESOURCE_PATH = /\[resource-?path\]/gi; +ModuleFilenameHelpers.ALL_LOADERS = "[all-loaders]"; +ModuleFilenameHelpers.REGEXP_ALL_LOADERS = /\[all-?loaders\]/gi; +ModuleFilenameHelpers.LOADERS = "[loaders]"; +ModuleFilenameHelpers.REGEXP_LOADERS = /\[loaders\]/gi; +ModuleFilenameHelpers.QUERY = "[query]"; +ModuleFilenameHelpers.REGEXP_QUERY = /\[query\]/gi; +ModuleFilenameHelpers.ID = "[id]"; +ModuleFilenameHelpers.REGEXP_ID = /\[id\]/gi; +ModuleFilenameHelpers.HASH = "[hash]"; +ModuleFilenameHelpers.REGEXP_HASH = /\[hash\]/gi; +ModuleFilenameHelpers.NAMESPACE = "[namespace]"; +ModuleFilenameHelpers.REGEXP_NAMESPACE = /\[namespace\]/gi; + +const getAfter = (str, token) => { + const idx = str.indexOf(token); + return idx < 0 ? "" : str.substr(idx); +}; + +const getBefore = (str, token) => { + const idx = str.lastIndexOf(token); + return idx < 0 ? "" : str.substr(0, idx); +}; + +const getHash = str => { + const hash = createHash("md4"); + hash.update(str); + const digest = /** @type {string} */ (hash.digest("hex")); + return digest.substr(0, 4); +}; + +const asRegExp = test => { + if (typeof test === "string") { + test = new RegExp("^" + test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")); } + return test; +}; - /** - * @param {Compiler} compiler Webpack Compiler - * @returns {void} - */ - apply(compiler) { - compiler.hooks.normalModuleFactory.tap("IgnorePlugin", nmf => { - nmf.hooks.beforeResolve.tap("IgnorePlugin", this.checkIgnore); +ModuleFilenameHelpers.createFilename = (module, options, requestShortener) => { + const opts = Object.assign( + { + namespace: "", + moduleFilenameTemplate: "" + }, + typeof options === "object" + ? options + : { + moduleFilenameTemplate: options + } + ); + + let absoluteResourcePath; + let hash; + let identifier; + let moduleId; + let shortIdentifier; + if (module === undefined) module = ""; + if (typeof module === "string") { + shortIdentifier = requestShortener.shorten(module); + identifier = shortIdentifier; + moduleId = ""; + absoluteResourcePath = module.split("!").pop(); + hash = getHash(identifier); + } else { + shortIdentifier = module.readableIdentifier(requestShortener); + identifier = requestShortener.shorten(module.identifier()); + moduleId = module.id; + absoluteResourcePath = module + .identifier() + .split("!") + .pop(); + hash = getHash(identifier); + } + const resource = shortIdentifier.split("!").pop(); + const loaders = getBefore(shortIdentifier, "!"); + const allLoaders = getBefore(identifier, "!"); + const query = getAfter(resource, "?"); + const resourcePath = resource.substr(0, resource.length - query.length); + if (typeof opts.moduleFilenameTemplate === "function") { + return opts.moduleFilenameTemplate({ + identifier: identifier, + shortIdentifier: shortIdentifier, + resource: resource, + resourcePath: resourcePath, + absoluteResourcePath: absoluteResourcePath, + allLoaders: allLoaders, + query: query, + moduleId: moduleId, + hash: hash, + namespace: opts.namespace }); - compiler.hooks.contextModuleFactory.tap("IgnorePlugin", cmf => { - cmf.hooks.beforeResolve.tap("IgnorePlugin", this.checkIgnore); + } + return opts.moduleFilenameTemplate + .replace(ModuleFilenameHelpers.REGEXP_ALL_LOADERS_RESOURCE, identifier) + .replace(ModuleFilenameHelpers.REGEXP_LOADERS_RESOURCE, shortIdentifier) + .replace(ModuleFilenameHelpers.REGEXP_RESOURCE, resource) + .replace(ModuleFilenameHelpers.REGEXP_RESOURCE_PATH, resourcePath) + .replace( + ModuleFilenameHelpers.REGEXP_ABSOLUTE_RESOURCE_PATH, + absoluteResourcePath + ) + .replace(ModuleFilenameHelpers.REGEXP_ALL_LOADERS, allLoaders) + .replace(ModuleFilenameHelpers.REGEXP_LOADERS, loaders) + .replace(ModuleFilenameHelpers.REGEXP_QUERY, query) + .replace(ModuleFilenameHelpers.REGEXP_ID, moduleId) + .replace(ModuleFilenameHelpers.REGEXP_HASH, hash) + .replace(ModuleFilenameHelpers.REGEXP_NAMESPACE, opts.namespace); +}; + +ModuleFilenameHelpers.replaceDuplicates = (array, fn, comparator) => { + const countMap = Object.create(null); + const posMap = Object.create(null); + array.forEach((item, idx) => { + countMap[item] = countMap[item] || []; + countMap[item].push(idx); + posMap[item] = 0; + }); + if (comparator) { + Object.keys(countMap).forEach(item => { + countMap[item].sort(comparator); }); } -} + return array.map((item, i) => { + if (countMap[item].length > 1) { + if (comparator && countMap[item][0] === i) return item; + return fn(item, i, posMap[item]++); + } else { + return item; + } + }); +}; -module.exports = IgnorePlugin; +ModuleFilenameHelpers.matchPart = (str, test) => { + if (!test) return true; + test = asRegExp(test); + if (Array.isArray(test)) { + return test.map(asRegExp).some(regExp => regExp.test(str)); + } else { + return test.test(str); + } +}; + +ModuleFilenameHelpers.matchObject = (obj, str) => { + if (obj.test) { + if (!ModuleFilenameHelpers.matchPart(str, obj.test)) { + return false; + } + } + if (obj.include) { + if (!ModuleFilenameHelpers.matchPart(str, obj.include)) { + return false; + } + } + if (obj.exclude) { + if (ModuleFilenameHelpers.matchPart(str, obj.exclude)) { + return false; + } + } + return true; +}; /***/ }), -/***/ 98509: +/***/ 71638: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63210,234 +61819,159 @@ module.exports = IgnorePlugin; */ -const { RawSource, ReplaceSource } = __webpack_require__(53665); +const WebpackError = __webpack_require__(97391); -// TODO: clean up this file -// replace with newer constructs +class ModuleNotFoundError extends WebpackError { + constructor(module, err) { + super("Module not found: " + err); -// TODO: remove DependencyVariables and replace them with something better + this.name = "ModuleNotFoundError"; + this.details = err.details; + this.missing = err.missing; + this.module = module; + this.error = err; -class JavascriptGenerator { - generate(module, dependencyTemplates, runtimeTemplate) { - const originalSource = module.originalSource(); - if (!originalSource) { - return new RawSource("throw new Error('No source available');"); - } + Error.captureStackTrace(this, this.constructor); + } +} - const source = new ReplaceSource(originalSource); +module.exports = ModuleNotFoundError; - this.sourceBlock( - module, - module, - [], - dependencyTemplates, - source, - runtimeTemplate - ); - return source; - } +/***/ }), - sourceBlock( - module, - block, - availableVars, - dependencyTemplates, - source, - runtimeTemplate - ) { - for (const dependency of block.dependencies) { - this.sourceDependency( - dependency, - dependencyTemplates, - source, - runtimeTemplate - ); - } +/***/ 62500: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - /** - * Get the variables of all blocks that we need to inject. - * These will contain the variable name and its expression. - * The name will be added as a parameter in a IIFE the expression as its value. - */ - const vars = block.variables.reduce((result, value) => { - const variable = this.sourceVariables( - value, - availableVars, - dependencyTemplates, - runtimeTemplate - ); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (variable) { - result.push(variable); - } - return result; - }, []); +const WebpackError = __webpack_require__(97391); - /** - * if we actually have variables - * this is important as how #splitVariablesInUniqueNamedChunks works - * it will always return an array in an array which would lead to a IIFE wrapper around - * a module if we do this with an empty vars array. - */ - if (vars.length > 0) { - /** - * Split all variables up into chunks of unique names. - * e.g. imagine you have the following variable names that need to be injected: - * [foo, bar, baz, foo, some, more] - * we can not inject "foo" twice, therefore we just make two IIFEs like so: - * (function(foo, bar, baz){ - * (function(foo, some, more){ - * … - * }(…)); - * }(…)); - * - * "splitVariablesInUniqueNamedChunks" splits the variables shown above up to this: - * [[foo, bar, baz], [foo, some, more]] - */ - const injectionVariableChunks = this.splitVariablesInUniqueNamedChunks( - vars - ); +/** @typedef {import("./Module")} Module */ - // create all the beginnings of IIFEs - const functionWrapperStarts = injectionVariableChunks.map( - variableChunk => { - return this.variableInjectionFunctionWrapperStartCode( - variableChunk.map(variable => variable.name) - ); - } - ); +class ModuleParseError extends WebpackError { + /** + * @param {Module} module the errored module + * @param {string} source source code + * @param {Error&any} err the parse error + * @param {string[]} loaders the loaders used + */ + constructor(module, source, err, loaders) { + let message = "Module parse failed: " + err.message; + let loc = undefined; + if (loaders.length >= 1) { + message += `\nFile was processed with these loaders:${loaders + .map(loader => `\n * ${loader}`) + .join("")}`; + message += + "\nYou may need an additional loader to handle the result of these loaders."; + } else { + message += + "\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders"; + } + if ( + err.loc && + typeof err.loc === "object" && + typeof err.loc.line === "number" + ) { + var lineNumber = err.loc.line; + if (/[\0\u0001\u0002\u0003\u0004\u0005\u0006\u0007]/.test(source)) { + // binary file + message += "\n(Source code omitted for this binary file)"; + } else { + const sourceLines = source.split(/\r?\n/); + const start = Math.max(0, lineNumber - 3); + const linesBefore = sourceLines.slice(start, lineNumber - 1); + const theLine = sourceLines[lineNumber - 1]; + const linesAfter = sourceLines.slice(lineNumber, lineNumber + 2); + message += + linesBefore.map(l => `\n| ${l}`).join("") + + `\n> ${theLine}` + + linesAfter.map(l => `\n| ${l}`).join(""); + } + loc = err.loc; + } else { + message += "\n" + err.stack; + } - // and all the ends - const functionWrapperEnds = injectionVariableChunks.map(variableChunk => { - return this.variableInjectionFunctionWrapperEndCode( - module, - variableChunk.map(variable => variable.expression), - block - ); - }); + super(message); - // join them to one big string - const varStartCode = functionWrapperStarts.join(""); + this.name = "ModuleParseError"; + this.module = module; + this.loc = loc; + this.error = err; - // reverse the ends first before joining them, as the last added must be the inner most - const varEndCode = functionWrapperEnds.reverse().join(""); + Error.captureStackTrace(this, this.constructor); + } +} - // if we have anything, add it to the source - if (varStartCode && varEndCode) { - const start = block.range ? block.range[0] : -10; - const end = block.range - ? block.range[1] - : module.originalSource().size() + 1; - source.insert(start + 0.5, varStartCode); - source.insert(end + 0.5, "\n/* WEBPACK VAR INJECTION */" + varEndCode); - } - } +module.exports = ModuleParseError; - for (const childBlock of block.blocks) { - this.sourceBlock( - module, - childBlock, - availableVars.concat(vars), - dependencyTemplates, - source, - runtimeTemplate - ); - } - } - sourceDependency(dependency, dependencyTemplates, source, runtimeTemplate) { - const template = dependencyTemplates.get(dependency.constructor); - if (!template) { - throw new Error( - "No template for dependency: " + dependency.constructor.name - ); - } - template.apply(dependency, source, runtimeTemplate, dependencyTemplates); - } +/***/ }), - sourceVariables( - variable, - availableVars, - dependencyTemplates, - runtimeTemplate - ) { - const name = variable.name; - const expr = variable.expressionSource( - dependencyTemplates, - runtimeTemplate - ); +/***/ 44576: +/***/ (function(module) { - if ( - availableVars.some( - v => v.name === name && v.expression.source() === expr.source() - ) - ) { - return; - } - return { - name: name, - expression: expr - }; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - /* - * creates the start part of a IIFE around the module to inject a variable name - * (function(…){ <- this part - * }.call(…)) - */ - variableInjectionFunctionWrapperStartCode(varNames) { - const args = varNames.join(", "); - return `/* WEBPACK VAR INJECTION */(function(${args}) {`; - } - contextArgument(module, block) { - if (this === block) { - return module.exportsArgument; - } - return "this"; - } +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./Dependency")} Dependency */ - /* - * creates the end part of a IIFE around the module to inject a variable name - * (function(…){ - * }.call(…)) <- this part +class ModuleReason { + /** + * @param {Module} module the referencing module + * @param {Dependency} dependency the referencing dependency + * @param {string=} explanation some extra detail */ - variableInjectionFunctionWrapperEndCode(module, varExpressions, block) { - const firstParam = this.contextArgument(module, block); - const furtherParams = varExpressions.map(e => e.source()).join(", "); - return `}.call(${firstParam}, ${furtherParams}))`; + constructor(module, dependency, explanation) { + this.module = module; + this.dependency = dependency; + this.explanation = explanation; + this._chunks = null; } - splitVariablesInUniqueNamedChunks(vars) { - const startState = [[]]; - return vars.reduce((chunks, variable) => { - const current = chunks[chunks.length - 1]; - // check if variable with same name exists already - // if so create a new chunk of variables. - const variableNameAlreadyExists = current.some( - v => v.name === variable.name - ); + hasChunk(chunk) { + if (this._chunks) { + if (this._chunks.has(chunk)) return true; + } else if (this.module && this.module._chunks.has(chunk)) return true; + return false; + } - if (variableNameAlreadyExists) { - // start new chunk with current variable - chunks.push([variable]); + rewriteChunks(oldChunk, newChunks) { + if (!this._chunks) { + if (this.module) { + if (!this.module._chunks.has(oldChunk)) return; + this._chunks = new Set(this.module._chunks); } else { - // else add it to current chunk - current.push(variable); + this._chunks = new Set(); } - return chunks; - }, startState); + } + if (this._chunks.has(oldChunk)) { + this._chunks.delete(oldChunk); + for (let i = 0; i < newChunks.length; i++) { + this._chunks.add(newChunks[i]); + } + } } } -module.exports = JavascriptGenerator; +module.exports = ModuleReason; /***/ }), -/***/ 10339: +/***/ 75100: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63447,190 +61981,98 @@ module.exports = JavascriptGenerator; */ -const Parser = __webpack_require__(70558); -const Template = __webpack_require__(96066); -const { ConcatSource } = __webpack_require__(53665); -const JavascriptGenerator = __webpack_require__(98509); -const createHash = __webpack_require__(15660); - -class JavascriptModulesPlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "JavascriptModulesPlugin", - (compilation, { normalModuleFactory }) => { - normalModuleFactory.hooks.createParser - .for("javascript/auto") - .tap("JavascriptModulesPlugin", options => { - return new Parser(options, "auto"); - }); - normalModuleFactory.hooks.createParser - .for("javascript/dynamic") - .tap("JavascriptModulesPlugin", options => { - return new Parser(options, "script"); - }); - normalModuleFactory.hooks.createParser - .for("javascript/esm") - .tap("JavascriptModulesPlugin", options => { - return new Parser(options, "module"); - }); - normalModuleFactory.hooks.createGenerator - .for("javascript/auto") - .tap("JavascriptModulesPlugin", () => { - return new JavascriptGenerator(); - }); - normalModuleFactory.hooks.createGenerator - .for("javascript/dynamic") - .tap("JavascriptModulesPlugin", () => { - return new JavascriptGenerator(); - }); - normalModuleFactory.hooks.createGenerator - .for("javascript/esm") - .tap("JavascriptModulesPlugin", () => { - return new JavascriptGenerator(); - }); - compilation.mainTemplate.hooks.renderManifest.tap( - "JavascriptModulesPlugin", - (result, options) => { - const chunk = options.chunk; - const hash = options.hash; - const fullHash = options.fullHash; - const outputOptions = options.outputOptions; - const moduleTemplates = options.moduleTemplates; - const dependencyTemplates = options.dependencyTemplates; - - const filenameTemplate = - chunk.filenameTemplate || outputOptions.filename; - - const useChunkHash = compilation.mainTemplate.useChunkHash(chunk); - - result.push({ - render: () => - compilation.mainTemplate.render( - hash, - chunk, - moduleTemplates.javascript, - dependencyTemplates - ), - filenameTemplate, - pathOptions: { - noChunkHash: !useChunkHash, - contentHashType: "javascript", - chunk - }, - identifier: `chunk${chunk.id}`, - hash: useChunkHash ? chunk.hash : fullHash - }); - return result; - } - ); - compilation.mainTemplate.hooks.modules.tap( - "JavascriptModulesPlugin", - (source, chunk, hash, moduleTemplate, dependencyTemplates) => { - return Template.renderChunkModules( - chunk, - m => typeof m.source === "function", - moduleTemplate, - dependencyTemplates, - "/******/ " - ); - } - ); - compilation.chunkTemplate.hooks.renderManifest.tap( - "JavascriptModulesPlugin", - (result, options) => { - const chunk = options.chunk; - const outputOptions = options.outputOptions; - const moduleTemplates = options.moduleTemplates; - const dependencyTemplates = options.dependencyTemplates; - const filenameTemplate = - chunk.filenameTemplate || outputOptions.chunkFilename; +const { Tapable, SyncWaterfallHook, SyncHook } = __webpack_require__(92402); - result.push({ - render: () => - this.renderJavascript( - compilation.chunkTemplate, - chunk, - moduleTemplates.javascript, - dependencyTemplates - ), - filenameTemplate, - pathOptions: { - chunk, - contentHashType: "javascript" - }, - identifier: `chunk${chunk.id}`, - hash: chunk.hash - }); +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("./Module")} Module */ - return result; - } - ); - compilation.hooks.contentHash.tap("JavascriptModulesPlugin", chunk => { - const outputOptions = compilation.outputOptions; - const { - hashSalt, - hashDigest, - hashDigestLength, - hashFunction - } = outputOptions; - const hash = createHash(hashFunction); - if (hashSalt) hash.update(hashSalt); - const template = chunk.hasRuntime() - ? compilation.mainTemplate - : compilation.chunkTemplate; - hash.update(`${chunk.id} `); - hash.update(chunk.ids ? chunk.ids.join(",") : ""); - template.updateHashForChunk( - hash, - chunk, - compilation.moduleTemplates.javascript, - compilation.dependencyTemplates - ); - for (const m of chunk.modulesIterable) { - if (typeof m.source === "function") { - hash.update(m.hash); - } - } - const digest = /** @type {string} */ (hash.digest(hashDigest)); - chunk.contentHash.javascript = digest.substr(0, hashDigestLength); - }); - } - ); +module.exports = class ModuleTemplate extends Tapable { + constructor(runtimeTemplate, type) { + super(); + this.runtimeTemplate = runtimeTemplate; + this.type = type; + this.hooks = { + content: new SyncWaterfallHook([ + "source", + "module", + "options", + "dependencyTemplates" + ]), + module: new SyncWaterfallHook([ + "source", + "module", + "options", + "dependencyTemplates" + ]), + render: new SyncWaterfallHook([ + "source", + "module", + "options", + "dependencyTemplates" + ]), + package: new SyncWaterfallHook([ + "source", + "module", + "options", + "dependencyTemplates" + ]), + hash: new SyncHook(["hash"]) + }; } - renderJavascript(chunkTemplate, chunk, moduleTemplate, dependencyTemplates) { - const moduleSources = Template.renderChunkModules( - chunk, - m => typeof m.source === "function", - moduleTemplate, - dependencyTemplates - ); - const core = chunkTemplate.hooks.modules.call( - moduleSources, - chunk, - moduleTemplate, - dependencyTemplates - ); - let source = chunkTemplate.hooks.render.call( - core, - chunk, - moduleTemplate, - dependencyTemplates - ); - if (chunk.hasEntryModule()) { - source = chunkTemplate.hooks.renderWithEntry.call(source, chunk); + /** + * @param {Module} module the module + * @param {TODO} dependencyTemplates templates for dependencies + * @param {TODO} options render options + * @returns {Source} the source + */ + render(module, dependencyTemplates, options) { + try { + const moduleSource = module.source( + dependencyTemplates, + this.runtimeTemplate, + this.type + ); + const moduleSourcePostContent = this.hooks.content.call( + moduleSource, + module, + options, + dependencyTemplates + ); + const moduleSourcePostModule = this.hooks.module.call( + moduleSourcePostContent, + module, + options, + dependencyTemplates + ); + const moduleSourcePostRender = this.hooks.render.call( + moduleSourcePostModule, + module, + options, + dependencyTemplates + ); + return this.hooks.package.call( + moduleSourcePostRender, + module, + options, + dependencyTemplates + ); + } catch (e) { + e.message = `${module.identifier()}\n${e.message}`; + throw e; } - chunk.rendered = true; - return new ConcatSource(source, ";"); } -} -module.exports = JavascriptModulesPlugin; + updateHash(hash) { + hash.update("1"); + this.hooks.hash.call(hash); + } +}; /***/ }), -/***/ 72806: +/***/ 6372: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63640,62 +62082,41 @@ module.exports = JavascriptModulesPlugin; */ -const { ConcatSource, RawSource } = __webpack_require__(53665); +const WebpackError = __webpack_require__(97391); +const { cleanUp } = __webpack_require__(80140); -const stringifySafe = data => { - const stringified = JSON.stringify(data); - if (!stringified) { - return undefined; // Invalid JSON - } - - return stringified.replace(/\u2028|\u2029/g, str => - str === "\u2029" ? "\\u2029" : "\\u2028" - ); // invalid in JavaScript but valid JSON -}; - -class JsonGenerator { - generate(module, dependencyTemplates, runtimeTemplate) { - const source = new ConcatSource(); - const data = module.buildInfo.jsonData; - if (data === undefined) { - return new RawSource( - runtimeTemplate.missingModuleStatement({ - request: module.rawRequest - }) - ); - } - let finalJson; - if ( - Array.isArray(module.buildMeta.providedExports) && - !module.isUsed("default") - ) { - // Only some exports are used: We can optimize here, by only generating a part of the JSON - const reducedJson = {}; - for (const exportName of module.buildMeta.providedExports) { - if (exportName === "default") continue; - const used = module.isUsed(exportName); - if (used) { - reducedJson[used] = data[exportName]; - } - } - finalJson = reducedJson; +class ModuleWarning extends WebpackError { + constructor(module, warning, { from = null } = {}) { + let message = "Module Warning"; + if (from) { + message += ` (from ${from}):\n`; } else { - finalJson = data; + message += ": "; } - // Use JSON because JSON.parse() is much faster than JavaScript evaluation - const jsonSource = JSON.stringify(stringifySafe(finalJson)); - const jsonExpr = `JSON.parse(${jsonSource})`; - source.add(`${module.moduleArgument}.exports = ${jsonExpr};`); - return source; + if (warning && typeof warning === "object" && warning.message) { + message += warning.message; + } else if (warning) { + message += warning; + } + super(message); + this.name = "ModuleWarning"; + this.module = module; + this.warning = warning; + this.details = + warning && typeof warning === "object" && warning.stack + ? cleanUp(warning.stack, this.message) + : undefined; + + Error.captureStackTrace(this, this.constructor); } } -module.exports = JsonGenerator; +module.exports = ModuleWarning; /***/ }), -/***/ 2859: +/***/ 10238: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63705,168 +62126,295 @@ module.exports = JsonGenerator; */ -const JsonParser = __webpack_require__(5807); -const JsonGenerator = __webpack_require__(72806); +const { Tapable, SyncHook, MultiHook } = __webpack_require__(92402); +const asyncLib = __webpack_require__(36386); +const MultiWatching = __webpack_require__(66624); +const MultiStats = __webpack_require__(55144); +const ConcurrentCompilationError = __webpack_require__(18933); -class JsonModulesPlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "JsonModulesPlugin", - (compilation, { normalModuleFactory }) => { - normalModuleFactory.hooks.createParser - .for("json") - .tap("JsonModulesPlugin", () => { - return new JsonParser(); - }); - normalModuleFactory.hooks.createGenerator - .for("json") - .tap("JsonModulesPlugin", () => { - return new JsonGenerator(); - }); - } - ); +module.exports = class MultiCompiler extends Tapable { + constructor(compilers) { + super(); + this.hooks = { + done: new SyncHook(["stats"]), + invalid: new MultiHook(compilers.map(c => c.hooks.invalid)), + run: new MultiHook(compilers.map(c => c.hooks.run)), + watchClose: new SyncHook([]), + watchRun: new MultiHook(compilers.map(c => c.hooks.watchRun)), + infrastructureLog: new MultiHook( + compilers.map(c => c.hooks.infrastructureLog) + ) + }; + if (!Array.isArray(compilers)) { + compilers = Object.keys(compilers).map(name => { + compilers[name].name = name; + return compilers[name]; + }); + } + this.compilers = compilers; + let doneCompilers = 0; + let compilerStats = []; + let index = 0; + for (const compiler of this.compilers) { + let compilerDone = false; + const compilerIndex = index++; + // eslint-disable-next-line no-loop-func + compiler.hooks.done.tap("MultiCompiler", stats => { + if (!compilerDone) { + compilerDone = true; + doneCompilers++; + } + compilerStats[compilerIndex] = stats; + if (doneCompilers === this.compilers.length) { + this.hooks.done.call(new MultiStats(compilerStats)); + } + }); + // eslint-disable-next-line no-loop-func + compiler.hooks.invalid.tap("MultiCompiler", () => { + if (compilerDone) { + compilerDone = false; + doneCompilers--; + } + }); + } + this.running = false; } -} - -module.exports = JsonModulesPlugin; + get outputPath() { + let commonPath = this.compilers[0].outputPath; + for (const compiler of this.compilers) { + while ( + compiler.outputPath.indexOf(commonPath) !== 0 && + /[/\\]/.test(commonPath) + ) { + commonPath = commonPath.replace(/[/\\][^/\\]*$/, ""); + } + } -/***/ }), + if (!commonPath && this.compilers[0].outputPath[0] === "/") return "/"; + return commonPath; + } -/***/ 5807: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + get inputFileSystem() { + throw new Error("Cannot read inputFileSystem of a MultiCompiler"); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + get outputFileSystem() { + throw new Error("Cannot read outputFileSystem of a MultiCompiler"); + } + set inputFileSystem(value) { + for (const compiler of this.compilers) { + compiler.inputFileSystem = value; + } + } -const parseJson = __webpack_require__(48335); -const JsonExportsDependency = __webpack_require__(54396); + set outputFileSystem(value) { + for (const compiler of this.compilers) { + compiler.outputFileSystem = value; + } + } -class JsonParser { - constructor(options) { - this.options = options; + getInfrastructureLogger(name) { + return this.compilers[0].getInfrastructureLogger(name); } - parse(source, state) { - const data = parseJson(source[0] === "\ufeff" ? source.slice(1) : source); - state.module.buildInfo.jsonData = data; - state.module.buildMeta.exportsType = "named"; - if (typeof data === "object" && data) { - state.module.addDependency(new JsonExportsDependency(Object.keys(data))); + validateDependencies(callback) { + const edges = new Set(); + const missing = []; + const targetFound = compiler => { + for (const edge of edges) { + if (edge.target === compiler) { + return true; + } + } + return false; + }; + const sortEdges = (e1, e2) => { + return ( + e1.source.name.localeCompare(e2.source.name) || + e1.target.name.localeCompare(e2.target.name) + ); + }; + for (const source of this.compilers) { + if (source.dependencies) { + for (const dep of source.dependencies) { + const target = this.compilers.find(c => c.name === dep); + if (!target) { + missing.push(dep); + } else { + edges.add({ + source, + target + }); + } + } + } } - state.module.addDependency(new JsonExportsDependency(["default"])); - return state; + const errors = missing.map(m => `Compiler dependency \`${m}\` not found.`); + const stack = this.compilers.filter(c => !targetFound(c)); + while (stack.length > 0) { + const current = stack.pop(); + for (const edge of edges) { + if (edge.source === current) { + edges.delete(edge); + const target = edge.target; + if (!targetFound(target)) { + stack.push(target); + } + } + } + } + if (edges.size > 0) { + const lines = Array.from(edges) + .sort(sortEdges) + .map(edge => `${edge.source.name} -> ${edge.target.name}`); + lines.unshift("Circular dependency found in compiler dependencies."); + errors.unshift(lines.join("\n")); + } + if (errors.length > 0) { + const message = errors.join("\n"); + callback(new Error(message)); + return false; + } + return true; } -} -module.exports = JsonParser; + runWithDependencies(compilers, fn, callback) { + const fulfilledNames = new Set(); + let remainingCompilers = compilers; + const isDependencyFulfilled = d => fulfilledNames.has(d); + const getReadyCompilers = () => { + let readyCompilers = []; + let list = remainingCompilers; + remainingCompilers = []; + for (const c of list) { + const ready = + !c.dependencies || c.dependencies.every(isDependencyFulfilled); + if (ready) { + readyCompilers.push(c); + } else { + remainingCompilers.push(c); + } + } + return readyCompilers; + }; + const runCompilers = callback => { + if (remainingCompilers.length === 0) return callback(); + asyncLib.map( + getReadyCompilers(), + (compiler, callback) => { + fn(compiler, err => { + if (err) return callback(err); + fulfilledNames.add(compiler.name); + runCompilers(callback); + }); + }, + callback + ); + }; + runCompilers(callback); + } + watch(watchOptions, handler) { + if (this.running) return handler(new ConcurrentCompilationError()); -/***/ }), + let watchings = []; + let allStats = this.compilers.map(() => null); + let compilerStatus = this.compilers.map(() => false); + if (this.validateDependencies(handler)) { + this.running = true; + this.runWithDependencies( + this.compilers, + (compiler, callback) => { + const compilerIdx = this.compilers.indexOf(compiler); + let firstRun = true; + let watching = compiler.watch( + Array.isArray(watchOptions) + ? watchOptions[compilerIdx] + : watchOptions, + (err, stats) => { + if (err) handler(err); + if (stats) { + allStats[compilerIdx] = stats; + compilerStatus[compilerIdx] = "new"; + if (compilerStatus.every(Boolean)) { + const freshStats = allStats.filter((s, idx) => { + return compilerStatus[idx] === "new"; + }); + compilerStatus.fill(true); + const multiStats = new MultiStats(freshStats); + handler(null, multiStats); + } + } + if (firstRun && !err) { + firstRun = false; + callback(); + } + } + ); + watchings.push(watching); + }, + () => { + // ignore + } + ); + } -/***/ 30735: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + return new MultiWatching(watchings, this); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + run(callback) { + if (this.running) { + return callback(new ConcurrentCompilationError()); + } + const finalCallback = (err, stats) => { + this.running = false; -const path = __webpack_require__(85622); -const asyncLib = __webpack_require__(36386); -const SingleEntryDependency = __webpack_require__(84828); + if (callback !== undefined) { + return callback(err, stats); + } + }; -class LibManifestPlugin { - constructor(options) { - this.options = options; + const allStats = this.compilers.map(() => null); + if (this.validateDependencies(callback)) { + this.running = true; + this.runWithDependencies( + this.compilers, + (compiler, callback) => { + const compilerIdx = this.compilers.indexOf(compiler); + compiler.run((err, stats) => { + if (err) { + return callback(err); + } + allStats[compilerIdx] = stats; + callback(); + }); + }, + err => { + if (err) { + return finalCallback(err); + } + finalCallback(null, new MultiStats(allStats)); + } + ); + } } - apply(compiler) { - compiler.hooks.emit.tapAsync( - "LibManifestPlugin", - (compilation, callback) => { - asyncLib.forEach( - compilation.chunks, - (chunk, callback) => { - if (!chunk.isOnlyInitial()) { - callback(); - return; - } - const targetPath = compilation.getPath(this.options.path, { - hash: compilation.hash, - chunk - }); - const name = - this.options.name && - compilation.getPath(this.options.name, { - hash: compilation.hash, - chunk - }); - const manifest = { - name, - type: this.options.type, - content: Array.from(chunk.modulesIterable, module => { - if ( - this.options.entryOnly && - !module.reasons.some( - r => r.dependency instanceof SingleEntryDependency - ) - ) { - return; - } - if (module.libIdent) { - const ident = module.libIdent({ - context: this.options.context || compiler.options.context - }); - if (ident) { - return { - ident, - data: { - id: module.id, - buildMeta: module.buildMeta - } - }; - } - } - }) - .filter(Boolean) - .reduce((obj, item) => { - obj[item.ident] = item.data; - return obj; - }, Object.create(null)) - }; - // Apply formatting to content if format flag is true; - const manifestContent = this.options.format - ? JSON.stringify(manifest, null, 2) - : JSON.stringify(manifest); - const content = Buffer.from(manifestContent, "utf8"); - compiler.outputFileSystem.mkdirp(path.dirname(targetPath), err => { - if (err) return callback(err); - compiler.outputFileSystem.writeFile( - targetPath, - content, - callback - ); - }); - }, - callback - ); + purgeInputFileSystem() { + for (const compiler of this.compilers) { + if (compiler.inputFileSystem && compiler.inputFileSystem.purge) { + compiler.inputFileSystem.purge(); } - ); + } } -} -module.exports = LibManifestPlugin; +}; /***/ }), -/***/ 65237: +/***/ 98046: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63876,62 +62424,23 @@ module.exports = LibManifestPlugin; */ -const SetVarMainTemplatePlugin = __webpack_require__(37098); +const MultiEntryDependency = __webpack_require__(7791); +const SingleEntryDependency = __webpack_require__(84828); +const MultiModuleFactory = __webpack_require__(24005); -/** @typedef {import("../declarations/WebpackOptions").LibraryCustomUmdObject} LibraryCustomUmdObject */ /** @typedef {import("./Compiler")} Compiler */ -/** - * @param {string[]} accessor the accessor to convert to path - * @returns {string} the path - */ -const accessorToObjectAccess = accessor => { - return accessor.map(a => `[${JSON.stringify(a)}]`).join(""); -}; - -/** - * @param {string=} base the path prefix - * @param {string|string[]|LibraryCustomUmdObject} accessor the accessor - * @param {"amd" | "commonjs" | "root"} umdProperty property used when a custom umd object is provided - * @param {string=} joinWith the element separator - * @returns {string} the path - */ -const accessorAccess = (base, accessor, umdProperty, joinWith = "; ") => { - const normalizedAccessor = - typeof accessor === "object" && !Array.isArray(accessor) - ? accessor[umdProperty] - : accessor; - const accessors = Array.isArray(normalizedAccessor) - ? normalizedAccessor - : [normalizedAccessor]; - return accessors - .map((_, idx) => { - const a = base - ? base + accessorToObjectAccess(accessors.slice(0, idx + 1)) - : accessors[0] + accessorToObjectAccess(accessors.slice(1, idx + 1)); - if (idx === accessors.length - 1) return a; - if (idx === 0 && base === undefined) { - return `${a} = typeof ${a} === "object" ? ${a} : {}`; - } - return `${a} = ${a} || {}`; - }) - .join(joinWith); -}; - -class LibraryTemplatePlugin { +class MultiEntryPlugin { /** - * @param {string|string[]|LibraryCustomUmdObject} name name of library - * @param {string} target type of library - * @param {boolean} umdNamedDefine setting this to true will name the UMD module - * @param {string|TODO} auxiliaryComment comment in the UMD wrapper - * @param {string|string[]} exportProperty which export should be exposed as library + * The MultiEntryPlugin is invoked whenever this.options.entry value is an array of paths + * @param {string} context context path + * @param {string[]} entries array of entry paths + * @param {string} name entry key name */ - constructor(name, target, umdNamedDefine, auxiliaryComment, exportProperty) { + constructor(context, entries, name) { + this.context = context; + this.entries = entries; this.name = name; - this.target = target; - this.umdNamedDefine = umdNamedDefine; - this.auxiliaryComment = auxiliaryComment; - this.exportProperty = exportProperty; } /** @@ -63939,128 +62448,287 @@ class LibraryTemplatePlugin { * @returns {void} */ apply(compiler) { - compiler.hooks.thisCompilation.tap("LibraryTemplatePlugin", compilation => { - if (this.exportProperty) { - const ExportPropertyMainTemplatePlugin = __webpack_require__(50471); - new ExportPropertyMainTemplatePlugin(this.exportProperty).apply( - compilation + compiler.hooks.compilation.tap( + "MultiEntryPlugin", + (compilation, { normalModuleFactory }) => { + const multiModuleFactory = new MultiModuleFactory(); + + compilation.dependencyFactories.set( + MultiEntryDependency, + multiModuleFactory + ); + compilation.dependencyFactories.set( + SingleEntryDependency, + normalModuleFactory ); } - switch (this.target) { - case "var": - if ( - !this.name || - (typeof this.name === "object" && !Array.isArray(this.name)) - ) { - throw new Error( - "library name must be set and not an UMD custom object for non-UMD target" - ); - } - new SetVarMainTemplatePlugin( - `var ${accessorAccess(undefined, this.name, "root")}`, - false - ).apply(compilation); - break; - case "assign": - new SetVarMainTemplatePlugin( - accessorAccess(undefined, this.name, "root"), - false - ).apply(compilation); - break; - case "this": - case "self": - case "window": - if (this.name) { - new SetVarMainTemplatePlugin( - accessorAccess(this.target, this.name, "root"), - false - ).apply(compilation); - } else { - new SetVarMainTemplatePlugin(this.target, true).apply(compilation); - } - break; - case "global": - if (this.name) { - new SetVarMainTemplatePlugin( - accessorAccess( - compilation.runtimeTemplate.outputOptions.globalObject, - this.name, - "root" - ), - false - ).apply(compilation); - } else { - new SetVarMainTemplatePlugin( - compilation.runtimeTemplate.outputOptions.globalObject, - true - ).apply(compilation); - } - break; - case "commonjs": - if (this.name) { - new SetVarMainTemplatePlugin( - accessorAccess("exports", this.name, "commonjs"), - false - ).apply(compilation); - } else { - new SetVarMainTemplatePlugin("exports", true).apply(compilation); - } - break; - case "commonjs2": - case "commonjs-module": - new SetVarMainTemplatePlugin("module.exports", false).apply( - compilation - ); - break; - case "amd": - case "amd-require": { - const AmdMainTemplatePlugin = __webpack_require__(9701); - if (this.name && typeof this.name !== "string") { - throw new Error("library name must be a string for amd target"); - } - new AmdMainTemplatePlugin({ - name: this.name, - requireAsWrapper: this.target === "amd-require" - }).apply(compilation); - break; - } - case "umd": - case "umd2": { - const UmdMainTemplatePlugin = __webpack_require__(75374); - new UmdMainTemplatePlugin(this.name, { - optionalAmdExternalAsGlobal: this.target === "umd2", - namedDefine: this.umdNamedDefine, - auxiliaryComment: this.auxiliaryComment - }).apply(compilation); - break; - } - case "jsonp": { - const JsonpExportMainTemplatePlugin = __webpack_require__(13732); - if (typeof this.name !== "string") - throw new Error("library name must be a string for jsonp target"); - new JsonpExportMainTemplatePlugin(this.name).apply(compilation); - break; + ); + + compiler.hooks.make.tapAsync( + "MultiEntryPlugin", + (compilation, callback) => { + const { context, entries, name } = this; + + const dep = MultiEntryPlugin.createDependency(entries, name); + compilation.addEntry(context, dep, name, callback); + } + ); + } + + /** + * @param {string[]} entries each entry path string + * @param {string} name name of the entry + * @returns {MultiEntryDependency} returns a constructed Dependency + */ + static createDependency(entries, name) { + return new MultiEntryDependency( + entries.map((e, idx) => { + const dep = new SingleEntryDependency(e); + // Because entrypoints are not dependencies found in an + // existing module, we give it a synthetic id + dep.loc = { + name, + index: idx + }; + return dep; + }), + name + ); + } +} + +module.exports = MultiEntryPlugin; + + +/***/ }), + +/***/ 4198: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Module = __webpack_require__(75993); +const Template = __webpack_require__(96066); +const { RawSource } = __webpack_require__(53665); + +/** @typedef {import("./util/createHash").Hash} Hash */ + +class MultiModule extends Module { + constructor(context, dependencies, name) { + super("javascript/dynamic", context); + + // Info from Factory + this.dependencies = dependencies; + this.name = name; + this._identifier = `multi ${this.dependencies + .map(d => d.request) + .join(" ")}`; + } + + identifier() { + return this._identifier; + } + + readableIdentifier(requestShortener) { + return `multi ${this.dependencies + .map(d => requestShortener.shorten(d.request)) + .join(" ")}`; + } + + build(options, compilation, resolver, fs, callback) { + this.built = true; + this.buildMeta = {}; + this.buildInfo = {}; + return callback(); + } + + needRebuild() { + return false; + } + + size() { + return 16 + this.dependencies.length * 12; + } + + /** + * @param {Hash} hash the hash used to track dependencies + * @returns {void} + */ + updateHash(hash) { + hash.update("multi module"); + hash.update(this.name || ""); + super.updateHash(hash); + } + + source(dependencyTemplates, runtimeTemplate) { + const str = []; + let idx = 0; + for (const dep of this.dependencies) { + if (dep.module) { + if (idx === this.dependencies.length - 1) { + str.push("module.exports = "); } - case "system": { - const SystemMainTemplatePlugin = __webpack_require__(97365); - new SystemMainTemplatePlugin({ - name: this.name - }).apply(compilation); - break; + str.push("__webpack_require__("); + if (runtimeTemplate.outputOptions.pathinfo) { + str.push(Template.toComment(dep.request)); } - default: - throw new Error(`${this.target} is not a valid Library target`); + str.push(`${JSON.stringify(dep.module.id)}`); + str.push(")"); + } else { + const content = __webpack_require__(75386).module( + dep.request + ); + str.push(content); } + str.push(";\n"); + idx++; + } + return new RawSource(str.join("")); + } +} + +module.exports = MultiModule; + + +/***/ }), + +/***/ 24005: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const { Tapable } = __webpack_require__(92402); +const MultiModule = __webpack_require__(4198); + +module.exports = class MultiModuleFactory extends Tapable { + constructor() { + super(); + this.hooks = {}; + } + + create(data, callback) { + const dependency = data.dependencies[0]; + callback( + null, + new MultiModule(data.context, dependency.dependencies, dependency.name) + ); + } +}; + + +/***/ }), + +/***/ 55144: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Stats = __webpack_require__(99977); + +const optionOrFallback = (optionValue, fallbackValue) => + optionValue !== undefined ? optionValue : fallbackValue; + +class MultiStats { + constructor(stats) { + this.stats = stats; + this.hash = stats.map(stat => stat.hash).join(""); + } + + hasErrors() { + return this.stats + .map(stat => stat.hasErrors()) + .reduce((a, b) => a || b, false); + } + + hasWarnings() { + return this.stats + .map(stat => stat.hasWarnings()) + .reduce((a, b) => a || b, false); + } + + toJson(options, forToString) { + if (typeof options === "boolean" || typeof options === "string") { + options = Stats.presetToOptions(options); + } else if (!options) { + options = {}; + } + const jsons = this.stats.map((stat, idx) => { + const childOptions = Stats.getChildOptions(options, idx); + const obj = stat.toJson(childOptions, forToString); + obj.name = stat.compilation && stat.compilation.name; + return obj; }); + const showVersion = + options.version === undefined + ? jsons.every(j => j.version) + : options.version !== false; + const showHash = + options.hash === undefined + ? jsons.every(j => j.hash) + : options.hash !== false; + if (showVersion) { + for (const j of jsons) { + delete j.version; + } + } + const obj = { + errors: jsons.reduce((arr, j) => { + return arr.concat( + j.errors.map(msg => { + return `(${j.name}) ${msg}`; + }) + ); + }, []), + warnings: jsons.reduce((arr, j) => { + return arr.concat( + j.warnings.map(msg => { + return `(${j.name}) ${msg}`; + }) + ); + }, []) + }; + if (showVersion) obj.version = __webpack_require__(71618)/* .version */ .i8; + if (showHash) obj.hash = this.hash; + if (options.children !== false) obj.children = jsons; + return obj; + } + + toString(options) { + if (typeof options === "boolean" || typeof options === "string") { + options = Stats.presetToOptions(options); + } else if (!options) { + options = {}; + } + + const useColors = optionOrFallback(options.colors, false); + + const obj = this.toJson(options, true); + + return Stats.jsonToString(obj, useColors); } } -module.exports = LibraryTemplatePlugin; +module.exports = MultiStats; /***/ }), -/***/ 48775: +/***/ 66624: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -64070,63 +62738,55 @@ module.exports = LibraryTemplatePlugin; */ -const ModuleFilenameHelpers = __webpack_require__(71474); +const asyncLib = __webpack_require__(36386); -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(4994); +class MultiWatching { + constructor(watchings, compiler) { + this.watchings = watchings; + this.compiler = compiler; + } -/** @typedef {import("../declarations/plugins/LoaderOptionsPlugin").LoaderOptionsPluginOptions} LoaderOptionsPluginOptions */ + invalidate() { + for (const watching of this.watchings) { + watching.invalidate(); + } + } -class LoaderOptionsPlugin { - /** - * @param {LoaderOptionsPluginOptions} options options object - */ - constructor(options) { - validateOptions(schema, options || {}, "Loader Options Plugin"); + suspend() { + for (const watching of this.watchings) { + watching.suspend(); + } + } - if (typeof options !== "object") options = {}; - if (!options.test) { - options.test = { - test: () => true - }; + resume() { + for (const watching of this.watchings) { + watching.resume(); } - this.options = options; } - apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap("LoaderOptionsPlugin", compilation => { - compilation.hooks.normalModuleLoader.tap( - "LoaderOptionsPlugin", - (context, module) => { - const resource = module.resource; - if (!resource) return; - const i = resource.indexOf("?"); - if ( - ModuleFilenameHelpers.matchObject( - options, - i < 0 ? resource : resource.substr(0, i) - ) - ) { - for (const key of Object.keys(options)) { - if (key === "include" || key === "exclude" || key === "test") { - continue; - } - context[key] = options[key]; - } - } + close(callback) { + asyncLib.forEach( + this.watchings, + (watching, finishedCallback) => { + watching.close(finishedCallback); + }, + err => { + this.compiler.hooks.watchClose.call(); + if (typeof callback === "function") { + this.compiler.running = false; + callback(err); } - ); - }); + } + ); } } -module.exports = LoaderOptionsPlugin; +module.exports = MultiWatching; /***/ }), -/***/ 95154: +/***/ 70419: /***/ (function(module) { "use strict"; @@ -64136,29 +62796,34 @@ module.exports = LoaderOptionsPlugin; */ -class LoaderTargetPlugin { - constructor(target) { - this.target = target; +class NamedChunksPlugin { + static defaultNameResolver(chunk) { + return chunk.name || null; + } + + constructor(nameResolver) { + this.nameResolver = nameResolver || NamedChunksPlugin.defaultNameResolver; } apply(compiler) { - compiler.hooks.compilation.tap("LoaderTargetPlugin", compilation => { - compilation.hooks.normalModuleLoader.tap( - "LoaderTargetPlugin", - loaderContext => { - loaderContext.target = this.target; + compiler.hooks.compilation.tap("NamedChunksPlugin", compilation => { + compilation.hooks.beforeChunkIds.tap("NamedChunksPlugin", chunks => { + for (const chunk of chunks) { + if (chunk.id === null) { + chunk.id = this.nameResolver(chunk); + } } - ); + }); }); } } -module.exports = LoaderTargetPlugin; +module.exports = NamedChunksPlugin; /***/ }), -/***/ 43626: +/***/ 86707: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -64168,585 +62833,122 @@ module.exports = LoaderTargetPlugin; */ -const { - ConcatSource, - OriginalSource, - PrefixSource, - RawSource -} = __webpack_require__(53665); -const { - Tapable, - SyncWaterfallHook, - SyncHook, - SyncBailHook -} = __webpack_require__(92402); -const Template = __webpack_require__(96066); - -/** @typedef {import("webpack-sources").ConcatSource} ConcatSource */ -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("./ModuleTemplate")} ModuleTemplate */ -/** @typedef {import("./Chunk")} Chunk */ -/** @typedef {import("./Module")} Module} */ -/** @typedef {import("./util/createHash").Hash} Hash} */ -/** @typedef {import("./Dependency").DependencyTemplate} DependencyTemplate} */ +const createHash = __webpack_require__(15660); +const RequestShortener = __webpack_require__(54254); -/** - * @typedef {Object} RenderManifestOptions - * @property {Chunk} chunk the chunk used to render - * @property {string} hash - * @property {string} fullHash - * @property {TODO} outputOptions - * @property {{javascript: ModuleTemplate, webassembly: ModuleTemplate}} moduleTemplates - * @property {Map} dependencyTemplates - */ +const getHash = str => { + const hash = createHash("md4"); + hash.update(str); + const digest = /** @type {string} */ (hash.digest("hex")); + return digest.substr(0, 4); +}; -// require function shortcuts: -// __webpack_require__.s = the module id of the entry point -// __webpack_require__.c = the module cache -// __webpack_require__.m = the module functions -// __webpack_require__.p = the bundle public path -// __webpack_require__.i = the identity function used for harmony imports -// __webpack_require__.e = the chunk ensure function -// __webpack_require__.d = the exported property define getter function -// __webpack_require__.o = Object.prototype.hasOwnProperty.call -// __webpack_require__.r = define compatibility on export -// __webpack_require__.t = create a fake namespace object -// __webpack_require__.n = compatibility get default export -// __webpack_require__.h = the webpack hash -// __webpack_require__.w = an object containing all installed WebAssembly.Instance export objects keyed by module id -// __webpack_require__.oe = the uncaught error handler for the webpack runtime -// __webpack_require__.nc = the script nonce +class NamedModulesPlugin { + constructor(options) { + this.options = options || {}; + } -module.exports = class MainTemplate extends Tapable { - /** - * - * @param {TODO=} outputOptions output options for the MainTemplate - */ - constructor(outputOptions) { - super(); - /** @type {TODO?} */ - this.outputOptions = outputOptions || {}; - this.hooks = { - /** @type {SyncWaterfallHook} */ - renderManifest: new SyncWaterfallHook(["result", "options"]), - modules: new SyncWaterfallHook([ - "modules", - "chunk", - "hash", - "moduleTemplate", - "dependencyTemplates" - ]), - moduleObj: new SyncWaterfallHook([ - "source", - "chunk", - "hash", - "moduleIdExpression" - ]), - requireEnsure: new SyncWaterfallHook([ - "source", - "chunk", - "hash", - "chunkIdExpression" - ]), - bootstrap: new SyncWaterfallHook([ - "source", - "chunk", - "hash", - "moduleTemplate", - "dependencyTemplates" - ]), - localVars: new SyncWaterfallHook(["source", "chunk", "hash"]), - require: new SyncWaterfallHook(["source", "chunk", "hash"]), - requireExtensions: new SyncWaterfallHook(["source", "chunk", "hash"]), - /** @type {SyncWaterfallHook} */ - beforeStartup: new SyncWaterfallHook(["source", "chunk", "hash"]), - /** @type {SyncWaterfallHook} */ - startup: new SyncWaterfallHook(["source", "chunk", "hash"]), - /** @type {SyncWaterfallHook} */ - afterStartup: new SyncWaterfallHook(["source", "chunk", "hash"]), - render: new SyncWaterfallHook([ - "source", - "chunk", - "hash", - "moduleTemplate", - "dependencyTemplates" - ]), - renderWithEntry: new SyncWaterfallHook(["source", "chunk", "hash"]), - moduleRequire: new SyncWaterfallHook([ - "source", - "chunk", - "hash", - "moduleIdExpression" - ]), - addModule: new SyncWaterfallHook([ - "source", - "chunk", - "hash", - "moduleIdExpression", - "moduleExpression" - ]), - currentHash: new SyncWaterfallHook(["source", "requestedLength"]), - assetPath: new SyncWaterfallHook(["path", "options", "assetInfo"]), - hash: new SyncHook(["hash"]), - hashForChunk: new SyncHook(["hash", "chunk"]), - globalHashPaths: new SyncWaterfallHook(["paths"]), - globalHash: new SyncBailHook(["chunk", "paths"]), + apply(compiler) { + compiler.hooks.compilation.tap("NamedModulesPlugin", compilation => { + compilation.hooks.beforeModuleIds.tap("NamedModulesPlugin", modules => { + const namedModules = new Map(); + const context = this.options.context || compiler.options.context; - // TODO this should be moved somewhere else - // It's weird here - hotBootstrap: new SyncWaterfallHook(["source", "chunk", "hash"]) - }; - this.hooks.startup.tap("MainTemplate", (source, chunk, hash) => { - /** @type {string[]} */ - const buf = []; - if (chunk.entryModule) { - buf.push("// Load entry module and return exports"); - buf.push( - `return ${this.renderRequireFunctionForModule( - hash, - chunk, - JSON.stringify(chunk.entryModule.id) - )}(${this.requireFn}.s = ${JSON.stringify(chunk.entryModule.id)});` - ); - } - return Template.asString(buf); - }); - this.hooks.render.tap( - "MainTemplate", - (bootstrapSource, chunk, hash, moduleTemplate, dependencyTemplates) => { - const source = new ConcatSource(); - source.add("/******/ (function(modules) { // webpackBootstrap\n"); - source.add(new PrefixSource("/******/", bootstrapSource)); - source.add("/******/ })\n"); - source.add( - "/************************************************************************/\n" - ); - source.add("/******/ ("); - source.add( - this.hooks.modules.call( - new RawSource(""), - chunk, - hash, - moduleTemplate, - dependencyTemplates - ) - ); - source.add(")"); - return source; - } - ); - this.hooks.localVars.tap("MainTemplate", (source, chunk, hash) => { - return Template.asString([ - source, - "// The module cache", - "var installedModules = {};" - ]); - }); - this.hooks.require.tap("MainTemplate", (source, chunk, hash) => { - return Template.asString([ - source, - "// Check if module is in cache", - "if(installedModules[moduleId]) {", - Template.indent("return installedModules[moduleId].exports;"), - "}", - "// Create a new module (and put it into the cache)", - "var module = installedModules[moduleId] = {", - Template.indent(this.hooks.moduleObj.call("", chunk, hash, "moduleId")), - "};", - "", - Template.asString( - outputOptions.strictModuleExceptionHandling - ? [ - "// Execute the module function", - "var threw = true;", - "try {", - Template.indent([ - `modules[moduleId].call(module.exports, module, module.exports, ${this.renderRequireFunctionForModule( - hash, - chunk, - "moduleId" - )});`, - "threw = false;" - ]), - "} finally {", - Template.indent([ - "if(threw) delete installedModules[moduleId];" - ]), - "}" - ] - : [ - "// Execute the module function", - `modules[moduleId].call(module.exports, module, module.exports, ${this.renderRequireFunctionForModule( - hash, - chunk, - "moduleId" - )});` - ] - ), - "", - "// Flag the module as loaded", - "module.l = true;", - "", - "// Return the exports of the module", - "return module.exports;" - ]); + for (const module of modules) { + if (module.id === null && module.libIdent) { + module.id = module.libIdent({ context }); + } + + if (module.id !== null) { + const namedModule = namedModules.get(module.id); + if (namedModule !== undefined) { + namedModule.push(module); + } else { + namedModules.set(module.id, [module]); + } + } + } + + for (const namedModule of namedModules.values()) { + if (namedModule.length > 1) { + for (const module of namedModule) { + const requestShortener = new RequestShortener(context); + module.id = `${module.id}?${getHash( + requestShortener.shorten(module.identifier()) + )}`; + } + } + } + }); }); - this.hooks.moduleObj.tap( - "MainTemplate", - (source, chunk, hash, varModuleId) => { - return Template.asString(["i: moduleId,", "l: false,", "exports: {}"]); - } - ); - this.hooks.requireExtensions.tap("MainTemplate", (source, chunk, hash) => { - const buf = []; - const chunkMaps = chunk.getChunkMaps(); - // Check if there are non initial chunks which need to be imported using require-ensure - if (Object.keys(chunkMaps.hash).length) { - buf.push("// This file contains only the entry chunk."); - buf.push("// The chunk loading function for additional chunks"); - buf.push(`${this.requireFn}.e = function requireEnsure(chunkId) {`); - buf.push(Template.indent("var promises = [];")); - buf.push( - Template.indent( - this.hooks.requireEnsure.call("", chunk, hash, "chunkId") - ) - ); - buf.push(Template.indent("return Promise.all(promises);")); - buf.push("};"); - } else if ( - chunk.hasModuleInGraph(m => - m.blocks.some(b => b.chunkGroup && b.chunkGroup.chunks.length > 0) - ) - ) { - // There async blocks in the graph, so we need to add an empty requireEnsure - // function anyway. This can happen with multiple entrypoints. - buf.push("// The chunk loading function for additional chunks"); - buf.push("// Since all referenced chunks are already included"); - buf.push("// in this file, this function is empty here."); - buf.push(`${this.requireFn}.e = function requireEnsure() {`); - buf.push(Template.indent("return Promise.resolve();")); - buf.push("};"); - } - buf.push(""); - buf.push("// expose the modules object (__webpack_modules__)"); - buf.push(`${this.requireFn}.m = modules;`); + } +} - buf.push(""); - buf.push("// expose the module cache"); - buf.push(`${this.requireFn}.c = installedModules;`); +module.exports = NamedModulesPlugin; - buf.push(""); - buf.push("// define getter function for harmony exports"); - buf.push(`${this.requireFn}.d = function(exports, name, getter) {`); - buf.push( - Template.indent([ - `if(!${this.requireFn}.o(exports, name)) {`, - Template.indent([ - "Object.defineProperty(exports, name, { enumerable: true, get: getter });" - ]), - "}" - ]) - ); - buf.push("};"); - buf.push(""); - buf.push("// define __esModule on exports"); - buf.push(`${this.requireFn}.r = function(exports) {`); - buf.push( - Template.indent([ - "if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {", - Template.indent([ - "Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });" - ]), - "}", - "Object.defineProperty(exports, '__esModule', { value: true });" - ]) - ); - buf.push("};"); +/***/ }), - buf.push(""); - buf.push("// create a fake namespace object"); - buf.push("// mode & 1: value is a module id, require it"); - buf.push("// mode & 2: merge all properties of value into the ns"); - buf.push("// mode & 4: return value when already ns object"); - buf.push("// mode & 8|1: behave like require"); - buf.push(`${this.requireFn}.t = function(value, mode) {`); - buf.push( - Template.indent([ - `if(mode & 1) value = ${this.requireFn}(value);`, - `if(mode & 8) return value;`, - "if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;", - "var ns = Object.create(null);", - `${this.requireFn}.r(ns);`, - "Object.defineProperty(ns, 'default', { enumerable: true, value: value });", - "if(mode & 2 && typeof value != 'string') for(var key in value) " + - `${this.requireFn}.d(ns, key, function(key) { ` + - "return value[key]; " + - "}.bind(null, key));", - "return ns;" - ]) - ); - buf.push("};"); +/***/ 22615: +/***/ (function(module) { - buf.push(""); - buf.push( - "// getDefaultExport function for compatibility with non-harmony modules" - ); - buf.push(this.requireFn + ".n = function(module) {"); - buf.push( - Template.indent([ - "var getter = module && module.__esModule ?", - Template.indent([ - "function getDefault() { return module['default']; } :", - "function getModuleExports() { return module; };" - ]), - `${this.requireFn}.d(getter, 'a', getter);`, - "return getter;" - ]) - ); - buf.push("};"); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - buf.push(""); - buf.push("// Object.prototype.hasOwnProperty.call"); - buf.push( - `${this.requireFn}.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };` - ); - const publicPath = this.getPublicPath({ - hash: hash +class NoEmitOnErrorsPlugin { + apply(compiler) { + compiler.hooks.shouldEmit.tap("NoEmitOnErrorsPlugin", compilation => { + if (compilation.getStats().hasErrors()) return false; + }); + compiler.hooks.compilation.tap("NoEmitOnErrorsPlugin", compilation => { + compilation.hooks.shouldRecord.tap("NoEmitOnErrorsPlugin", () => { + if (compilation.getStats().hasErrors()) return false; }); - buf.push(""); - buf.push("// __webpack_public_path__"); - buf.push(`${this.requireFn}.p = ${JSON.stringify(publicPath)};`); - return Template.asString(buf); }); - - this.requireFn = "__webpack_require__"; } +} - /** - * - * @param {RenderManifestOptions} options render manifest options - * @returns {TODO[]} returns render manifest - */ - getRenderManifest(options) { - const result = []; +module.exports = NoEmitOnErrorsPlugin; - this.hooks.renderManifest.call(result, options); - return result; - } +/***/ }), - /** - * TODO webpack 5: remove moduleTemplate and dependencyTemplates - * @param {string} hash hash to be used for render call - * @param {Chunk} chunk Chunk instance - * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render - * @param {Map} dependencyTemplates dependency templates - * @returns {string[]} the generated source of the bootstrap code - */ - renderBootstrap(hash, chunk, moduleTemplate, dependencyTemplates) { - const buf = []; - buf.push( - this.hooks.bootstrap.call( - "", - chunk, - hash, - moduleTemplate, - dependencyTemplates - ) - ); - buf.push(this.hooks.localVars.call("", chunk, hash)); - buf.push(""); - buf.push("// The require function"); - buf.push(`function ${this.requireFn}(moduleId) {`); - buf.push(Template.indent(this.hooks.require.call("", chunk, hash))); - buf.push("}"); - buf.push(""); - buf.push( - Template.asString(this.hooks.requireExtensions.call("", chunk, hash)) - ); - buf.push(""); - buf.push(Template.asString(this.hooks.beforeStartup.call("", chunk, hash))); - const afterStartupCode = Template.asString( - this.hooks.afterStartup.call("", chunk, hash) - ); - if (afterStartupCode) { - // TODO webpack 5: this is a bit hacky to avoid a breaking change - // change it to a better way - buf.push("var startupResult = (function() {"); - } - buf.push(Template.asString(this.hooks.startup.call("", chunk, hash))); - if (afterStartupCode) { - buf.push("})();"); - buf.push(afterStartupCode); - buf.push("return startupResult;"); - } - return buf; - } +/***/ 45759: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - /** - * @param {string} hash hash to be used for render call - * @param {Chunk} chunk Chunk instance - * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render - * @param {Map} dependencyTemplates dependency templates - * @returns {ConcatSource} the newly generated source from rendering - */ - render(hash, chunk, moduleTemplate, dependencyTemplates) { - const buf = this.renderBootstrap( - hash, - chunk, - moduleTemplate, - dependencyTemplates - ); - let source = this.hooks.render.call( - new OriginalSource( - Template.prefix(buf, " \t") + "\n", - "webpack/bootstrap" - ), - chunk, - hash, - moduleTemplate, - dependencyTemplates - ); - if (chunk.hasEntryModule()) { - source = this.hooks.renderWithEntry.call(source, chunk, hash); - } - if (!source) { - throw new Error( - "Compiler error: MainTemplate plugin 'render' should return something" - ); - } - chunk.rendered = true; - return new ConcatSource(source, ";"); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - /** - * - * @param {string} hash hash for render fn - * @param {Chunk} chunk Chunk instance for require - * @param {(number|string)=} varModuleId module id - * @returns {TODO} the moduleRequire hook call return signature - */ - renderRequireFunctionForModule(hash, chunk, varModuleId) { - return this.hooks.moduleRequire.call( - this.requireFn, - chunk, - hash, - varModuleId - ); - } - /** - * - * @param {string} hash hash for render add fn - * @param {Chunk} chunk Chunk instance for require add fn - * @param {(string|number)=} varModuleId module id - * @param {Module} varModule Module instance - * @returns {TODO} renderAddModule call - */ - renderAddModule(hash, chunk, varModuleId, varModule) { - return this.hooks.addModule.call( - `modules[${varModuleId}] = ${varModule};`, - chunk, - hash, - varModuleId, - varModule - ); - } +const WebpackError = __webpack_require__(97391); - /** - * - * @param {string} hash string hash - * @param {number=} length length - * @returns {string} call hook return - */ - renderCurrentHashCode(hash, length) { - length = length || Infinity; - return this.hooks.currentHash.call( - JSON.stringify(hash.substr(0, length)), - length - ); - } - - /** - * - * @param {object} options get public path options - * @returns {string} hook call - */ - getPublicPath(options) { - return this.hooks.assetPath.call( - this.outputOptions.publicPath || "", - options - ); - } - - getAssetPath(path, options) { - return this.hooks.assetPath.call(path, options); - } - - getAssetPathWithInfo(path, options) { - const assetInfo = {}; - // TODO webpack 5: refactor assetPath hook to receive { path, info } object - const newPath = this.hooks.assetPath.call(path, options, assetInfo); - return { path: newPath, info: assetInfo }; - } - - /** - * Updates hash with information from this template - * @param {Hash} hash the hash to update - * @returns {void} - */ - updateHash(hash) { - hash.update("maintemplate"); - hash.update("3"); - this.hooks.hash.call(hash); - } +module.exports = class NoModeWarning extends WebpackError { + constructor(modules) { + super(); - /** - * TODO webpack 5: remove moduleTemplate and dependencyTemplates - * Updates hash with chunk-specific information from this template - * @param {Hash} hash the hash to update - * @param {Chunk} chunk the chunk - * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render - * @param {Map} dependencyTemplates dependency templates - * @returns {void} - */ - updateHashForChunk(hash, chunk, moduleTemplate, dependencyTemplates) { - this.updateHash(hash); - this.hooks.hashForChunk.call(hash, chunk); - for (const line of this.renderBootstrap( - "0000", - chunk, - moduleTemplate, - dependencyTemplates - )) { - hash.update(line); - } - } + this.name = "NoModeWarning"; + this.message = + "configuration\n" + + "The 'mode' option has not been set, webpack will fallback to 'production' for this value. " + + "Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\n" + + "You can also set it to 'none' to disable any default behavior. " + + "Learn more: https://webpack.js.org/configuration/mode/"; - useChunkHash(chunk) { - const paths = this.hooks.globalHashPaths.call([]); - return !this.hooks.globalHash.call(chunk, paths); + Error.captureStackTrace(this, this.constructor); } }; /***/ }), -/***/ 50332: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -module.exports = __webpack_require__(32327); - - -/***/ }), - -/***/ 75993: +/***/ 28386: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -64756,914 +62958,1250 @@ module.exports = __webpack_require__(32327); */ -const util = __webpack_require__(31669); - -const DependenciesBlock = __webpack_require__(16071); -const ModuleReason = __webpack_require__(44576); -const SortableSet = __webpack_require__(50071); -const Template = __webpack_require__(96066); +const path = __webpack_require__(85622); +const ParserHelpers = __webpack_require__(23999); +const ConstDependency = __webpack_require__(71101); -/** @typedef {import("./Chunk")} Chunk */ -/** @typedef {import("./RequestShortener")} RequestShortener */ -/** @typedef {import("./WebpackError")} WebpackError */ -/** @typedef {import("./util/createHash").Hash} Hash */ +const NullFactory = __webpack_require__(40438); -const EMPTY_RESOLVE_OPTIONS = {}; +class NodeStuffPlugin { + constructor(options) { + this.options = options; + } -let debugId = 1000; + apply(compiler) { + const options = this.options; + compiler.hooks.compilation.tap( + "NodeStuffPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(ConstDependency, new NullFactory()); + compilation.dependencyTemplates.set( + ConstDependency, + new ConstDependency.Template() + ); -const sortById = (a, b) => { - return a.id - b.id; -}; + const handler = (parser, parserOptions) => { + if (parserOptions.node === false) return; -const sortByDebugId = (a, b) => { - return a.debugId - b.debugId; -}; + let localOptions = options; + if (parserOptions.node) { + localOptions = Object.assign({}, localOptions, parserOptions.node); + } -/** @typedef {(requestShortener: RequestShortener) => string} OptimizationBailoutFunction */ + const setConstant = (expressionName, value) => { + parser.hooks.expression + .for(expressionName) + .tap("NodeStuffPlugin", () => { + parser.state.current.addVariable( + expressionName, + JSON.stringify(value) + ); + return true; + }); + }; -class Module extends DependenciesBlock { - constructor(type, context = null) { - super(); - /** @type {string} */ - this.type = type; - /** @type {string} */ - this.context = context; + const setModuleConstant = (expressionName, fn) => { + parser.hooks.expression + .for(expressionName) + .tap("NodeStuffPlugin", () => { + parser.state.current.addVariable( + expressionName, + JSON.stringify(fn(parser.state.module)) + ); + return true; + }); + }; + const context = compiler.context; + if (localOptions.__filename) { + if (localOptions.__filename === "mock") { + setConstant("__filename", "/index.js"); + } else { + setModuleConstant("__filename", module => + path.relative(context, module.resource) + ); + } + parser.hooks.evaluateIdentifier + .for("__filename") + .tap("NodeStuffPlugin", expr => { + if (!parser.state.module) return; + const resource = parser.state.module.resource; + const i = resource.indexOf("?"); + return ParserHelpers.evaluateToString( + i < 0 ? resource : resource.substr(0, i) + )(expr); + }); + } + if (localOptions.__dirname) { + if (localOptions.__dirname === "mock") { + setConstant("__dirname", "/"); + } else { + setModuleConstant("__dirname", module => + path.relative(context, module.context) + ); + } + parser.hooks.evaluateIdentifier + .for("__dirname") + .tap("NodeStuffPlugin", expr => { + if (!parser.state.module) return; + return ParserHelpers.evaluateToString( + parser.state.module.context + )(expr); + }); + } + parser.hooks.expression + .for("require.extensions") + .tap( + "NodeStuffPlugin", + ParserHelpers.expressionIsUnsupported( + parser, + "require.extensions is not supported by webpack. Use a loader instead." + ) + ); + }; - // Unique Id - /** @type {number} */ - this.debugId = debugId++; + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("NodeStuffPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("NodeStuffPlugin", handler); + } + ); + } +} +module.exports = NodeStuffPlugin; - // Hash - /** @type {string} */ - this.hash = undefined; - /** @type {string} */ - this.renderedHash = undefined; - // Info from Factory - /** @type {TODO} */ - this.resolveOptions = EMPTY_RESOLVE_OPTIONS; - /** @type {object} */ - this.factoryMeta = {}; +/***/ }), - // Info from Build - /** @type {WebpackError[]} */ - this.warnings = []; - /** @type {WebpackError[]} */ - this.errors = []; - /** @type {object} */ - this.buildMeta = undefined; - /** @type {object} */ - this.buildInfo = undefined; +/***/ 25963: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // Graph (per Compilation) - /** @type {ModuleReason[]} */ - this.reasons = []; - /** @type {SortableSet} */ - this._chunks = new SortableSet(undefined, sortById); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // Info from Compilation (per Compilation) - /** @type {number|string} */ - this.id = null; - /** @type {number} */ - this.index = null; - /** @type {number} */ - this.index2 = null; - /** @type {number} */ - this.depth = null; - /** @type {Module} */ - this.issuer = null; - /** @type {undefined | object} */ - this.profile = undefined; - /** @type {boolean} */ - this.prefetched = false; - /** @type {boolean} */ - this.built = false; - // Info from Optimization (per Compilation) - /** @type {null | boolean} */ - this.used = null; - /** @type {false | true | string[]} */ - this.usedExports = null; - /** @type {(string | OptimizationBailoutFunction)[]} */ - this.optimizationBailout = []; +const NativeModule = __webpack_require__(32282); - // delayed operations - /** @type {undefined | {oldChunk: Chunk, newChunks: Chunk[]}[] } */ - this._rewriteChunkInReasons = undefined; +const { + CachedSource, + LineToLineMappedSource, + OriginalSource, + RawSource, + SourceMapSource +} = __webpack_require__(53665); +const { getContext, runLoaders } = __webpack_require__(73278); - /** @type {boolean} */ - this.useSourceMap = false; +const WebpackError = __webpack_require__(97391); +const Module = __webpack_require__(75993); +const ModuleParseError = __webpack_require__(62500); +const ModuleBuildError = __webpack_require__(12072); +const ModuleError = __webpack_require__(82528); +const ModuleWarning = __webpack_require__(6372); +const createHash = __webpack_require__(15660); +const contextify = __webpack_require__(94658).contextify; - // info from build - this._source = null; - } +/** @typedef {import("./util/createHash").Hash} Hash */ - get exportsArgument() { - return (this.buildInfo && this.buildInfo.exportsArgument) || "exports"; +const asString = buf => { + if (Buffer.isBuffer(buf)) { + return buf.toString("utf-8"); } + return buf; +}; - get moduleArgument() { - return (this.buildInfo && this.buildInfo.moduleArgument) || "module"; +const asBuffer = str => { + if (!Buffer.isBuffer(str)) { + return Buffer.from(str, "utf-8"); } + return str; +}; - disconnect() { - this.hash = undefined; - this.renderedHash = undefined; - - this.reasons.length = 0; - this._rewriteChunkInReasons = undefined; - this._chunks.clear(); - - this.id = null; - this.index = null; - this.index2 = null; - this.depth = null; - this.issuer = null; - this.profile = undefined; - this.prefetched = false; - this.built = false; +class NonErrorEmittedError extends WebpackError { + constructor(error) { + super(); - this.used = null; - this.usedExports = null; - this.optimizationBailout.length = 0; - super.disconnect(); - } + this.name = "NonErrorEmittedError"; + this.message = "(Emitted value instead of an instance of Error) " + error; - unseal() { - this.id = null; - this.index = null; - this.index2 = null; - this.depth = null; - this._chunks.clear(); - super.unseal(); + Error.captureStackTrace(this, this.constructor); } +} - setChunks(chunks) { - this._chunks = new SortableSet(chunks, sortById); - } +/** + * @typedef {Object} CachedSourceEntry + * @property {TODO} source the generated source + * @property {string} hash the hash value + */ - addChunk(chunk) { - if (this._chunks.has(chunk)) return false; - this._chunks.add(chunk); - return true; - } +class NormalModule extends Module { + constructor({ + type, + request, + userRequest, + rawRequest, + loaders, + resource, + matchResource, + parser, + generator, + resolveOptions + }) { + super(type, getContext(resource)); - removeChunk(chunk) { - if (this._chunks.delete(chunk)) { - chunk.removeModule(this); - return true; - } - return false; - } + // Info from Factory + this.request = request; + this.userRequest = userRequest; + this.rawRequest = rawRequest; + this.binary = type.startsWith("webassembly"); + this.parser = parser; + this.generator = generator; + this.resource = resource; + this.matchResource = matchResource; + this.loaders = loaders; + if (resolveOptions !== undefined) this.resolveOptions = resolveOptions; - isInChunk(chunk) { - return this._chunks.has(chunk); - } + // Info from Build + this.error = null; + this._source = null; + this._sourceSize = null; + this._buildHash = ""; + this.buildTimestamp = undefined; + /** @private @type {Map} */ + this._cachedSources = new Map(); - isEntryModule() { - for (const chunk of this._chunks) { - if (chunk.entryModule === this) return true; - } - return false; - } + // Options for the NormalModule set by plugins + // TODO refactor this -> options object filled from Factory + this.useSourceMap = false; + this.lineToLine = false; - get optional() { - return ( - this.reasons.length > 0 && - this.reasons.every(r => r.dependency && r.dependency.optional) - ); + // Cache + this._lastSuccessfulBuildMeta = {}; } - /** - * @returns {Chunk[]} all chunks which contain the module - */ - getChunks() { - return Array.from(this._chunks); + identifier() { + return this.request; } - getNumberOfChunks() { - return this._chunks.size; + readableIdentifier(requestShortener) { + return requestShortener.shorten(this.userRequest); } - get chunksIterable() { - return this._chunks; + libIdent(options) { + return contextify(options.context, this.userRequest); } - hasEqualsChunks(otherModule) { - if (this._chunks.size !== otherModule._chunks.size) return false; - this._chunks.sortWith(sortByDebugId); - otherModule._chunks.sortWith(sortByDebugId); - const a = this._chunks[Symbol.iterator](); - const b = otherModule._chunks[Symbol.iterator](); - // eslint-disable-next-line no-constant-condition - while (true) { - const aItem = a.next(); - const bItem = b.next(); - if (aItem.done) return true; - if (aItem.value !== bItem.value) return false; - } + nameForCondition() { + const resource = this.matchResource || this.resource; + const idx = resource.indexOf("?"); + if (idx >= 0) return resource.substr(0, idx); + return resource; } - addReason(module, dependency, explanation) { - this.reasons.push(new ModuleReason(module, dependency, explanation)); + updateCacheModule(module) { + this.type = module.type; + this.request = module.request; + this.userRequest = module.userRequest; + this.rawRequest = module.rawRequest; + this.parser = module.parser; + this.generator = module.generator; + this.resource = module.resource; + this.matchResource = module.matchResource; + this.loaders = module.loaders; + this.resolveOptions = module.resolveOptions; } - removeReason(module, dependency) { - for (let i = 0; i < this.reasons.length; i++) { - let r = this.reasons[i]; - if (r.module === module && r.dependency === dependency) { - this.reasons.splice(i, 1); - return true; - } + createSourceForAsset(name, content, sourceMap) { + if (!sourceMap) { + return new RawSource(content); } - return false; - } - hasReasonForChunk(chunk) { - if (this._rewriteChunkInReasons) { - for (const operation of this._rewriteChunkInReasons) { - this._doRewriteChunkInReasons(operation.oldChunk, operation.newChunks); - } - this._rewriteChunkInReasons = undefined; - } - for (let i = 0; i < this.reasons.length; i++) { - if (this.reasons[i].hasChunk(chunk)) return true; + if (typeof sourceMap === "string") { + return new OriginalSource(content, sourceMap); } - return false; - } - hasReasons() { - return this.reasons.length > 0; + return new SourceMapSource(content, name, sourceMap); } - rewriteChunkInReasons(oldChunk, newChunks) { - // This is expensive. Delay operation until we really need the data - if (this._rewriteChunkInReasons === undefined) { - this._rewriteChunkInReasons = []; - } - this._rewriteChunkInReasons.push({ - oldChunk, - newChunks - }); - } - - _doRewriteChunkInReasons(oldChunk, newChunks) { - for (let i = 0; i < this.reasons.length; i++) { - this.reasons[i].rewriteChunks(oldChunk, newChunks); - } - } - - /** - * @param {string=} exportName the name of the export - * @returns {boolean|string} false if the export isn't used, true if no exportName is provided and the module is used, or the name to access it if the export is used - */ - isUsed(exportName) { - if (!exportName) return this.used !== false; - if (this.used === null || this.usedExports === null) return exportName; - if (!this.used) return false; - if (!this.usedExports) return false; - if (this.usedExports === true) return exportName; - let idx = this.usedExports.indexOf(exportName); - if (idx < 0) return false; + createLoaderContext(resolver, options, compilation, fs) { + const requestShortener = compilation.runtimeTemplate.requestShortener; + const getCurrentLoaderName = () => { + const currentLoader = this.getCurrentLoader(loaderContext); + if (!currentLoader) return "(not in loader scope)"; + return requestShortener.shorten(currentLoader.loader); + }; + const loaderContext = { + version: 2, + emitWarning: warning => { + if (!(warning instanceof Error)) { + warning = new NonErrorEmittedError(warning); + } + this.warnings.push( + new ModuleWarning(this, warning, { + from: getCurrentLoaderName() + }) + ); + }, + emitError: error => { + if (!(error instanceof Error)) { + error = new NonErrorEmittedError(error); + } + this.errors.push( + new ModuleError(this, error, { + from: getCurrentLoaderName() + }) + ); + }, + getLogger: name => { + const currentLoader = this.getCurrentLoader(loaderContext); + return compilation.getLogger(() => + [currentLoader && currentLoader.loader, name, this.identifier()] + .filter(Boolean) + .join("|") + ); + }, + // TODO remove in webpack 5 + exec: (code, filename) => { + // @ts-ignore Argument of type 'this' is not assignable to parameter of type 'Module'. + const module = new NativeModule(filename, this); + // @ts-ignore _nodeModulePaths is deprecated and undocumented Node.js API + module.paths = NativeModule._nodeModulePaths(this.context); + module.filename = filename; + module._compile(code, filename); + return module.exports; + }, + resolve(context, request, callback) { + resolver.resolve({}, context, request, {}, callback); + }, + getResolve(options) { + const child = options ? resolver.withOptions(options) : resolver; + return (context, request, callback) => { + if (callback) { + child.resolve({}, context, request, {}, callback); + } else { + return new Promise((resolve, reject) => { + child.resolve({}, context, request, {}, (err, result) => { + if (err) reject(err); + else resolve(result); + }); + }); + } + }; + }, + emitFile: (name, content, sourceMap, assetInfo) => { + if (!this.buildInfo.assets) { + this.buildInfo.assets = Object.create(null); + this.buildInfo.assetsInfo = new Map(); + } + this.buildInfo.assets[name] = this.createSourceForAsset( + name, + content, + sourceMap + ); + this.buildInfo.assetsInfo.set(name, assetInfo); + }, + rootContext: options.context, + webpack: true, + sourceMap: !!this.useSourceMap, + mode: options.mode || "production", + _module: this, + _compilation: compilation, + _compiler: compilation.compiler, + fs: fs + }; - // Mangle export name if possible - if (this.isProvided(exportName)) { - if (this.buildMeta.exportsType === "namespace") { - return Template.numberToIdentifer(idx); - } - if ( - this.buildMeta.exportsType === "named" && - !this.usedExports.includes("default") - ) { - return Template.numberToIdentifer(idx); - } + compilation.hooks.normalModuleLoader.call(loaderContext, this); + if (options.loader) { + Object.assign(loaderContext, options.loader); } - return exportName; - } - - isProvided(exportName) { - if (!Array.isArray(this.buildMeta.providedExports)) return null; - return this.buildMeta.providedExports.includes(exportName); - } - - toString() { - return `Module[${this.id || this.debugId}]`; - } - - needRebuild(fileTimestamps, contextTimestamps) { - return true; - } - /** - * @param {Hash} hash the hash used to track dependencies - * @returns {void} - */ - updateHash(hash) { - hash.update(`${this.id}`); - hash.update(JSON.stringify(this.usedExports)); - super.updateHash(hash); + return loaderContext; } - sortItems(sortChunks) { - super.sortItems(); - if (sortChunks) this._chunks.sort(); - this.reasons.sort((a, b) => { - if (a.module === b.module) return 0; - if (!a.module) return -1; - if (!b.module) return 1; - return sortById(a.module, b.module); - }); - if (Array.isArray(this.usedExports)) { - this.usedExports.sort(); + getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) { + if ( + this.loaders && + this.loaders.length && + index < this.loaders.length && + index >= 0 && + this.loaders[index] + ) { + return this.loaders[index]; } + return null; } - unbuild() { - this.dependencies.length = 0; - this.blocks.length = 0; - this.variables.length = 0; - this.buildMeta = undefined; - this.buildInfo = undefined; - this.disconnect(); - } + createSource(source, resourceBuffer, sourceMap) { + // if there is no identifier return raw source + if (!this.identifier) { + return new RawSource(source); + } - get arguments() { - throw new Error("Module.arguments was removed, there is no replacement."); - } + // from here on we assume we have an identifier + const identifier = this.identifier(); - set arguments(value) { - throw new Error("Module.arguments was removed, there is no replacement."); - } -} + if (this.lineToLine && resourceBuffer) { + return new LineToLineMappedSource( + source, + identifier, + asString(resourceBuffer) + ); + } -// TODO remove in webpack 5 -Object.defineProperty(Module.prototype, "forEachChunk", { - configurable: false, - value: util.deprecate( - /** - * @deprecated - * @param {function(any, any, Set): void} fn callback function - * @returns {void} - * @this {Module} - */ - function(fn) { - this._chunks.forEach(fn); - }, - "Module.forEachChunk: Use for(const chunk of module.chunksIterable) instead" - ) -}); + if (this.useSourceMap && sourceMap) { + return new SourceMapSource(source, identifier, sourceMap); + } -// TODO remove in webpack 5 -Object.defineProperty(Module.prototype, "mapChunks", { - configurable: false, - value: util.deprecate( - /** - * @deprecated - * @param {function(any, any): void} fn Mapper function - * @returns {Array} Array of chunks mapped - * @this {Module} - */ - function(fn) { - return Array.from(this._chunks, fn); - }, - "Module.mapChunks: Use Array.from(module.chunksIterable, fn) instead" - ) -}); + if (Buffer.isBuffer(source)) { + // @ts-ignore + // TODO We need to fix @types/webpack-sources to allow RawSource to take a Buffer | string + return new RawSource(source); + } -// TODO remove in webpack 5 -Object.defineProperty(Module.prototype, "entry", { - configurable: false, - get() { - throw new Error("Module.entry was removed. Use Chunk.entryModule"); - }, - set() { - throw new Error("Module.entry was removed. Use Chunk.entryModule"); + return new OriginalSource(source, identifier); } -}); - -// TODO remove in webpack 5 -Object.defineProperty(Module.prototype, "meta", { - configurable: false, - get: util.deprecate( - /** - * @deprecated - * @returns {void} - * @this {Module} - */ - function() { - return this.buildMeta; - }, - "Module.meta was renamed to Module.buildMeta" - ), - set: util.deprecate( - /** - * @deprecated - * @param {TODO} value Value - * @returns {void} - * @this {Module} - */ - function(value) { - this.buildMeta = value; - }, - "Module.meta was renamed to Module.buildMeta" - ) -}); -/** @type {function(): string} */ -Module.prototype.identifier = null; + doBuild(options, compilation, resolver, fs, callback) { + const loaderContext = this.createLoaderContext( + resolver, + options, + compilation, + fs + ); -/** @type {function(RequestShortener): string} */ -Module.prototype.readableIdentifier = null; + runLoaders( + { + resource: this.resource, + loaders: this.loaders, + context: loaderContext, + readResource: fs.readFile.bind(fs) + }, + (err, result) => { + if (result) { + this.buildInfo.cacheable = result.cacheable; + this.buildInfo.fileDependencies = new Set(result.fileDependencies); + this.buildInfo.contextDependencies = new Set( + result.contextDependencies + ); + } -Module.prototype.build = null; -Module.prototype.source = null; -Module.prototype.size = null; -Module.prototype.nameForCondition = null; -/** @type {null | function(Chunk): boolean} */ -Module.prototype.chunkCondition = null; -Module.prototype.updateCacheModule = null; + if (err) { + if (!(err instanceof Error)) { + err = new NonErrorEmittedError(err); + } + const currentLoader = this.getCurrentLoader(loaderContext); + const error = new ModuleBuildError(this, err, { + from: + currentLoader && + compilation.runtimeTemplate.requestShortener.shorten( + currentLoader.loader + ) + }); + return callback(error); + } -module.exports = Module; + const resourceBuffer = result.resourceBuffer; + const source = result.result[0]; + const sourceMap = result.result.length >= 1 ? result.result[1] : null; + const extraInfo = result.result.length >= 2 ? result.result[2] : null; + if (!Buffer.isBuffer(source) && typeof source !== "string") { + const currentLoader = this.getCurrentLoader(loaderContext, 0); + const err = new Error( + `Final loader (${ + currentLoader + ? compilation.runtimeTemplate.requestShortener.shorten( + currentLoader.loader + ) + : "unknown" + }) didn't return a Buffer or String` + ); + const error = new ModuleBuildError(this, err); + return callback(error); + } -/***/ }), + this._source = this.createSource( + this.binary ? asBuffer(source) : asString(source), + resourceBuffer, + sourceMap + ); + this._sourceSize = null; + this._ast = + typeof extraInfo === "object" && + extraInfo !== null && + extraInfo.webpackAST !== undefined + ? extraInfo.webpackAST + : null; + return callback(); + } + ); + } -/***/ 12072: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + markModuleAsErrored(error) { + // Restore build meta from successful build to keep importing state + this.buildMeta = Object.assign({}, this._lastSuccessfulBuildMeta); + this.error = error; + this.errors.push(this.error); + this._source = new RawSource( + "throw new Error(" + JSON.stringify(this.error.message) + ");" + ); + this._sourceSize = null; + this._ast = null; + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + applyNoParseRule(rule, content) { + // must start with "rule" if rule is a string + if (typeof rule === "string") { + return content.indexOf(rule) === 0; + } + if (typeof rule === "function") { + return rule(content); + } + // we assume rule is a regexp + return rule.test(content); + } -const WebpackError = __webpack_require__(97391); -const { cutOffLoaderExecution } = __webpack_require__(80140); + // check if module should not be parsed + // returns "true" if the module should !not! be parsed + // returns "false" if the module !must! be parsed + shouldPreventParsing(noParseRule, request) { + // if no noParseRule exists, return false + // the module !must! be parsed. + if (!noParseRule) { + return false; + } -class ModuleBuildError extends WebpackError { - constructor(module, err, { from = null } = {}) { - let message = "Module build failed"; - let details = undefined; - if (from) { - message += ` (from ${from}):\n`; - } else { - message += ": "; + // we only have one rule to check + if (!Array.isArray(noParseRule)) { + // returns "true" if the module is !not! to be parsed + return this.applyNoParseRule(noParseRule, request); } - if (err !== null && typeof err === "object") { - if (typeof err.stack === "string" && err.stack) { - const stack = cutOffLoaderExecution(err.stack); - if (!err.hideStack) { - message += stack; - } else { - details = stack; - if (typeof err.message === "string" && err.message) { - message += err.message; - } else { - message += err; - } - } - } else if (typeof err.message === "string" && err.message) { - message += err.message; - } else { - message += err; + + for (let i = 0; i < noParseRule.length; i++) { + const rule = noParseRule[i]; + // early exit on first truthy match + // this module is !not! to be parsed + if (this.applyNoParseRule(rule, request)) { + return true; } - } else { - message = err; } - - super(message); - - this.name = "ModuleBuildError"; - this.details = details; - this.module = module; - this.error = err; - - Error.captureStackTrace(this, this.constructor); + // no match found, so this module !should! be parsed + return false; } -} -module.exports = ModuleBuildError; + _initBuildHash(compilation) { + const hash = createHash(compilation.outputOptions.hashFunction); + if (this._source) { + hash.update("source"); + this._source.updateHash(hash); + } + hash.update("meta"); + hash.update(JSON.stringify(this.buildMeta)); + this._buildHash = /** @type {string} */ (hash.digest("hex")); + } + build(options, compilation, resolver, fs, callback) { + this.buildTimestamp = Date.now(); + this.built = true; + this._source = null; + this._sourceSize = null; + this._ast = null; + this._buildHash = ""; + this.error = null; + this.errors.length = 0; + this.warnings.length = 0; + this.buildMeta = {}; + this.buildInfo = { + cacheable: false, + fileDependencies: new Set(), + contextDependencies: new Set(), + assets: undefined, + assetsInfo: undefined + }; -/***/ }), + return this.doBuild(options, compilation, resolver, fs, err => { + this._cachedSources.clear(); -/***/ 14953: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // if we have an error mark module as failed and exit + if (err) { + this.markModuleAsErrored(err); + this._initBuildHash(compilation); + return callback(); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // check if this module should !not! be parsed. + // if so, exit here; + const noParseRule = options.module && options.module.noParse; + if (this.shouldPreventParsing(noParseRule, this.request)) { + this._initBuildHash(compilation); + return callback(); + } + const handleParseError = e => { + const source = this._source.source(); + const loaders = this.loaders.map(item => + contextify(options.context, item.loader) + ); + const error = new ModuleParseError(this, source, e, loaders); + this.markModuleAsErrored(error); + this._initBuildHash(compilation); + return callback(); + }; -const WebpackError = __webpack_require__(97391); - -/** @typedef {import("./Module")} Module */ - -class ModuleDependencyError extends WebpackError { - /** - * Creates an instance of ModuleDependencyError. - * @param {Module} module module tied to dependency - * @param {Error} err error thrown - * @param {TODO} loc location of dependency - */ - constructor(module, err, loc) { - super(err.message); - - this.name = "ModuleDependencyError"; - this.details = err.stack - .split("\n") - .slice(1) - .join("\n"); - this.module = module; - this.loc = loc; - this.error = err; - this.origin = module.issuer; + const handleParseResult = result => { + this._lastSuccessfulBuildMeta = this.buildMeta; + this._initBuildHash(compilation); + return callback(); + }; - Error.captureStackTrace(this, this.constructor); + try { + const result = this.parser.parse( + this._ast || this._source.source(), + { + current: this, + module: this, + compilation: compilation, + options: options + }, + (err, result) => { + if (err) { + handleParseError(err); + } else { + handleParseResult(result); + } + } + ); + if (result !== undefined) { + // parse is sync + handleParseResult(result); + } + } catch (e) { + handleParseError(e); + } + }); } -} - -module.exports = ModuleDependencyError; - - -/***/ }), - -/***/ 59136: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const WebpackError = __webpack_require__(97391); - -module.exports = class ModuleDependencyWarning extends WebpackError { - constructor(module, err, loc) { - super(err.message); - - this.name = "ModuleDependencyWarning"; - this.details = err.stack - .split("\n") - .slice(1) - .join("\n"); - this.module = module; - this.loc = loc; - this.error = err; - this.origin = module.issuer; - Error.captureStackTrace(this, this.constructor); + getHashDigest(dependencyTemplates) { + // TODO webpack 5 refactor + let dtHash = dependencyTemplates.get("hash"); + return `${this.hash}-${dtHash}`; } -}; + source(dependencyTemplates, runtimeTemplate, type = "javascript") { + const hashDigest = this.getHashDigest(dependencyTemplates); + const cacheEntry = this._cachedSources.get(type); + if (cacheEntry !== undefined && cacheEntry.hash === hashDigest) { + // We can reuse the cached source + return cacheEntry.source; + } -/***/ }), + const source = this.generator.generate( + this, + dependencyTemplates, + runtimeTemplate, + type + ); -/***/ 82528: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + const cachedSource = new CachedSource(source); + this._cachedSources.set(type, { + source: cachedSource, + hash: hashDigest + }); + return cachedSource; + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + originalSource() { + return this._source; + } + needRebuild(fileTimestamps, contextTimestamps) { + // always try to rebuild in case of an error + if (this.error) return true; -const WebpackError = __webpack_require__(97391); -const { cleanUp } = __webpack_require__(80140); + // always rebuild when module is not cacheable + if (!this.buildInfo.cacheable) return true; -class ModuleError extends WebpackError { - constructor(module, err, { from = null } = {}) { - let message = "Module Error"; - if (from) { - message += ` (from ${from}):\n`; - } else { - message += ": "; + // Check timestamps of all dependencies + // Missing timestamp -> need rebuild + // Timestamp bigger than buildTimestamp -> need rebuild + for (const file of this.buildInfo.fileDependencies) { + const timestamp = fileTimestamps.get(file); + if (!timestamp) return true; + if (timestamp >= this.buildTimestamp) return true; } - if (err && typeof err === "object" && err.message) { - message += err.message; - } else if (err) { - message += err; + for (const file of this.buildInfo.contextDependencies) { + const timestamp = contextTimestamps.get(file); + if (!timestamp) return true; + if (timestamp >= this.buildTimestamp) return true; } - super(message); - this.name = "ModuleError"; - this.module = module; - this.error = err; - this.details = - err && typeof err === "object" && err.stack - ? cleanUp(err.stack, this.message) - : undefined; + // elsewise -> no rebuild needed + return false; + } - Error.captureStackTrace(this, this.constructor); + size() { + if (this._sourceSize === null) { + this._sourceSize = this._source ? this._source.size() : -1; + } + return this._sourceSize; + } + + /** + * @param {Hash} hash the hash used to track dependencies + * @returns {void} + */ + updateHash(hash) { + hash.update(this._buildHash); + super.updateHash(hash); } } -module.exports = ModuleError; +module.exports = NormalModule; /***/ }), -/***/ 71474: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ 22298: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const createHash = __webpack_require__(15660); - -const ModuleFilenameHelpers = exports; + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ -ModuleFilenameHelpers.ALL_LOADERS_RESOURCE = "[all-loaders][resource]"; -ModuleFilenameHelpers.REGEXP_ALL_LOADERS_RESOURCE = /\[all-?loaders\]\[resource\]/gi; -ModuleFilenameHelpers.LOADERS_RESOURCE = "[loaders][resource]"; -ModuleFilenameHelpers.REGEXP_LOADERS_RESOURCE = /\[loaders\]\[resource\]/gi; -ModuleFilenameHelpers.RESOURCE = "[resource]"; -ModuleFilenameHelpers.REGEXP_RESOURCE = /\[resource\]/gi; -ModuleFilenameHelpers.ABSOLUTE_RESOURCE_PATH = "[absolute-resource-path]"; -ModuleFilenameHelpers.REGEXP_ABSOLUTE_RESOURCE_PATH = /\[abs(olute)?-?resource-?path\]/gi; -ModuleFilenameHelpers.RESOURCE_PATH = "[resource-path]"; -ModuleFilenameHelpers.REGEXP_RESOURCE_PATH = /\[resource-?path\]/gi; -ModuleFilenameHelpers.ALL_LOADERS = "[all-loaders]"; -ModuleFilenameHelpers.REGEXP_ALL_LOADERS = /\[all-?loaders\]/gi; -ModuleFilenameHelpers.LOADERS = "[loaders]"; -ModuleFilenameHelpers.REGEXP_LOADERS = /\[loaders\]/gi; -ModuleFilenameHelpers.QUERY = "[query]"; -ModuleFilenameHelpers.REGEXP_QUERY = /\[query\]/gi; -ModuleFilenameHelpers.ID = "[id]"; -ModuleFilenameHelpers.REGEXP_ID = /\[id\]/gi; -ModuleFilenameHelpers.HASH = "[hash]"; -ModuleFilenameHelpers.REGEXP_HASH = /\[hash\]/gi; -ModuleFilenameHelpers.NAMESPACE = "[namespace]"; -ModuleFilenameHelpers.REGEXP_NAMESPACE = /\[namespace\]/gi; -const getAfter = (str, token) => { - const idx = str.indexOf(token); - return idx < 0 ? "" : str.substr(idx); -}; +const path = __webpack_require__(85622); +const asyncLib = __webpack_require__(36386); +const { + Tapable, + AsyncSeriesWaterfallHook, + SyncWaterfallHook, + SyncBailHook, + SyncHook, + HookMap +} = __webpack_require__(92402); +const NormalModule = __webpack_require__(25963); +const RawModule = __webpack_require__(82353); +const RuleSet = __webpack_require__(84247); +const { cachedCleverMerge } = __webpack_require__(67916); -const getBefore = (str, token) => { - const idx = str.lastIndexOf(token); - return idx < 0 ? "" : str.substr(0, idx); -}; +const EMPTY_RESOLVE_OPTIONS = {}; -const getHash = str => { - const hash = createHash("md4"); - hash.update(str); - const digest = /** @type {string} */ (hash.digest("hex")); - return digest.substr(0, 4); -}; +const MATCH_RESOURCE_REGEX = /^([^!]+)!=!/; -const asRegExp = test => { - if (typeof test === "string") { - test = new RegExp("^" + test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")); +const loaderToIdent = data => { + if (!data.options) { + return data.loader; } - return test; -}; - -ModuleFilenameHelpers.createFilename = (module, options, requestShortener) => { - const opts = Object.assign( - { - namespace: "", - moduleFilenameTemplate: "" - }, - typeof options === "object" - ? options - : { - moduleFilenameTemplate: options - } - ); - - let absoluteResourcePath; - let hash; - let identifier; - let moduleId; - let shortIdentifier; - if (module === undefined) module = ""; - if (typeof module === "string") { - shortIdentifier = requestShortener.shorten(module); - identifier = shortIdentifier; - moduleId = ""; - absoluteResourcePath = module.split("!").pop(); - hash = getHash(identifier); - } else { - shortIdentifier = module.readableIdentifier(requestShortener); - identifier = requestShortener.shorten(module.identifier()); - moduleId = module.id; - absoluteResourcePath = module - .identifier() - .split("!") - .pop(); - hash = getHash(identifier); + if (typeof data.options === "string") { + return data.loader + "?" + data.options; } - const resource = shortIdentifier.split("!").pop(); - const loaders = getBefore(shortIdentifier, "!"); - const allLoaders = getBefore(identifier, "!"); - const query = getAfter(resource, "?"); - const resourcePath = resource.substr(0, resource.length - query.length); - if (typeof opts.moduleFilenameTemplate === "function") { - return opts.moduleFilenameTemplate({ - identifier: identifier, - shortIdentifier: shortIdentifier, - resource: resource, - resourcePath: resourcePath, - absoluteResourcePath: absoluteResourcePath, - allLoaders: allLoaders, - query: query, - moduleId: moduleId, - hash: hash, - namespace: opts.namespace - }); + if (typeof data.options !== "object") { + throw new Error("loader options must be string or object"); } - return opts.moduleFilenameTemplate - .replace(ModuleFilenameHelpers.REGEXP_ALL_LOADERS_RESOURCE, identifier) - .replace(ModuleFilenameHelpers.REGEXP_LOADERS_RESOURCE, shortIdentifier) - .replace(ModuleFilenameHelpers.REGEXP_RESOURCE, resource) - .replace(ModuleFilenameHelpers.REGEXP_RESOURCE_PATH, resourcePath) - .replace( - ModuleFilenameHelpers.REGEXP_ABSOLUTE_RESOURCE_PATH, - absoluteResourcePath - ) - .replace(ModuleFilenameHelpers.REGEXP_ALL_LOADERS, allLoaders) - .replace(ModuleFilenameHelpers.REGEXP_LOADERS, loaders) - .replace(ModuleFilenameHelpers.REGEXP_QUERY, query) - .replace(ModuleFilenameHelpers.REGEXP_ID, moduleId) - .replace(ModuleFilenameHelpers.REGEXP_HASH, hash) - .replace(ModuleFilenameHelpers.REGEXP_NAMESPACE, opts.namespace); -}; - -ModuleFilenameHelpers.replaceDuplicates = (array, fn, comparator) => { - const countMap = Object.create(null); - const posMap = Object.create(null); - array.forEach((item, idx) => { - countMap[item] = countMap[item] || []; - countMap[item].push(idx); - posMap[item] = 0; - }); - if (comparator) { - Object.keys(countMap).forEach(item => { - countMap[item].sort(comparator); - }); + if (data.ident) { + return data.loader + "??" + data.ident; } - return array.map((item, i) => { - if (countMap[item].length > 1) { - if (comparator && countMap[item][0] === i) return item; - return fn(item, i, posMap[item]++); - } else { - return item; - } - }); + return data.loader + "?" + JSON.stringify(data.options); }; -ModuleFilenameHelpers.matchPart = (str, test) => { - if (!test) return true; - test = asRegExp(test); - if (Array.isArray(test)) { - return test.map(asRegExp).some(regExp => regExp.test(str)); +const identToLoaderRequest = resultString => { + const idx = resultString.indexOf("?"); + if (idx >= 0) { + const loader = resultString.substr(0, idx); + const options = resultString.substr(idx + 1); + return { + loader, + options + }; } else { - return test.test(str); - } -}; - -ModuleFilenameHelpers.matchObject = (obj, str) => { - if (obj.test) { - if (!ModuleFilenameHelpers.matchPart(str, obj.test)) { - return false; - } - } - if (obj.include) { - if (!ModuleFilenameHelpers.matchPart(str, obj.include)) { - return false; - } - } - if (obj.exclude) { - if (ModuleFilenameHelpers.matchPart(str, obj.exclude)) { - return false; - } + return { + loader: resultString, + options: undefined + }; } - return true; }; +const dependencyCache = new WeakMap(); -/***/ }), +class NormalModuleFactory extends Tapable { + constructor(context, resolverFactory, options) { + super(); + this.hooks = { + resolver: new SyncWaterfallHook(["resolver"]), + factory: new SyncWaterfallHook(["factory"]), + beforeResolve: new AsyncSeriesWaterfallHook(["data"]), + afterResolve: new AsyncSeriesWaterfallHook(["data"]), + createModule: new SyncBailHook(["data"]), + module: new SyncWaterfallHook(["module", "data"]), + createParser: new HookMap(() => new SyncBailHook(["parserOptions"])), + parser: new HookMap(() => new SyncHook(["parser", "parserOptions"])), + createGenerator: new HookMap( + () => new SyncBailHook(["generatorOptions"]) + ), + generator: new HookMap( + () => new SyncHook(["generator", "generatorOptions"]) + ) + }; + this._pluginCompat.tap("NormalModuleFactory", options => { + switch (options.name) { + case "before-resolve": + case "after-resolve": + options.async = true; + break; + case "parser": + this.hooks.parser + .for("javascript/auto") + .tap(options.fn.name || "unnamed compat plugin", options.fn); + return true; + } + let match; + match = /^parser (.+)$/.exec(options.name); + if (match) { + this.hooks.parser + .for(match[1]) + .tap( + options.fn.name || "unnamed compat plugin", + options.fn.bind(this) + ); + return true; + } + match = /^create-parser (.+)$/.exec(options.name); + if (match) { + this.hooks.createParser + .for(match[1]) + .tap( + options.fn.name || "unnamed compat plugin", + options.fn.bind(this) + ); + return true; + } + }); + this.resolverFactory = resolverFactory; + this.ruleSet = new RuleSet(options.defaultRules.concat(options.rules)); + this.cachePredicate = + typeof options.unsafeCache === "function" + ? options.unsafeCache + : Boolean.bind(null, options.unsafeCache); + this.context = context || ""; + this.parserCache = Object.create(null); + this.generatorCache = Object.create(null); + this.hooks.factory.tap("NormalModuleFactory", () => (result, callback) => { + let resolver = this.hooks.resolver.call(null); -/***/ 71638: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Ignored + if (!resolver) return callback(); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + resolver(result, (err, data) => { + if (err) return callback(err); + // Ignored + if (!data) return callback(); -const WebpackError = __webpack_require__(97391); + // direct module + if (typeof data.source === "function") return callback(null, data); -class ModuleNotFoundError extends WebpackError { - constructor(module, err) { - super("Module not found: " + err); + this.hooks.afterResolve.callAsync(data, (err, result) => { + if (err) return callback(err); - this.name = "ModuleNotFoundError"; - this.details = err.details; - this.missing = err.missing; - this.module = module; - this.error = err; + // Ignored + if (!result) return callback(); - Error.captureStackTrace(this, this.constructor); - } -} + let createdModule = this.hooks.createModule.call(result); + if (!createdModule) { + if (!result.request) { + return callback(new Error("Empty dependency (no request)")); + } -module.exports = ModuleNotFoundError; + createdModule = new NormalModule(result); + } + createdModule = this.hooks.module.call(createdModule, result); -/***/ }), + return callback(null, createdModule); + }); + }); + }); + this.hooks.resolver.tap("NormalModuleFactory", () => (data, callback) => { + const contextInfo = data.contextInfo; + const context = data.context; + const request = data.request; -/***/ 62500: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + const loaderResolver = this.getResolver("loader"); + const normalResolver = this.getResolver("normal", data.resolveOptions); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + let matchResource = undefined; + let requestWithoutMatchResource = request; + const matchResourceMatch = MATCH_RESOURCE_REGEX.exec(request); + if (matchResourceMatch) { + matchResource = matchResourceMatch[1]; + if (/^\.\.?\//.test(matchResource)) { + matchResource = path.join(context, matchResource); + } + requestWithoutMatchResource = request.substr( + matchResourceMatch[0].length + ); + } + const noPreAutoLoaders = requestWithoutMatchResource.startsWith("-!"); + const noAutoLoaders = + noPreAutoLoaders || requestWithoutMatchResource.startsWith("!"); + const noPrePostAutoLoaders = requestWithoutMatchResource.startsWith("!!"); + let elements = requestWithoutMatchResource + .replace(/^-?!+/, "") + .replace(/!!+/g, "!") + .split("!"); + let resource = elements.pop(); + elements = elements.map(identToLoaderRequest); -const WebpackError = __webpack_require__(97391); + asyncLib.parallel( + [ + callback => + this.resolveRequestArray( + contextInfo, + context, + elements, + loaderResolver, + callback + ), + callback => { + if (resource === "" || resource[0] === "?") { + return callback(null, { + resource + }); + } -/** @typedef {import("./Module")} Module */ + normalResolver.resolve( + contextInfo, + context, + resource, + {}, + (err, resource, resourceResolveData) => { + if (err) return callback(err); + callback(null, { + resourceResolveData, + resource + }); + } + ); + } + ], + (err, results) => { + if (err) return callback(err); + let loaders = results[0]; + const resourceResolveData = results[1].resourceResolveData; + resource = results[1].resource; -class ModuleParseError extends WebpackError { - /** - * @param {Module} module the errored module - * @param {string} source source code - * @param {Error&any} err the parse error - * @param {string[]} loaders the loaders used - */ - constructor(module, source, err, loaders) { - let message = "Module parse failed: " + err.message; - let loc = undefined; - if (loaders.length >= 1) { - message += `\nFile was processed with these loaders:${loaders - .map(loader => `\n * ${loader}`) - .join("")}`; - message += - "\nYou may need an additional loader to handle the result of these loaders."; - } else { - message += - "\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders"; - } - if ( - err.loc && - typeof err.loc === "object" && - typeof err.loc.line === "number" - ) { - var lineNumber = err.loc.line; - if (/[\0\u0001\u0002\u0003\u0004\u0005\u0006\u0007]/.test(source)) { - // binary file - message += "\n(Source code omitted for this binary file)"; + // translate option idents + try { + for (const item of loaders) { + if (typeof item.options === "string" && item.options[0] === "?") { + const ident = item.options.substr(1); + item.options = this.ruleSet.findOptionsByIdent(ident); + item.ident = ident; + } + } + } catch (e) { + return callback(e); + } + + if (resource === false) { + // ignored + return callback( + null, + new RawModule( + "/* (ignored) */", + `ignored ${context} ${request}`, + `${request} (ignored)` + ) + ); + } + + const userRequest = + (matchResource !== undefined ? `${matchResource}!=!` : "") + + loaders + .map(loaderToIdent) + .concat([resource]) + .join("!"); + + let resourcePath = + matchResource !== undefined ? matchResource : resource; + let resourceQuery = ""; + const queryIndex = resourcePath.indexOf("?"); + if (queryIndex >= 0) { + resourceQuery = resourcePath.substr(queryIndex); + resourcePath = resourcePath.substr(0, queryIndex); + } + + const result = this.ruleSet.exec({ + resource: resourcePath, + realResource: + matchResource !== undefined + ? resource.replace(/\?.*/, "") + : resourcePath, + resourceQuery, + issuer: contextInfo.issuer, + compiler: contextInfo.compiler + }); + const settings = {}; + const useLoadersPost = []; + const useLoaders = []; + const useLoadersPre = []; + for (const r of result) { + if (r.type === "use") { + if (r.enforce === "post" && !noPrePostAutoLoaders) { + useLoadersPost.push(r.value); + } else if ( + r.enforce === "pre" && + !noPreAutoLoaders && + !noPrePostAutoLoaders + ) { + useLoadersPre.push(r.value); + } else if ( + !r.enforce && + !noAutoLoaders && + !noPrePostAutoLoaders + ) { + useLoaders.push(r.value); + } + } else if ( + typeof r.value === "object" && + r.value !== null && + typeof settings[r.type] === "object" && + settings[r.type] !== null + ) { + settings[r.type] = cachedCleverMerge(settings[r.type], r.value); + } else { + settings[r.type] = r.value; + } + } + asyncLib.parallel( + [ + this.resolveRequestArray.bind( + this, + contextInfo, + this.context, + useLoadersPost, + loaderResolver + ), + this.resolveRequestArray.bind( + this, + contextInfo, + this.context, + useLoaders, + loaderResolver + ), + this.resolveRequestArray.bind( + this, + contextInfo, + this.context, + useLoadersPre, + loaderResolver + ) + ], + (err, results) => { + if (err) return callback(err); + if (matchResource === undefined) { + loaders = results[0].concat(loaders, results[1], results[2]); + } else { + loaders = results[0].concat(results[1], loaders, results[2]); + } + process.nextTick(() => { + const type = settings.type; + const resolveOptions = settings.resolve; + callback(null, { + context: context, + request: loaders + .map(loaderToIdent) + .concat([resource]) + .join("!"), + dependencies: data.dependencies, + userRequest, + rawRequest: request, + loaders, + resource, + matchResource, + resourceResolveData, + settings, + type, + parser: this.getParser(type, settings.parser), + generator: this.getGenerator(type, settings.generator), + resolveOptions + }); + }); + } + ); + } + ); + }); + } + + create(data, callback) { + const dependencies = data.dependencies; + const cacheEntry = dependencyCache.get(dependencies[0]); + if (cacheEntry) return callback(null, cacheEntry); + const context = data.context || this.context; + const resolveOptions = data.resolveOptions || EMPTY_RESOLVE_OPTIONS; + const request = dependencies[0].request; + const contextInfo = data.contextInfo || {}; + this.hooks.beforeResolve.callAsync( + { + contextInfo, + resolveOptions, + context, + request, + dependencies + }, + (err, result) => { + if (err) return callback(err); + + // Ignored + if (!result) return callback(); + + const factory = this.hooks.factory.call(null); + + // Ignored + if (!factory) return callback(); + + factory(result, (err, module) => { + if (err) return callback(err); + + if (module && this.cachePredicate(module)) { + for (const d of dependencies) { + dependencyCache.set(d, module); + } + } + + callback(null, module); + }); + } + ); + } + + resolveRequestArray(contextInfo, context, array, resolver, callback) { + if (array.length === 0) return callback(null, []); + asyncLib.map( + array, + (item, callback) => { + resolver.resolve( + contextInfo, + context, + item.loader, + {}, + (err, result) => { + if ( + err && + /^[^/]*$/.test(item.loader) && + !/-loader$/.test(item.loader) + ) { + return resolver.resolve( + contextInfo, + context, + item.loader + "-loader", + {}, + err2 => { + if (!err2) { + err.message = + err.message + + "\n" + + "BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.\n" + + ` You need to specify '${item.loader}-loader' instead of '${item.loader}',\n` + + " see https://webpack.js.org/migrate/3/#automatic-loader-module-name-extension-removed"; + } + callback(err); + } + ); + } + if (err) return callback(err); + + const optionsOnly = item.options + ? { + options: item.options + } + : undefined; + return callback( + null, + Object.assign({}, item, identToLoaderRequest(result), optionsOnly) + ); + } + ); + }, + callback + ); + } + + getParser(type, parserOptions) { + let ident = type; + if (parserOptions) { + if (parserOptions.ident) { + ident = `${type}|${parserOptions.ident}`; } else { - const sourceLines = source.split(/\r?\n/); - const start = Math.max(0, lineNumber - 3); - const linesBefore = sourceLines.slice(start, lineNumber - 1); - const theLine = sourceLines[lineNumber - 1]; - const linesAfter = sourceLines.slice(lineNumber, lineNumber + 2); - message += - linesBefore.map(l => `\n| ${l}`).join("") + - `\n> ${theLine}` + - linesAfter.map(l => `\n| ${l}`).join(""); + ident = JSON.stringify([type, parserOptions]); } - loc = err.loc; - } else { - message += "\n" + err.stack; } + if (ident in this.parserCache) { + return this.parserCache[ident]; + } + return (this.parserCache[ident] = this.createParser(type, parserOptions)); + } - super(message); + createParser(type, parserOptions = {}) { + const parser = this.hooks.createParser.for(type).call(parserOptions); + if (!parser) { + throw new Error(`No parser registered for ${type}`); + } + this.hooks.parser.for(type).call(parser, parserOptions); + return parser; + } - this.name = "ModuleParseError"; - this.module = module; - this.loc = loc; - this.error = err; + getGenerator(type, generatorOptions) { + let ident = type; + if (generatorOptions) { + if (generatorOptions.ident) { + ident = `${type}|${generatorOptions.ident}`; + } else { + ident = JSON.stringify([type, generatorOptions]); + } + } + if (ident in this.generatorCache) { + return this.generatorCache[ident]; + } + return (this.generatorCache[ident] = this.createGenerator( + type, + generatorOptions + )); + } - Error.captureStackTrace(this, this.constructor); + createGenerator(type, generatorOptions = {}) { + const generator = this.hooks.createGenerator + .for(type) + .call(generatorOptions); + if (!generator) { + throw new Error(`No generator registered for ${type}`); + } + this.hooks.generator.for(type).call(generator, generatorOptions); + return generator; + } + + getResolver(type, resolveOptions) { + return this.resolverFactory.get( + type, + resolveOptions || EMPTY_RESOLVE_OPTIONS + ); } } -module.exports = ModuleParseError; +module.exports = NormalModuleFactory; /***/ }), -/***/ 44576: -/***/ (function(module) { +/***/ 73253: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -65672,54 +64210,57 @@ module.exports = ModuleParseError; */ -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./Dependency")} Dependency */ - -class ModuleReason { - /** - * @param {Module} module the referencing module - * @param {Dependency} dependency the referencing dependency - * @param {string=} explanation some extra detail - */ - constructor(module, dependency, explanation) { - this.module = module; - this.dependency = dependency; - this.explanation = explanation; - this._chunks = null; - } +const path = __webpack_require__(85622); - hasChunk(chunk) { - if (this._chunks) { - if (this._chunks.has(chunk)) return true; - } else if (this.module && this.module._chunks.has(chunk)) return true; - return false; +class NormalModuleReplacementPlugin { + constructor(resourceRegExp, newResource) { + this.resourceRegExp = resourceRegExp; + this.newResource = newResource; } - rewriteChunks(oldChunk, newChunks) { - if (!this._chunks) { - if (this.module) { - if (!this.module._chunks.has(oldChunk)) return; - this._chunks = new Set(this.module._chunks); - } else { - this._chunks = new Set(); - } - } - if (this._chunks.has(oldChunk)) { - this._chunks.delete(oldChunk); - for (let i = 0; i < newChunks.length; i++) { - this._chunks.add(newChunks[i]); + apply(compiler) { + const resourceRegExp = this.resourceRegExp; + const newResource = this.newResource; + compiler.hooks.normalModuleFactory.tap( + "NormalModuleReplacementPlugin", + nmf => { + nmf.hooks.beforeResolve.tap("NormalModuleReplacementPlugin", result => { + if (!result) return; + if (resourceRegExp.test(result.request)) { + if (typeof newResource === "function") { + newResource(result); + } else { + result.request = newResource; + } + } + return result; + }); + nmf.hooks.afterResolve.tap("NormalModuleReplacementPlugin", result => { + if (!result) return; + if (resourceRegExp.test(result.resource)) { + if (typeof newResource === "function") { + newResource(result); + } else { + result.resource = path.resolve( + path.dirname(result.resource), + newResource + ); + } + } + return result; + }); } - } + ); } } -module.exports = ModuleReason; +module.exports = NormalModuleReplacementPlugin; /***/ }), -/***/ 75100: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 40438: +/***/ (function(module) { "use strict"; /* @@ -65728,99 +64269,18 @@ module.exports = ModuleReason; */ -const { Tapable, SyncWaterfallHook, SyncHook } = __webpack_require__(92402); - -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("./Module")} Module */ - -module.exports = class ModuleTemplate extends Tapable { - constructor(runtimeTemplate, type) { - super(); - this.runtimeTemplate = runtimeTemplate; - this.type = type; - this.hooks = { - content: new SyncWaterfallHook([ - "source", - "module", - "options", - "dependencyTemplates" - ]), - module: new SyncWaterfallHook([ - "source", - "module", - "options", - "dependencyTemplates" - ]), - render: new SyncWaterfallHook([ - "source", - "module", - "options", - "dependencyTemplates" - ]), - package: new SyncWaterfallHook([ - "source", - "module", - "options", - "dependencyTemplates" - ]), - hash: new SyncHook(["hash"]) - }; - } - - /** - * @param {Module} module the module - * @param {TODO} dependencyTemplates templates for dependencies - * @param {TODO} options render options - * @returns {Source} the source - */ - render(module, dependencyTemplates, options) { - try { - const moduleSource = module.source( - dependencyTemplates, - this.runtimeTemplate, - this.type - ); - const moduleSourcePostContent = this.hooks.content.call( - moduleSource, - module, - options, - dependencyTemplates - ); - const moduleSourcePostModule = this.hooks.module.call( - moduleSourcePostContent, - module, - options, - dependencyTemplates - ); - const moduleSourcePostRender = this.hooks.render.call( - moduleSourcePostModule, - module, - options, - dependencyTemplates - ); - return this.hooks.package.call( - moduleSourcePostRender, - module, - options, - dependencyTemplates - ); - } catch (e) { - e.message = `${module.identifier()}\n${e.message}`; - throw e; - } - } - - updateHash(hash) { - hash.update("1"); - this.hooks.hash.call(hash); - } -}; +class NullFactory { + create(data, callback) { + return callback(); + } +} +module.exports = NullFactory; /***/ }), -/***/ 6372: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 4428: +/***/ (function(module) { "use strict"; /* @@ -65829,42 +64289,16 @@ module.exports = class ModuleTemplate extends Tapable { */ -const WebpackError = __webpack_require__(97391); -const { cleanUp } = __webpack_require__(80140); - -class ModuleWarning extends WebpackError { - constructor(module, warning, { from = null } = {}) { - let message = "Module Warning"; - if (from) { - message += ` (from ${from}):\n`; - } else { - message += ": "; - } - if (warning && typeof warning === "object" && warning.message) { - message += warning.message; - } else if (warning) { - message += warning; - } - super(message); - this.name = "ModuleWarning"; - this.module = module; - this.warning = warning; - this.details = - warning && typeof warning === "object" && warning.stack - ? cleanUp(warning.stack, this.message) - : undefined; - - Error.captureStackTrace(this, this.constructor); - } +class OptionsApply { + process(options, compiler) {} } - -module.exports = ModuleWarning; +module.exports = OptionsApply; /***/ }), -/***/ 10238: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 3414: +/***/ (function(module) { "use strict"; /* @@ -65873,295 +64307,146 @@ module.exports = ModuleWarning; */ -const { Tapable, SyncHook, MultiHook } = __webpack_require__(92402); -const asyncLib = __webpack_require__(36386); -const MultiWatching = __webpack_require__(66624); -const MultiStats = __webpack_require__(55144); -const ConcurrentCompilationError = __webpack_require__(18933); - -module.exports = class MultiCompiler extends Tapable { - constructor(compilers) { - super(); - this.hooks = { - done: new SyncHook(["stats"]), - invalid: new MultiHook(compilers.map(c => c.hooks.invalid)), - run: new MultiHook(compilers.map(c => c.hooks.run)), - watchClose: new SyncHook([]), - watchRun: new MultiHook(compilers.map(c => c.hooks.watchRun)), - infrastructureLog: new MultiHook( - compilers.map(c => c.hooks.infrastructureLog) - ) - }; - if (!Array.isArray(compilers)) { - compilers = Object.keys(compilers).map(name => { - compilers[name].name = name; - return compilers[name]; - }); - } - this.compilers = compilers; - let doneCompilers = 0; - let compilerStats = []; - let index = 0; - for (const compiler of this.compilers) { - let compilerDone = false; - const compilerIndex = index++; - // eslint-disable-next-line no-loop-func - compiler.hooks.done.tap("MultiCompiler", stats => { - if (!compilerDone) { - compilerDone = true; - doneCompilers++; - } - compilerStats[compilerIndex] = stats; - if (doneCompilers === this.compilers.length) { - this.hooks.done.call(new MultiStats(compilerStats)); - } - }); - // eslint-disable-next-line no-loop-func - compiler.hooks.invalid.tap("MultiCompiler", () => { - if (compilerDone) { - compilerDone = false; - doneCompilers--; - } - }); - } - this.running = false; - } - - get outputPath() { - let commonPath = this.compilers[0].outputPath; - for (const compiler of this.compilers) { - while ( - compiler.outputPath.indexOf(commonPath) !== 0 && - /[/\\]/.test(commonPath) - ) { - commonPath = commonPath.replace(/[/\\][^/\\]*$/, ""); - } - } - - if (!commonPath && this.compilers[0].outputPath[0] === "/") return "/"; - return commonPath; - } - - get inputFileSystem() { - throw new Error("Cannot read inputFileSystem of a MultiCompiler"); - } - - get outputFileSystem() { - throw new Error("Cannot read outputFileSystem of a MultiCompiler"); +/** + * Gets the value at path of object + * @param {object} obj object to query + * @param {string} path query path + * @returns {any} - if {@param path} requests element from array, then `undefined` will be returned + */ +const getProperty = (obj, path) => { + let name = path.split("."); + for (let i = 0; i < name.length - 1; i++) { + obj = obj[name[i]]; + if (typeof obj !== "object" || !obj || Array.isArray(obj)) return; } + return obj[name.pop()]; +}; - set inputFileSystem(value) { - for (const compiler of this.compilers) { - compiler.inputFileSystem = value; - } +/** + * Sets the value at path of object. Stops execution, if {@param path} requests element from array to be set + * @param {object} obj object to query + * @param {string} path query path + * @param {any} value value to be set + * @returns {void} + */ +const setProperty = (obj, path, value) => { + let name = path.split("."); + for (let i = 0; i < name.length - 1; i++) { + if (typeof obj[name[i]] !== "object" && obj[name[i]] !== undefined) return; + if (Array.isArray(obj[name[i]])) return; + if (!obj[name[i]]) obj[name[i]] = {}; + obj = obj[name[i]]; } + obj[name.pop()] = value; +}; - set outputFileSystem(value) { - for (const compiler of this.compilers) { - compiler.outputFileSystem = value; - } - } +/** + * @typedef {'call' | 'make' | 'append'} ConfigType + */ +/** + * @typedef {(options: object) => any} MakeConfigHandler + */ +/** + * @typedef {(value: any, options: object) => any} CallConfigHandler + */ +/** + * @typedef {any[]} AppendConfigValues + */ - getInfrastructureLogger(name) { - return this.compilers[0].getInfrastructureLogger(name); +class OptionsDefaulter { + constructor() { + /** + * Stores default options settings or functions for computing them + */ + this.defaults = {}; + /** + * Stores configuration for options + * @type {{[key: string]: ConfigType}} + */ + this.config = {}; } - validateDependencies(callback) { - const edges = new Set(); - const missing = []; - const targetFound = compiler => { - for (const edge of edges) { - if (edge.target === compiler) { - return true; - } - } - return false; - }; - const sortEdges = (e1, e2) => { - return ( - e1.source.name.localeCompare(e2.source.name) || - e1.target.name.localeCompare(e2.target.name) - ); - }; - for (const source of this.compilers) { - if (source.dependencies) { - for (const dep of source.dependencies) { - const target = this.compilers.find(c => c.name === dep); - if (!target) { - missing.push(dep); - } else { - edges.add({ - source, - target - }); + /** + * Enhancing {@param options} with default values + * @param {object} options provided options + * @returns {object} - enhanced options + * @throws {Error} - will throw error, if configuration value is other then `undefined` or {@link ConfigType} + */ + process(options) { + options = Object.assign({}, options); + for (let name in this.defaults) { + switch (this.config[name]) { + /** + * If {@link ConfigType} doesn't specified and current value is `undefined`, then default value will be assigned + */ + case undefined: + if (getProperty(options, name) === undefined) { + setProperty(options, name, this.defaults[name]); } - } - } - } - const errors = missing.map(m => `Compiler dependency \`${m}\` not found.`); - const stack = this.compilers.filter(c => !targetFound(c)); - while (stack.length > 0) { - const current = stack.pop(); - for (const edge of edges) { - if (edge.source === current) { - edges.delete(edge); - const target = edge.target; - if (!targetFound(target)) { - stack.push(target); + break; + /** + * Assign result of {@link CallConfigHandler} + */ + case "call": + setProperty( + options, + name, + this.defaults[name].call(this, getProperty(options, name), options) + ); + break; + /** + * Assign result of {@link MakeConfigHandler}, if current value is `undefined` + */ + case "make": + if (getProperty(options, name) === undefined) { + setProperty(options, name, this.defaults[name].call(this, options)); } + break; + /** + * Adding {@link AppendConfigValues} at the end of the current array + */ + case "append": { + let oldValue = getProperty(options, name); + if (!Array.isArray(oldValue)) { + oldValue = []; + } + oldValue.push(...this.defaults[name]); + setProperty(options, name, oldValue); + break; } - } - } - if (edges.size > 0) { - const lines = Array.from(edges) - .sort(sortEdges) - .map(edge => `${edge.source.name} -> ${edge.target.name}`); - lines.unshift("Circular dependency found in compiler dependencies."); - errors.unshift(lines.join("\n")); - } - if (errors.length > 0) { - const message = errors.join("\n"); - callback(new Error(message)); - return false; - } - return true; - } - - runWithDependencies(compilers, fn, callback) { - const fulfilledNames = new Set(); - let remainingCompilers = compilers; - const isDependencyFulfilled = d => fulfilledNames.has(d); - const getReadyCompilers = () => { - let readyCompilers = []; - let list = remainingCompilers; - remainingCompilers = []; - for (const c of list) { - const ready = - !c.dependencies || c.dependencies.every(isDependencyFulfilled); - if (ready) { - readyCompilers.push(c); - } else { - remainingCompilers.push(c); - } - } - return readyCompilers; - }; - const runCompilers = callback => { - if (remainingCompilers.length === 0) return callback(); - asyncLib.map( - getReadyCompilers(), - (compiler, callback) => { - fn(compiler, err => { - if (err) return callback(err); - fulfilledNames.add(compiler.name); - runCompilers(callback); - }); - }, - callback - ); - }; - runCompilers(callback); - } - - watch(watchOptions, handler) { - if (this.running) return handler(new ConcurrentCompilationError()); - - let watchings = []; - let allStats = this.compilers.map(() => null); - let compilerStatus = this.compilers.map(() => false); - if (this.validateDependencies(handler)) { - this.running = true; - this.runWithDependencies( - this.compilers, - (compiler, callback) => { - const compilerIdx = this.compilers.indexOf(compiler); - let firstRun = true; - let watching = compiler.watch( - Array.isArray(watchOptions) - ? watchOptions[compilerIdx] - : watchOptions, - (err, stats) => { - if (err) handler(err); - if (stats) { - allStats[compilerIdx] = stats; - compilerStatus[compilerIdx] = "new"; - if (compilerStatus.every(Boolean)) { - const freshStats = allStats.filter((s, idx) => { - return compilerStatus[idx] === "new"; - }); - compilerStatus.fill(true); - const multiStats = new MultiStats(freshStats); - handler(null, multiStats); - } - } - if (firstRun && !err) { - firstRun = false; - callback(); - } - } + default: + throw new Error( + "OptionsDefaulter cannot process " + this.config[name] ); - watchings.push(watching); - }, - () => { - // ignore - } - ); - } - - return new MultiWatching(watchings, this); - } - - run(callback) { - if (this.running) { - return callback(new ConcurrentCompilationError()); - } - - const finalCallback = (err, stats) => { - this.running = false; - - if (callback !== undefined) { - return callback(err, stats); } - }; - - const allStats = this.compilers.map(() => null); - if (this.validateDependencies(callback)) { - this.running = true; - this.runWithDependencies( - this.compilers, - (compiler, callback) => { - const compilerIdx = this.compilers.indexOf(compiler); - compiler.run((err, stats) => { - if (err) { - return callback(err); - } - allStats[compilerIdx] = stats; - callback(); - }); - }, - err => { - if (err) { - return finalCallback(err); - } - finalCallback(null, new MultiStats(allStats)); - } - ); } + return options; } - purgeInputFileSystem() { - for (const compiler of this.compilers) { - if (compiler.inputFileSystem && compiler.inputFileSystem.purge) { - compiler.inputFileSystem.purge(); - } + /** + * Builds up default values + * @param {string} name option path + * @param {ConfigType | any} config if {@param def} is provided, then only {@link ConfigType} is allowed + * @param {MakeConfigHandler | CallConfigHandler | AppendConfigValues} [def] defaults + * @returns {void} + */ + set(name, config, def) { + if (def !== undefined) { + this.defaults[name] = def; + this.config[name] = config; + } else { + this.defaults[name] = config; + delete this.config[name]; } } -}; +} + +module.exports = OptionsDefaulter; /***/ }), -/***/ 98046: +/***/ 70558: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -66171,2030 +64456,2460 @@ module.exports = class MultiCompiler extends Tapable { */ -const MultiEntryDependency = __webpack_require__(7791); -const SingleEntryDependency = __webpack_require__(84828); -const MultiModuleFactory = __webpack_require__(24005); +// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API -/** @typedef {import("./Compiler")} Compiler */ +const acorn = __webpack_require__(77087); +const { Tapable, SyncBailHook, HookMap } = __webpack_require__(92402); +const util = __webpack_require__(31669); +const vm = __webpack_require__(92184); +const BasicEvaluatedExpression = __webpack_require__(96770); +const StackedSetMap = __webpack_require__(92251); -class MultiEntryPlugin { - /** - * The MultiEntryPlugin is invoked whenever this.options.entry value is an array of paths - * @param {string} context context path - * @param {string[]} entries array of entry paths - * @param {string} name entry key name - */ - constructor(context, entries, name) { - this.context = context; - this.entries = entries; - this.name = name; - } - - /** - * @param {Compiler} compiler the compiler instance - * @returns {void} - */ - apply(compiler) { - compiler.hooks.compilation.tap( - "MultiEntryPlugin", - (compilation, { normalModuleFactory }) => { - const multiModuleFactory = new MultiModuleFactory(); - - compilation.dependencyFactories.set( - MultiEntryDependency, - multiModuleFactory - ); - compilation.dependencyFactories.set( - SingleEntryDependency, - normalModuleFactory - ); - } - ); - - compiler.hooks.make.tapAsync( - "MultiEntryPlugin", - (compilation, callback) => { - const { context, entries, name } = this; - - const dep = MultiEntryPlugin.createDependency(entries, name); - compilation.addEntry(context, dep, name, callback); - } - ); - } - - /** - * @param {string[]} entries each entry path string - * @param {string} name name of the entry - * @returns {MultiEntryDependency} returns a constructed Dependency - */ - static createDependency(entries, name) { - return new MultiEntryDependency( - entries.map((e, idx) => { - const dep = new SingleEntryDependency(e); - // Because entrypoints are not dependencies found in an - // existing module, we give it a synthetic id - dep.loc = { - name, - index: idx - }; - return dep; - }), - name - ); - } -} - -module.exports = MultiEntryPlugin; - - -/***/ }), - -/***/ 4198: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const Module = __webpack_require__(75993); -const Template = __webpack_require__(96066); -const { RawSource } = __webpack_require__(53665); - -/** @typedef {import("./util/createHash").Hash} Hash */ - -class MultiModule extends Module { - constructor(context, dependencies, name) { - super("javascript/dynamic", context); - - // Info from Factory - this.dependencies = dependencies; - this.name = name; - this._identifier = `multi ${this.dependencies - .map(d => d.request) - .join(" ")}`; - } - - identifier() { - return this._identifier; - } - - readableIdentifier(requestShortener) { - return `multi ${this.dependencies - .map(d => requestShortener.shorten(d.request)) - .join(" ")}`; - } - - build(options, compilation, resolver, fs, callback) { - this.built = true; - this.buildMeta = {}; - this.buildInfo = {}; - return callback(); - } - - needRebuild() { - return false; - } - - size() { - return 16 + this.dependencies.length * 12; - } - - /** - * @param {Hash} hash the hash used to track dependencies - * @returns {void} - */ - updateHash(hash) { - hash.update("multi module"); - hash.update(this.name || ""); - super.updateHash(hash); - } - - source(dependencyTemplates, runtimeTemplate) { - const str = []; - let idx = 0; - for (const dep of this.dependencies) { - if (dep.module) { - if (idx === this.dependencies.length - 1) { - str.push("module.exports = "); - } - str.push("__webpack_require__("); - if (runtimeTemplate.outputOptions.pathinfo) { - str.push(Template.toComment(dep.request)); - } - str.push(`${JSON.stringify(dep.module.id)}`); - str.push(")"); - } else { - const content = __webpack_require__(75386).module( - dep.request - ); - str.push(content); - } - str.push(";\n"); - idx++; - } - return new RawSource(str.join("")); - } -} - -module.exports = MultiModule; - - -/***/ }), - -/***/ 24005: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const { Tapable } = __webpack_require__(92402); -const MultiModule = __webpack_require__(4198); - -module.exports = class MultiModuleFactory extends Tapable { - constructor() { - super(); - this.hooks = {}; - } +const acornParser = acorn.Parser; - create(data, callback) { - const dependency = data.dependencies[0]; - callback( - null, - new MultiModule(data.context, dependency.dependencies, dependency.name) - ); - } +const joinRanges = (startRange, endRange) => { + if (!endRange) return startRange; + if (!startRange) return endRange; + return [startRange[0], endRange[1]]; }; +const defaultParserOptions = { + ranges: true, + locations: true, + ecmaVersion: 11, + sourceType: "module", + onComment: null +}; -/***/ }), - -/***/ 55144: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const Stats = __webpack_require__(99977); - -const optionOrFallback = (optionValue, fallbackValue) => - optionValue !== undefined ? optionValue : fallbackValue; - -class MultiStats { - constructor(stats) { - this.stats = stats; - this.hash = stats.map(stat => stat.hash).join(""); - } - - hasErrors() { - return this.stats - .map(stat => stat.hasErrors()) - .reduce((a, b) => a || b, false); - } +// regexp to match at least one "magic comment" +const webpackCommentRegExp = new RegExp(/(^|\W)webpack[A-Z]{1,}[A-Za-z]{1,}:/); - hasWarnings() { - return this.stats - .map(stat => stat.hasWarnings()) - .reduce((a, b) => a || b, false); - } +const EMPTY_COMMENT_OPTIONS = { + options: null, + errors: null +}; - toJson(options, forToString) { - if (typeof options === "boolean" || typeof options === "string") { - options = Stats.presetToOptions(options); - } else if (!options) { - options = {}; - } - const jsons = this.stats.map((stat, idx) => { - const childOptions = Stats.getChildOptions(options, idx); - const obj = stat.toJson(childOptions, forToString); - obj.name = stat.compilation && stat.compilation.name; - return obj; - }); - const showVersion = - options.version === undefined - ? jsons.every(j => j.version) - : options.version !== false; - const showHash = - options.hash === undefined - ? jsons.every(j => j.hash) - : options.hash !== false; - if (showVersion) { - for (const j of jsons) { - delete j.version; - } - } - const obj = { - errors: jsons.reduce((arr, j) => { - return arr.concat( - j.errors.map(msg => { - return `(${j.name}) ${msg}`; - }) - ); - }, []), - warnings: jsons.reduce((arr, j) => { - return arr.concat( - j.warnings.map(msg => { - return `(${j.name}) ${msg}`; - }) - ); - }, []) +class Parser extends Tapable { + constructor(options, sourceType = "auto") { + super(); + this.hooks = { + evaluateTypeof: new HookMap(() => new SyncBailHook(["expression"])), + evaluate: new HookMap(() => new SyncBailHook(["expression"])), + evaluateIdentifier: new HookMap(() => new SyncBailHook(["expression"])), + evaluateDefinedIdentifier: new HookMap( + () => new SyncBailHook(["expression"]) + ), + evaluateCallExpressionMember: new HookMap( + () => new SyncBailHook(["expression", "param"]) + ), + statement: new SyncBailHook(["statement"]), + statementIf: new SyncBailHook(["statement"]), + label: new HookMap(() => new SyncBailHook(["statement"])), + import: new SyncBailHook(["statement", "source"]), + importSpecifier: new SyncBailHook([ + "statement", + "source", + "exportName", + "identifierName" + ]), + export: new SyncBailHook(["statement"]), + exportImport: new SyncBailHook(["statement", "source"]), + exportDeclaration: new SyncBailHook(["statement", "declaration"]), + exportExpression: new SyncBailHook(["statement", "declaration"]), + exportSpecifier: new SyncBailHook([ + "statement", + "identifierName", + "exportName", + "index" + ]), + exportImportSpecifier: new SyncBailHook([ + "statement", + "source", + "identifierName", + "exportName", + "index" + ]), + varDeclaration: new HookMap(() => new SyncBailHook(["declaration"])), + varDeclarationLet: new HookMap(() => new SyncBailHook(["declaration"])), + varDeclarationConst: new HookMap(() => new SyncBailHook(["declaration"])), + varDeclarationVar: new HookMap(() => new SyncBailHook(["declaration"])), + canRename: new HookMap(() => new SyncBailHook(["initExpression"])), + rename: new HookMap(() => new SyncBailHook(["initExpression"])), + assigned: new HookMap(() => new SyncBailHook(["expression"])), + assign: new HookMap(() => new SyncBailHook(["expression"])), + typeof: new HookMap(() => new SyncBailHook(["expression"])), + importCall: new SyncBailHook(["expression"]), + call: new HookMap(() => new SyncBailHook(["expression"])), + callAnyMember: new HookMap(() => new SyncBailHook(["expression"])), + new: new HookMap(() => new SyncBailHook(["expression"])), + expression: new HookMap(() => new SyncBailHook(["expression"])), + expressionAnyMember: new HookMap(() => new SyncBailHook(["expression"])), + expressionConditionalOperator: new SyncBailHook(["expression"]), + expressionLogicalOperator: new SyncBailHook(["expression"]), + program: new SyncBailHook(["ast", "comments"]) }; - if (showVersion) obj.version = __webpack_require__(71618)/* .version */ .i8; - if (showHash) obj.hash = this.hash; - if (options.children !== false) obj.children = jsons; - return obj; - } - - toString(options) { - if (typeof options === "boolean" || typeof options === "string") { - options = Stats.presetToOptions(options); - } else if (!options) { - options = {}; - } - - const useColors = optionOrFallback(options.colors, false); - - const obj = this.toJson(options, true); - - return Stats.jsonToString(obj, useColors); - } -} - -module.exports = MultiStats; - - -/***/ }), - -/***/ 66624: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const asyncLib = __webpack_require__(36386); - -class MultiWatching { - constructor(watchings, compiler) { - this.watchings = watchings; - this.compiler = compiler; - } - - invalidate() { - for (const watching of this.watchings) { - watching.invalidate(); - } - } - - suspend() { - for (const watching of this.watchings) { - watching.suspend(); - } - } - - resume() { - for (const watching of this.watchings) { - watching.resume(); - } - } - - close(callback) { - asyncLib.forEach( - this.watchings, - (watching, finishedCallback) => { - watching.close(finishedCallback); - }, - err => { - this.compiler.hooks.watchClose.call(); - if (typeof callback === "function") { - this.compiler.running = false; - callback(err); - } - } - ); - } -} - -module.exports = MultiWatching; - - -/***/ }), - -/***/ 70419: -/***/ (function(module) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -class NamedChunksPlugin { - static defaultNameResolver(chunk) { - return chunk.name || null; - } - - constructor(nameResolver) { - this.nameResolver = nameResolver || NamedChunksPlugin.defaultNameResolver; - } - - apply(compiler) { - compiler.hooks.compilation.tap("NamedChunksPlugin", compilation => { - compilation.hooks.beforeChunkIds.tap("NamedChunksPlugin", chunks => { - for (const chunk of chunks) { - if (chunk.id === null) { - chunk.id = this.nameResolver(chunk); + const HOOK_MAP_COMPAT_CONFIG = { + evaluateTypeof: /^evaluate typeof (.+)$/, + evaluateIdentifier: /^evaluate Identifier (.+)$/, + evaluateDefinedIdentifier: /^evaluate defined Identifier (.+)$/, + evaluateCallExpressionMember: /^evaluate CallExpression .(.+)$/, + evaluate: /^evaluate (.+)$/, + label: /^label (.+)$/, + varDeclarationLet: /^var-let (.+)$/, + varDeclarationConst: /^var-const (.+)$/, + varDeclarationVar: /^var-var (.+)$/, + varDeclaration: /^var (.+)$/, + canRename: /^can-rename (.+)$/, + rename: /^rename (.+)$/, + typeof: /^typeof (.+)$/, + assigned: /^assigned (.+)$/, + assign: /^assign (.+)$/, + callAnyMember: /^call (.+)\.\*$/, + call: /^call (.+)$/, + new: /^new (.+)$/, + expressionConditionalOperator: /^expression \?:$/, + expressionAnyMember: /^expression (.+)\.\*$/, + expression: /^expression (.+)$/ + }; + this._pluginCompat.tap("Parser", options => { + for (const name of Object.keys(HOOK_MAP_COMPAT_CONFIG)) { + const regexp = HOOK_MAP_COMPAT_CONFIG[name]; + const match = regexp.exec(options.name); + if (match) { + if (match[1]) { + this.hooks[name].tap( + match[1], + options.fn.name || "unnamed compat plugin", + options.fn.bind(this) + ); + } else { + this.hooks[name].tap( + options.fn.name || "unnamed compat plugin", + options.fn.bind(this) + ); } + return true; } - }); + } }); + this.options = options; + this.sourceType = sourceType; + this.scope = undefined; + this.state = undefined; + this.comments = undefined; + this.initializeEvaluating(); } -} - -module.exports = NamedChunksPlugin; - - -/***/ }), - -/***/ 86707: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const createHash = __webpack_require__(15660); -const RequestShortener = __webpack_require__(54254); - -const getHash = str => { - const hash = createHash("md4"); - hash.update(str); - const digest = /** @type {string} */ (hash.digest("hex")); - return digest.substr(0, 4); -}; -class NamedModulesPlugin { - constructor(options) { - this.options = options || {}; - } - - apply(compiler) { - compiler.hooks.compilation.tap("NamedModulesPlugin", compilation => { - compilation.hooks.beforeModuleIds.tap("NamedModulesPlugin", modules => { - const namedModules = new Map(); - const context = this.options.context || compiler.options.context; - - for (const module of modules) { - if (module.id === null && module.libIdent) { - module.id = module.libIdent({ context }); + initializeEvaluating() { + this.hooks.evaluate.for("Literal").tap("Parser", expr => { + switch (typeof expr.value) { + case "number": + return new BasicEvaluatedExpression() + .setNumber(expr.value) + .setRange(expr.range); + case "string": + return new BasicEvaluatedExpression() + .setString(expr.value) + .setRange(expr.range); + case "boolean": + return new BasicEvaluatedExpression() + .setBoolean(expr.value) + .setRange(expr.range); + } + if (expr.value === null) { + return new BasicEvaluatedExpression().setNull().setRange(expr.range); + } + if (expr.value instanceof RegExp) { + return new BasicEvaluatedExpression() + .setRegExp(expr.value) + .setRange(expr.range); + } + }); + this.hooks.evaluate.for("LogicalExpression").tap("Parser", expr => { + let left; + let leftAsBool; + let right; + if (expr.operator === "&&") { + left = this.evaluateExpression(expr.left); + leftAsBool = left && left.asBool(); + if (leftAsBool === false) return left.setRange(expr.range); + if (leftAsBool !== true) return; + right = this.evaluateExpression(expr.right); + return right.setRange(expr.range); + } else if (expr.operator === "||") { + left = this.evaluateExpression(expr.left); + leftAsBool = left && left.asBool(); + if (leftAsBool === true) return left.setRange(expr.range); + if (leftAsBool !== false) return; + right = this.evaluateExpression(expr.right); + return right.setRange(expr.range); + } + }); + this.hooks.evaluate.for("BinaryExpression").tap("Parser", expr => { + let left; + let right; + let res; + if (expr.operator === "+") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + res = new BasicEvaluatedExpression(); + if (left.isString()) { + if (right.isString()) { + res.setString(left.string + right.string); + } else if (right.isNumber()) { + res.setString(left.string + right.number); + } else if ( + right.isWrapped() && + right.prefix && + right.prefix.isString() + ) { + // "left" + ("prefix" + inner + "postfix") + // => ("leftprefix" + inner + "postfix") + res.setWrapped( + new BasicEvaluatedExpression() + .setString(left.string + right.prefix.string) + .setRange(joinRanges(left.range, right.prefix.range)), + right.postfix, + right.wrappedInnerExpressions + ); + } else if (right.isWrapped()) { + // "left" + ([null] + inner + "postfix") + // => ("left" + inner + "postfix") + res.setWrapped(left, right.postfix, right.wrappedInnerExpressions); + } else { + // "left" + expr + // => ("left" + expr + "") + res.setWrapped(left, null, [right]); } - - if (module.id !== null) { - const namedModule = namedModules.get(module.id); - if (namedModule !== undefined) { - namedModule.push(module); - } else { - namedModules.set(module.id, [module]); + } else if (left.isNumber()) { + if (right.isString()) { + res.setString(left.number + right.string); + } else if (right.isNumber()) { + res.setNumber(left.number + right.number); + } else { + return; + } + } else if (left.isWrapped()) { + if (left.postfix && left.postfix.isString() && right.isString()) { + // ("prefix" + inner + "postfix") + "right" + // => ("prefix" + inner + "postfixright") + res.setWrapped( + left.prefix, + new BasicEvaluatedExpression() + .setString(left.postfix.string + right.string) + .setRange(joinRanges(left.postfix.range, right.range)), + left.wrappedInnerExpressions + ); + } else if ( + left.postfix && + left.postfix.isString() && + right.isNumber() + ) { + // ("prefix" + inner + "postfix") + 123 + // => ("prefix" + inner + "postfix123") + res.setWrapped( + left.prefix, + new BasicEvaluatedExpression() + .setString(left.postfix.string + right.number) + .setRange(joinRanges(left.postfix.range, right.range)), + left.wrappedInnerExpressions + ); + } else if (right.isString()) { + // ("prefix" + inner + [null]) + "right" + // => ("prefix" + inner + "right") + res.setWrapped(left.prefix, right, left.wrappedInnerExpressions); + } else if (right.isNumber()) { + // ("prefix" + inner + [null]) + 123 + // => ("prefix" + inner + "123") + res.setWrapped( + left.prefix, + new BasicEvaluatedExpression() + .setString(right.number + "") + .setRange(right.range), + left.wrappedInnerExpressions + ); + } else if (right.isWrapped()) { + // ("prefix1" + inner1 + "postfix1") + ("prefix2" + inner2 + "postfix2") + // ("prefix1" + inner1 + "postfix1" + "prefix2" + inner2 + "postfix2") + res.setWrapped( + left.prefix, + right.postfix, + left.wrappedInnerExpressions && + right.wrappedInnerExpressions && + left.wrappedInnerExpressions + .concat(left.postfix ? [left.postfix] : []) + .concat(right.prefix ? [right.prefix] : []) + .concat(right.wrappedInnerExpressions) + ); + } else { + // ("prefix" + inner + postfix) + expr + // => ("prefix" + inner + postfix + expr + [null]) + res.setWrapped( + left.prefix, + null, + left.wrappedInnerExpressions && + left.wrappedInnerExpressions.concat( + left.postfix ? [left.postfix, right] : [right] + ) + ); + } + } else { + if (right.isString()) { + // left + "right" + // => ([null] + left + "right") + res.setWrapped(null, right, [left]); + } else if (right.isWrapped()) { + // left + (prefix + inner + "postfix") + // => ([null] + left + prefix + inner + "postfix") + res.setWrapped( + null, + right.postfix, + right.wrappedInnerExpressions && + (right.prefix ? [left, right.prefix] : [left]).concat( + right.wrappedInnerExpressions + ) + ); + } else { + return; + } + } + res.setRange(expr.range); + return res; + } else if (expr.operator === "-") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number - right.number); + res.setRange(expr.range); + return res; + } else if (expr.operator === "*") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number * right.number); + res.setRange(expr.range); + return res; + } else if (expr.operator === "/") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number / right.number); + res.setRange(expr.range); + return res; + } else if (expr.operator === "**") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(Math.pow(left.number, right.number)); + res.setRange(expr.range); + return res; + } else if (expr.operator === "==" || expr.operator === "===") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + res = new BasicEvaluatedExpression(); + res.setRange(expr.range); + if (left.isString() && right.isString()) { + return res.setBoolean(left.string === right.string); + } else if (left.isNumber() && right.isNumber()) { + return res.setBoolean(left.number === right.number); + } else if (left.isBoolean() && right.isBoolean()) { + return res.setBoolean(left.bool === right.bool); + } + } else if (expr.operator === "!=" || expr.operator === "!==") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + res = new BasicEvaluatedExpression(); + res.setRange(expr.range); + if (left.isString() && right.isString()) { + return res.setBoolean(left.string !== right.string); + } else if (left.isNumber() && right.isNumber()) { + return res.setBoolean(left.number !== right.number); + } else if (left.isBoolean() && right.isBoolean()) { + return res.setBoolean(left.bool !== right.bool); + } + } else if (expr.operator === "&") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number & right.number); + res.setRange(expr.range); + return res; + } else if (expr.operator === "|") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number | right.number); + res.setRange(expr.range); + return res; + } else if (expr.operator === "^") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number ^ right.number); + res.setRange(expr.range); + return res; + } else if (expr.operator === ">>>") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number >>> right.number); + res.setRange(expr.range); + return res; + } else if (expr.operator === ">>") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number >> right.number); + res.setRange(expr.range); + return res; + } else if (expr.operator === "<<") { + left = this.evaluateExpression(expr.left); + right = this.evaluateExpression(expr.right); + if (!left || !right) return; + if (!left.isNumber() || !right.isNumber()) return; + res = new BasicEvaluatedExpression(); + res.setNumber(left.number << right.number); + res.setRange(expr.range); + return res; + } + }); + this.hooks.evaluate.for("UnaryExpression").tap("Parser", expr => { + if (expr.operator === "typeof") { + let res; + let name; + if (expr.argument.type === "Identifier") { + name = + this.scope.renames.get(expr.argument.name) || expr.argument.name; + if (!this.scope.definitions.has(name)) { + const hook = this.hooks.evaluateTypeof.get(name); + if (hook !== undefined) { + res = hook.call(expr); + if (res !== undefined) return res; } } } - - for (const namedModule of namedModules.values()) { - if (namedModule.length > 1) { - for (const module of namedModule) { - const requestShortener = new RequestShortener(context); - module.id = `${module.id}?${getHash( - requestShortener.shorten(module.identifier()) - )}`; + if (expr.argument.type === "MemberExpression") { + const exprName = this.getNameForExpression(expr.argument); + if (exprName && exprName.free) { + const hook = this.hooks.evaluateTypeof.get(exprName.name); + if (hook !== undefined) { + res = hook.call(expr); + if (res !== undefined) return res; } } } - }); + if (expr.argument.type === "FunctionExpression") { + return new BasicEvaluatedExpression() + .setString("function") + .setRange(expr.range); + } + const arg = this.evaluateExpression(expr.argument); + if (arg.isString() || arg.isWrapped()) { + return new BasicEvaluatedExpression() + .setString("string") + .setRange(expr.range); + } + if (arg.isNumber()) { + return new BasicEvaluatedExpression() + .setString("number") + .setRange(expr.range); + } + if (arg.isBoolean()) { + return new BasicEvaluatedExpression() + .setString("boolean") + .setRange(expr.range); + } + if (arg.isArray() || arg.isConstArray() || arg.isRegExp()) { + return new BasicEvaluatedExpression() + .setString("object") + .setRange(expr.range); + } + } else if (expr.operator === "!") { + const argument = this.evaluateExpression(expr.argument); + if (!argument) return; + if (argument.isBoolean()) { + return new BasicEvaluatedExpression() + .setBoolean(!argument.bool) + .setRange(expr.range); + } + if (argument.isTruthy()) { + return new BasicEvaluatedExpression() + .setBoolean(false) + .setRange(expr.range); + } + if (argument.isFalsy()) { + return new BasicEvaluatedExpression() + .setBoolean(true) + .setRange(expr.range); + } + if (argument.isString()) { + return new BasicEvaluatedExpression() + .setBoolean(!argument.string) + .setRange(expr.range); + } + if (argument.isNumber()) { + return new BasicEvaluatedExpression() + .setBoolean(!argument.number) + .setRange(expr.range); + } + } else if (expr.operator === "~") { + const argument = this.evaluateExpression(expr.argument); + if (!argument) return; + if (!argument.isNumber()) return; + const res = new BasicEvaluatedExpression(); + res.setNumber(~argument.number); + res.setRange(expr.range); + return res; + } }); - } -} - -module.exports = NamedModulesPlugin; - - -/***/ }), - -/***/ 22615: -/***/ (function(module) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -class NoEmitOnErrorsPlugin { - apply(compiler) { - compiler.hooks.shouldEmit.tap("NoEmitOnErrorsPlugin", compilation => { - if (compilation.getStats().hasErrors()) return false; + this.hooks.evaluateTypeof.for("undefined").tap("Parser", expr => { + return new BasicEvaluatedExpression() + .setString("undefined") + .setRange(expr.range); }); - compiler.hooks.compilation.tap("NoEmitOnErrorsPlugin", compilation => { - compilation.hooks.shouldRecord.tap("NoEmitOnErrorsPlugin", () => { - if (compilation.getStats().hasErrors()) return false; - }); + this.hooks.evaluate.for("Identifier").tap("Parser", expr => { + const name = this.scope.renames.get(expr.name) || expr.name; + if (!this.scope.definitions.has(expr.name)) { + const hook = this.hooks.evaluateIdentifier.get(name); + if (hook !== undefined) { + const result = hook.call(expr); + if (result) return result; + } + return new BasicEvaluatedExpression() + .setIdentifier(name) + .setRange(expr.range); + } else { + const hook = this.hooks.evaluateDefinedIdentifier.get(name); + if (hook !== undefined) { + return hook.call(expr); + } + } }); - } -} - -module.exports = NoEmitOnErrorsPlugin; - - -/***/ }), - -/***/ 45759: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const WebpackError = __webpack_require__(97391); - -module.exports = class NoModeWarning extends WebpackError { - constructor(modules) { - super(); - - this.name = "NoModeWarning"; - this.message = - "configuration\n" + - "The 'mode' option has not been set, webpack will fallback to 'production' for this value. " + - "Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\n" + - "You can also set it to 'none' to disable any default behavior. " + - "Learn more: https://webpack.js.org/configuration/mode/"; - - Error.captureStackTrace(this, this.constructor); - } -}; - - -/***/ }), - -/***/ 28386: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const path = __webpack_require__(85622); -const ParserHelpers = __webpack_require__(23999); -const ConstDependency = __webpack_require__(71101); - -const NullFactory = __webpack_require__(40438); - -class NodeStuffPlugin { - constructor(options) { - this.options = options; - } - - apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap( - "NodeStuffPlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set(ConstDependency, new NullFactory()); - compilation.dependencyTemplates.set( - ConstDependency, - new ConstDependency.Template() - ); - - const handler = (parser, parserOptions) => { - if (parserOptions.node === false) return; - - let localOptions = options; - if (parserOptions.node) { - localOptions = Object.assign({}, localOptions, parserOptions.node); + this.hooks.evaluate.for("ThisExpression").tap("Parser", expr => { + const name = this.scope.renames.get("this"); + if (name) { + const hook = this.hooks.evaluateIdentifier.get(name); + if (hook !== undefined) { + const result = hook.call(expr); + if (result) return result; + } + return new BasicEvaluatedExpression() + .setIdentifier(name) + .setRange(expr.range); + } + }); + this.hooks.evaluate.for("MemberExpression").tap("Parser", expression => { + let exprName = this.getNameForExpression(expression); + if (exprName) { + if (exprName.free) { + const hook = this.hooks.evaluateIdentifier.get(exprName.name); + if (hook !== undefined) { + const result = hook.call(expression); + if (result) return result; } - - const setConstant = (expressionName, value) => { - parser.hooks.expression - .for(expressionName) - .tap("NodeStuffPlugin", () => { - parser.state.current.addVariable( - expressionName, - JSON.stringify(value) - ); - return true; - }); - }; - - const setModuleConstant = (expressionName, fn) => { - parser.hooks.expression - .for(expressionName) - .tap("NodeStuffPlugin", () => { - parser.state.current.addVariable( - expressionName, - JSON.stringify(fn(parser.state.module)) - ); - return true; - }); - }; - const context = compiler.context; - if (localOptions.__filename) { - if (localOptions.__filename === "mock") { - setConstant("__filename", "/index.js"); - } else { - setModuleConstant("__filename", module => - path.relative(context, module.resource) - ); - } - parser.hooks.evaluateIdentifier - .for("__filename") - .tap("NodeStuffPlugin", expr => { - if (!parser.state.module) return; - const resource = parser.state.module.resource; - const i = resource.indexOf("?"); - return ParserHelpers.evaluateToString( - i < 0 ? resource : resource.substr(0, i) - )(expr); - }); + return new BasicEvaluatedExpression() + .setIdentifier(exprName.name) + .setRange(expression.range); + } else { + const hook = this.hooks.evaluateDefinedIdentifier.get(exprName.name); + if (hook !== undefined) { + return hook.call(expression); } - if (localOptions.__dirname) { - if (localOptions.__dirname === "mock") { - setConstant("__dirname", "/"); - } else { - setModuleConstant("__dirname", module => - path.relative(context, module.context) - ); + } + } + }); + this.hooks.evaluate.for("CallExpression").tap("Parser", expr => { + if (expr.callee.type !== "MemberExpression") return; + if ( + expr.callee.property.type !== + (expr.callee.computed ? "Literal" : "Identifier") + ) + return; + const param = this.evaluateExpression(expr.callee.object); + if (!param) return; + const property = expr.callee.property.name || expr.callee.property.value; + const hook = this.hooks.evaluateCallExpressionMember.get(property); + if (hook !== undefined) { + return hook.call(expr, param); + } + }); + this.hooks.evaluateCallExpressionMember + .for("replace") + .tap("Parser", (expr, param) => { + if (!param.isString()) return; + if (expr.arguments.length !== 2) return; + let arg1 = this.evaluateExpression(expr.arguments[0]); + let arg2 = this.evaluateExpression(expr.arguments[1]); + if (!arg1.isString() && !arg1.isRegExp()) return; + arg1 = arg1.regExp || arg1.string; + if (!arg2.isString()) return; + arg2 = arg2.string; + return new BasicEvaluatedExpression() + .setString(param.string.replace(arg1, arg2)) + .setRange(expr.range); + }); + ["substr", "substring"].forEach(fn => { + this.hooks.evaluateCallExpressionMember + .for(fn) + .tap("Parser", (expr, param) => { + if (!param.isString()) return; + let arg1; + let result, + str = param.string; + switch (expr.arguments.length) { + case 1: + arg1 = this.evaluateExpression(expr.arguments[0]); + if (!arg1.isNumber()) return; + result = str[fn](arg1.number); + break; + case 2: { + arg1 = this.evaluateExpression(expr.arguments[0]); + const arg2 = this.evaluateExpression(expr.arguments[1]); + if (!arg1.isNumber()) return; + if (!arg2.isNumber()) return; + result = str[fn](arg1.number, arg2.number); + break; } - parser.hooks.evaluateIdentifier - .for("__dirname") - .tap("NodeStuffPlugin", expr => { - if (!parser.state.module) return; - return ParserHelpers.evaluateToString( - parser.state.module.context - )(expr); - }); + default: + return; } - parser.hooks.expression - .for("require.extensions") - .tap( - "NodeStuffPlugin", - ParserHelpers.expressionIsUnsupported( - parser, - "require.extensions is not supported by webpack. Use a loader instead." - ) - ); - }; - - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("NodeStuffPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("NodeStuffPlugin", handler); - } - ); - } -} -module.exports = NodeStuffPlugin; - - -/***/ }), - -/***/ 25963: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const NativeModule = __webpack_require__(32282); - -const { - CachedSource, - LineToLineMappedSource, - OriginalSource, - RawSource, - SourceMapSource -} = __webpack_require__(53665); -const { getContext, runLoaders } = __webpack_require__(73278); - -const WebpackError = __webpack_require__(97391); -const Module = __webpack_require__(75993); -const ModuleParseError = __webpack_require__(62500); -const ModuleBuildError = __webpack_require__(12072); -const ModuleError = __webpack_require__(82528); -const ModuleWarning = __webpack_require__(6372); -const createHash = __webpack_require__(15660); -const contextify = __webpack_require__(94658).contextify; - -/** @typedef {import("./util/createHash").Hash} Hash */ - -const asString = buf => { - if (Buffer.isBuffer(buf)) { - return buf.toString("utf-8"); - } - return buf; -}; + return new BasicEvaluatedExpression() + .setString(result) + .setRange(expr.range); + }); + }); -const asBuffer = str => { - if (!Buffer.isBuffer(str)) { - return Buffer.from(str, "utf-8"); - } - return str; -}; + /** + * @param {string} kind "cooked" | "raw" + * @param {TODO} templateLiteralExpr TemplateLiteral expr + * @returns {{quasis: BasicEvaluatedExpression[], parts: BasicEvaluatedExpression[]}} Simplified template + */ + const getSimplifiedTemplateResult = (kind, templateLiteralExpr) => { + const quasis = []; + const parts = []; -class NonErrorEmittedError extends WebpackError { - constructor(error) { - super(); + for (let i = 0; i < templateLiteralExpr.quasis.length; i++) { + const quasiExpr = templateLiteralExpr.quasis[i]; + const quasi = quasiExpr.value[kind]; - this.name = "NonErrorEmittedError"; - this.message = "(Emitted value instead of an instance of Error) " + error; + if (i > 0) { + const prevExpr = parts[parts.length - 1]; + const expr = this.evaluateExpression( + templateLiteralExpr.expressions[i - 1] + ); + const exprAsString = expr.asString(); + if (typeof exprAsString === "string") { + // We can merge quasi + expr + quasi when expr + // is a const string - Error.captureStackTrace(this, this.constructor); - } -} + prevExpr.setString(prevExpr.string + exprAsString + quasi); + prevExpr.setRange([prevExpr.range[0], quasiExpr.range[1]]); + // We unset the expression as it doesn't match to a single expression + prevExpr.setExpression(undefined); + continue; + } + parts.push(expr); + } -/** - * @typedef {Object} CachedSourceEntry - * @property {TODO} source the generated source - * @property {string} hash the hash value - */ + const part = new BasicEvaluatedExpression() + .setString(quasi) + .setRange(quasiExpr.range) + .setExpression(quasiExpr); + quasis.push(part); + parts.push(part); + } + return { + quasis, + parts + }; + }; -class NormalModule extends Module { - constructor({ - type, - request, - userRequest, - rawRequest, - loaders, - resource, - matchResource, - parser, - generator, - resolveOptions - }) { - super(type, getContext(resource)); + this.hooks.evaluate.for("TemplateLiteral").tap("Parser", node => { + const { quasis, parts } = getSimplifiedTemplateResult("cooked", node); + if (parts.length === 1) { + return parts[0].setRange(node.range); + } + return new BasicEvaluatedExpression() + .setTemplateString(quasis, parts, "cooked") + .setRange(node.range); + }); + this.hooks.evaluate.for("TaggedTemplateExpression").tap("Parser", node => { + if (this.evaluateExpression(node.tag).identifier !== "String.raw") return; + const { quasis, parts } = getSimplifiedTemplateResult("raw", node.quasi); + if (parts.length === 1) { + return parts[0].setRange(node.range); + } + return new BasicEvaluatedExpression() + .setTemplateString(quasis, parts, "raw") + .setRange(node.range); + }); - // Info from Factory - this.request = request; - this.userRequest = userRequest; - this.rawRequest = rawRequest; - this.binary = type.startsWith("webassembly"); - this.parser = parser; - this.generator = generator; - this.resource = resource; - this.matchResource = matchResource; - this.loaders = loaders; - if (resolveOptions !== undefined) this.resolveOptions = resolveOptions; + this.hooks.evaluateCallExpressionMember + .for("concat") + .tap("Parser", (expr, param) => { + if (!param.isString() && !param.isWrapped()) return; - // Info from Build - this.error = null; - this._source = null; - this._sourceSize = null; - this._buildHash = ""; - this.buildTimestamp = undefined; - /** @private @type {Map} */ - this._cachedSources = new Map(); + let stringSuffix = null; + let hasUnknownParams = false; + for (let i = expr.arguments.length - 1; i >= 0; i--) { + const argExpr = this.evaluateExpression(expr.arguments[i]); + if (!argExpr.isString() && !argExpr.isNumber()) { + hasUnknownParams = true; + break; + } - // Options for the NormalModule set by plugins - // TODO refactor this -> options object filled from Factory - this.useSourceMap = false; - this.lineToLine = false; + const value = argExpr.isString() + ? argExpr.string + : "" + argExpr.number; - // Cache - this._lastSuccessfulBuildMeta = {}; - } + const newString = value + (stringSuffix ? stringSuffix.string : ""); + const newRange = [ + argExpr.range[0], + (stringSuffix || argExpr).range[1] + ]; + stringSuffix = new BasicEvaluatedExpression() + .setString(newString) + .setRange(newRange); + } - identifier() { - return this.request; + if (hasUnknownParams) { + const prefix = param.isString() ? param : param.prefix; + return new BasicEvaluatedExpression() + .setWrapped(prefix, stringSuffix) + .setRange(expr.range); + } else if (param.isWrapped()) { + const postfix = stringSuffix || param.postfix; + return new BasicEvaluatedExpression() + .setWrapped(param.prefix, postfix) + .setRange(expr.range); + } else { + const newString = + param.string + (stringSuffix ? stringSuffix.string : ""); + return new BasicEvaluatedExpression() + .setString(newString) + .setRange(expr.range); + } + }); + this.hooks.evaluateCallExpressionMember + .for("split") + .tap("Parser", (expr, param) => { + if (!param.isString()) return; + if (expr.arguments.length !== 1) return; + let result; + const arg = this.evaluateExpression(expr.arguments[0]); + if (arg.isString()) { + result = param.string.split(arg.string); + } else if (arg.isRegExp()) { + result = param.string.split(arg.regExp); + } else { + return; + } + return new BasicEvaluatedExpression() + .setArray(result) + .setRange(expr.range); + }); + this.hooks.evaluate.for("ConditionalExpression").tap("Parser", expr => { + const condition = this.evaluateExpression(expr.test); + const conditionValue = condition.asBool(); + let res; + if (conditionValue === undefined) { + const consequent = this.evaluateExpression(expr.consequent); + const alternate = this.evaluateExpression(expr.alternate); + if (!consequent || !alternate) return; + res = new BasicEvaluatedExpression(); + if (consequent.isConditional()) { + res.setOptions(consequent.options); + } else { + res.setOptions([consequent]); + } + if (alternate.isConditional()) { + res.addOptions(alternate.options); + } else { + res.addOptions([alternate]); + } + } else { + res = this.evaluateExpression( + conditionValue ? expr.consequent : expr.alternate + ); + } + res.setRange(expr.range); + return res; + }); + this.hooks.evaluate.for("ArrayExpression").tap("Parser", expr => { + const items = expr.elements.map(element => { + return element !== null && this.evaluateExpression(element); + }); + if (!items.every(Boolean)) return; + return new BasicEvaluatedExpression() + .setItems(items) + .setRange(expr.range); + }); } - readableIdentifier(requestShortener) { - return requestShortener.shorten(this.userRequest); + getRenameIdentifier(expr) { + const result = this.evaluateExpression(expr); + if (result && result.isIdentifier()) { + return result.identifier; + } } - libIdent(options) { - return contextify(options.context, this.userRequest); + walkClass(classy) { + if (classy.superClass) this.walkExpression(classy.superClass); + if (classy.body && classy.body.type === "ClassBody") { + const wasTopLevel = this.scope.topLevelScope; + this.scope.topLevelScope = false; + for (const methodDefinition of classy.body.body) { + if (methodDefinition.type === "MethodDefinition") { + this.walkMethodDefinition(methodDefinition); + } + } + this.scope.topLevelScope = wasTopLevel; + } } - nameForCondition() { - const resource = this.matchResource || this.resource; - const idx = resource.indexOf("?"); - if (idx >= 0) return resource.substr(0, idx); - return resource; + walkMethodDefinition(methodDefinition) { + if (methodDefinition.computed && methodDefinition.key) { + this.walkExpression(methodDefinition.key); + } + if (methodDefinition.value) { + this.walkExpression(methodDefinition.value); + } } - updateCacheModule(module) { - this.type = module.type; - this.request = module.request; - this.userRequest = module.userRequest; - this.rawRequest = module.rawRequest; - this.parser = module.parser; - this.generator = module.generator; - this.resource = module.resource; - this.matchResource = module.matchResource; - this.loaders = module.loaders; - this.resolveOptions = module.resolveOptions; + // Prewalking iterates the scope for variable declarations + prewalkStatements(statements) { + for (let index = 0, len = statements.length; index < len; index++) { + const statement = statements[index]; + this.prewalkStatement(statement); + } } - createSourceForAsset(name, content, sourceMap) { - if (!sourceMap) { - return new RawSource(content); + // Block-Prewalking iterates the scope for block variable declarations + blockPrewalkStatements(statements) { + for (let index = 0, len = statements.length; index < len; index++) { + const statement = statements[index]; + this.blockPrewalkStatement(statement); } + } - if (typeof sourceMap === "string") { - return new OriginalSource(content, sourceMap); + // Walking iterates the statements and expressions and processes them + walkStatements(statements) { + for (let index = 0, len = statements.length; index < len; index++) { + const statement = statements[index]; + this.walkStatement(statement); } - - return new SourceMapSource(content, name, sourceMap); } - createLoaderContext(resolver, options, compilation, fs) { - const requestShortener = compilation.runtimeTemplate.requestShortener; - const getCurrentLoaderName = () => { - const currentLoader = this.getCurrentLoader(loaderContext); - if (!currentLoader) return "(not in loader scope)"; - return requestShortener.shorten(currentLoader.loader); - }; - const loaderContext = { - version: 2, - emitWarning: warning => { - if (!(warning instanceof Error)) { - warning = new NonErrorEmittedError(warning); - } - this.warnings.push( - new ModuleWarning(this, warning, { - from: getCurrentLoaderName() - }) - ); - }, - emitError: error => { - if (!(error instanceof Error)) { - error = new NonErrorEmittedError(error); - } - this.errors.push( - new ModuleError(this, error, { - from: getCurrentLoaderName() - }) - ); - }, - getLogger: name => { - const currentLoader = this.getCurrentLoader(loaderContext); - return compilation.getLogger(() => - [currentLoader && currentLoader.loader, name, this.identifier()] - .filter(Boolean) - .join("|") - ); - }, - // TODO remove in webpack 5 - exec: (code, filename) => { - // @ts-ignore Argument of type 'this' is not assignable to parameter of type 'Module'. - const module = new NativeModule(filename, this); - // @ts-ignore _nodeModulePaths is deprecated and undocumented Node.js API - module.paths = NativeModule._nodeModulePaths(this.context); - module.filename = filename; - module._compile(code, filename); - return module.exports; - }, - resolve(context, request, callback) { - resolver.resolve({}, context, request, {}, callback); - }, - getResolve(options) { - const child = options ? resolver.withOptions(options) : resolver; - return (context, request, callback) => { - if (callback) { - child.resolve({}, context, request, {}, callback); - } else { - return new Promise((resolve, reject) => { - child.resolve({}, context, request, {}, (err, result) => { - if (err) reject(err); - else resolve(result); - }); - }); - } - }; - }, - emitFile: (name, content, sourceMap, assetInfo) => { - if (!this.buildInfo.assets) { - this.buildInfo.assets = Object.create(null); - this.buildInfo.assetsInfo = new Map(); - } - this.buildInfo.assets[name] = this.createSourceForAsset( - name, - content, - sourceMap - ); - this.buildInfo.assetsInfo.set(name, assetInfo); - }, - rootContext: options.context, - webpack: true, - sourceMap: !!this.useSourceMap, - mode: options.mode || "production", - _module: this, - _compilation: compilation, - _compiler: compilation.compiler, - fs: fs - }; - - compilation.hooks.normalModuleLoader.call(loaderContext, this); - if (options.loader) { - Object.assign(loaderContext, options.loader); + prewalkStatement(statement) { + switch (statement.type) { + case "BlockStatement": + this.prewalkBlockStatement(statement); + break; + case "DoWhileStatement": + this.prewalkDoWhileStatement(statement); + break; + case "ExportAllDeclaration": + this.prewalkExportAllDeclaration(statement); + break; + case "ExportDefaultDeclaration": + this.prewalkExportDefaultDeclaration(statement); + break; + case "ExportNamedDeclaration": + this.prewalkExportNamedDeclaration(statement); + break; + case "ForInStatement": + this.prewalkForInStatement(statement); + break; + case "ForOfStatement": + this.prewalkForOfStatement(statement); + break; + case "ForStatement": + this.prewalkForStatement(statement); + break; + case "FunctionDeclaration": + this.prewalkFunctionDeclaration(statement); + break; + case "IfStatement": + this.prewalkIfStatement(statement); + break; + case "ImportDeclaration": + this.prewalkImportDeclaration(statement); + break; + case "LabeledStatement": + this.prewalkLabeledStatement(statement); + break; + case "SwitchStatement": + this.prewalkSwitchStatement(statement); + break; + case "TryStatement": + this.prewalkTryStatement(statement); + break; + case "VariableDeclaration": + this.prewalkVariableDeclaration(statement); + break; + case "WhileStatement": + this.prewalkWhileStatement(statement); + break; + case "WithStatement": + this.prewalkWithStatement(statement); + break; } - - return loaderContext; } - getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) { - if ( - this.loaders && - this.loaders.length && - index < this.loaders.length && - index >= 0 && - this.loaders[index] - ) { - return this.loaders[index]; + blockPrewalkStatement(statement) { + switch (statement.type) { + case "VariableDeclaration": + this.blockPrewalkVariableDeclaration(statement); + break; + case "ExportDefaultDeclaration": + this.blockPrewalkExportDefaultDeclaration(statement); + break; + case "ExportNamedDeclaration": + this.blockPrewalkExportNamedDeclaration(statement); + break; + case "ClassDeclaration": + this.blockPrewalkClassDeclaration(statement); + break; } - return null; } - createSource(source, resourceBuffer, sourceMap) { - // if there is no identifier return raw source - if (!this.identifier) { - return new RawSource(source); + walkStatement(statement) { + if (this.hooks.statement.call(statement) !== undefined) return; + switch (statement.type) { + case "BlockStatement": + this.walkBlockStatement(statement); + break; + case "ClassDeclaration": + this.walkClassDeclaration(statement); + break; + case "DoWhileStatement": + this.walkDoWhileStatement(statement); + break; + case "ExportDefaultDeclaration": + this.walkExportDefaultDeclaration(statement); + break; + case "ExportNamedDeclaration": + this.walkExportNamedDeclaration(statement); + break; + case "ExpressionStatement": + this.walkExpressionStatement(statement); + break; + case "ForInStatement": + this.walkForInStatement(statement); + break; + case "ForOfStatement": + this.walkForOfStatement(statement); + break; + case "ForStatement": + this.walkForStatement(statement); + break; + case "FunctionDeclaration": + this.walkFunctionDeclaration(statement); + break; + case "IfStatement": + this.walkIfStatement(statement); + break; + case "LabeledStatement": + this.walkLabeledStatement(statement); + break; + case "ReturnStatement": + this.walkReturnStatement(statement); + break; + case "SwitchStatement": + this.walkSwitchStatement(statement); + break; + case "ThrowStatement": + this.walkThrowStatement(statement); + break; + case "TryStatement": + this.walkTryStatement(statement); + break; + case "VariableDeclaration": + this.walkVariableDeclaration(statement); + break; + case "WhileStatement": + this.walkWhileStatement(statement); + break; + case "WithStatement": + this.walkWithStatement(statement); + break; } + } - // from here on we assume we have an identifier - const identifier = this.identifier(); + // Real Statements + prewalkBlockStatement(statement) { + this.prewalkStatements(statement.body); + } - if (this.lineToLine && resourceBuffer) { - return new LineToLineMappedSource( - source, - identifier, - asString(resourceBuffer) - ); - } + walkBlockStatement(statement) { + this.inBlockScope(() => { + const body = statement.body; + this.blockPrewalkStatements(body); + this.walkStatements(body); + }); + } - if (this.useSourceMap && sourceMap) { - return new SourceMapSource(source, identifier, sourceMap); - } + walkExpressionStatement(statement) { + this.walkExpression(statement.expression); + } - if (Buffer.isBuffer(source)) { - // @ts-ignore - // TODO We need to fix @types/webpack-sources to allow RawSource to take a Buffer | string - return new RawSource(source); + prewalkIfStatement(statement) { + this.prewalkStatement(statement.consequent); + if (statement.alternate) { + this.prewalkStatement(statement.alternate); } + } - return new OriginalSource(source, identifier); + walkIfStatement(statement) { + const result = this.hooks.statementIf.call(statement); + if (result === undefined) { + this.walkExpression(statement.test); + this.walkStatement(statement.consequent); + if (statement.alternate) { + this.walkStatement(statement.alternate); + } + } else { + if (result) { + this.walkStatement(statement.consequent); + } else if (statement.alternate) { + this.walkStatement(statement.alternate); + } + } } - doBuild(options, compilation, resolver, fs, callback) { - const loaderContext = this.createLoaderContext( - resolver, - options, - compilation, - fs - ); + prewalkLabeledStatement(statement) { + this.prewalkStatement(statement.body); + } - runLoaders( - { - resource: this.resource, - loaders: this.loaders, - context: loaderContext, - readResource: fs.readFile.bind(fs) - }, - (err, result) => { - if (result) { - this.buildInfo.cacheable = result.cacheable; - this.buildInfo.fileDependencies = new Set(result.fileDependencies); - this.buildInfo.contextDependencies = new Set( - result.contextDependencies - ); - } + walkLabeledStatement(statement) { + const hook = this.hooks.label.get(statement.label.name); + if (hook !== undefined) { + const result = hook.call(statement); + if (result === true) return; + } + this.walkStatement(statement.body); + } - if (err) { - if (!(err instanceof Error)) { - err = new NonErrorEmittedError(err); - } - const currentLoader = this.getCurrentLoader(loaderContext); - const error = new ModuleBuildError(this, err, { - from: - currentLoader && - compilation.runtimeTemplate.requestShortener.shorten( - currentLoader.loader - ) - }); - return callback(error); - } + prewalkWithStatement(statement) { + this.prewalkStatement(statement.body); + } - const resourceBuffer = result.resourceBuffer; - const source = result.result[0]; - const sourceMap = result.result.length >= 1 ? result.result[1] : null; - const extraInfo = result.result.length >= 2 ? result.result[2] : null; + walkWithStatement(statement) { + this.walkExpression(statement.object); + this.walkStatement(statement.body); + } - if (!Buffer.isBuffer(source) && typeof source !== "string") { - const currentLoader = this.getCurrentLoader(loaderContext, 0); - const err = new Error( - `Final loader (${ - currentLoader - ? compilation.runtimeTemplate.requestShortener.shorten( - currentLoader.loader - ) - : "unknown" - }) didn't return a Buffer or String` - ); - const error = new ModuleBuildError(this, err); - return callback(error); - } + prewalkSwitchStatement(statement) { + this.prewalkSwitchCases(statement.cases); + } - this._source = this.createSource( - this.binary ? asBuffer(source) : asString(source), - resourceBuffer, - sourceMap - ); - this._sourceSize = null; - this._ast = - typeof extraInfo === "object" && - extraInfo !== null && - extraInfo.webpackAST !== undefined - ? extraInfo.webpackAST - : null; - return callback(); - } - ); + walkSwitchStatement(statement) { + this.walkExpression(statement.discriminant); + this.walkSwitchCases(statement.cases); } - markModuleAsErrored(error) { - // Restore build meta from successful build to keep importing state - this.buildMeta = Object.assign({}, this._lastSuccessfulBuildMeta); - this.error = error; - this.errors.push(this.error); - this._source = new RawSource( - "throw new Error(" + JSON.stringify(this.error.message) + ");" - ); - this._sourceSize = null; - this._ast = null; + walkTerminatingStatement(statement) { + if (statement.argument) this.walkExpression(statement.argument); } - applyNoParseRule(rule, content) { - // must start with "rule" if rule is a string - if (typeof rule === "string") { - return content.indexOf(rule) === 0; - } + walkReturnStatement(statement) { + this.walkTerminatingStatement(statement); + } - if (typeof rule === "function") { - return rule(content); - } - // we assume rule is a regexp - return rule.test(content); + walkThrowStatement(statement) { + this.walkTerminatingStatement(statement); } - // check if module should not be parsed - // returns "true" if the module should !not! be parsed - // returns "false" if the module !must! be parsed - shouldPreventParsing(noParseRule, request) { - // if no noParseRule exists, return false - // the module !must! be parsed. - if (!noParseRule) { - return false; - } + prewalkTryStatement(statement) { + this.prewalkStatement(statement.block); + } - // we only have one rule to check - if (!Array.isArray(noParseRule)) { - // returns "true" if the module is !not! to be parsed - return this.applyNoParseRule(noParseRule, request); + walkTryStatement(statement) { + if (this.scope.inTry) { + this.walkStatement(statement.block); + } else { + this.scope.inTry = true; + this.walkStatement(statement.block); + this.scope.inTry = false; } + if (statement.handler) this.walkCatchClause(statement.handler); + if (statement.finalizer) this.walkStatement(statement.finalizer); + } - for (let i = 0; i < noParseRule.length; i++) { - const rule = noParseRule[i]; - // early exit on first truthy match - // this module is !not! to be parsed - if (this.applyNoParseRule(rule, request)) { - return true; - } - } - // no match found, so this module !should! be parsed - return false; + prewalkWhileStatement(statement) { + this.prewalkStatement(statement.body); } - _initBuildHash(compilation) { - const hash = createHash(compilation.outputOptions.hashFunction); - if (this._source) { - hash.update("source"); - this._source.updateHash(hash); - } - hash.update("meta"); - hash.update(JSON.stringify(this.buildMeta)); - this._buildHash = /** @type {string} */ (hash.digest("hex")); + walkWhileStatement(statement) { + this.walkExpression(statement.test); + this.walkStatement(statement.body); } - build(options, compilation, resolver, fs, callback) { - this.buildTimestamp = Date.now(); - this.built = true; - this._source = null; - this._sourceSize = null; - this._ast = null; - this._buildHash = ""; - this.error = null; - this.errors.length = 0; - this.warnings.length = 0; - this.buildMeta = {}; - this.buildInfo = { - cacheable: false, - fileDependencies: new Set(), - contextDependencies: new Set(), - assets: undefined, - assetsInfo: undefined - }; + prewalkDoWhileStatement(statement) { + this.prewalkStatement(statement.body); + } - return this.doBuild(options, compilation, resolver, fs, err => { - this._cachedSources.clear(); + walkDoWhileStatement(statement) { + this.walkStatement(statement.body); + this.walkExpression(statement.test); + } - // if we have an error mark module as failed and exit - if (err) { - this.markModuleAsErrored(err); - this._initBuildHash(compilation); - return callback(); + prewalkForStatement(statement) { + if (statement.init) { + if (statement.init.type === "VariableDeclaration") { + this.prewalkStatement(statement.init); } + } + this.prewalkStatement(statement.body); + } - // check if this module should !not! be parsed. - // if so, exit here; - const noParseRule = options.module && options.module.noParse; - if (this.shouldPreventParsing(noParseRule, this.request)) { - this._initBuildHash(compilation); - return callback(); + walkForStatement(statement) { + this.inBlockScope(() => { + if (statement.init) { + if (statement.init.type === "VariableDeclaration") { + this.blockPrewalkVariableDeclaration(statement.init); + this.walkStatement(statement.init); + } else { + this.walkExpression(statement.init); + } } + if (statement.test) { + this.walkExpression(statement.test); + } + if (statement.update) { + this.walkExpression(statement.update); + } + const body = statement.body; + if (body.type === "BlockStatement") { + // no need to add additional scope + this.blockPrewalkStatements(body.body); + this.walkStatements(body.body); + } else { + this.walkStatement(body); + } + }); + } - const handleParseError = e => { - const source = this._source.source(); - const loaders = this.loaders.map(item => - contextify(options.context, item.loader) - ); - const error = new ModuleParseError(this, source, e, loaders); - this.markModuleAsErrored(error); - this._initBuildHash(compilation); - return callback(); - }; - - const handleParseResult = result => { - this._lastSuccessfulBuildMeta = this.buildMeta; - this._initBuildHash(compilation); - return callback(); - }; + prewalkForInStatement(statement) { + if (statement.left.type === "VariableDeclaration") { + this.prewalkVariableDeclaration(statement.left); + } + this.prewalkStatement(statement.body); + } - try { - const result = this.parser.parse( - this._ast || this._source.source(), - { - current: this, - module: this, - compilation: compilation, - options: options - }, - (err, result) => { - if (err) { - handleParseError(err); - } else { - handleParseResult(result); - } - } - ); - if (result !== undefined) { - // parse is sync - handleParseResult(result); - } - } catch (e) { - handleParseError(e); + walkForInStatement(statement) { + this.inBlockScope(() => { + if (statement.left.type === "VariableDeclaration") { + this.blockPrewalkVariableDeclaration(statement.left); + this.walkVariableDeclaration(statement.left); + } else { + this.walkPattern(statement.left); + } + this.walkExpression(statement.right); + const body = statement.body; + if (body.type === "BlockStatement") { + // no need to add additional scope + this.blockPrewalkStatements(body.body); + this.walkStatements(body.body); + } else { + this.walkStatement(body); } }); } - getHashDigest(dependencyTemplates) { - // TODO webpack 5 refactor - let dtHash = dependencyTemplates.get("hash"); - return `${this.hash}-${dtHash}`; + prewalkForOfStatement(statement) { + if (statement.left.type === "VariableDeclaration") { + this.prewalkVariableDeclaration(statement.left); + } + this.prewalkStatement(statement.body); } - source(dependencyTemplates, runtimeTemplate, type = "javascript") { - const hashDigest = this.getHashDigest(dependencyTemplates); - const cacheEntry = this._cachedSources.get(type); - if (cacheEntry !== undefined && cacheEntry.hash === hashDigest) { - // We can reuse the cached source - return cacheEntry.source; - } + walkForOfStatement(statement) { + this.inBlockScope(() => { + if (statement.left.type === "VariableDeclaration") { + this.blockPrewalkVariableDeclaration(statement.left); + this.walkVariableDeclaration(statement.left); + } else { + this.walkPattern(statement.left); + } + this.walkExpression(statement.right); + const body = statement.body; + if (body.type === "BlockStatement") { + // no need to add additional scope + this.blockPrewalkStatements(body.body); + this.walkStatements(body.body); + } else { + this.walkStatement(body); + } + }); + } - const source = this.generator.generate( - this, - dependencyTemplates, - runtimeTemplate, - type - ); + // Declarations + prewalkFunctionDeclaration(statement) { + if (statement.id) { + this.scope.renames.set(statement.id.name, null); + this.scope.definitions.add(statement.id.name); + } + } - const cachedSource = new CachedSource(source); - this._cachedSources.set(type, { - source: cachedSource, - hash: hashDigest + walkFunctionDeclaration(statement) { + const wasTopLevel = this.scope.topLevelScope; + this.scope.topLevelScope = false; + this.inFunctionScope(true, statement.params, () => { + for (const param of statement.params) { + this.walkPattern(param); + } + if (statement.body.type === "BlockStatement") { + this.detectMode(statement.body.body); + this.prewalkStatement(statement.body); + this.walkStatement(statement.body); + } else { + this.walkExpression(statement.body); + } }); - return cachedSource; + this.scope.topLevelScope = wasTopLevel; } - originalSource() { - return this._source; + prewalkImportDeclaration(statement) { + const source = statement.source.value; + this.hooks.import.call(statement, source); + for (const specifier of statement.specifiers) { + const name = specifier.local.name; + this.scope.renames.set(name, null); + this.scope.definitions.add(name); + switch (specifier.type) { + case "ImportDefaultSpecifier": + this.hooks.importSpecifier.call(statement, source, "default", name); + break; + case "ImportSpecifier": + this.hooks.importSpecifier.call( + statement, + source, + specifier.imported.name, + name + ); + break; + case "ImportNamespaceSpecifier": + this.hooks.importSpecifier.call(statement, source, null, name); + break; + } + } } - needRebuild(fileTimestamps, contextTimestamps) { - // always try to rebuild in case of an error - if (this.error) return true; + enterDeclaration(declaration, onIdent) { + switch (declaration.type) { + case "VariableDeclaration": + for (const declarator of declaration.declarations) { + switch (declarator.type) { + case "VariableDeclarator": { + this.enterPattern(declarator.id, onIdent); + break; + } + } + } + break; + case "FunctionDeclaration": + this.enterPattern(declaration.id, onIdent); + break; + case "ClassDeclaration": + this.enterPattern(declaration.id, onIdent); + break; + } + } - // always rebuild when module is not cacheable - if (!this.buildInfo.cacheable) return true; + blockPrewalkExportNamedDeclaration(statement) { + if (statement.declaration) { + this.blockPrewalkStatement(statement.declaration); + } + } - // Check timestamps of all dependencies - // Missing timestamp -> need rebuild - // Timestamp bigger than buildTimestamp -> need rebuild - for (const file of this.buildInfo.fileDependencies) { - const timestamp = fileTimestamps.get(file); - if (!timestamp) return true; - if (timestamp >= this.buildTimestamp) return true; + prewalkExportNamedDeclaration(statement) { + let source; + if (statement.source) { + source = statement.source.value; + this.hooks.exportImport.call(statement, source); + } else { + this.hooks.export.call(statement); } - for (const file of this.buildInfo.contextDependencies) { - const timestamp = contextTimestamps.get(file); - if (!timestamp) return true; - if (timestamp >= this.buildTimestamp) return true; + if (statement.declaration) { + if ( + !this.hooks.exportDeclaration.call(statement, statement.declaration) + ) { + this.prewalkStatement(statement.declaration); + let index = 0; + this.enterDeclaration(statement.declaration, def => { + this.hooks.exportSpecifier.call(statement, def, def, index++); + }); + } + } + if (statement.specifiers) { + for ( + let specifierIndex = 0; + specifierIndex < statement.specifiers.length; + specifierIndex++ + ) { + const specifier = statement.specifiers[specifierIndex]; + switch (specifier.type) { + case "ExportSpecifier": { + const name = specifier.exported.name; + if (source) { + this.hooks.exportImportSpecifier.call( + statement, + source, + specifier.local.name, + name, + specifierIndex + ); + } else { + this.hooks.exportSpecifier.call( + statement, + specifier.local.name, + name, + specifierIndex + ); + } + break; + } + } + } } - // elsewise -> no rebuild needed - return false; } - size() { - if (this._sourceSize === null) { - this._sourceSize = this._source ? this._source.size() : -1; + walkExportNamedDeclaration(statement) { + if (statement.declaration) { + this.walkStatement(statement.declaration); } - return this._sourceSize; } - /** - * @param {Hash} hash the hash used to track dependencies - * @returns {void} - */ - updateHash(hash) { - hash.update(this._buildHash); - super.updateHash(hash); + blockPrewalkExportDefaultDeclaration(statement) { + if (statement.declaration.type === "ClassDeclaration") { + this.blockPrewalkClassDeclaration(statement.declaration); + } } -} -module.exports = NormalModule; + prewalkExportDefaultDeclaration(statement) { + this.prewalkStatement(statement.declaration); + if ( + statement.declaration.id && + statement.declaration.type !== "FunctionExpression" && + statement.declaration.type !== "ClassExpression" + ) { + this.hooks.exportSpecifier.call( + statement, + statement.declaration.id.name, + "default" + ); + } + } + walkExportDefaultDeclaration(statement) { + this.hooks.export.call(statement); + if ( + statement.declaration.id && + statement.declaration.type !== "FunctionExpression" && + statement.declaration.type !== "ClassExpression" + ) { + if ( + !this.hooks.exportDeclaration.call(statement, statement.declaration) + ) { + this.walkStatement(statement.declaration); + } + } else { + // Acorn parses `export default function() {}` as `FunctionDeclaration` and + // `export default class {}` as `ClassDeclaration`, both with `id = null`. + // These nodes must be treated as expressions. + if (statement.declaration.type === "FunctionDeclaration") { + this.walkFunctionDeclaration(statement.declaration); + } else if (statement.declaration.type === "ClassDeclaration") { + this.walkClassDeclaration(statement.declaration); + } else { + this.walkExpression(statement.declaration); + } + if (!this.hooks.exportExpression.call(statement, statement.declaration)) { + this.hooks.exportSpecifier.call( + statement, + statement.declaration, + "default" + ); + } + } + } -/***/ }), + prewalkExportAllDeclaration(statement) { + const source = statement.source.value; + this.hooks.exportImport.call(statement, source); + this.hooks.exportImportSpecifier.call(statement, source, null, null, 0); + } -/***/ 22298: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + prewalkVariableDeclaration(statement) { + if (statement.kind !== "var") return; + this._prewalkVariableDeclaration(statement, this.hooks.varDeclarationVar); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ + blockPrewalkVariableDeclaration(statement) { + if (statement.kind === "var") return; + const hookMap = + statement.kind === "const" + ? this.hooks.varDeclarationConst + : this.hooks.varDeclarationLet; + this._prewalkVariableDeclaration(statement, hookMap); + } + _prewalkVariableDeclaration(statement, hookMap) { + for (const declarator of statement.declarations) { + switch (declarator.type) { + case "VariableDeclarator": { + this.enterPattern(declarator.id, (name, decl) => { + let hook = hookMap.get(name); + if (hook === undefined || !hook.call(decl)) { + hook = this.hooks.varDeclaration.get(name); + if (hook === undefined || !hook.call(decl)) { + this.scope.renames.set(name, null); + this.scope.definitions.add(name); + } + } + }); + break; + } + } + } + } -const path = __webpack_require__(85622); -const asyncLib = __webpack_require__(36386); -const { - Tapable, - AsyncSeriesWaterfallHook, - SyncWaterfallHook, - SyncBailHook, - SyncHook, - HookMap -} = __webpack_require__(92402); -const NormalModule = __webpack_require__(25963); -const RawModule = __webpack_require__(82353); -const RuleSet = __webpack_require__(84247); -const { cachedCleverMerge } = __webpack_require__(67916); + walkVariableDeclaration(statement) { + for (const declarator of statement.declarations) { + switch (declarator.type) { + case "VariableDeclarator": { + const renameIdentifier = + declarator.init && this.getRenameIdentifier(declarator.init); + if (renameIdentifier && declarator.id.type === "Identifier") { + const hook = this.hooks.canRename.get(renameIdentifier); + if (hook !== undefined && hook.call(declarator.init)) { + // renaming with "var a = b;" + const hook = this.hooks.rename.get(renameIdentifier); + if (hook === undefined || !hook.call(declarator.init)) { + this.scope.renames.set( + declarator.id.name, + this.scope.renames.get(renameIdentifier) || renameIdentifier + ); + this.scope.definitions.delete(declarator.id.name); + } + break; + } + } + this.walkPattern(declarator.id); + if (declarator.init) this.walkExpression(declarator.init); + break; + } + } + } + } -const EMPTY_RESOLVE_OPTIONS = {}; + blockPrewalkClassDeclaration(statement) { + if (statement.id) { + this.scope.renames.set(statement.id.name, null); + this.scope.definitions.add(statement.id.name); + } + } -const MATCH_RESOURCE_REGEX = /^([^!]+)!=!/; + walkClassDeclaration(statement) { + this.walkClass(statement); + } -const loaderToIdent = data => { - if (!data.options) { - return data.loader; + prewalkSwitchCases(switchCases) { + for (let index = 0, len = switchCases.length; index < len; index++) { + const switchCase = switchCases[index]; + this.prewalkStatements(switchCase.consequent); + } } - if (typeof data.options === "string") { - return data.loader + "?" + data.options; + + walkSwitchCases(switchCases) { + for (let index = 0, len = switchCases.length; index < len; index++) { + const switchCase = switchCases[index]; + + if (switchCase.test) { + this.walkExpression(switchCase.test); + } + this.walkStatements(switchCase.consequent); + } } - if (typeof data.options !== "object") { - throw new Error("loader options must be string or object"); + + walkCatchClause(catchClause) { + this.inBlockScope(() => { + // Error binding is optional in catch clause since ECMAScript 2019 + if (catchClause.param !== null) { + this.enterPattern(catchClause.param, ident => { + this.scope.renames.set(ident, null); + this.scope.definitions.add(ident); + }); + this.walkPattern(catchClause.param); + } + this.prewalkStatement(catchClause.body); + this.walkStatement(catchClause.body); + }); } - if (data.ident) { - return data.loader + "??" + data.ident; + + walkPattern(pattern) { + switch (pattern.type) { + case "ArrayPattern": + this.walkArrayPattern(pattern); + break; + case "AssignmentPattern": + this.walkAssignmentPattern(pattern); + break; + case "MemberExpression": + this.walkMemberExpression(pattern); + break; + case "ObjectPattern": + this.walkObjectPattern(pattern); + break; + case "RestElement": + this.walkRestElement(pattern); + break; + } } - return data.loader + "?" + JSON.stringify(data.options); -}; -const identToLoaderRequest = resultString => { - const idx = resultString.indexOf("?"); - if (idx >= 0) { - const loader = resultString.substr(0, idx); - const options = resultString.substr(idx + 1); - return { - loader, - options - }; - } else { - return { - loader: resultString, - options: undefined - }; + walkAssignmentPattern(pattern) { + this.walkExpression(pattern.right); + this.walkPattern(pattern.left); } -}; -const dependencyCache = new WeakMap(); + walkObjectPattern(pattern) { + for (let i = 0, len = pattern.properties.length; i < len; i++) { + const prop = pattern.properties[i]; + if (prop) { + if (prop.computed) this.walkExpression(prop.key); + if (prop.value) this.walkPattern(prop.value); + } + } + } -class NormalModuleFactory extends Tapable { - constructor(context, resolverFactory, options) { - super(); - this.hooks = { - resolver: new SyncWaterfallHook(["resolver"]), - factory: new SyncWaterfallHook(["factory"]), - beforeResolve: new AsyncSeriesWaterfallHook(["data"]), - afterResolve: new AsyncSeriesWaterfallHook(["data"]), - createModule: new SyncBailHook(["data"]), - module: new SyncWaterfallHook(["module", "data"]), - createParser: new HookMap(() => new SyncBailHook(["parserOptions"])), - parser: new HookMap(() => new SyncHook(["parser", "parserOptions"])), - createGenerator: new HookMap( - () => new SyncBailHook(["generatorOptions"]) - ), - generator: new HookMap( - () => new SyncHook(["generator", "generatorOptions"]) - ) - }; - this._pluginCompat.tap("NormalModuleFactory", options => { - switch (options.name) { - case "before-resolve": - case "after-resolve": - options.async = true; - break; - case "parser": - this.hooks.parser - .for("javascript/auto") - .tap(options.fn.name || "unnamed compat plugin", options.fn); - return true; + walkArrayPattern(pattern) { + for (let i = 0, len = pattern.elements.length; i < len; i++) { + const element = pattern.elements[i]; + if (element) this.walkPattern(element); + } + } + + walkRestElement(pattern) { + this.walkPattern(pattern.argument); + } + + walkExpressions(expressions) { + for (const expression of expressions) { + if (expression) { + this.walkExpression(expression); } - let match; - match = /^parser (.+)$/.exec(options.name); - if (match) { - this.hooks.parser - .for(match[1]) - .tap( - options.fn.name || "unnamed compat plugin", - options.fn.bind(this) - ); - return true; + } + } + + walkExpression(expression) { + switch (expression.type) { + case "ArrayExpression": + this.walkArrayExpression(expression); + break; + case "ArrowFunctionExpression": + this.walkArrowFunctionExpression(expression); + break; + case "AssignmentExpression": + this.walkAssignmentExpression(expression); + break; + case "AwaitExpression": + this.walkAwaitExpression(expression); + break; + case "BinaryExpression": + this.walkBinaryExpression(expression); + break; + case "CallExpression": + this.walkCallExpression(expression); + break; + case "ClassExpression": + this.walkClassExpression(expression); + break; + case "ConditionalExpression": + this.walkConditionalExpression(expression); + break; + case "FunctionExpression": + this.walkFunctionExpression(expression); + break; + case "Identifier": + this.walkIdentifier(expression); + break; + case "LogicalExpression": + this.walkLogicalExpression(expression); + break; + case "MemberExpression": + this.walkMemberExpression(expression); + break; + case "NewExpression": + this.walkNewExpression(expression); + break; + case "ObjectExpression": + this.walkObjectExpression(expression); + break; + case "SequenceExpression": + this.walkSequenceExpression(expression); + break; + case "SpreadElement": + this.walkSpreadElement(expression); + break; + case "TaggedTemplateExpression": + this.walkTaggedTemplateExpression(expression); + break; + case "TemplateLiteral": + this.walkTemplateLiteral(expression); + break; + case "ThisExpression": + this.walkThisExpression(expression); + break; + case "UnaryExpression": + this.walkUnaryExpression(expression); + break; + case "UpdateExpression": + this.walkUpdateExpression(expression); + break; + case "YieldExpression": + this.walkYieldExpression(expression); + break; + } + } + + walkAwaitExpression(expression) { + this.walkExpression(expression.argument); + } + + walkArrayExpression(expression) { + if (expression.elements) { + this.walkExpressions(expression.elements); + } + } + + walkSpreadElement(expression) { + if (expression.argument) { + this.walkExpression(expression.argument); + } + } + + walkObjectExpression(expression) { + for ( + let propIndex = 0, len = expression.properties.length; + propIndex < len; + propIndex++ + ) { + const prop = expression.properties[propIndex]; + if (prop.type === "SpreadElement") { + this.walkExpression(prop.argument); + continue; } - match = /^create-parser (.+)$/.exec(options.name); - if (match) { - this.hooks.createParser - .for(match[1]) - .tap( - options.fn.name || "unnamed compat plugin", - options.fn.bind(this) - ); - return true; + if (prop.computed) { + this.walkExpression(prop.key); } - }); - this.resolverFactory = resolverFactory; - this.ruleSet = new RuleSet(options.defaultRules.concat(options.rules)); - this.cachePredicate = - typeof options.unsafeCache === "function" - ? options.unsafeCache - : Boolean.bind(null, options.unsafeCache); - this.context = context || ""; - this.parserCache = Object.create(null); - this.generatorCache = Object.create(null); - this.hooks.factory.tap("NormalModuleFactory", () => (result, callback) => { - let resolver = this.hooks.resolver.call(null); + if (prop.shorthand) { + this.scope.inShorthand = true; + } + this.walkExpression(prop.value); + if (prop.shorthand) { + this.scope.inShorthand = false; + } + } + } - // Ignored - if (!resolver) return callback(); + walkFunctionExpression(expression) { + const wasTopLevel = this.scope.topLevelScope; + this.scope.topLevelScope = false; + const scopeParams = expression.params; - resolver(result, (err, data) => { - if (err) return callback(err); + // Add function name in scope for recursive calls + if (expression.id) { + scopeParams.push(expression.id.name); + } - // Ignored - if (!data) return callback(); + this.inFunctionScope(true, scopeParams, () => { + for (const param of expression.params) { + this.walkPattern(param); + } + if (expression.body.type === "BlockStatement") { + this.detectMode(expression.body.body); + this.prewalkStatement(expression.body); + this.walkStatement(expression.body); + } else { + this.walkExpression(expression.body); + } + }); + this.scope.topLevelScope = wasTopLevel; + } - // direct module - if (typeof data.source === "function") return callback(null, data); + walkArrowFunctionExpression(expression) { + this.inFunctionScope(false, expression.params, () => { + for (const param of expression.params) { + this.walkPattern(param); + } + if (expression.body.type === "BlockStatement") { + this.detectMode(expression.body.body); + this.prewalkStatement(expression.body); + this.walkStatement(expression.body); + } else { + this.walkExpression(expression.body); + } + }); + } - this.hooks.afterResolve.callAsync(data, (err, result) => { - if (err) return callback(err); + walkSequenceExpression(expression) { + if (expression.expressions) this.walkExpressions(expression.expressions); + } - // Ignored - if (!result) return callback(); + walkUpdateExpression(expression) { + this.walkExpression(expression.argument); + } - let createdModule = this.hooks.createModule.call(result); - if (!createdModule) { - if (!result.request) { - return callback(new Error("Empty dependency (no request)")); - } + walkUnaryExpression(expression) { + if (expression.operator === "typeof") { + const exprName = this.getNameForExpression(expression.argument); + if (exprName && exprName.free) { + const hook = this.hooks.typeof.get(exprName.name); + if (hook !== undefined) { + const result = hook.call(expression); + if (result === true) return; + } + } + } + this.walkExpression(expression.argument); + } - createdModule = new NormalModule(result); - } + walkLeftRightExpression(expression) { + this.walkExpression(expression.left); + this.walkExpression(expression.right); + } - createdModule = this.hooks.module.call(createdModule, result); + walkBinaryExpression(expression) { + this.walkLeftRightExpression(expression); + } - return callback(null, createdModule); - }); - }); + walkLogicalExpression(expression) { + const result = this.hooks.expressionLogicalOperator.call(expression); + if (result === undefined) { + this.walkLeftRightExpression(expression); + } else { + if (result) { + this.walkExpression(expression.right); + } + } + } + + walkAssignmentExpression(expression) { + const renameIdentifier = this.getRenameIdentifier(expression.right); + if (expression.left.type === "Identifier" && renameIdentifier) { + const hook = this.hooks.canRename.get(renameIdentifier); + if (hook !== undefined && hook.call(expression.right)) { + // renaming "a = b;" + const hook = this.hooks.rename.get(renameIdentifier); + if (hook === undefined || !hook.call(expression.right)) { + this.scope.renames.set(expression.left.name, renameIdentifier); + this.scope.definitions.delete(expression.left.name); + } + return; + } + } + if (expression.left.type === "Identifier") { + const assignedHook = this.hooks.assigned.get(expression.left.name); + if (assignedHook === undefined || !assignedHook.call(expression)) { + this.walkExpression(expression.right); + } + this.scope.renames.set(expression.left.name, null); + const assignHook = this.hooks.assign.get(expression.left.name); + if (assignHook === undefined || !assignHook.call(expression)) { + this.walkExpression(expression.left); + } + return; + } + this.walkExpression(expression.right); + this.walkPattern(expression.left); + this.enterPattern(expression.left, (name, decl) => { + this.scope.renames.set(name, null); }); - this.hooks.resolver.tap("NormalModuleFactory", () => (data, callback) => { - const contextInfo = data.contextInfo; - const context = data.context; - const request = data.request; + } - const loaderResolver = this.getResolver("loader"); - const normalResolver = this.getResolver("normal", data.resolveOptions); + walkConditionalExpression(expression) { + const result = this.hooks.expressionConditionalOperator.call(expression); + if (result === undefined) { + this.walkExpression(expression.test); + this.walkExpression(expression.consequent); + if (expression.alternate) { + this.walkExpression(expression.alternate); + } + } else { + if (result) { + this.walkExpression(expression.consequent); + } else if (expression.alternate) { + this.walkExpression(expression.alternate); + } + } + } - let matchResource = undefined; - let requestWithoutMatchResource = request; - const matchResourceMatch = MATCH_RESOURCE_REGEX.exec(request); - if (matchResourceMatch) { - matchResource = matchResourceMatch[1]; - if (/^\.\.?\//.test(matchResource)) { - matchResource = path.join(context, matchResource); + walkNewExpression(expression) { + const callee = this.evaluateExpression(expression.callee); + if (callee.isIdentifier()) { + const hook = this.hooks.new.get(callee.identifier); + if (hook !== undefined) { + const result = hook.call(expression); + if (result === true) { + return; } - requestWithoutMatchResource = request.substr( - matchResourceMatch[0].length - ); } + } - const noPreAutoLoaders = requestWithoutMatchResource.startsWith("-!"); - const noAutoLoaders = - noPreAutoLoaders || requestWithoutMatchResource.startsWith("!"); - const noPrePostAutoLoaders = requestWithoutMatchResource.startsWith("!!"); - let elements = requestWithoutMatchResource - .replace(/^-?!+/, "") - .replace(/!!+/g, "!") - .split("!"); - let resource = elements.pop(); - elements = elements.map(identToLoaderRequest); + this.walkExpression(expression.callee); + if (expression.arguments) { + this.walkExpressions(expression.arguments); + } + } - asyncLib.parallel( - [ - callback => - this.resolveRequestArray( - contextInfo, - context, - elements, - loaderResolver, - callback - ), - callback => { - if (resource === "" || resource[0] === "?") { - return callback(null, { - resource - }); - } + walkYieldExpression(expression) { + if (expression.argument) { + this.walkExpression(expression.argument); + } + } - normalResolver.resolve( - contextInfo, - context, - resource, - {}, - (err, resource, resourceResolveData) => { - if (err) return callback(err); - callback(null, { - resourceResolveData, - resource - }); - } - ); - } - ], - (err, results) => { - if (err) return callback(err); - let loaders = results[0]; - const resourceResolveData = results[1].resourceResolveData; - resource = results[1].resource; + walkTemplateLiteral(expression) { + if (expression.expressions) { + this.walkExpressions(expression.expressions); + } + } - // translate option idents - try { - for (const item of loaders) { - if (typeof item.options === "string" && item.options[0] === "?") { - const ident = item.options.substr(1); - item.options = this.ruleSet.findOptionsByIdent(ident); - item.ident = ident; - } - } - } catch (e) { - return callback(e); - } + walkTaggedTemplateExpression(expression) { + if (expression.tag) { + this.walkExpression(expression.tag); + } + if (expression.quasi && expression.quasi.expressions) { + this.walkExpressions(expression.quasi.expressions); + } + } - if (resource === false) { - // ignored - return callback( - null, - new RawModule( - "/* (ignored) */", - `ignored ${context} ${request}`, - `${request} (ignored)` - ) - ); + walkClassExpression(expression) { + this.walkClass(expression); + } + + _walkIIFE(functionExpression, options, currentThis) { + const renameArgOrThis = argOrThis => { + const renameIdentifier = this.getRenameIdentifier(argOrThis); + if (renameIdentifier) { + const hook = this.hooks.canRename.get(renameIdentifier); + if (hook !== undefined && hook.call(argOrThis)) { + const hook = this.hooks.rename.get(renameIdentifier); + if (hook === undefined || !hook.call(argOrThis)) { + return renameIdentifier; } + } + } + this.walkExpression(argOrThis); + }; + const params = functionExpression.params; + const renameThis = currentThis ? renameArgOrThis(currentThis) : null; + const args = options.map(renameArgOrThis); + const wasTopLevel = this.scope.topLevelScope; + this.scope.topLevelScope = false; + const scopeParams = params.filter((identifier, idx) => !args[idx]); - const userRequest = - (matchResource !== undefined ? `${matchResource}!=!` : "") + - loaders - .map(loaderToIdent) - .concat([resource]) - .join("!"); + // Add function name in scope for recursive calls + if (functionExpression.id) { + scopeParams.push(functionExpression.id.name); + } - let resourcePath = - matchResource !== undefined ? matchResource : resource; - let resourceQuery = ""; - const queryIndex = resourcePath.indexOf("?"); - if (queryIndex >= 0) { - resourceQuery = resourcePath.substr(queryIndex); - resourcePath = resourcePath.substr(0, queryIndex); - } + this.inFunctionScope(true, scopeParams, () => { + if (renameThis) { + this.scope.renames.set("this", renameThis); + } + for (let i = 0; i < args.length; i++) { + const param = args[i]; + if (!param) continue; + if (!params[i] || params[i].type !== "Identifier") continue; + this.scope.renames.set(params[i].name, param); + } + if (functionExpression.body.type === "BlockStatement") { + this.detectMode(functionExpression.body.body); + this.prewalkStatement(functionExpression.body); + this.walkStatement(functionExpression.body); + } else { + this.walkExpression(functionExpression.body); + } + }); + this.scope.topLevelScope = wasTopLevel; + } - const result = this.ruleSet.exec({ - resource: resourcePath, - realResource: - matchResource !== undefined - ? resource.replace(/\?.*/, "") - : resourcePath, - resourceQuery, - issuer: contextInfo.issuer, - compiler: contextInfo.compiler - }); - const settings = {}; - const useLoadersPost = []; - const useLoaders = []; - const useLoadersPre = []; - for (const r of result) { - if (r.type === "use") { - if (r.enforce === "post" && !noPrePostAutoLoaders) { - useLoadersPost.push(r.value); - } else if ( - r.enforce === "pre" && - !noPreAutoLoaders && - !noPrePostAutoLoaders - ) { - useLoadersPre.push(r.value); - } else if ( - !r.enforce && - !noAutoLoaders && - !noPrePostAutoLoaders - ) { - useLoaders.push(r.value); - } - } else if ( - typeof r.value === "object" && - r.value !== null && - typeof settings[r.type] === "object" && - settings[r.type] !== null - ) { - settings[r.type] = cachedCleverMerge(settings[r.type], r.value); - } else { - settings[r.type] = r.value; - } - } - asyncLib.parallel( - [ - this.resolveRequestArray.bind( - this, - contextInfo, - this.context, - useLoadersPost, - loaderResolver - ), - this.resolveRequestArray.bind( - this, - contextInfo, - this.context, - useLoaders, - loaderResolver - ), - this.resolveRequestArray.bind( - this, - contextInfo, - this.context, - useLoadersPre, - loaderResolver - ) - ], - (err, results) => { - if (err) return callback(err); - if (matchResource === undefined) { - loaders = results[0].concat(loaders, results[1], results[2]); - } else { - loaders = results[0].concat(results[1], loaders, results[2]); - } - process.nextTick(() => { - const type = settings.type; - const resolveOptions = settings.resolve; - callback(null, { - context: context, - request: loaders - .map(loaderToIdent) - .concat([resource]) - .join("!"), - dependencies: data.dependencies, - userRequest, - rawRequest: request, - loaders, - resource, - matchResource, - resourceResolveData, - settings, - type, - parser: this.getParser(type, settings.parser), - generator: this.getGenerator(type, settings.generator), - resolveOptions - }); - }); - } - ); - } + walkCallExpression(expression) { + if ( + expression.callee.type === "MemberExpression" && + expression.callee.object.type === "FunctionExpression" && + !expression.callee.computed && + (expression.callee.property.name === "call" || + expression.callee.property.name === "bind") && + expression.arguments.length > 0 + ) { + // (function(…) { }.call/bind(?, …)) + this._walkIIFE( + expression.callee.object, + expression.arguments.slice(1), + expression.arguments[0] ); - }); - } - - create(data, callback) { - const dependencies = data.dependencies; - const cacheEntry = dependencyCache.get(dependencies[0]); - if (cacheEntry) return callback(null, cacheEntry); - const context = data.context || this.context; - const resolveOptions = data.resolveOptions || EMPTY_RESOLVE_OPTIONS; - const request = dependencies[0].request; - const contextInfo = data.contextInfo || {}; - this.hooks.beforeResolve.callAsync( - { - contextInfo, - resolveOptions, - context, - request, - dependencies - }, - (err, result) => { - if (err) return callback(err); - - // Ignored - if (!result) return callback(); - - const factory = this.hooks.factory.call(null); - - // Ignored - if (!factory) return callback(); - - factory(result, (err, module) => { - if (err) return callback(err); + } else if (expression.callee.type === "FunctionExpression") { + // (function(…) { }(…)) + this._walkIIFE(expression.callee, expression.arguments, null); + } else if (expression.callee.type === "Import") { + let result = this.hooks.importCall.call(expression); + if (result === true) return; - if (module && this.cachePredicate(module)) { - for (const d of dependencies) { - dependencyCache.set(d, module); - } + if (expression.arguments) this.walkExpressions(expression.arguments); + } else { + const callee = this.evaluateExpression(expression.callee); + if (callee.isIdentifier()) { + const callHook = this.hooks.call.get(callee.identifier); + if (callHook !== undefined) { + let result = callHook.call(expression); + if (result === true) return; + } + let identifier = callee.identifier.replace(/\.[^.]+$/, ""); + if (identifier !== callee.identifier) { + const callAnyHook = this.hooks.callAnyMember.get(identifier); + if (callAnyHook !== undefined) { + let result = callAnyHook.call(expression); + if (result === true) return; } - - callback(null, module); - }); + } } - ); - } - - resolveRequestArray(contextInfo, context, array, resolver, callback) { - if (array.length === 0) return callback(null, []); - asyncLib.map( - array, - (item, callback) => { - resolver.resolve( - contextInfo, - context, - item.loader, - {}, - (err, result) => { - if ( - err && - /^[^/]*$/.test(item.loader) && - !/-loader$/.test(item.loader) - ) { - return resolver.resolve( - contextInfo, - context, - item.loader + "-loader", - {}, - err2 => { - if (!err2) { - err.message = - err.message + - "\n" + - "BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.\n" + - ` You need to specify '${item.loader}-loader' instead of '${item.loader}',\n` + - " see https://webpack.js.org/migrate/3/#automatic-loader-module-name-extension-removed"; - } - callback(err); - } - ); - } - if (err) return callback(err); - const optionsOnly = item.options - ? { - options: item.options - } - : undefined; - return callback( - null, - Object.assign({}, item, identToLoaderRequest(result), optionsOnly) - ); - } - ); - }, - callback - ); + if (expression.callee) this.walkExpression(expression.callee); + if (expression.arguments) this.walkExpressions(expression.arguments); + } } - getParser(type, parserOptions) { - let ident = type; - if (parserOptions) { - if (parserOptions.ident) { - ident = `${type}|${parserOptions.ident}`; - } else { - ident = JSON.stringify([type, parserOptions]); + walkMemberExpression(expression) { + const exprName = this.getNameForExpression(expression); + if (exprName && exprName.free) { + const expressionHook = this.hooks.expression.get(exprName.name); + if (expressionHook !== undefined) { + const result = expressionHook.call(expression); + if (result === true) return; + } + const expressionAnyMemberHook = this.hooks.expressionAnyMember.get( + exprName.nameGeneral + ); + if (expressionAnyMemberHook !== undefined) { + const result = expressionAnyMemberHook.call(expression); + if (result === true) return; } } - if (ident in this.parserCache) { - return this.parserCache[ident]; - } - return (this.parserCache[ident] = this.createParser(type, parserOptions)); + this.walkExpression(expression.object); + if (expression.computed === true) this.walkExpression(expression.property); } - createParser(type, parserOptions = {}) { - const parser = this.hooks.createParser.for(type).call(parserOptions); - if (!parser) { - throw new Error(`No parser registered for ${type}`); + walkThisExpression(expression) { + const expressionHook = this.hooks.expression.get("this"); + if (expressionHook !== undefined) { + expressionHook.call(expression); } - this.hooks.parser.for(type).call(parser, parserOptions); - return parser; } - getGenerator(type, generatorOptions) { - let ident = type; - if (generatorOptions) { - if (generatorOptions.ident) { - ident = `${type}|${generatorOptions.ident}`; - } else { - ident = JSON.stringify([type, generatorOptions]); + walkIdentifier(expression) { + if (!this.scope.definitions.has(expression.name)) { + const hook = this.hooks.expression.get( + this.scope.renames.get(expression.name) || expression.name + ); + if (hook !== undefined) { + const result = hook.call(expression); + if (result === true) return; } } - if (ident in this.generatorCache) { - return this.generatorCache[ident]; - } - return (this.generatorCache[ident] = this.createGenerator( - type, - generatorOptions - )); - } - - createGenerator(type, generatorOptions = {}) { - const generator = this.hooks.createGenerator - .for(type) - .call(generatorOptions); - if (!generator) { - throw new Error(`No generator registered for ${type}`); - } - this.hooks.generator.for(type).call(generator, generatorOptions); - return generator; } - getResolver(type, resolveOptions) { - return this.resolverFactory.get( - type, - resolveOptions || EMPTY_RESOLVE_OPTIONS - ); - } -} + /** + * @deprecated + * @param {any} params scope params + * @param {function(): void} fn inner function + * @returns {void} + */ + inScope(params, fn) { + const oldScope = this.scope; + this.scope = { + topLevelScope: oldScope.topLevelScope, + inTry: false, + inShorthand: false, + isStrict: oldScope.isStrict, + isAsmJs: oldScope.isAsmJs, + definitions: oldScope.definitions.createChild(), + renames: oldScope.renames.createChild() + }; -module.exports = NormalModuleFactory; + this.scope.renames.set("this", null); + this.enterPatterns(params, ident => { + this.scope.renames.set(ident, null); + this.scope.definitions.add(ident); + }); -/***/ }), + fn(); -/***/ 73253: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + this.scope = oldScope; + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + inFunctionScope(hasThis, params, fn) { + const oldScope = this.scope; + this.scope = { + topLevelScope: oldScope.topLevelScope, + inTry: false, + inShorthand: false, + isStrict: oldScope.isStrict, + isAsmJs: oldScope.isAsmJs, + definitions: oldScope.definitions.createChild(), + renames: oldScope.renames.createChild() + }; + if (hasThis) { + this.scope.renames.set("this", null); + } -const path = __webpack_require__(85622); + this.enterPatterns(params, ident => { + this.scope.renames.set(ident, null); + this.scope.definitions.add(ident); + }); -class NormalModuleReplacementPlugin { - constructor(resourceRegExp, newResource) { - this.resourceRegExp = resourceRegExp; - this.newResource = newResource; - } + fn(); - apply(compiler) { - const resourceRegExp = this.resourceRegExp; - const newResource = this.newResource; - compiler.hooks.normalModuleFactory.tap( - "NormalModuleReplacementPlugin", - nmf => { - nmf.hooks.beforeResolve.tap("NormalModuleReplacementPlugin", result => { - if (!result) return; - if (resourceRegExp.test(result.request)) { - if (typeof newResource === "function") { - newResource(result); - } else { - result.request = newResource; - } - } - return result; - }); - nmf.hooks.afterResolve.tap("NormalModuleReplacementPlugin", result => { - if (!result) return; - if (resourceRegExp.test(result.resource)) { - if (typeof newResource === "function") { - newResource(result); - } else { - result.resource = path.resolve( - path.dirname(result.resource), - newResource - ); - } - } - return result; - }); - } - ); + this.scope = oldScope; } -} -module.exports = NormalModuleReplacementPlugin; - - -/***/ }), + inBlockScope(fn) { + const oldScope = this.scope; + this.scope = { + topLevelScope: oldScope.topLevelScope, + inTry: oldScope.inTry, + inShorthand: false, + isStrict: oldScope.isStrict, + isAsmJs: oldScope.isAsmJs, + definitions: oldScope.definitions.createChild(), + renames: oldScope.renames.createChild() + }; -/***/ 40438: -/***/ (function(module) { + fn(); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + this.scope = oldScope; + } + // TODO webpack 5: remove this methods + // only for backward-compat + detectStrictMode(statements) { + this.detectMode(statements); + } -class NullFactory { - create(data, callback) { - return callback(); + detectMode(statements) { + const isLiteral = + statements.length >= 1 && + statements[0].type === "ExpressionStatement" && + statements[0].expression.type === "Literal"; + if (isLiteral && statements[0].expression.value === "use strict") { + this.scope.isStrict = true; + } + if (isLiteral && statements[0].expression.value === "use asm") { + this.scope.isAsmJs = true; + } } -} -module.exports = NullFactory; + enterPatterns(patterns, onIdent) { + for (const pattern of patterns) { + if (typeof pattern !== "string") { + this.enterPattern(pattern, onIdent); + } else if (pattern) { + onIdent(pattern); + } + } + } -/***/ }), + enterPattern(pattern, onIdent) { + if (!pattern) return; + switch (pattern.type) { + case "ArrayPattern": + this.enterArrayPattern(pattern, onIdent); + break; + case "AssignmentPattern": + this.enterAssignmentPattern(pattern, onIdent); + break; + case "Identifier": + this.enterIdentifier(pattern, onIdent); + break; + case "ObjectPattern": + this.enterObjectPattern(pattern, onIdent); + break; + case "RestElement": + this.enterRestElement(pattern, onIdent); + break; + case "Property": + this.enterPattern(pattern.value, onIdent); + break; + } + } -/***/ 4428: -/***/ (function(module) { + enterIdentifier(pattern, onIdent) { + onIdent(pattern.name, pattern); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + enterObjectPattern(pattern, onIdent) { + for ( + let propIndex = 0, len = pattern.properties.length; + propIndex < len; + propIndex++ + ) { + const prop = pattern.properties[propIndex]; + this.enterPattern(prop, onIdent); + } + } + enterArrayPattern(pattern, onIdent) { + for ( + let elementIndex = 0, len = pattern.elements.length; + elementIndex < len; + elementIndex++ + ) { + const element = pattern.elements[elementIndex]; + this.enterPattern(element, onIdent); + } + } -class OptionsApply { - process(options, compiler) {} -} -module.exports = OptionsApply; + enterRestElement(pattern, onIdent) { + this.enterPattern(pattern.argument, onIdent); + } + enterAssignmentPattern(pattern, onIdent) { + this.enterPattern(pattern.left, onIdent); + } -/***/ }), + evaluateExpression(expression) { + try { + const hook = this.hooks.evaluate.get(expression.type); + if (hook !== undefined) { + const result = hook.call(expression); + if (result !== undefined) { + if (result) { + result.setExpression(expression); + } + return result; + } + } + } catch (e) { + console.warn(e); + // ignore error + } + return new BasicEvaluatedExpression() + .setRange(expression.range) + .setExpression(expression); + } -/***/ 3414: -/***/ (function(module) { + parseString(expression) { + switch (expression.type) { + case "BinaryExpression": + if (expression.operator === "+") { + return ( + this.parseString(expression.left) + + this.parseString(expression.right) + ); + } + break; + case "Literal": + return expression.value + ""; + } + throw new Error( + expression.type + " is not supported as parameter for require" + ); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + parseCalculatedString(expression) { + switch (expression.type) { + case "BinaryExpression": + if (expression.operator === "+") { + const left = this.parseCalculatedString(expression.left); + const right = this.parseCalculatedString(expression.right); + if (left.code) { + return { + range: left.range, + value: left.value, + code: true, + conditional: false + }; + } else if (right.code) { + return { + range: [ + left.range[0], + right.range ? right.range[1] : left.range[1] + ], + value: left.value + right.value, + code: true, + conditional: false + }; + } else { + return { + range: [left.range[0], right.range[1]], + value: left.value + right.value, + code: false, + conditional: false + }; + } + } + break; + case "ConditionalExpression": { + const consequent = this.parseCalculatedString(expression.consequent); + const alternate = this.parseCalculatedString(expression.alternate); + const items = []; + if (consequent.conditional) { + items.push(...consequent.conditional); + } else if (!consequent.code) { + items.push(consequent); + } else { + break; + } + if (alternate.conditional) { + items.push(...alternate.conditional); + } else if (!alternate.code) { + items.push(alternate); + } else { + break; + } + return { + range: undefined, + value: "", + code: true, + conditional: items + }; + } + case "Literal": + return { + range: expression.range, + value: expression.value + "", + code: false, + conditional: false + }; + } + return { + range: undefined, + value: "", + code: true, + conditional: false + }; + } + parse(source, initialState) { + let ast; + let comments; + if (typeof source === "object" && source !== null) { + ast = source; + comments = source.comments; + } else { + comments = []; + ast = Parser.parse(source, { + sourceType: this.sourceType, + onComment: comments + }); + } -/** - * Gets the value at path of object - * @param {object} obj object to query - * @param {string} path query path - * @returns {any} - if {@param path} requests element from array, then `undefined` will be returned - */ -const getProperty = (obj, path) => { - let name = path.split("."); - for (let i = 0; i < name.length - 1; i++) { - obj = obj[name[i]]; - if (typeof obj !== "object" || !obj || Array.isArray(obj)) return; + const oldScope = this.scope; + const oldState = this.state; + const oldComments = this.comments; + this.scope = { + topLevelScope: true, + inTry: false, + inShorthand: false, + isStrict: false, + isAsmJs: false, + definitions: new StackedSetMap(), + renames: new StackedSetMap() + }; + const state = (this.state = initialState || {}); + this.comments = comments; + if (this.hooks.program.call(ast, comments) === undefined) { + this.detectMode(ast.body); + this.prewalkStatements(ast.body); + this.blockPrewalkStatements(ast.body); + this.walkStatements(ast.body); + } + this.scope = oldScope; + this.state = oldState; + this.comments = oldComments; + return state; } - return obj[name.pop()]; -}; -/** - * Sets the value at path of object. Stops execution, if {@param path} requests element from array to be set - * @param {object} obj object to query - * @param {string} path query path - * @param {any} value value to be set - * @returns {void} - */ -const setProperty = (obj, path, value) => { - let name = path.split("."); - for (let i = 0; i < name.length - 1; i++) { - if (typeof obj[name[i]] !== "object" && obj[name[i]] !== undefined) return; - if (Array.isArray(obj[name[i]])) return; - if (!obj[name[i]]) obj[name[i]] = {}; - obj = obj[name[i]]; + evaluate(source) { + const ast = Parser.parse("(" + source + ")", { + sourceType: this.sourceType, + locations: false + }); + // TODO(https://github.com/acornjs/acorn/issues/741) + // @ts-ignore + if (ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement") { + throw new Error("evaluate: Source is not a expression"); + } + // TODO(https://github.com/acornjs/acorn/issues/741) + // @ts-ignore + return this.evaluateExpression(ast.body[0].expression); } - obj[name.pop()] = value; -}; - -/** - * @typedef {'call' | 'make' | 'append'} ConfigType - */ -/** - * @typedef {(options: object) => any} MakeConfigHandler - */ -/** - * @typedef {(value: any, options: object) => any} CallConfigHandler - */ -/** - * @typedef {any[]} AppendConfigValues - */ -class OptionsDefaulter { - constructor() { - /** - * Stores default options settings or functions for computing them - */ - this.defaults = {}; - /** - * Stores configuration for options - * @type {{[key: string]: ConfigType}} - */ - this.config = {}; + getComments(range) { + return this.comments.filter( + comment => comment.range[0] >= range[0] && comment.range[1] <= range[1] + ); } - /** - * Enhancing {@param options} with default values - * @param {object} options provided options - * @returns {object} - enhanced options - * @throws {Error} - will throw error, if configuration value is other then `undefined` or {@link ConfigType} - */ - process(options) { - options = Object.assign({}, options); - for (let name in this.defaults) { - switch (this.config[name]) { - /** - * If {@link ConfigType} doesn't specified and current value is `undefined`, then default value will be assigned - */ - case undefined: - if (getProperty(options, name) === undefined) { - setProperty(options, name, this.defaults[name]); - } - break; - /** - * Assign result of {@link CallConfigHandler} - */ - case "call": - setProperty( - options, - name, - this.defaults[name].call(this, getProperty(options, name), options) - ); - break; - /** - * Assign result of {@link MakeConfigHandler}, if current value is `undefined` - */ - case "make": - if (getProperty(options, name) === undefined) { - setProperty(options, name, this.defaults[name].call(this, options)); - } - break; - /** - * Adding {@link AppendConfigValues} at the end of the current array - */ - case "append": { - let oldValue = getProperty(options, name); - if (!Array.isArray(oldValue)) { - oldValue = []; - } - oldValue.push(...this.defaults[name]); - setProperty(options, name, oldValue); - break; + parseCommentOptions(range) { + const comments = this.getComments(range); + if (comments.length === 0) { + return EMPTY_COMMENT_OPTIONS; + } + let options = {}; + let errors = []; + for (const comment of comments) { + const { value } = comment; + if (value && webpackCommentRegExp.test(value)) { + // try compile only if webpack options comment is present + try { + const val = vm.runInNewContext(`(function(){return {${value}};})()`); + Object.assign(options, val); + } catch (e) { + e.comment = comment; + errors.push(e); } - default: - throw new Error( - "OptionsDefaulter cannot process " + this.config[name] - ); } } - return options; + return { options, errors }; } - /** - * Builds up default values - * @param {string} name option path - * @param {ConfigType | any} config if {@param def} is provided, then only {@link ConfigType} is allowed - * @param {MakeConfigHandler | CallConfigHandler | AppendConfigValues} [def] defaults - * @returns {void} - */ - set(name, config, def) { - if (def !== undefined) { - this.defaults[name] = def; - this.config[name] = config; + getNameForExpression(expression) { + let expr = expression; + const exprName = []; + while ( + expr.type === "MemberExpression" && + expr.property.type === (expr.computed ? "Literal" : "Identifier") + ) { + exprName.push(expr.computed ? expr.property.value : expr.property.name); + expr = expr.object; + } + let free; + if (expr.type === "Identifier") { + free = !this.scope.definitions.has(expr.name); + exprName.push(this.scope.renames.get(expr.name) || expr.name); + } else if ( + expr.type === "ThisExpression" && + this.scope.renames.get("this") + ) { + free = true; + exprName.push(this.scope.renames.get("this")); + } else if (expr.type === "ThisExpression") { + free = this.scope.topLevelScope; + exprName.push("this"); } else { - this.defaults[name] = config; - delete this.config[name]; + return null; + } + let prefix = ""; + for (let i = exprName.length - 1; i >= 2; i--) { + prefix += exprName[i] + "."; + } + if (exprName.length > 1) { + prefix += exprName[1]; + } + const name = prefix ? prefix + "." + exprName[0] : exprName[0]; + const nameGeneral = prefix; + return { + name, + nameGeneral, + free + }; + } + + static parse(code, options) { + const type = options ? options.sourceType : "module"; + const parserOptions = Object.assign( + Object.create(null), + defaultParserOptions, + options + ); + + if (type === "auto") { + parserOptions.sourceType = "module"; + } else if (parserOptions.sourceType === "script") { + parserOptions.allowReturnOutsideFunction = true; + } + + let ast; + let error; + let threw = false; + try { + ast = acornParser.parse(code, parserOptions); + } catch (e) { + error = e; + threw = true; + } + + if (threw && type === "auto") { + parserOptions.sourceType = "script"; + parserOptions.allowReturnOutsideFunction = true; + if (Array.isArray(parserOptions.onComment)) { + parserOptions.onComment.length = 0; + } + try { + ast = acornParser.parse(code, parserOptions); + threw = false; + } catch (e) { + threw = true; + } } + + if (threw) { + throw error; + } + + return ast; } } -module.exports = OptionsDefaulter; +// TODO remove in webpack 5 +Object.defineProperty(Parser.prototype, "getCommentOptions", { + configurable: false, + value: util.deprecate( + /** + * @deprecated + * @param {TODO} range Range + * @returns {void} + * @this {Parser} + */ + function(range) { + return this.parseCommentOptions(range).options; + }, + "Parser.getCommentOptions: Use Parser.parseCommentOptions(range) instead" + ) +}); + +module.exports = Parser; /***/ }), -/***/ 70558: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 23999: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* @@ -68202,2461 +66917,2057 @@ module.exports = OptionsDefaulter; Author Tobias Koppers @sokra */ +const path = __webpack_require__(85622); -// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API - -const acorn = __webpack_require__(77087); -const { Tapable, SyncBailHook, HookMap } = __webpack_require__(92402); -const util = __webpack_require__(31669); -const vm = __webpack_require__(92184); const BasicEvaluatedExpression = __webpack_require__(96770); -const StackedSetMap = __webpack_require__(92251); +const ConstDependency = __webpack_require__(71101); +const UnsupportedFeatureWarning = __webpack_require__(99953); -const acornParser = acorn.Parser; +const ParserHelpers = exports; -const joinRanges = (startRange, endRange) => { - if (!endRange) return startRange; - if (!startRange) return endRange; - return [startRange[0], endRange[1]]; +ParserHelpers.addParsedVariableToModule = (parser, name, expression) => { + if (!parser.state.current.addVariable) return false; + var deps = []; + parser.parse(expression, { + current: { + addDependency: dep => { + dep.userRequest = name; + deps.push(dep); + } + }, + module: parser.state.module + }); + parser.state.current.addVariable(name, expression, deps); + return true; }; -const defaultParserOptions = { - ranges: true, - locations: true, - ecmaVersion: 11, - sourceType: "module", - onComment: null +ParserHelpers.requireFileAsExpression = (context, pathToModule) => { + var moduleJsPath = path.relative(context, pathToModule); + if (!/^[A-Z]:/i.test(moduleJsPath)) { + moduleJsPath = "./" + moduleJsPath.replace(/\\/g, "/"); + } + return "require(" + JSON.stringify(moduleJsPath) + ")"; }; -// regexp to match at least one "magic comment" -const webpackCommentRegExp = new RegExp(/(^|\W)webpack[A-Z]{1,}[A-Za-z]{1,}:/); +ParserHelpers.toConstantDependency = (parser, value) => { + return function constDependency(expr) { + var dep = new ConstDependency(value, expr.range, false); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + return true; + }; +}; -const EMPTY_COMMENT_OPTIONS = { - options: null, - errors: null +ParserHelpers.toConstantDependencyWithWebpackRequire = (parser, value) => { + return function constDependencyWithWebpackRequire(expr) { + var dep = new ConstDependency(value, expr.range, true); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + return true; + }; }; -class Parser extends Tapable { - constructor(options, sourceType = "auto") { - super(); - this.hooks = { - evaluateTypeof: new HookMap(() => new SyncBailHook(["expression"])), - evaluate: new HookMap(() => new SyncBailHook(["expression"])), - evaluateIdentifier: new HookMap(() => new SyncBailHook(["expression"])), - evaluateDefinedIdentifier: new HookMap( - () => new SyncBailHook(["expression"]) - ), - evaluateCallExpressionMember: new HookMap( - () => new SyncBailHook(["expression", "param"]) - ), - statement: new SyncBailHook(["statement"]), - statementIf: new SyncBailHook(["statement"]), - label: new HookMap(() => new SyncBailHook(["statement"])), - import: new SyncBailHook(["statement", "source"]), - importSpecifier: new SyncBailHook([ - "statement", - "source", - "exportName", - "identifierName" - ]), - export: new SyncBailHook(["statement"]), - exportImport: new SyncBailHook(["statement", "source"]), - exportDeclaration: new SyncBailHook(["statement", "declaration"]), - exportExpression: new SyncBailHook(["statement", "declaration"]), - exportSpecifier: new SyncBailHook([ - "statement", - "identifierName", - "exportName", - "index" - ]), - exportImportSpecifier: new SyncBailHook([ - "statement", - "source", - "identifierName", - "exportName", - "index" - ]), - varDeclaration: new HookMap(() => new SyncBailHook(["declaration"])), - varDeclarationLet: new HookMap(() => new SyncBailHook(["declaration"])), - varDeclarationConst: new HookMap(() => new SyncBailHook(["declaration"])), - varDeclarationVar: new HookMap(() => new SyncBailHook(["declaration"])), - canRename: new HookMap(() => new SyncBailHook(["initExpression"])), - rename: new HookMap(() => new SyncBailHook(["initExpression"])), - assigned: new HookMap(() => new SyncBailHook(["expression"])), - assign: new HookMap(() => new SyncBailHook(["expression"])), - typeof: new HookMap(() => new SyncBailHook(["expression"])), - importCall: new SyncBailHook(["expression"]), - call: new HookMap(() => new SyncBailHook(["expression"])), - callAnyMember: new HookMap(() => new SyncBailHook(["expression"])), - new: new HookMap(() => new SyncBailHook(["expression"])), - expression: new HookMap(() => new SyncBailHook(["expression"])), - expressionAnyMember: new HookMap(() => new SyncBailHook(["expression"])), - expressionConditionalOperator: new SyncBailHook(["expression"]), - expressionLogicalOperator: new SyncBailHook(["expression"]), - program: new SyncBailHook(["ast", "comments"]) - }; - const HOOK_MAP_COMPAT_CONFIG = { - evaluateTypeof: /^evaluate typeof (.+)$/, - evaluateIdentifier: /^evaluate Identifier (.+)$/, - evaluateDefinedIdentifier: /^evaluate defined Identifier (.+)$/, - evaluateCallExpressionMember: /^evaluate CallExpression .(.+)$/, - evaluate: /^evaluate (.+)$/, - label: /^label (.+)$/, - varDeclarationLet: /^var-let (.+)$/, - varDeclarationConst: /^var-const (.+)$/, - varDeclarationVar: /^var-var (.+)$/, - varDeclaration: /^var (.+)$/, - canRename: /^can-rename (.+)$/, - rename: /^rename (.+)$/, - typeof: /^typeof (.+)$/, - assigned: /^assigned (.+)$/, - assign: /^assign (.+)$/, - callAnyMember: /^call (.+)\.\*$/, - call: /^call (.+)$/, - new: /^new (.+)$/, - expressionConditionalOperator: /^expression \?:$/, - expressionAnyMember: /^expression (.+)\.\*$/, - expression: /^expression (.+)$/ - }; - this._pluginCompat.tap("Parser", options => { - for (const name of Object.keys(HOOK_MAP_COMPAT_CONFIG)) { - const regexp = HOOK_MAP_COMPAT_CONFIG[name]; - const match = regexp.exec(options.name); - if (match) { - if (match[1]) { - this.hooks[name].tap( - match[1], - options.fn.name || "unnamed compat plugin", - options.fn.bind(this) - ); - } else { - this.hooks[name].tap( - options.fn.name || "unnamed compat plugin", - options.fn.bind(this) - ); - } - return true; - } - } - }); - this.options = options; - this.sourceType = sourceType; - this.scope = undefined; - this.state = undefined; - this.comments = undefined; - this.initializeEvaluating(); +ParserHelpers.evaluateToString = value => { + return function stringExpression(expr) { + return new BasicEvaluatedExpression().setString(value).setRange(expr.range); + }; +}; + +ParserHelpers.evaluateToBoolean = value => { + return function booleanExpression(expr) { + return new BasicEvaluatedExpression() + .setBoolean(value) + .setRange(expr.range); + }; +}; + +ParserHelpers.evaluateToIdentifier = (identifier, truthy) => { + return function identifierExpression(expr) { + let evex = new BasicEvaluatedExpression() + .setIdentifier(identifier) + .setRange(expr.range); + if (truthy === true) { + evex = evex.setTruthy(); + } else if (truthy === false) { + evex = evex.setFalsy(); + } + return evex; + }; +}; + +ParserHelpers.expressionIsUnsupported = (parser, message) => { + return function unsupportedExpression(expr) { + var dep = new ConstDependency("(void 0)", expr.range, false); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + if (!parser.state.module) return; + parser.state.module.warnings.push( + new UnsupportedFeatureWarning(parser.state.module, message, expr.loc) + ); + return true; + }; +}; + +ParserHelpers.skipTraversal = function skipTraversal() { + return true; +}; + +ParserHelpers.approve = function approve() { + return true; +}; + + +/***/ }), + +/***/ 27850: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +const PrefetchDependency = __webpack_require__(14237); + +class PrefetchPlugin { + constructor(context, request) { + if (!request) { + this.request = context; + } else { + this.context = context; + this.request = request; + } } - initializeEvaluating() { - this.hooks.evaluate.for("Literal").tap("Parser", expr => { - switch (typeof expr.value) { - case "number": - return new BasicEvaluatedExpression() - .setNumber(expr.value) - .setRange(expr.range); - case "string": - return new BasicEvaluatedExpression() - .setString(expr.value) - .setRange(expr.range); - case "boolean": - return new BasicEvaluatedExpression() - .setBoolean(expr.value) - .setRange(expr.range); - } - if (expr.value === null) { - return new BasicEvaluatedExpression().setNull().setRange(expr.range); - } - if (expr.value instanceof RegExp) { - return new BasicEvaluatedExpression() - .setRegExp(expr.value) - .setRange(expr.range); - } - }); - this.hooks.evaluate.for("LogicalExpression").tap("Parser", expr => { - let left; - let leftAsBool; - let right; - if (expr.operator === "&&") { - left = this.evaluateExpression(expr.left); - leftAsBool = left && left.asBool(); - if (leftAsBool === false) return left.setRange(expr.range); - if (leftAsBool !== true) return; - right = this.evaluateExpression(expr.right); - return right.setRange(expr.range); - } else if (expr.operator === "||") { - left = this.evaluateExpression(expr.left); - leftAsBool = left && left.asBool(); - if (leftAsBool === true) return left.setRange(expr.range); - if (leftAsBool !== false) return; - right = this.evaluateExpression(expr.right); - return right.setRange(expr.range); + apply(compiler) { + compiler.hooks.compilation.tap( + "PrefetchPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set( + PrefetchDependency, + normalModuleFactory + ); } + ); + compiler.hooks.make.tapAsync("PrefetchPlugin", (compilation, callback) => { + compilation.prefetch( + this.context || compiler.context, + new PrefetchDependency(this.request), + callback + ); }); - this.hooks.evaluate.for("BinaryExpression").tap("Parser", expr => { - let left; - let right; - let res; - if (expr.operator === "+") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - res = new BasicEvaluatedExpression(); - if (left.isString()) { - if (right.isString()) { - res.setString(left.string + right.string); - } else if (right.isNumber()) { - res.setString(left.string + right.number); - } else if ( - right.isWrapped() && - right.prefix && - right.prefix.isString() - ) { - // "left" + ("prefix" + inner + "postfix") - // => ("leftprefix" + inner + "postfix") - res.setWrapped( - new BasicEvaluatedExpression() - .setString(left.string + right.prefix.string) - .setRange(joinRanges(left.range, right.prefix.range)), - right.postfix, - right.wrappedInnerExpressions - ); - } else if (right.isWrapped()) { - // "left" + ([null] + inner + "postfix") - // => ("left" + inner + "postfix") - res.setWrapped(left, right.postfix, right.wrappedInnerExpressions); - } else { - // "left" + expr - // => ("left" + expr + "") - res.setWrapped(left, null, [right]); - } - } else if (left.isNumber()) { - if (right.isString()) { - res.setString(left.number + right.string); - } else if (right.isNumber()) { - res.setNumber(left.number + right.number); + } +} +module.exports = PrefetchPlugin; + + +/***/ }), + +/***/ 63123: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(26336); + +/** @typedef {import("../declarations/plugins/ProgressPlugin").ProgressPluginArgument} ProgressPluginArgument */ +/** @typedef {import("../declarations/plugins/ProgressPlugin").ProgressPluginOptions} ProgressPluginOptions */ + +const createDefaultHandler = (profile, logger) => { + let lastState; + let lastStateTime; + + const defaultHandler = (percentage, msg, ...args) => { + logger.status(`${Math.floor(percentage * 100)}%`, msg, ...args); + if (profile) { + let state = msg; + state = state.replace(/^\d+\/\d+\s+/, ""); + if (percentage === 0) { + lastState = null; + lastStateTime = Date.now(); + } else if (state !== lastState || percentage === 1) { + const now = Date.now(); + if (lastState) { + const diff = now - lastStateTime; + const stateMsg = `${diff}ms ${lastState}`; + if (diff > 1000) { + logger.warn(stateMsg); + } else if (diff > 10) { + logger.info(stateMsg); + } else if (diff > 0) { + logger.log(stateMsg); } else { - return; + logger.debug(stateMsg); } - } else if (left.isWrapped()) { - if (left.postfix && left.postfix.isString() && right.isString()) { - // ("prefix" + inner + "postfix") + "right" - // => ("prefix" + inner + "postfixright") - res.setWrapped( - left.prefix, - new BasicEvaluatedExpression() - .setString(left.postfix.string + right.string) - .setRange(joinRanges(left.postfix.range, right.range)), - left.wrappedInnerExpressions - ); - } else if ( - left.postfix && - left.postfix.isString() && - right.isNumber() - ) { - // ("prefix" + inner + "postfix") + 123 - // => ("prefix" + inner + "postfix123") - res.setWrapped( - left.prefix, - new BasicEvaluatedExpression() - .setString(left.postfix.string + right.number) - .setRange(joinRanges(left.postfix.range, right.range)), - left.wrappedInnerExpressions - ); - } else if (right.isString()) { - // ("prefix" + inner + [null]) + "right" - // => ("prefix" + inner + "right") - res.setWrapped(left.prefix, right, left.wrappedInnerExpressions); - } else if (right.isNumber()) { - // ("prefix" + inner + [null]) + 123 - // => ("prefix" + inner + "123") - res.setWrapped( - left.prefix, - new BasicEvaluatedExpression() - .setString(right.number + "") - .setRange(right.range), - left.wrappedInnerExpressions - ); - } else if (right.isWrapped()) { - // ("prefix1" + inner1 + "postfix1") + ("prefix2" + inner2 + "postfix2") - // ("prefix1" + inner1 + "postfix1" + "prefix2" + inner2 + "postfix2") - res.setWrapped( - left.prefix, - right.postfix, - left.wrappedInnerExpressions && - right.wrappedInnerExpressions && - left.wrappedInnerExpressions - .concat(left.postfix ? [left.postfix] : []) - .concat(right.prefix ? [right.prefix] : []) - .concat(right.wrappedInnerExpressions) - ); - } else { - // ("prefix" + inner + postfix) + expr - // => ("prefix" + inner + postfix + expr + [null]) - res.setWrapped( - left.prefix, - null, - left.wrappedInnerExpressions && - left.wrappedInnerExpressions.concat( - left.postfix ? [left.postfix, right] : [right] - ) - ); + } + lastState = state; + lastStateTime = now; + } + } + if (percentage === 1) logger.status(); + }; + + return defaultHandler; +}; + +class ProgressPlugin { + /** + * @param {ProgressPluginArgument} options options + */ + constructor(options) { + if (typeof options === "function") { + options = { + handler: options + }; + } + + options = options || {}; + validateOptions(schema, options, "Progress Plugin"); + options = Object.assign({}, ProgressPlugin.defaultOptions, options); + + this.profile = options.profile; + this.handler = options.handler; + this.modulesCount = options.modulesCount; + this.showEntries = options.entries; + this.showModules = options.modules; + this.showActiveModules = options.activeModules; + } + + apply(compiler) { + const { modulesCount } = this; + const handler = + this.handler || + createDefaultHandler( + this.profile, + compiler.getInfrastructureLogger("webpack.Progress") + ); + const showEntries = this.showEntries; + const showModules = this.showModules; + const showActiveModules = this.showActiveModules; + if (compiler.compilers) { + const states = new Array(compiler.compilers.length); + compiler.compilers.forEach((compiler, idx) => { + new ProgressPlugin((p, msg, ...args) => { + states[idx] = [p, msg, ...args]; + handler( + states + .map(state => (state && state[0]) || 0) + .reduce((a, b) => a + b) / states.length, + `[${idx}] ${msg}`, + ...args + ); + }).apply(compiler); + }); + } else { + let lastModulesCount = 0; + let lastEntriesCount = 0; + let moduleCount = modulesCount; + let entriesCount = 1; + let doneModules = 0; + let doneEntries = 0; + const activeModules = new Set(); + let lastActiveModule = ""; + + const update = () => { + const percentByModules = + doneModules / Math.max(lastModulesCount, moduleCount); + const percentByEntries = + doneEntries / Math.max(lastEntriesCount, entriesCount); + + const items = [ + 0.1 + Math.max(percentByModules, percentByEntries) * 0.6, + "building" + ]; + if (showEntries) { + items.push(`${doneEntries}/${entriesCount} entries`); + } + if (showModules) { + items.push(`${doneModules}/${moduleCount} modules`); + } + if (showActiveModules) { + items.push(`${activeModules.size} active`); + items.push(lastActiveModule); + } + handler(...items); + }; + + const moduleAdd = module => { + moduleCount++; + if (showActiveModules) { + const ident = module.identifier(); + if (ident) { + activeModules.add(ident); + lastActiveModule = ident; } - } else { - if (right.isString()) { - // left + "right" - // => ([null] + left + "right") - res.setWrapped(null, right, [left]); - } else if (right.isWrapped()) { - // left + (prefix + inner + "postfix") - // => ([null] + left + prefix + inner + "postfix") - res.setWrapped( - null, - right.postfix, - right.wrappedInnerExpressions && - (right.prefix ? [left, right.prefix] : [left]).concat( - right.wrappedInnerExpressions - ) - ); - } else { - return; + } + update(); + }; + + const entryAdd = (entry, name) => { + entriesCount++; + update(); + }; + + const moduleDone = module => { + doneModules++; + if (showActiveModules) { + const ident = module.identifier(); + if (ident) { + activeModules.delete(ident); + if (lastActiveModule === ident) { + lastActiveModule = ""; + for (const m of activeModules) { + lastActiveModule = m; + } + } } } - res.setRange(expr.range); - return res; - } else if (expr.operator === "-") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number - right.number); - res.setRange(expr.range); - return res; - } else if (expr.operator === "*") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number * right.number); - res.setRange(expr.range); - return res; - } else if (expr.operator === "/") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number / right.number); - res.setRange(expr.range); - return res; - } else if (expr.operator === "**") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(Math.pow(left.number, right.number)); - res.setRange(expr.range); - return res; - } else if (expr.operator === "==" || expr.operator === "===") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - res = new BasicEvaluatedExpression(); - res.setRange(expr.range); - if (left.isString() && right.isString()) { - return res.setBoolean(left.string === right.string); - } else if (left.isNumber() && right.isNumber()) { - return res.setBoolean(left.number === right.number); - } else if (left.isBoolean() && right.isBoolean()) { - return res.setBoolean(left.bool === right.bool); - } - } else if (expr.operator === "!=" || expr.operator === "!==") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - res = new BasicEvaluatedExpression(); - res.setRange(expr.range); - if (left.isString() && right.isString()) { - return res.setBoolean(left.string !== right.string); - } else if (left.isNumber() && right.isNumber()) { - return res.setBoolean(left.number !== right.number); - } else if (left.isBoolean() && right.isBoolean()) { - return res.setBoolean(left.bool !== right.bool); - } - } else if (expr.operator === "&") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number & right.number); - res.setRange(expr.range); - return res; - } else if (expr.operator === "|") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number | right.number); - res.setRange(expr.range); - return res; - } else if (expr.operator === "^") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number ^ right.number); - res.setRange(expr.range); - return res; - } else if (expr.operator === ">>>") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number >>> right.number); - res.setRange(expr.range); - return res; - } else if (expr.operator === ">>") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number >> right.number); - res.setRange(expr.range); - return res; - } else if (expr.operator === "<<") { - left = this.evaluateExpression(expr.left); - right = this.evaluateExpression(expr.right); - if (!left || !right) return; - if (!left.isNumber() || !right.isNumber()) return; - res = new BasicEvaluatedExpression(); - res.setNumber(left.number << right.number); - res.setRange(expr.range); - return res; - } - }); - this.hooks.evaluate.for("UnaryExpression").tap("Parser", expr => { - if (expr.operator === "typeof") { - let res; - let name; - if (expr.argument.type === "Identifier") { - name = - this.scope.renames.get(expr.argument.name) || expr.argument.name; - if (!this.scope.definitions.has(name)) { - const hook = this.hooks.evaluateTypeof.get(name); - if (hook !== undefined) { - res = hook.call(expr); - if (res !== undefined) return res; - } - } - } - if (expr.argument.type === "MemberExpression") { - const exprName = this.getNameForExpression(expr.argument); - if (exprName && exprName.free) { - const hook = this.hooks.evaluateTypeof.get(exprName.name); - if (hook !== undefined) { - res = hook.call(expr); - if (res !== undefined) return res; + update(); + }; + + const entryDone = (entry, name) => { + doneEntries++; + update(); + }; + + compiler.hooks.compilation.tap("ProgressPlugin", compilation => { + if (compilation.compiler.isChild()) return; + lastModulesCount = moduleCount; + lastEntriesCount = entriesCount; + moduleCount = entriesCount = 0; + doneModules = doneEntries = 0; + handler(0, "compiling"); + + compilation.hooks.buildModule.tap("ProgressPlugin", moduleAdd); + compilation.hooks.failedModule.tap("ProgressPlugin", moduleDone); + compilation.hooks.succeedModule.tap("ProgressPlugin", moduleDone); + + compilation.hooks.addEntry.tap("ProgressPlugin", entryAdd); + compilation.hooks.failedEntry.tap("ProgressPlugin", entryDone); + compilation.hooks.succeedEntry.tap("ProgressPlugin", entryDone); + + const hooks = { + finishModules: "finish module graph", + seal: "sealing", + beforeChunks: "chunk graph", + afterChunks: "after chunk graph", + optimizeDependenciesBasic: "basic dependencies optimization", + optimizeDependencies: "dependencies optimization", + optimizeDependenciesAdvanced: "advanced dependencies optimization", + afterOptimizeDependencies: "after dependencies optimization", + optimize: "optimizing", + optimizeModulesBasic: "basic module optimization", + optimizeModules: "module optimization", + optimizeModulesAdvanced: "advanced module optimization", + afterOptimizeModules: "after module optimization", + optimizeChunksBasic: "basic chunk optimization", + optimizeChunks: "chunk optimization", + optimizeChunksAdvanced: "advanced chunk optimization", + afterOptimizeChunks: "after chunk optimization", + optimizeTree: "module and chunk tree optimization", + afterOptimizeTree: "after module and chunk tree optimization", + optimizeChunkModulesBasic: "basic chunk modules optimization", + optimizeChunkModules: "chunk modules optimization", + optimizeChunkModulesAdvanced: "advanced chunk modules optimization", + afterOptimizeChunkModules: "after chunk modules optimization", + reviveModules: "module reviving", + optimizeModuleOrder: "module order optimization", + advancedOptimizeModuleOrder: "advanced module order optimization", + beforeModuleIds: "before module ids", + moduleIds: "module ids", + optimizeModuleIds: "module id optimization", + afterOptimizeModuleIds: "module id optimization", + reviveChunks: "chunk reviving", + optimizeChunkOrder: "chunk order optimization", + beforeChunkIds: "before chunk ids", + optimizeChunkIds: "chunk id optimization", + afterOptimizeChunkIds: "after chunk id optimization", + recordModules: "record modules", + recordChunks: "record chunks", + beforeHash: "hashing", + afterHash: "after hashing", + recordHash: "record hash", + beforeModuleAssets: "module assets processing", + beforeChunkAssets: "chunk assets processing", + additionalChunkAssets: "additional chunk assets processing", + record: "recording", + additionalAssets: "additional asset processing", + optimizeChunkAssets: "chunk asset optimization", + afterOptimizeChunkAssets: "after chunk asset optimization", + optimizeAssets: "asset optimization", + afterOptimizeAssets: "after asset optimization", + afterSeal: "after seal" + }; + const numberOfHooks = Object.keys(hooks).length; + Object.keys(hooks).forEach((name, idx) => { + const title = hooks[name]; + const percentage = (idx / numberOfHooks) * 0.25 + 0.7; + compilation.hooks[name].intercept({ + name: "ProgressPlugin", + context: true, + call: () => { + handler(percentage, title); + }, + tap: (context, tap) => { + if (context) { + // p is percentage from 0 to 1 + // args is any number of messages in a hierarchical matter + context.reportProgress = (p, ...args) => { + handler(percentage, title, tap.name, ...args); + }; + } + handler(percentage, title, tap.name); } + }); + }); + }); + compiler.hooks.emit.intercept({ + name: "ProgressPlugin", + context: true, + call: () => { + handler(0.95, "emitting"); + }, + tap: (context, tap) => { + if (context) { + context.reportProgress = (p, ...args) => { + handler(0.95, "emitting", tap.name, ...args); + }; } + handler(0.95, "emitting", tap.name); } - if (expr.argument.type === "FunctionExpression") { - return new BasicEvaluatedExpression() - .setString("function") - .setRange(expr.range); - } - const arg = this.evaluateExpression(expr.argument); - if (arg.isString() || arg.isWrapped()) { - return new BasicEvaluatedExpression() - .setString("string") - .setRange(expr.range); - } - if (arg.isNumber()) { - return new BasicEvaluatedExpression() - .setString("number") - .setRange(expr.range); - } - if (arg.isBoolean()) { - return new BasicEvaluatedExpression() - .setString("boolean") - .setRange(expr.range); - } - if (arg.isArray() || arg.isConstArray() || arg.isRegExp()) { - return new BasicEvaluatedExpression() - .setString("object") - .setRange(expr.range); - } - } else if (expr.operator === "!") { - const argument = this.evaluateExpression(expr.argument); - if (!argument) return; - if (argument.isBoolean()) { - return new BasicEvaluatedExpression() - .setBoolean(!argument.bool) - .setRange(expr.range); - } - if (argument.isTruthy()) { - return new BasicEvaluatedExpression() - .setBoolean(false) - .setRange(expr.range); - } - if (argument.isFalsy()) { - return new BasicEvaluatedExpression() - .setBoolean(true) - .setRange(expr.range); - } - if (argument.isString()) { - return new BasicEvaluatedExpression() - .setBoolean(!argument.string) - .setRange(expr.range); - } - if (argument.isNumber()) { - return new BasicEvaluatedExpression() - .setBoolean(!argument.number) - .setRange(expr.range); - } - } else if (expr.operator === "~") { - const argument = this.evaluateExpression(expr.argument); - if (!argument) return; - if (!argument.isNumber()) return; - const res = new BasicEvaluatedExpression(); - res.setNumber(~argument.number); - res.setRange(expr.range); - return res; - } - }); - this.hooks.evaluateTypeof.for("undefined").tap("Parser", expr => { - return new BasicEvaluatedExpression() - .setString("undefined") - .setRange(expr.range); - }); - this.hooks.evaluate.for("Identifier").tap("Parser", expr => { - const name = this.scope.renames.get(expr.name) || expr.name; - if (!this.scope.definitions.has(expr.name)) { - const hook = this.hooks.evaluateIdentifier.get(name); - if (hook !== undefined) { - const result = hook.call(expr); - if (result) return result; - } - return new BasicEvaluatedExpression() - .setIdentifier(name) - .setRange(expr.range); - } else { - const hook = this.hooks.evaluateDefinedIdentifier.get(name); - if (hook !== undefined) { - return hook.call(expr); - } - } - }); - this.hooks.evaluate.for("ThisExpression").tap("Parser", expr => { - const name = this.scope.renames.get("this"); - if (name) { - const hook = this.hooks.evaluateIdentifier.get(name); - if (hook !== undefined) { - const result = hook.call(expr); - if (result) return result; - } - return new BasicEvaluatedExpression() - .setIdentifier(name) - .setRange(expr.range); - } - }); - this.hooks.evaluate.for("MemberExpression").tap("Parser", expression => { - let exprName = this.getNameForExpression(expression); - if (exprName) { - if (exprName.free) { - const hook = this.hooks.evaluateIdentifier.get(exprName.name); - if (hook !== undefined) { - const result = hook.call(expression); - if (result) return result; - } - return new BasicEvaluatedExpression() - .setIdentifier(exprName.name) - .setRange(expression.range); - } else { - const hook = this.hooks.evaluateDefinedIdentifier.get(exprName.name); - if (hook !== undefined) { - return hook.call(expression); + }); + compiler.hooks.afterEmit.intercept({ + name: "ProgressPlugin", + context: true, + call: () => { + handler(0.98, "after emitting"); + }, + tap: (context, tap) => { + if (context) { + context.reportProgress = (p, ...args) => { + handler(0.98, "after emitting", tap.name, ...args); + }; } + handler(0.98, "after emitting", tap.name); } - } - }); - this.hooks.evaluate.for("CallExpression").tap("Parser", expr => { - if (expr.callee.type !== "MemberExpression") return; - if ( - expr.callee.property.type !== - (expr.callee.computed ? "Literal" : "Identifier") - ) - return; - const param = this.evaluateExpression(expr.callee.object); - if (!param) return; - const property = expr.callee.property.name || expr.callee.property.value; - const hook = this.hooks.evaluateCallExpressionMember.get(property); - if (hook !== undefined) { - return hook.call(expr, param); - } - }); - this.hooks.evaluateCallExpressionMember - .for("replace") - .tap("Parser", (expr, param) => { - if (!param.isString()) return; - if (expr.arguments.length !== 2) return; - let arg1 = this.evaluateExpression(expr.arguments[0]); - let arg2 = this.evaluateExpression(expr.arguments[1]); - if (!arg1.isString() && !arg1.isRegExp()) return; - arg1 = arg1.regExp || arg1.string; - if (!arg2.isString()) return; - arg2 = arg2.string; - return new BasicEvaluatedExpression() - .setString(param.string.replace(arg1, arg2)) - .setRange(expr.range); }); - ["substr", "substring"].forEach(fn => { - this.hooks.evaluateCallExpressionMember - .for(fn) - .tap("Parser", (expr, param) => { - if (!param.isString()) return; - let arg1; - let result, - str = param.string; - switch (expr.arguments.length) { - case 1: - arg1 = this.evaluateExpression(expr.arguments[0]); - if (!arg1.isNumber()) return; - result = str[fn](arg1.number); - break; - case 2: { - arg1 = this.evaluateExpression(expr.arguments[0]); - const arg2 = this.evaluateExpression(expr.arguments[1]); - if (!arg1.isNumber()) return; - if (!arg2.isNumber()) return; - result = str[fn](arg1.number, arg2.number); - break; - } - default: - return; - } - return new BasicEvaluatedExpression() - .setString(result) - .setRange(expr.range); - }); - }); + compiler.hooks.done.tap("ProgressPlugin", () => { + handler(1, ""); + }); + } + } +} - /** - * @param {string} kind "cooked" | "raw" - * @param {TODO} templateLiteralExpr TemplateLiteral expr - * @returns {{quasis: BasicEvaluatedExpression[], parts: BasicEvaluatedExpression[]}} Simplified template - */ - const getSimplifiedTemplateResult = (kind, templateLiteralExpr) => { - const quasis = []; - const parts = []; +ProgressPlugin.defaultOptions = { + profile: false, + modulesCount: 500, + modules: true, + activeModules: true, + // TODO webpack 5 default this to true + entries: false +}; - for (let i = 0; i < templateLiteralExpr.quasis.length; i++) { - const quasiExpr = templateLiteralExpr.quasis[i]; - const quasi = quasiExpr.value[kind]; +module.exports = ProgressPlugin; - if (i > 0) { - const prevExpr = parts[parts.length - 1]; - const expr = this.evaluateExpression( - templateLiteralExpr.expressions[i - 1] - ); - const exprAsString = expr.asString(); - if (typeof exprAsString === "string") { - // We can merge quasi + expr + quasi when expr - // is a const string - prevExpr.setString(prevExpr.string + exprAsString + quasi); - prevExpr.setRange([prevExpr.range[0], quasiExpr.range[1]]); - // We unset the expression as it doesn't match to a single expression - prevExpr.setExpression(undefined); - continue; - } - parts.push(expr); - } +/***/ }), - const part = new BasicEvaluatedExpression() - .setString(quasi) - .setRange(quasiExpr.range) - .setExpression(quasiExpr); - quasis.push(part); - parts.push(part); - } - return { - quasis, - parts - }; - }; +/***/ 72861: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - this.hooks.evaluate.for("TemplateLiteral").tap("Parser", node => { - const { quasis, parts } = getSimplifiedTemplateResult("cooked", node); - if (parts.length === 1) { - return parts[0].setRange(node.range); - } - return new BasicEvaluatedExpression() - .setTemplateString(quasis, parts, "cooked") - .setRange(node.range); - }); - this.hooks.evaluate.for("TaggedTemplateExpression").tap("Parser", node => { - if (this.evaluateExpression(node.tag).identifier !== "String.raw") return; - const { quasis, parts } = getSimplifiedTemplateResult("raw", node.quasi); - if (parts.length === 1) { - return parts[0].setRange(node.range); - } - return new BasicEvaluatedExpression() - .setTemplateString(quasis, parts, "raw") - .setRange(node.range); - }); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - this.hooks.evaluateCallExpressionMember - .for("concat") - .tap("Parser", (expr, param) => { - if (!param.isString() && !param.isWrapped()) return; - let stringSuffix = null; - let hasUnknownParams = false; - for (let i = expr.arguments.length - 1; i >= 0; i--) { - const argExpr = this.evaluateExpression(expr.arguments[i]); - if (!argExpr.isString() && !argExpr.isNumber()) { - hasUnknownParams = true; - break; - } - - const value = argExpr.isString() - ? argExpr.string - : "" + argExpr.number; +const ParserHelpers = __webpack_require__(23999); +const ConstDependency = __webpack_require__(71101); - const newString = value + (stringSuffix ? stringSuffix.string : ""); - const newRange = [ - argExpr.range[0], - (stringSuffix || argExpr).range[1] - ]; - stringSuffix = new BasicEvaluatedExpression() - .setString(newString) - .setRange(newRange); - } +const NullFactory = __webpack_require__(40438); - if (hasUnknownParams) { - const prefix = param.isString() ? param : param.prefix; - return new BasicEvaluatedExpression() - .setWrapped(prefix, stringSuffix) - .setRange(expr.range); - } else if (param.isWrapped()) { - const postfix = stringSuffix || param.postfix; - return new BasicEvaluatedExpression() - .setWrapped(param.prefix, postfix) - .setRange(expr.range); - } else { - const newString = - param.string + (stringSuffix ? stringSuffix.string : ""); - return new BasicEvaluatedExpression() - .setString(newString) - .setRange(expr.range); - } - }); - this.hooks.evaluateCallExpressionMember - .for("split") - .tap("Parser", (expr, param) => { - if (!param.isString()) return; - if (expr.arguments.length !== 1) return; - let result; - const arg = this.evaluateExpression(expr.arguments[0]); - if (arg.isString()) { - result = param.string.split(arg.string); - } else if (arg.isRegExp()) { - result = param.string.split(arg.regExp); - } else { - return; - } - return new BasicEvaluatedExpression() - .setArray(result) - .setRange(expr.range); - }); - this.hooks.evaluate.for("ConditionalExpression").tap("Parser", expr => { - const condition = this.evaluateExpression(expr.test); - const conditionValue = condition.asBool(); - let res; - if (conditionValue === undefined) { - const consequent = this.evaluateExpression(expr.consequent); - const alternate = this.evaluateExpression(expr.alternate); - if (!consequent || !alternate) return; - res = new BasicEvaluatedExpression(); - if (consequent.isConditional()) { - res.setOptions(consequent.options); - } else { - res.setOptions([consequent]); - } - if (alternate.isConditional()) { - res.addOptions(alternate.options); - } else { - res.addOptions([alternate]); - } - } else { - res = this.evaluateExpression( - conditionValue ? expr.consequent : expr.alternate - ); - } - res.setRange(expr.range); - return res; - }); - this.hooks.evaluate.for("ArrayExpression").tap("Parser", expr => { - const items = expr.elements.map(element => { - return element !== null && this.evaluateExpression(element); - }); - if (!items.every(Boolean)) return; - return new BasicEvaluatedExpression() - .setItems(items) - .setRange(expr.range); - }); +class ProvidePlugin { + constructor(definitions) { + this.definitions = definitions; } - getRenameIdentifier(expr) { - const result = this.evaluateExpression(expr); - if (result && result.isIdentifier()) { - return result.identifier; - } - } + apply(compiler) { + const definitions = this.definitions; + compiler.hooks.compilation.tap( + "ProvidePlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(ConstDependency, new NullFactory()); + compilation.dependencyTemplates.set( + ConstDependency, + new ConstDependency.Template() + ); + const handler = (parser, parserOptions) => { + Object.keys(definitions).forEach(name => { + var request = [].concat(definitions[name]); + var splittedName = name.split("."); + if (splittedName.length > 0) { + splittedName.slice(1).forEach((_, i) => { + const name = splittedName.slice(0, i + 1).join("."); + parser.hooks.canRename + .for(name) + .tap("ProvidePlugin", ParserHelpers.approve); + }); + } + parser.hooks.expression.for(name).tap("ProvidePlugin", expr => { + let nameIdentifier = name; + const scopedName = name.includes("."); + let expression = `require(${JSON.stringify(request[0])})`; + if (scopedName) { + nameIdentifier = `__webpack_provided_${name.replace( + /\./g, + "_dot_" + )}`; + } + if (request.length > 1) { + expression += request + .slice(1) + .map(r => `[${JSON.stringify(r)}]`) + .join(""); + } + if ( + !ParserHelpers.addParsedVariableToModule( + parser, + nameIdentifier, + expression + ) + ) { + return false; + } + if (scopedName) { + ParserHelpers.toConstantDependency( + parser, + nameIdentifier + )(expr); + } + return true; + }); + }); + }; + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("ProvidePlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("ProvidePlugin", handler); - walkClass(classy) { - if (classy.superClass) this.walkExpression(classy.superClass); - if (classy.body && classy.body.type === "ClassBody") { - const wasTopLevel = this.scope.topLevelScope; - this.scope.topLevelScope = false; - for (const methodDefinition of classy.body.body) { - if (methodDefinition.type === "MethodDefinition") { - this.walkMethodDefinition(methodDefinition); - } + // Disable ProvidePlugin for javascript/esm, see https://github.com/webpack/webpack/issues/7032 } - this.scope.topLevelScope = wasTopLevel; - } - } - - walkMethodDefinition(methodDefinition) { - if (methodDefinition.computed && methodDefinition.key) { - this.walkExpression(methodDefinition.key); - } - if (methodDefinition.value) { - this.walkExpression(methodDefinition.value); - } + ); } +} +module.exports = ProvidePlugin; - // Prewalking iterates the scope for variable declarations - prewalkStatements(statements) { - for (let index = 0, len = statements.length; index < len; index++) { - const statement = statements[index]; - this.prewalkStatement(statement); - } - } - // Block-Prewalking iterates the scope for block variable declarations - blockPrewalkStatements(statements) { - for (let index = 0, len = statements.length; index < len; index++) { - const statement = statements[index]; - this.blockPrewalkStatement(statement); - } - } +/***/ }), - // Walking iterates the statements and expressions and processes them - walkStatements(statements) { - for (let index = 0, len = statements.length; index < len; index++) { - const statement = statements[index]; - this.walkStatement(statement); - } - } +/***/ 82353: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - prewalkStatement(statement) { - switch (statement.type) { - case "BlockStatement": - this.prewalkBlockStatement(statement); - break; - case "DoWhileStatement": - this.prewalkDoWhileStatement(statement); - break; - case "ExportAllDeclaration": - this.prewalkExportAllDeclaration(statement); - break; - case "ExportDefaultDeclaration": - this.prewalkExportDefaultDeclaration(statement); - break; - case "ExportNamedDeclaration": - this.prewalkExportNamedDeclaration(statement); - break; - case "ForInStatement": - this.prewalkForInStatement(statement); - break; - case "ForOfStatement": - this.prewalkForOfStatement(statement); - break; - case "ForStatement": - this.prewalkForStatement(statement); - break; - case "FunctionDeclaration": - this.prewalkFunctionDeclaration(statement); - break; - case "IfStatement": - this.prewalkIfStatement(statement); - break; - case "ImportDeclaration": - this.prewalkImportDeclaration(statement); - break; - case "LabeledStatement": - this.prewalkLabeledStatement(statement); - break; - case "SwitchStatement": - this.prewalkSwitchStatement(statement); - break; - case "TryStatement": - this.prewalkTryStatement(statement); - break; - case "VariableDeclaration": - this.prewalkVariableDeclaration(statement); - break; - case "WhileStatement": - this.prewalkWhileStatement(statement); - break; - case "WithStatement": - this.prewalkWithStatement(statement); - break; - } - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - blockPrewalkStatement(statement) { - switch (statement.type) { - case "VariableDeclaration": - this.blockPrewalkVariableDeclaration(statement); - break; - case "ExportDefaultDeclaration": - this.blockPrewalkExportDefaultDeclaration(statement); - break; - case "ExportNamedDeclaration": - this.blockPrewalkExportNamedDeclaration(statement); - break; - case "ClassDeclaration": - this.blockPrewalkClassDeclaration(statement); - break; - } - } - walkStatement(statement) { - if (this.hooks.statement.call(statement) !== undefined) return; - switch (statement.type) { - case "BlockStatement": - this.walkBlockStatement(statement); - break; - case "ClassDeclaration": - this.walkClassDeclaration(statement); - break; - case "DoWhileStatement": - this.walkDoWhileStatement(statement); - break; - case "ExportDefaultDeclaration": - this.walkExportDefaultDeclaration(statement); - break; - case "ExportNamedDeclaration": - this.walkExportNamedDeclaration(statement); - break; - case "ExpressionStatement": - this.walkExpressionStatement(statement); - break; - case "ForInStatement": - this.walkForInStatement(statement); - break; - case "ForOfStatement": - this.walkForOfStatement(statement); - break; - case "ForStatement": - this.walkForStatement(statement); - break; - case "FunctionDeclaration": - this.walkFunctionDeclaration(statement); - break; - case "IfStatement": - this.walkIfStatement(statement); - break; - case "LabeledStatement": - this.walkLabeledStatement(statement); - break; - case "ReturnStatement": - this.walkReturnStatement(statement); - break; - case "SwitchStatement": - this.walkSwitchStatement(statement); - break; - case "ThrowStatement": - this.walkThrowStatement(statement); - break; - case "TryStatement": - this.walkTryStatement(statement); - break; - case "VariableDeclaration": - this.walkVariableDeclaration(statement); - break; - case "WhileStatement": - this.walkWhileStatement(statement); - break; - case "WithStatement": - this.walkWithStatement(statement); - break; - } - } +const Module = __webpack_require__(75993); +const { OriginalSource, RawSource } = __webpack_require__(53665); - // Real Statements - prewalkBlockStatement(statement) { - this.prewalkStatements(statement.body); +module.exports = class RawModule extends Module { + constructor(source, identifier, readableIdentifier) { + super("javascript/dynamic", null); + this.sourceStr = source; + this.identifierStr = identifier || this.sourceStr; + this.readableIdentifierStr = readableIdentifier || this.identifierStr; + this.built = false; } - walkBlockStatement(statement) { - this.inBlockScope(() => { - const body = statement.body; - this.blockPrewalkStatements(body); - this.walkStatements(body); - }); + identifier() { + return this.identifierStr; } - walkExpressionStatement(statement) { - this.walkExpression(statement.expression); + size() { + return this.sourceStr.length; } - prewalkIfStatement(statement) { - this.prewalkStatement(statement.consequent); - if (statement.alternate) { - this.prewalkStatement(statement.alternate); - } + readableIdentifier(requestShortener) { + return requestShortener.shorten(this.readableIdentifierStr); } - walkIfStatement(statement) { - const result = this.hooks.statementIf.call(statement); - if (result === undefined) { - this.walkExpression(statement.test); - this.walkStatement(statement.consequent); - if (statement.alternate) { - this.walkStatement(statement.alternate); - } - } else { - if (result) { - this.walkStatement(statement.consequent); - } else if (statement.alternate) { - this.walkStatement(statement.alternate); - } - } + needRebuild() { + return false; } - prewalkLabeledStatement(statement) { - this.prewalkStatement(statement.body); + build(options, compilations, resolver, fs, callback) { + this.built = true; + this.buildMeta = {}; + this.buildInfo = { + cacheable: true + }; + callback(); } - walkLabeledStatement(statement) { - const hook = this.hooks.label.get(statement.label.name); - if (hook !== undefined) { - const result = hook.call(statement); - if (result === true) return; + source() { + if (this.useSourceMap) { + return new OriginalSource(this.sourceStr, this.identifier()); + } else { + return new RawSource(this.sourceStr); } - this.walkStatement(statement.body); - } - - prewalkWithStatement(statement) { - this.prewalkStatement(statement.body); } - walkWithStatement(statement) { - this.walkExpression(statement.object); - this.walkStatement(statement.body); + updateHash(hash) { + hash.update(this.sourceStr); + super.updateHash(hash); } +}; - prewalkSwitchStatement(statement) { - this.prewalkSwitchCases(statement.cases); - } - walkSwitchStatement(statement) { - this.walkExpression(statement.discriminant); - this.walkSwitchCases(statement.cases); - } +/***/ }), - walkTerminatingStatement(statement) { - if (statement.argument) this.walkExpression(statement.argument); - } +/***/ 40355: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - walkReturnStatement(statement) { - this.walkTerminatingStatement(statement); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - walkThrowStatement(statement) { - this.walkTerminatingStatement(statement); - } - prewalkTryStatement(statement) { - this.prewalkStatement(statement.block); - } +const identifierUtils = __webpack_require__(94658); - walkTryStatement(statement) { - if (this.scope.inTry) { - this.walkStatement(statement.block); - } else { - this.scope.inTry = true; - this.walkStatement(statement.block); - this.scope.inTry = false; - } - if (statement.handler) this.walkCatchClause(statement.handler); - if (statement.finalizer) this.walkStatement(statement.finalizer); - } +/** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("./Module")} Module */ - prewalkWhileStatement(statement) { - this.prewalkStatement(statement.body); - } +/** + * @typedef {Object} RecordsChunks + * @property {Record=} byName + * @property {Record=} bySource + * @property {number[]=} usedIds + */ - walkWhileStatement(statement) { - this.walkExpression(statement.test); - this.walkStatement(statement.body); - } +/** + * @typedef {Object} RecordsModules + * @property {Record=} byIdentifier + * @property {Record=} bySource + * @property {Record=} usedIds + */ - prewalkDoWhileStatement(statement) { - this.prewalkStatement(statement.body); - } +/** + * @typedef {Object} Records + * @property {RecordsChunks=} chunks + * @property {RecordsModules=} modules + */ - walkDoWhileStatement(statement) { - this.walkStatement(statement.body); - this.walkExpression(statement.test); +class RecordIdsPlugin { + /** + * @param {Object} options Options object + * @param {boolean=} options.portableIds true, when ids need to be portable + */ + constructor(options) { + this.options = options || {}; } - prewalkForStatement(statement) { - if (statement.init) { - if (statement.init.type === "VariableDeclaration") { - this.prewalkStatement(statement.init); - } - } - this.prewalkStatement(statement.body); - } + /** + * @param {Compiler} compiler the Compiler + * @returns {void} + */ + apply(compiler) { + const portableIds = this.options.portableIds; + compiler.hooks.compilation.tap("RecordIdsPlugin", compilation => { + compilation.hooks.recordModules.tap( + "RecordIdsPlugin", + /** + * @param {Module[]} modules the modules array + * @param {Records} records the records object + * @returns {void} + */ + (modules, records) => { + if (!records.modules) records.modules = {}; + if (!records.modules.byIdentifier) records.modules.byIdentifier = {}; + if (!records.modules.usedIds) records.modules.usedIds = {}; + for (const module of modules) { + if (typeof module.id !== "number") continue; + const identifier = portableIds + ? identifierUtils.makePathsRelative( + compiler.context, + module.identifier(), + compilation.cache + ) + : module.identifier(); + records.modules.byIdentifier[identifier] = module.id; + records.modules.usedIds[module.id] = module.id; + } + } + ); + compilation.hooks.reviveModules.tap( + "RecordIdsPlugin", + /** + * @param {Module[]} modules the modules array + * @param {Records} records the records object + * @returns {void} + */ + (modules, records) => { + if (!records.modules) return; + if (records.modules.byIdentifier) { + /** @type {Set} */ + const usedIds = new Set(); + for (const module of modules) { + if (module.id !== null) continue; + const identifier = portableIds + ? identifierUtils.makePathsRelative( + compiler.context, + module.identifier(), + compilation.cache + ) + : module.identifier(); + const id = records.modules.byIdentifier[identifier]; + if (id === undefined) continue; + if (usedIds.has(id)) continue; + usedIds.add(id); + module.id = id; + } + } + if (Array.isArray(records.modules.usedIds)) { + compilation.usedModuleIds = new Set(records.modules.usedIds); + } + } + ); - walkForStatement(statement) { - this.inBlockScope(() => { - if (statement.init) { - if (statement.init.type === "VariableDeclaration") { - this.blockPrewalkVariableDeclaration(statement.init); - this.walkStatement(statement.init); - } else { - this.walkExpression(statement.init); + /** + * @param {Module} module the module + * @returns {string} the (portable) identifier + */ + const getModuleIdentifier = module => { + if (portableIds) { + return identifierUtils.makePathsRelative( + compiler.context, + module.identifier(), + compilation.cache + ); } - } - if (statement.test) { - this.walkExpression(statement.test); - } - if (statement.update) { - this.walkExpression(statement.update); - } - const body = statement.body; - if (body.type === "BlockStatement") { - // no need to add additional scope - this.blockPrewalkStatements(body.body); - this.walkStatements(body.body); - } else { - this.walkStatement(body); - } - }); - } + return module.identifier(); + }; - prewalkForInStatement(statement) { - if (statement.left.type === "VariableDeclaration") { - this.prewalkVariableDeclaration(statement.left); - } - this.prewalkStatement(statement.body); - } + /** + * @param {Chunk} chunk the chunk + * @returns {string[]} sources of the chunk + */ + const getChunkSources = chunk => { + /** @type {string[]} */ + const sources = []; + for (const chunkGroup of chunk.groupsIterable) { + const index = chunkGroup.chunks.indexOf(chunk); + if (chunkGroup.name) { + sources.push(`${index} ${chunkGroup.name}`); + } else { + for (const origin of chunkGroup.origins) { + if (origin.module) { + if (origin.request) { + sources.push( + `${index} ${getModuleIdentifier(origin.module)} ${ + origin.request + }` + ); + } else if (typeof origin.loc === "string") { + sources.push( + `${index} ${getModuleIdentifier(origin.module)} ${ + origin.loc + }` + ); + } else if ( + origin.loc && + typeof origin.loc === "object" && + origin.loc.start + ) { + sources.push( + `${index} ${getModuleIdentifier( + origin.module + )} ${JSON.stringify(origin.loc.start)}` + ); + } + } + } + } + } + return sources; + }; - walkForInStatement(statement) { - this.inBlockScope(() => { - if (statement.left.type === "VariableDeclaration") { - this.blockPrewalkVariableDeclaration(statement.left); - this.walkVariableDeclaration(statement.left); - } else { - this.walkPattern(statement.left); - } - this.walkExpression(statement.right); - const body = statement.body; - if (body.type === "BlockStatement") { - // no need to add additional scope - this.blockPrewalkStatements(body.body); - this.walkStatements(body.body); - } else { - this.walkStatement(body); - } + compilation.hooks.recordChunks.tap( + "RecordIdsPlugin", + /** + * @param {Chunk[]} chunks the chunks array + * @param {Records} records the records object + * @returns {void} + */ + (chunks, records) => { + if (!records.chunks) records.chunks = {}; + if (!records.chunks.byName) records.chunks.byName = {}; + if (!records.chunks.bySource) records.chunks.bySource = {}; + /** @type {Set} */ + const usedIds = new Set(); + for (const chunk of chunks) { + if (typeof chunk.id !== "number") continue; + const name = chunk.name; + if (name) records.chunks.byName[name] = chunk.id; + const sources = getChunkSources(chunk); + for (const source of sources) { + records.chunks.bySource[source] = chunk.id; + } + usedIds.add(chunk.id); + } + records.chunks.usedIds = Array.from(usedIds).sort(); + } + ); + compilation.hooks.reviveChunks.tap( + "RecordIdsPlugin", + /** + * @param {Chunk[]} chunks the chunks array + * @param {Records} records the records object + * @returns {void} + */ + (chunks, records) => { + if (!records.chunks) return; + /** @type {Set} */ + const usedIds = new Set(); + if (records.chunks.byName) { + for (const chunk of chunks) { + if (chunk.id !== null) continue; + if (!chunk.name) continue; + const id = records.chunks.byName[chunk.name]; + if (id === undefined) continue; + if (usedIds.has(id)) continue; + usedIds.add(id); + chunk.id = id; + } + } + if (records.chunks.bySource) { + for (const chunk of chunks) { + const sources = getChunkSources(chunk); + for (const source of sources) { + const id = records.chunks.bySource[source]; + if (id === undefined) continue; + if (usedIds.has(id)) continue; + usedIds.add(id); + chunk.id = id; + break; + } + } + } + if (Array.isArray(records.chunks.usedIds)) { + compilation.usedChunkIds = new Set(records.chunks.usedIds); + } + } + ); }); } +} +module.exports = RecordIdsPlugin; - prewalkForOfStatement(statement) { - if (statement.left.type === "VariableDeclaration") { - this.prewalkVariableDeclaration(statement.left); - } - this.prewalkStatement(statement.body); - } - walkForOfStatement(statement) { - this.inBlockScope(() => { - if (statement.left.type === "VariableDeclaration") { - this.blockPrewalkVariableDeclaration(statement.left); - this.walkVariableDeclaration(statement.left); - } else { - this.walkPattern(statement.left); - } - this.walkExpression(statement.right); - const body = statement.body; - if (body.type === "BlockStatement") { - // no need to add additional scope - this.blockPrewalkStatements(body.body); - this.walkStatements(body.body); - } else { - this.walkStatement(body); - } - }); - } +/***/ }), - // Declarations - prewalkFunctionDeclaration(statement) { - if (statement.id) { - this.scope.renames.set(statement.id.name, null); - this.scope.definitions.add(statement.id.name); - } - } +/***/ 15377: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - walkFunctionDeclaration(statement) { - const wasTopLevel = this.scope.topLevelScope; - this.scope.topLevelScope = false; - this.inFunctionScope(true, statement.params, () => { - for (const param of statement.params) { - this.walkPattern(param); - } - if (statement.body.type === "BlockStatement") { - this.detectMode(statement.body.body); - this.prewalkStatement(statement.body); - this.walkStatement(statement.body); - } else { - this.walkExpression(statement.body); - } - }); - this.scope.topLevelScope = wasTopLevel; +"use strict"; + + +const WebpackError = __webpack_require__(97391); + +module.exports = class RemovedPluginError extends WebpackError { + constructor(message) { + super(message); + + Error.captureStackTrace(this, this.constructor); } +}; - prewalkImportDeclaration(statement) { - const source = statement.source.value; - this.hooks.import.call(statement, source); - for (const specifier of statement.specifiers) { - const name = specifier.local.name; - this.scope.renames.set(name, null); - this.scope.definitions.add(name); - switch (specifier.type) { - case "ImportDefaultSpecifier": - this.hooks.importSpecifier.call(statement, source, "default", name); - break; - case "ImportSpecifier": - this.hooks.importSpecifier.call( - statement, - source, - specifier.imported.name, - name - ); - break; - case "ImportNamespaceSpecifier": - this.hooks.importSpecifier.call(statement, source, null, name); - break; - } + +/***/ }), + +/***/ 54254: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const path = __webpack_require__(85622); +const NORMALIZE_SLASH_DIRECTION_REGEXP = /\\/g; +const PATH_CHARS_REGEXP = /[-[\]{}()*+?.,\\^$|#\s]/g; +const SEPARATOR_REGEXP = /[/\\]$/; +const FRONT_OR_BACK_BANG_REGEXP = /^!|!$/g; +const INDEX_JS_REGEXP = /\/index.js(!|\?|\(query\))/g; +const MATCH_RESOURCE_REGEXP = /!=!/; + +const normalizeBackSlashDirection = request => { + return request.replace(NORMALIZE_SLASH_DIRECTION_REGEXP, "/"); +}; + +const createRegExpForPath = path => { + const regexpTypePartial = path.replace(PATH_CHARS_REGEXP, "\\$&"); + return new RegExp(`(^|!)${regexpTypePartial}`, "g"); +}; + +class RequestShortener { + constructor(directory) { + directory = normalizeBackSlashDirection(directory); + if (SEPARATOR_REGEXP.test(directory)) { + directory = directory.substr(0, directory.length - 1); } - } - enterDeclaration(declaration, onIdent) { - switch (declaration.type) { - case "VariableDeclaration": - for (const declarator of declaration.declarations) { - switch (declarator.type) { - case "VariableDeclarator": { - this.enterPattern(declarator.id, onIdent); - break; - } - } - } - break; - case "FunctionDeclaration": - this.enterPattern(declaration.id, onIdent); - break; - case "ClassDeclaration": - this.enterPattern(declaration.id, onIdent); - break; + if (directory) { + this.currentDirectoryRegExp = createRegExpForPath(directory); } - } - blockPrewalkExportNamedDeclaration(statement) { - if (statement.declaration) { - this.blockPrewalkStatement(statement.declaration); + const dirname = path.dirname(directory); + const endsWithSeparator = SEPARATOR_REGEXP.test(dirname); + const parentDirectory = endsWithSeparator + ? dirname.substr(0, dirname.length - 1) + : dirname; + if (parentDirectory && parentDirectory !== directory) { + this.parentDirectoryRegExp = createRegExpForPath(`${parentDirectory}/`); + } + + if (__dirname.length >= 2) { + const buildins = normalizeBackSlashDirection(path.join(__dirname, "..")); + const buildinsAsModule = + this.currentDirectoryRegExp && + this.currentDirectoryRegExp.test(buildins); + this.buildinsAsModule = buildinsAsModule; + this.buildinsRegExp = createRegExpForPath(buildins); } + + this.cache = new Map(); } - prewalkExportNamedDeclaration(statement) { - let source; - if (statement.source) { - source = statement.source.value; - this.hooks.exportImport.call(statement, source); - } else { - this.hooks.export.call(statement); + shorten(request) { + if (!request) return request; + const cacheEntry = this.cache.get(request); + if (cacheEntry !== undefined) { + return cacheEntry; } - if (statement.declaration) { - if ( - !this.hooks.exportDeclaration.call(statement, statement.declaration) - ) { - this.prewalkStatement(statement.declaration); - let index = 0; - this.enterDeclaration(statement.declaration, def => { - this.hooks.exportSpecifier.call(statement, def, def, index++); - }); - } + let result = normalizeBackSlashDirection(request); + if (this.buildinsAsModule && this.buildinsRegExp) { + result = result.replace(this.buildinsRegExp, "!(webpack)"); } - if (statement.specifiers) { - for ( - let specifierIndex = 0; - specifierIndex < statement.specifiers.length; - specifierIndex++ - ) { - const specifier = statement.specifiers[specifierIndex]; - switch (specifier.type) { - case "ExportSpecifier": { - const name = specifier.exported.name; - if (source) { - this.hooks.exportImportSpecifier.call( - statement, - source, - specifier.local.name, - name, - specifierIndex - ); - } else { - this.hooks.exportSpecifier.call( - statement, - specifier.local.name, - name, - specifierIndex - ); - } - break; - } - } - } + if (this.currentDirectoryRegExp) { + result = result.replace(this.currentDirectoryRegExp, "!."); } - } - - walkExportNamedDeclaration(statement) { - if (statement.declaration) { - this.walkStatement(statement.declaration); + if (this.parentDirectoryRegExp) { + result = result.replace(this.parentDirectoryRegExp, "!../"); } - } - - blockPrewalkExportDefaultDeclaration(statement) { - if (statement.declaration.type === "ClassDeclaration") { - this.blockPrewalkClassDeclaration(statement.declaration); + if (!this.buildinsAsModule && this.buildinsRegExp) { + result = result.replace(this.buildinsRegExp, "!(webpack)"); } + result = result.replace(INDEX_JS_REGEXP, "$1"); + result = result.replace(FRONT_OR_BACK_BANG_REGEXP, ""); + result = result.replace(MATCH_RESOURCE_REGEXP, " = "); + this.cache.set(request, result); + return result; } +} - prewalkExportDefaultDeclaration(statement) { - this.prewalkStatement(statement.declaration); - if ( - statement.declaration.id && - statement.declaration.type !== "FunctionExpression" && - statement.declaration.type !== "ClassExpression" - ) { - this.hooks.exportSpecifier.call( - statement, - statement.declaration.id.name, - "default" - ); - } - } +module.exports = RequestShortener; - walkExportDefaultDeclaration(statement) { - this.hooks.export.call(statement); - if ( - statement.declaration.id && - statement.declaration.type !== "FunctionExpression" && - statement.declaration.type !== "ClassExpression" - ) { - if ( - !this.hooks.exportDeclaration.call(statement, statement.declaration) - ) { - this.walkStatement(statement.declaration); - } - } else { - // Acorn parses `export default function() {}` as `FunctionDeclaration` and - // `export default class {}` as `ClassDeclaration`, both with `id = null`. - // These nodes must be treated as expressions. - if (statement.declaration.type === "FunctionDeclaration") { - this.walkFunctionDeclaration(statement.declaration); - } else if (statement.declaration.type === "ClassDeclaration") { - this.walkClassDeclaration(statement.declaration); - } else { - this.walkExpression(statement.declaration); - } - if (!this.hooks.exportExpression.call(statement, statement.declaration)) { - this.hooks.exportSpecifier.call( - statement, - statement.declaration, - "default" + +/***/ }), + +/***/ 88226: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const ParserHelpers = __webpack_require__(23999); +const ConstDependency = __webpack_require__(71101); +const NullFactory = __webpack_require__(40438); + +module.exports = class RequireJsStuffPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "RequireJsStuffPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(ConstDependency, new NullFactory()); + compilation.dependencyTemplates.set( + ConstDependency, + new ConstDependency.Template() ); + const handler = (parser, parserOptions) => { + if (parserOptions.requireJs !== undefined && !parserOptions.requireJs) + return; + + parser.hooks.call + .for("require.config") + .tap( + "RequireJsStuffPlugin", + ParserHelpers.toConstantDependency(parser, "undefined") + ); + parser.hooks.call + .for("requirejs.config") + .tap( + "RequireJsStuffPlugin", + ParserHelpers.toConstantDependency(parser, "undefined") + ); + + parser.hooks.expression + .for("require.version") + .tap( + "RequireJsStuffPlugin", + ParserHelpers.toConstantDependency( + parser, + JSON.stringify("0.0.0") + ) + ); + parser.hooks.expression + .for("requirejs.onError") + .tap( + "RequireJsStuffPlugin", + ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + "__webpack_require__.oe" + ) + ); + }; + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("RequireJsStuffPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("RequireJsStuffPlugin", handler); } - } + ); } +}; - prewalkExportAllDeclaration(statement) { - const source = statement.source.value; - this.hooks.exportImport.call(statement, source); - this.hooks.exportImportSpecifier.call(statement, source, null, null, 0); - } - prewalkVariableDeclaration(statement) { - if (statement.kind !== "var") return; - this._prewalkVariableDeclaration(statement, this.hooks.varDeclarationVar); - } +/***/ }), - blockPrewalkVariableDeclaration(statement) { - if (statement.kind === "var") return; - const hookMap = - statement.kind === "const" - ? this.hooks.varDeclarationConst - : this.hooks.varDeclarationLet; - this._prewalkVariableDeclaration(statement, hookMap); - } +/***/ 50588: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - _prewalkVariableDeclaration(statement, hookMap) { - for (const declarator of statement.declarations) { - switch (declarator.type) { - case "VariableDeclarator": { - this.enterPattern(declarator.id, (name, decl) => { - let hook = hookMap.get(name); - if (hook === undefined || !hook.call(decl)) { - hook = this.hooks.varDeclaration.get(name); - if (hook === undefined || !hook.call(decl)) { - this.scope.renames.set(name, null); - this.scope.definitions.add(name); - } - } - }); - break; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ + + +const { Tapable, HookMap, SyncHook, SyncWaterfallHook } = __webpack_require__(92402); +const Factory = __webpack_require__(87450).ResolverFactory; +const { cachedCleverMerge } = __webpack_require__(67916); + +/** @typedef {import("enhanced-resolve").Resolver} Resolver */ + +const EMTPY_RESOLVE_OPTIONS = {}; + +module.exports = class ResolverFactory extends Tapable { + constructor() { + super(); + this.hooks = { + resolveOptions: new HookMap( + () => new SyncWaterfallHook(["resolveOptions"]) + ), + resolver: new HookMap(() => new SyncHook(["resolver", "resolveOptions"])) + }; + this._pluginCompat.tap("ResolverFactory", options => { + let match; + match = /^resolve-options (.+)$/.exec(options.name); + if (match) { + this.hooks.resolveOptions + .for(match[1]) + .tap(options.fn.name || "unnamed compat plugin", options.fn); + return true; } - } + match = /^resolver (.+)$/.exec(options.name); + if (match) { + this.hooks.resolver + .for(match[1]) + .tap(options.fn.name || "unnamed compat plugin", options.fn); + return true; + } + }); + this.cache2 = new Map(); } - walkVariableDeclaration(statement) { - for (const declarator of statement.declarations) { - switch (declarator.type) { - case "VariableDeclarator": { - const renameIdentifier = - declarator.init && this.getRenameIdentifier(declarator.init); - if (renameIdentifier && declarator.id.type === "Identifier") { - const hook = this.hooks.canRename.get(renameIdentifier); - if (hook !== undefined && hook.call(declarator.init)) { - // renaming with "var a = b;" - const hook = this.hooks.rename.get(renameIdentifier); - if (hook === undefined || !hook.call(declarator.init)) { - this.scope.renames.set( - declarator.id.name, - this.scope.renames.get(renameIdentifier) || renameIdentifier - ); - this.scope.definitions.delete(declarator.id.name); - } - break; - } - } - this.walkPattern(declarator.id); - if (declarator.init) this.walkExpression(declarator.init); - break; - } - } - } + get(type, resolveOptions) { + resolveOptions = resolveOptions || EMTPY_RESOLVE_OPTIONS; + const ident = `${type}|${JSON.stringify(resolveOptions)}`; + const resolver = this.cache2.get(ident); + if (resolver) return resolver; + const newResolver = this._create(type, resolveOptions); + this.cache2.set(ident, newResolver); + return newResolver; } - blockPrewalkClassDeclaration(statement) { - if (statement.id) { - this.scope.renames.set(statement.id.name, null); - this.scope.definitions.add(statement.id.name); + _create(type, resolveOptions) { + const originalResolveOptions = Object.assign({}, resolveOptions); + resolveOptions = this.hooks.resolveOptions.for(type).call(resolveOptions); + const resolver = Factory.createResolver(resolveOptions); + if (!resolver) { + throw new Error("No resolver created"); } + /** @type {Map} */ + const childCache = new Map(); + resolver.withOptions = options => { + const cacheEntry = childCache.get(options); + if (cacheEntry !== undefined) return cacheEntry; + const mergedOptions = cachedCleverMerge(originalResolveOptions, options); + const resolver = this.get(type, mergedOptions); + childCache.set(options, resolver); + return resolver; + }; + this.hooks.resolver.for(type).call(resolver, resolveOptions); + return resolver; } +}; - walkClassDeclaration(statement) { - this.walkClass(statement); - } - prewalkSwitchCases(switchCases) { - for (let index = 0, len = switchCases.length; index < len; index++) { - const switchCase = switchCases[index]; - this.prewalkStatements(switchCase.consequent); - } - } +/***/ }), - walkSwitchCases(switchCases) { - for (let index = 0, len = switchCases.length; index < len; index++) { - const switchCase = switchCases[index]; +/***/ 84247: +/***/ (function(module) { - if (switchCase.test) { - this.walkExpression(switchCase.test); - } - this.walkStatements(switchCase.consequent); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +/* +: +: [] +: { + resource: { + test: , + include: , + exclude: , + }, + resource: , -> resource.test + test: , -> resource.test + include: , -> resource.include + exclude: , -> resource.exclude + resourceQuery: , + compiler: , + issuer: , + use: "loader", -> use[0].loader + loader: <>, -> use[0].loader + loaders: <>, -> use + options: {}, -> use[0].options, + query: {}, -> options + parser: {}, + use: [ + "loader" -> use[x].loader + ], + use: [ + { + loader: "loader", + options: {} } - } + ], + rules: [ + + ], + oneOf: [ + + ] +} - walkCatchClause(catchClause) { - this.inBlockScope(() => { - // Error binding is optional in catch clause since ECMAScript 2019 - if (catchClause.param !== null) { - this.enterPattern(catchClause.param, ident => { - this.scope.renames.set(ident, null); - this.scope.definitions.add(ident); - }); - this.walkPattern(catchClause.param); - } - this.prewalkStatement(catchClause.body); - this.walkStatement(catchClause.body); - }); - } +: /regExp/ +: function(arg) {} +: "starting" +: [] // or +: { and: [] } +: { or: [] } +: { not: [] } +: { test: , include: , exclude: } - walkPattern(pattern) { - switch (pattern.type) { - case "ArrayPattern": - this.walkArrayPattern(pattern); - break; - case "AssignmentPattern": - this.walkAssignmentPattern(pattern); - break; - case "MemberExpression": - this.walkMemberExpression(pattern); - break; - case "ObjectPattern": - this.walkObjectPattern(pattern); - break; - case "RestElement": - this.walkRestElement(pattern); - break; - } - } - walkAssignmentPattern(pattern) { - this.walkExpression(pattern.right); - this.walkPattern(pattern.left); - } +normalized: - walkObjectPattern(pattern) { - for (let i = 0, len = pattern.properties.length; i < len; i++) { - const prop = pattern.properties[i]; - if (prop) { - if (prop.computed) this.walkExpression(prop.key); - if (prop.value) this.walkPattern(prop.value); - } +{ + resource: function(), + resourceQuery: function(), + compiler: function(), + issuer: function(), + use: [ + { + loader: string, + options: string, + : } - } + ], + rules: [], + oneOf: [], + : , +} - walkArrayPattern(pattern) { - for (let i = 0, len = pattern.elements.length; i < len; i++) { - const element = pattern.elements[i]; - if (element) this.walkPattern(element); - } - } +*/ - walkRestElement(pattern) { - this.walkPattern(pattern.argument); - } - walkExpressions(expressions) { - for (const expression of expressions) { - if (expression) { - this.walkExpression(expression); - } + +const notMatcher = matcher => { + return str => { + return !matcher(str); + }; +}; + +const orMatcher = items => { + return str => { + for (let i = 0; i < items.length; i++) { + if (items[i](str)) return true; } - } + return false; + }; +}; - walkExpression(expression) { - switch (expression.type) { - case "ArrayExpression": - this.walkArrayExpression(expression); - break; - case "ArrowFunctionExpression": - this.walkArrowFunctionExpression(expression); - break; - case "AssignmentExpression": - this.walkAssignmentExpression(expression); - break; - case "AwaitExpression": - this.walkAwaitExpression(expression); - break; - case "BinaryExpression": - this.walkBinaryExpression(expression); - break; - case "CallExpression": - this.walkCallExpression(expression); - break; - case "ClassExpression": - this.walkClassExpression(expression); - break; - case "ConditionalExpression": - this.walkConditionalExpression(expression); - break; - case "FunctionExpression": - this.walkFunctionExpression(expression); - break; - case "Identifier": - this.walkIdentifier(expression); - break; - case "LogicalExpression": - this.walkLogicalExpression(expression); - break; - case "MemberExpression": - this.walkMemberExpression(expression); - break; - case "NewExpression": - this.walkNewExpression(expression); - break; - case "ObjectExpression": - this.walkObjectExpression(expression); - break; - case "SequenceExpression": - this.walkSequenceExpression(expression); - break; - case "SpreadElement": - this.walkSpreadElement(expression); - break; - case "TaggedTemplateExpression": - this.walkTaggedTemplateExpression(expression); - break; - case "TemplateLiteral": - this.walkTemplateLiteral(expression); - break; - case "ThisExpression": - this.walkThisExpression(expression); - break; - case "UnaryExpression": - this.walkUnaryExpression(expression); - break; - case "UpdateExpression": - this.walkUpdateExpression(expression); - break; - case "YieldExpression": - this.walkYieldExpression(expression); - break; +const andMatcher = items => { + return str => { + for (let i = 0; i < items.length; i++) { + if (!items[i](str)) return false; } - } + return true; + }; +}; - walkAwaitExpression(expression) { - this.walkExpression(expression.argument); +module.exports = class RuleSet { + constructor(rules) { + this.references = Object.create(null); + this.rules = RuleSet.normalizeRules(rules, this.references, "ref-"); } - walkArrayExpression(expression) { - if (expression.elements) { - this.walkExpressions(expression.elements); + static normalizeRules(rules, refs, ident) { + if (Array.isArray(rules)) { + return rules.map((rule, idx) => { + return RuleSet.normalizeRule(rule, refs, `${ident}-${idx}`); + }); + } else if (rules) { + return [RuleSet.normalizeRule(rules, refs, ident)]; + } else { + return []; } } - walkSpreadElement(expression) { - if (expression.argument) { - this.walkExpression(expression.argument); + static normalizeRule(rule, refs, ident) { + if (typeof rule === "string") { + return { + use: [ + { + loader: rule + } + ] + }; } - } - - walkObjectExpression(expression) { - for ( - let propIndex = 0, len = expression.properties.length; - propIndex < len; - propIndex++ - ) { - const prop = expression.properties[propIndex]; - if (prop.type === "SpreadElement") { - this.walkExpression(prop.argument); - continue; - } - if (prop.computed) { - this.walkExpression(prop.key); - } - if (prop.shorthand) { - this.scope.inShorthand = true; - } - this.walkExpression(prop.value); - if (prop.shorthand) { - this.scope.inShorthand = false; - } + if (!rule) { + throw new Error("Unexcepted null when object was expected as rule"); } - } - - walkFunctionExpression(expression) { - const wasTopLevel = this.scope.topLevelScope; - this.scope.topLevelScope = false; - const scopeParams = expression.params; - - // Add function name in scope for recursive calls - if (expression.id) { - scopeParams.push(expression.id.name); + if (typeof rule !== "object") { + throw new Error( + "Unexcepted " + + typeof rule + + " when object was expected as rule (" + + rule + + ")" + ); } - this.inFunctionScope(true, scopeParams, () => { - for (const param of expression.params) { - this.walkPattern(param); - } - if (expression.body.type === "BlockStatement") { - this.detectMode(expression.body.body); - this.prewalkStatement(expression.body); - this.walkStatement(expression.body); - } else { - this.walkExpression(expression.body); - } - }); - this.scope.topLevelScope = wasTopLevel; - } + const newRule = {}; + let useSource; + let resourceSource; + let condition; - walkArrowFunctionExpression(expression) { - this.inFunctionScope(false, expression.params, () => { - for (const param of expression.params) { - this.walkPattern(param); - } - if (expression.body.type === "BlockStatement") { - this.detectMode(expression.body.body); - this.prewalkStatement(expression.body); - this.walkStatement(expression.body); - } else { - this.walkExpression(expression.body); + const checkUseSource = newSource => { + if (useSource && useSource !== newSource) { + throw new Error( + RuleSet.buildErrorMessage( + rule, + new Error( + "Rule can only have one result source (provided " + + newSource + + " and " + + useSource + + ")" + ) + ) + ); } - }); - } - - walkSequenceExpression(expression) { - if (expression.expressions) this.walkExpressions(expression.expressions); - } + useSource = newSource; + }; - walkUpdateExpression(expression) { - this.walkExpression(expression.argument); - } + const checkResourceSource = newSource => { + if (resourceSource && resourceSource !== newSource) { + throw new Error( + RuleSet.buildErrorMessage( + rule, + new Error( + "Rule can only have one resource source (provided " + + newSource + + " and " + + resourceSource + + ")" + ) + ) + ); + } + resourceSource = newSource; + }; - walkUnaryExpression(expression) { - if (expression.operator === "typeof") { - const exprName = this.getNameForExpression(expression.argument); - if (exprName && exprName.free) { - const hook = this.hooks.typeof.get(exprName.name); - if (hook !== undefined) { - const result = hook.call(expression); - if (result === true) return; - } + if (rule.test || rule.include || rule.exclude) { + checkResourceSource("test + include + exclude"); + condition = { + test: rule.test, + include: rule.include, + exclude: rule.exclude + }; + try { + newRule.resource = RuleSet.normalizeCondition(condition); + } catch (error) { + throw new Error(RuleSet.buildErrorMessage(condition, error)); } } - this.walkExpression(expression.argument); - } - - walkLeftRightExpression(expression) { - this.walkExpression(expression.left); - this.walkExpression(expression.right); - } - - walkBinaryExpression(expression) { - this.walkLeftRightExpression(expression); - } - walkLogicalExpression(expression) { - const result = this.hooks.expressionLogicalOperator.call(expression); - if (result === undefined) { - this.walkLeftRightExpression(expression); - } else { - if (result) { - this.walkExpression(expression.right); + if (rule.resource) { + checkResourceSource("resource"); + try { + newRule.resource = RuleSet.normalizeCondition(rule.resource); + } catch (error) { + throw new Error(RuleSet.buildErrorMessage(rule.resource, error)); } } - } - walkAssignmentExpression(expression) { - const renameIdentifier = this.getRenameIdentifier(expression.right); - if (expression.left.type === "Identifier" && renameIdentifier) { - const hook = this.hooks.canRename.get(renameIdentifier); - if (hook !== undefined && hook.call(expression.right)) { - // renaming "a = b;" - const hook = this.hooks.rename.get(renameIdentifier); - if (hook === undefined || !hook.call(expression.right)) { - this.scope.renames.set(expression.left.name, renameIdentifier); - this.scope.definitions.delete(expression.left.name); - } - return; + if (rule.realResource) { + try { + newRule.realResource = RuleSet.normalizeCondition(rule.realResource); + } catch (error) { + throw new Error(RuleSet.buildErrorMessage(rule.realResource, error)); } } - if (expression.left.type === "Identifier") { - const assignedHook = this.hooks.assigned.get(expression.left.name); - if (assignedHook === undefined || !assignedHook.call(expression)) { - this.walkExpression(expression.right); - } - this.scope.renames.set(expression.left.name, null); - const assignHook = this.hooks.assign.get(expression.left.name); - if (assignHook === undefined || !assignHook.call(expression)) { - this.walkExpression(expression.left); + + if (rule.resourceQuery) { + try { + newRule.resourceQuery = RuleSet.normalizeCondition(rule.resourceQuery); + } catch (error) { + throw new Error(RuleSet.buildErrorMessage(rule.resourceQuery, error)); } - return; } - this.walkExpression(expression.right); - this.walkPattern(expression.left); - this.enterPattern(expression.left, (name, decl) => { - this.scope.renames.set(name, null); - }); - } - walkConditionalExpression(expression) { - const result = this.hooks.expressionConditionalOperator.call(expression); - if (result === undefined) { - this.walkExpression(expression.test); - this.walkExpression(expression.consequent); - if (expression.alternate) { - this.walkExpression(expression.alternate); - } - } else { - if (result) { - this.walkExpression(expression.consequent); - } else if (expression.alternate) { - this.walkExpression(expression.alternate); + if (rule.compiler) { + try { + newRule.compiler = RuleSet.normalizeCondition(rule.compiler); + } catch (error) { + throw new Error(RuleSet.buildErrorMessage(rule.compiler, error)); } } - } - walkNewExpression(expression) { - const callee = this.evaluateExpression(expression.callee); - if (callee.isIdentifier()) { - const hook = this.hooks.new.get(callee.identifier); - if (hook !== undefined) { - const result = hook.call(expression); - if (result === true) { - return; - } + if (rule.issuer) { + try { + newRule.issuer = RuleSet.normalizeCondition(rule.issuer); + } catch (error) { + throw new Error(RuleSet.buildErrorMessage(rule.issuer, error)); } } - this.walkExpression(expression.callee); - if (expression.arguments) { - this.walkExpressions(expression.arguments); + if (rule.loader && rule.loaders) { + throw new Error( + RuleSet.buildErrorMessage( + rule, + new Error( + "Provided loader and loaders for rule (use only one of them)" + ) + ) + ); } - } - walkYieldExpression(expression) { - if (expression.argument) { - this.walkExpression(expression.argument); + const loader = rule.loaders || rule.loader; + if (typeof loader === "string" && !rule.options && !rule.query) { + checkUseSource("loader"); + newRule.use = RuleSet.normalizeUse(loader.split("!"), ident); + } else if (typeof loader === "string" && (rule.options || rule.query)) { + checkUseSource("loader + options/query"); + newRule.use = RuleSet.normalizeUse( + { + loader: loader, + options: rule.options, + query: rule.query + }, + ident + ); + } else if (loader && (rule.options || rule.query)) { + throw new Error( + RuleSet.buildErrorMessage( + rule, + new Error( + "options/query cannot be used with loaders (use options for each array item)" + ) + ) + ); + } else if (loader) { + checkUseSource("loaders"); + newRule.use = RuleSet.normalizeUse(loader, ident); + } else if (rule.options || rule.query) { + throw new Error( + RuleSet.buildErrorMessage( + rule, + new Error( + "options/query provided without loader (use loader + options)" + ) + ) + ); } - } - walkTemplateLiteral(expression) { - if (expression.expressions) { - this.walkExpressions(expression.expressions); + if (rule.use) { + checkUseSource("use"); + newRule.use = RuleSet.normalizeUse(rule.use, ident); } - } - walkTaggedTemplateExpression(expression) { - if (expression.tag) { - this.walkExpression(expression.tag); + if (rule.rules) { + newRule.rules = RuleSet.normalizeRules( + rule.rules, + refs, + `${ident}-rules` + ); } - if (expression.quasi && expression.quasi.expressions) { - this.walkExpressions(expression.quasi.expressions); + + if (rule.oneOf) { + newRule.oneOf = RuleSet.normalizeRules( + rule.oneOf, + refs, + `${ident}-oneOf` + ); } - } - walkClassExpression(expression) { - this.walkClass(expression); - } + const keys = Object.keys(rule).filter(key => { + return ![ + "resource", + "resourceQuery", + "compiler", + "test", + "include", + "exclude", + "issuer", + "loader", + "options", + "query", + "loaders", + "use", + "rules", + "oneOf" + ].includes(key); + }); + for (const key of keys) { + newRule[key] = rule[key]; + } - _walkIIFE(functionExpression, options, currentThis) { - const renameArgOrThis = argOrThis => { - const renameIdentifier = this.getRenameIdentifier(argOrThis); - if (renameIdentifier) { - const hook = this.hooks.canRename.get(renameIdentifier); - if (hook !== undefined && hook.call(argOrThis)) { - const hook = this.hooks.rename.get(renameIdentifier); - if (hook === undefined || !hook.call(argOrThis)) { - return renameIdentifier; - } + if (Array.isArray(newRule.use)) { + for (const item of newRule.use) { + if (item.ident) { + refs[item.ident] = item.options; } } - this.walkExpression(argOrThis); - }; - const params = functionExpression.params; - const renameThis = currentThis ? renameArgOrThis(currentThis) : null; - const args = options.map(renameArgOrThis); - const wasTopLevel = this.scope.topLevelScope; - this.scope.topLevelScope = false; - const scopeParams = params.filter((identifier, idx) => !args[idx]); - - // Add function name in scope for recursive calls - if (functionExpression.id) { - scopeParams.push(functionExpression.id.name); } - this.inFunctionScope(true, scopeParams, () => { - if (renameThis) { - this.scope.renames.set("this", renameThis); - } - for (let i = 0; i < args.length; i++) { - const param = args[i]; - if (!param) continue; - if (!params[i] || params[i].type !== "Identifier") continue; - this.scope.renames.set(params[i].name, param); - } - if (functionExpression.body.type === "BlockStatement") { - this.detectMode(functionExpression.body.body); - this.prewalkStatement(functionExpression.body); - this.walkStatement(functionExpression.body); - } else { - this.walkExpression(functionExpression.body); - } - }); - this.scope.topLevelScope = wasTopLevel; + return newRule; } - walkCallExpression(expression) { - if ( - expression.callee.type === "MemberExpression" && - expression.callee.object.type === "FunctionExpression" && - !expression.callee.computed && - (expression.callee.property.name === "call" || - expression.callee.property.name === "bind") && - expression.arguments.length > 0 - ) { - // (function(…) { }.call/bind(?, …)) - this._walkIIFE( - expression.callee.object, - expression.arguments.slice(1), - expression.arguments[0] - ); - } else if (expression.callee.type === "FunctionExpression") { - // (function(…) { }(…)) - this._walkIIFE(expression.callee, expression.arguments, null); - } else if (expression.callee.type === "Import") { - let result = this.hooks.importCall.call(expression); - if (result === true) return; - - if (expression.arguments) this.walkExpressions(expression.arguments); - } else { - const callee = this.evaluateExpression(expression.callee); - if (callee.isIdentifier()) { - const callHook = this.hooks.call.get(callee.identifier); - if (callHook !== undefined) { - let result = callHook.call(expression); - if (result === true) return; - } - let identifier = callee.identifier.replace(/\.[^.]+$/, ""); - if (identifier !== callee.identifier) { - const callAnyHook = this.hooks.callAnyMember.get(identifier); - if (callAnyHook !== undefined) { - let result = callAnyHook.call(expression); - if (result === true) return; - } - } - } + static buildErrorMessage(condition, error) { + const conditionAsText = JSON.stringify( + condition, + (key, value) => { + return value === undefined ? "undefined" : value; + }, + 2 + ); + return error.message + " in " + conditionAsText; + } - if (expression.callee) this.walkExpression(expression.callee); - if (expression.arguments) this.walkExpressions(expression.arguments); + static normalizeUse(use, ident) { + if (typeof use === "function") { + return data => RuleSet.normalizeUse(use(data), ident); } + if (Array.isArray(use)) { + return use + .map((item, idx) => RuleSet.normalizeUse(item, `${ident}-${idx}`)) + .reduce((arr, items) => arr.concat(items), []); + } + return [RuleSet.normalizeUseItem(use, ident)]; } - walkMemberExpression(expression) { - const exprName = this.getNameForExpression(expression); - if (exprName && exprName.free) { - const expressionHook = this.hooks.expression.get(exprName.name); - if (expressionHook !== undefined) { - const result = expressionHook.call(expression); - if (result === true) return; - } - const expressionAnyMemberHook = this.hooks.expressionAnyMember.get( - exprName.nameGeneral - ); - if (expressionAnyMemberHook !== undefined) { - const result = expressionAnyMemberHook.call(expression); - if (result === true) return; - } + static normalizeUseItemString(useItemString) { + const idx = useItemString.indexOf("?"); + if (idx >= 0) { + return { + loader: useItemString.substr(0, idx), + options: useItemString.substr(idx + 1) + }; } - this.walkExpression(expression.object); - if (expression.computed === true) this.walkExpression(expression.property); + return { + loader: useItemString, + options: undefined + }; } - walkThisExpression(expression) { - const expressionHook = this.hooks.expression.get("this"); - if (expressionHook !== undefined) { - expressionHook.call(expression); + static normalizeUseItem(item, ident) { + if (typeof item === "string") { + return RuleSet.normalizeUseItemString(item); } - } - walkIdentifier(expression) { - if (!this.scope.definitions.has(expression.name)) { - const hook = this.hooks.expression.get( - this.scope.renames.get(expression.name) || expression.name - ); - if (hook !== undefined) { - const result = hook.call(expression); - if (result === true) return; - } + const newItem = {}; + + if (item.options && item.query) { + throw new Error("Provided options and query in use"); } - } - /** - * @deprecated - * @param {any} params scope params - * @param {function(): void} fn inner function - * @returns {void} - */ - inScope(params, fn) { - const oldScope = this.scope; - this.scope = { - topLevelScope: oldScope.topLevelScope, - inTry: false, - inShorthand: false, - isStrict: oldScope.isStrict, - isAsmJs: oldScope.isAsmJs, - definitions: oldScope.definitions.createChild(), - renames: oldScope.renames.createChild() - }; + if (!item.loader) { + throw new Error("No loader specified"); + } - this.scope.renames.set("this", null); + newItem.options = item.options || item.query; - this.enterPatterns(params, ident => { - this.scope.renames.set(ident, null); - this.scope.definitions.add(ident); + if (typeof newItem.options === "object" && newItem.options) { + if (newItem.options.ident) { + newItem.ident = newItem.options.ident; + } else { + newItem.ident = ident; + } + } + + const keys = Object.keys(item).filter(function(key) { + return !["options", "query"].includes(key); }); - fn(); + for (const key of keys) { + newItem[key] = item[key]; + } - this.scope = oldScope; + return newItem; } - inFunctionScope(hasThis, params, fn) { - const oldScope = this.scope; - this.scope = { - topLevelScope: oldScope.topLevelScope, - inTry: false, - inShorthand: false, - isStrict: oldScope.isStrict, - isAsmJs: oldScope.isAsmJs, - definitions: oldScope.definitions.createChild(), - renames: oldScope.renames.createChild() - }; - - if (hasThis) { - this.scope.renames.set("this", null); + static normalizeCondition(condition) { + if (!condition) throw new Error("Expected condition but got falsy value"); + if (typeof condition === "string") { + return str => str.indexOf(condition) === 0; + } + if (typeof condition === "function") { + return condition; + } + if (condition instanceof RegExp) { + return condition.test.bind(condition); + } + if (Array.isArray(condition)) { + const items = condition.map(c => RuleSet.normalizeCondition(c)); + return orMatcher(items); + } + if (typeof condition !== "object") { + throw Error( + "Unexcepted " + + typeof condition + + " when condition was expected (" + + condition + + ")" + ); } - this.enterPatterns(params, ident => { - this.scope.renames.set(ident, null); - this.scope.definitions.add(ident); + const matchers = []; + Object.keys(condition).forEach(key => { + const value = condition[key]; + switch (key) { + case "or": + case "include": + case "test": + if (value) matchers.push(RuleSet.normalizeCondition(value)); + break; + case "and": + if (value) { + const items = value.map(c => RuleSet.normalizeCondition(c)); + matchers.push(andMatcher(items)); + } + break; + case "not": + case "exclude": + if (value) { + const matcher = RuleSet.normalizeCondition(value); + matchers.push(notMatcher(matcher)); + } + break; + default: + throw new Error("Unexcepted property " + key + " in condition"); + } }); - - fn(); - - this.scope = oldScope; + if (matchers.length === 0) { + throw new Error("Excepted condition but got " + condition); + } + if (matchers.length === 1) { + return matchers[0]; + } + return andMatcher(matchers); } - inBlockScope(fn) { - const oldScope = this.scope; - this.scope = { - topLevelScope: oldScope.topLevelScope, - inTry: oldScope.inTry, - inShorthand: false, - isStrict: oldScope.isStrict, - isAsmJs: oldScope.isAsmJs, - definitions: oldScope.definitions.createChild(), - renames: oldScope.renames.createChild() - }; - - fn(); - - this.scope = oldScope; + exec(data) { + const result = []; + this._run( + data, + { + rules: this.rules + }, + result + ); + return result; } - // TODO webpack 5: remove this methods - // only for backward-compat - detectStrictMode(statements) { - this.detectMode(statements); - } + _run(data, rule, result) { + // test conditions + if (rule.resource && !data.resource) return false; + if (rule.realResource && !data.realResource) return false; + if (rule.resourceQuery && !data.resourceQuery) return false; + if (rule.compiler && !data.compiler) return false; + if (rule.issuer && !data.issuer) return false; + if (rule.resource && !rule.resource(data.resource)) return false; + if (rule.realResource && !rule.realResource(data.realResource)) + return false; + if (data.issuer && rule.issuer && !rule.issuer(data.issuer)) return false; + if ( + data.resourceQuery && + rule.resourceQuery && + !rule.resourceQuery(data.resourceQuery) + ) { + return false; + } + if (data.compiler && rule.compiler && !rule.compiler(data.compiler)) { + return false; + } - detectMode(statements) { - const isLiteral = - statements.length >= 1 && - statements[0].type === "ExpressionStatement" && - statements[0].expression.type === "Literal"; - if (isLiteral && statements[0].expression.value === "use strict") { - this.scope.isStrict = true; + // apply + const keys = Object.keys(rule).filter(key => { + return ![ + "resource", + "realResource", + "resourceQuery", + "compiler", + "issuer", + "rules", + "oneOf", + "use", + "enforce" + ].includes(key); + }); + for (const key of keys) { + result.push({ + type: key, + value: rule[key] + }); } - if (isLiteral && statements[0].expression.value === "use asm") { - this.scope.isAsmJs = true; + + if (rule.use) { + const process = use => { + if (typeof use === "function") { + process(use(data)); + } else if (Array.isArray(use)) { + use.forEach(process); + } else { + result.push({ + type: "use", + value: use, + enforce: rule.enforce + }); + } + }; + process(rule.use); } - } - enterPatterns(patterns, onIdent) { - for (const pattern of patterns) { - if (typeof pattern !== "string") { - this.enterPattern(pattern, onIdent); - } else if (pattern) { - onIdent(pattern); + if (rule.rules) { + for (let i = 0; i < rule.rules.length; i++) { + this._run(data, rule.rules[i], result); } } - } - enterPattern(pattern, onIdent) { - if (!pattern) return; - switch (pattern.type) { - case "ArrayPattern": - this.enterArrayPattern(pattern, onIdent); - break; - case "AssignmentPattern": - this.enterAssignmentPattern(pattern, onIdent); - break; - case "Identifier": - this.enterIdentifier(pattern, onIdent); - break; - case "ObjectPattern": - this.enterObjectPattern(pattern, onIdent); - break; - case "RestElement": - this.enterRestElement(pattern, onIdent); - break; - case "Property": - this.enterPattern(pattern.value, onIdent); - break; + if (rule.oneOf) { + for (let i = 0; i < rule.oneOf.length; i++) { + if (this._run(data, rule.oneOf[i], result)) break; + } } - } - enterIdentifier(pattern, onIdent) { - onIdent(pattern.name, pattern); + return true; } - enterObjectPattern(pattern, onIdent) { - for ( - let propIndex = 0, len = pattern.properties.length; - propIndex < len; - propIndex++ - ) { - const prop = pattern.properties[propIndex]; - this.enterPattern(prop, onIdent); + findOptionsByIdent(ident) { + const options = this.references[ident]; + if (!options) { + throw new Error("Can't find options with ident '" + ident + "'"); } + return options; } +}; - enterArrayPattern(pattern, onIdent) { - for ( - let elementIndex = 0, len = pattern.elements.length; - elementIndex < len; - elementIndex++ - ) { - const element = pattern.elements[elementIndex]; - this.enterPattern(element, onIdent); - } + +/***/ }), + +/***/ 44006: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Template = __webpack_require__(96066); + +/** @typedef {import("./Module")} Module */ + +module.exports = class RuntimeTemplate { + constructor(outputOptions, requestShortener) { + this.outputOptions = outputOptions || {}; + this.requestShortener = requestShortener; } - enterRestElement(pattern, onIdent) { - this.enterPattern(pattern.argument, onIdent); + /** + * Add a comment + * @param {object} options Information content of the comment + * @param {string=} options.request request string used originally + * @param {string=} options.chunkName name of the chunk referenced + * @param {string=} options.chunkReason reason information of the chunk + * @param {string=} options.message additional message + * @param {string=} options.exportName name of the export + * @returns {string} comment + */ + comment({ request, chunkName, chunkReason, message, exportName }) { + let content; + if (this.outputOptions.pathinfo) { + content = [message, request, chunkName, chunkReason] + .filter(Boolean) + .map(item => this.requestShortener.shorten(item)) + .join(" | "); + } else { + content = [message, chunkName, chunkReason] + .filter(Boolean) + .map(item => this.requestShortener.shorten(item)) + .join(" | "); + } + if (!content) return ""; + if (this.outputOptions.pathinfo) { + return Template.toComment(content) + " "; + } else { + return Template.toNormalComment(content) + " "; + } } - enterAssignmentPattern(pattern, onIdent) { - this.enterPattern(pattern.left, onIdent); + throwMissingModuleErrorFunction({ request }) { + const err = `Cannot find module '${request}'`; + return `function webpackMissingModule() { var e = new Error(${JSON.stringify( + err + )}); e.code = 'MODULE_NOT_FOUND'; throw e; }`; } - evaluateExpression(expression) { - try { - const hook = this.hooks.evaluate.get(expression.type); - if (hook !== undefined) { - const result = hook.call(expression); - if (result !== undefined) { - if (result) { - result.setExpression(expression); - } - return result; - } - } - } catch (e) { - console.warn(e); - // ignore error - } - return new BasicEvaluatedExpression() - .setRange(expression.range) - .setExpression(expression); + missingModule({ request }) { + return `!(${this.throwMissingModuleErrorFunction({ request })}())`; } - parseString(expression) { - switch (expression.type) { - case "BinaryExpression": - if (expression.operator === "+") { - return ( - this.parseString(expression.left) + - this.parseString(expression.right) - ); - } - break; - case "Literal": - return expression.value + ""; - } - throw new Error( - expression.type + " is not supported as parameter for require" - ); + missingModuleStatement({ request }) { + return `${this.missingModule({ request })};\n`; } - parseCalculatedString(expression) { - switch (expression.type) { - case "BinaryExpression": - if (expression.operator === "+") { - const left = this.parseCalculatedString(expression.left); - const right = this.parseCalculatedString(expression.right); - if (left.code) { - return { - range: left.range, - value: left.value, - code: true, - conditional: false - }; - } else if (right.code) { - return { - range: [ - left.range[0], - right.range ? right.range[1] : left.range[1] - ], - value: left.value + right.value, - code: true, - conditional: false - }; - } else { - return { - range: [left.range[0], right.range[1]], - value: left.value + right.value, - code: false, - conditional: false - }; - } - } - break; - case "ConditionalExpression": { - const consequent = this.parseCalculatedString(expression.consequent); - const alternate = this.parseCalculatedString(expression.alternate); - const items = []; - if (consequent.conditional) { - items.push(...consequent.conditional); - } else if (!consequent.code) { - items.push(consequent); - } else { - break; - } - if (alternate.conditional) { - items.push(...alternate.conditional); - } else if (!alternate.code) { - items.push(alternate); - } else { - break; - } - return { - range: undefined, - value: "", - code: true, - conditional: items - }; - } - case "Literal": - return { - range: expression.range, - value: expression.value + "", - code: false, - conditional: false - }; - } - return { - range: undefined, - value: "", - code: true, - conditional: false - }; + missingModulePromise({ request }) { + return `Promise.resolve().then(${this.throwMissingModuleErrorFunction({ + request + })})`; } - parse(source, initialState) { - let ast; - let comments; - if (typeof source === "object" && source !== null) { - ast = source; - comments = source.comments; - } else { - comments = []; - ast = Parser.parse(source, { - sourceType: this.sourceType, - onComment: comments + moduleId({ module, request }) { + if (!module) { + return this.missingModule({ + request }); } - - const oldScope = this.scope; - const oldState = this.state; - const oldComments = this.comments; - this.scope = { - topLevelScope: true, - inTry: false, - inShorthand: false, - isStrict: false, - isAsmJs: false, - definitions: new StackedSetMap(), - renames: new StackedSetMap() - }; - const state = (this.state = initialState || {}); - this.comments = comments; - if (this.hooks.program.call(ast, comments) === undefined) { - this.detectMode(ast.body); - this.prewalkStatements(ast.body); - this.blockPrewalkStatements(ast.body); - this.walkStatements(ast.body); + if (module.id === null) { + throw new Error( + `RuntimeTemplate.moduleId(): Module ${module.identifier()} has no id. This should not happen.` + ); } - this.scope = oldScope; - this.state = oldState; - this.comments = oldComments; - return state; + return `${this.comment({ request })}${JSON.stringify(module.id)}`; } - evaluate(source) { - const ast = Parser.parse("(" + source + ")", { - sourceType: this.sourceType, - locations: false - }); - // TODO(https://github.com/acornjs/acorn/issues/741) - // @ts-ignore - if (ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement") { - throw new Error("evaluate: Source is not a expression"); + moduleRaw({ module, request }) { + if (!module) { + return this.missingModule({ + request + }); } - // TODO(https://github.com/acornjs/acorn/issues/741) - // @ts-ignore - return this.evaluateExpression(ast.body[0].expression); + return `__webpack_require__(${this.moduleId({ module, request })})`; } - getComments(range) { - return this.comments.filter( - comment => comment.range[0] >= range[0] && comment.range[1] <= range[1] - ); + moduleExports({ module, request }) { + return this.moduleRaw({ + module, + request + }); } - parseCommentOptions(range) { - const comments = this.getComments(range); - if (comments.length === 0) { - return EMPTY_COMMENT_OPTIONS; + moduleNamespace({ module, request, strict }) { + if (!module) { + return this.missingModule({ + request + }); } - let options = {}; - let errors = []; - for (const comment of comments) { - const { value } = comment; - if (value && webpackCommentRegExp.test(value)) { - // try compile only if webpack options comment is present - try { - const val = vm.runInNewContext(`(function(){return {${value}};})()`); - Object.assign(options, val); - } catch (e) { - e.comment = comment; - errors.push(e); - } - } + const moduleId = this.moduleId({ + module, + request + }); + const exportsType = module.buildMeta && module.buildMeta.exportsType; + if (exportsType === "namespace") { + const rawModule = this.moduleRaw({ + module, + request + }); + return rawModule; + } else if (exportsType === "named") { + return `__webpack_require__.t(${moduleId}, 3)`; + } else if (strict) { + return `__webpack_require__.t(${moduleId}, 1)`; + } else { + return `__webpack_require__.t(${moduleId}, 7)`; } - return { options, errors }; } - getNameForExpression(expression) { - let expr = expression; - const exprName = []; - while ( - expr.type === "MemberExpression" && - expr.property.type === (expr.computed ? "Literal" : "Identifier") - ) { - exprName.push(expr.computed ? expr.property.value : expr.property.name); - expr = expr.object; + moduleNamespacePromise({ block, module, request, message, strict, weak }) { + if (!module) { + return this.missingModulePromise({ + request + }); } - let free; - if (expr.type === "Identifier") { - free = !this.scope.definitions.has(expr.name); - exprName.push(this.scope.renames.get(expr.name) || expr.name); - } else if ( - expr.type === "ThisExpression" && - this.scope.renames.get("this") - ) { - free = true; - exprName.push(this.scope.renames.get("this")); - } else if (expr.type === "ThisExpression") { - free = this.scope.topLevelScope; - exprName.push("this"); - } else { - return null; + if (module.id === null) { + throw new Error( + `RuntimeTemplate.moduleNamespacePromise(): Module ${module.identifier()} has no id. This should not happen.` + ); } - let prefix = ""; - for (let i = exprName.length - 1; i >= 2; i--) { - prefix += exprName[i] + "."; + const promise = this.blockPromise({ + block, + message + }); + + let getModuleFunction; + let idExpr = JSON.stringify(module.id); + const comment = this.comment({ + request + }); + let header = ""; + if (weak) { + if (idExpr.length > 8) { + // 'var x="nnnnnn";x,"+x+",x' vs '"nnnnnn",nnnnnn,"nnnnnn"' + header += `var id = ${idExpr}; `; + idExpr = "id"; + } + header += `if(!__webpack_require__.m[${idExpr}]) { var e = new Error("Module '" + ${idExpr} + "' is not available (weak dependency)"); e.code = 'MODULE_NOT_FOUND'; throw e; } `; } - if (exprName.length > 1) { - prefix += exprName[1]; + const moduleId = this.moduleId({ + module, + request + }); + const exportsType = module.buildMeta && module.buildMeta.exportsType; + if (exportsType === "namespace") { + if (header) { + const rawModule = this.moduleRaw({ + module, + request + }); + getModuleFunction = `function() { ${header}return ${rawModule}; }`; + } else { + getModuleFunction = `__webpack_require__.bind(null, ${comment}${idExpr})`; + } + } else if (exportsType === "named") { + if (header) { + getModuleFunction = `function() { ${header}return __webpack_require__.t(${moduleId}, 3); }`; + } else { + getModuleFunction = `__webpack_require__.t.bind(null, ${comment}${idExpr}, 3)`; + } + } else if (strict) { + if (header) { + getModuleFunction = `function() { ${header}return __webpack_require__.t(${moduleId}, 1); }`; + } else { + getModuleFunction = `__webpack_require__.t.bind(null, ${comment}${idExpr}, 1)`; + } + } else { + if (header) { + getModuleFunction = `function() { ${header}return __webpack_require__.t(${moduleId}, 7); }`; + } else { + getModuleFunction = `__webpack_require__.t.bind(null, ${comment}${idExpr}, 7)`; + } } - const name = prefix ? prefix + "." + exprName[0] : exprName[0]; - const nameGeneral = prefix; - return { - name, - nameGeneral, - free - }; + + return `${promise || "Promise.resolve()"}.then(${getModuleFunction})`; } - static parse(code, options) { - const type = options ? options.sourceType : "module"; - const parserOptions = Object.assign( - Object.create(null), - defaultParserOptions, - options - ); + /** + * + * @param {Object} options options object + * @param {boolean=} options.update whether a new variable should be created or the existing one updated + * @param {Module} options.module the module + * @param {string} options.request the request that should be printed as comment + * @param {string} options.importVar name of the import variable + * @param {Module} options.originModule module in which the statement is emitted + * @returns {string} the import statement + */ + importStatement({ update, module, request, importVar, originModule }) { + if (!module) { + return this.missingModuleStatement({ + request + }); + } + const moduleId = this.moduleId({ + module, + request + }); + const optDeclaration = update ? "" : "var "; - if (type === "auto") { - parserOptions.sourceType = "module"; - } else if (parserOptions.sourceType === "script") { - parserOptions.allowReturnOutsideFunction = true; + const exportsType = module.buildMeta && module.buildMeta.exportsType; + let content = `/* harmony import */ ${optDeclaration}${importVar} = __webpack_require__(${moduleId});\n`; + + if (!exportsType && !originModule.buildMeta.strictHarmonyModule) { + content += `/* harmony import */ ${optDeclaration}${importVar}_default = /*#__PURE__*/__webpack_require__.n(${importVar});\n`; } + if (exportsType === "named") { + if (Array.isArray(module.buildMeta.providedExports)) { + content += `${optDeclaration}${importVar}_namespace = /*#__PURE__*/__webpack_require__.t(${moduleId}, 1);\n`; + } else { + content += `${optDeclaration}${importVar}_namespace = /*#__PURE__*/__webpack_require__.t(${moduleId});\n`; + } + } + return content; + } - let ast; - let error; - let threw = false; - try { - ast = acornParser.parse(code, parserOptions); - } catch (e) { - error = e; - threw = true; + exportFromImport({ + module, + request, + exportName, + originModule, + asiSafe, + isCall, + callContext, + importVar + }) { + if (!module) { + return this.missingModule({ + request + }); } + const exportsType = module.buildMeta && module.buildMeta.exportsType; - if (threw && type === "auto") { - parserOptions.sourceType = "script"; - parserOptions.allowReturnOutsideFunction = true; - if (Array.isArray(parserOptions.onComment)) { - parserOptions.onComment.length = 0; + if (!exportsType) { + if (exportName === "default") { + if (!originModule.buildMeta.strictHarmonyModule) { + if (isCall) { + return `${importVar}_default()`; + } else if (asiSafe) { + return `(${importVar}_default())`; + } else { + return `${importVar}_default.a`; + } + } else { + return importVar; + } + } else if (originModule.buildMeta.strictHarmonyModule) { + if (exportName) { + return "/* non-default import from non-esm module */undefined"; + } else { + return `/*#__PURE__*/__webpack_require__.t(${importVar})`; + } } - try { - ast = acornParser.parse(code, parserOptions); - threw = false; - } catch (e) { - threw = true; + } + + if (exportsType === "named") { + if (exportName === "default") { + return importVar; + } else if (!exportName) { + return `${importVar}_namespace`; } } - if (threw) { - throw error; + if (exportName) { + const used = module.isUsed(exportName); + if (!used) { + const comment = Template.toNormalComment(`unused export ${exportName}`); + return `${comment} undefined`; + } + const comment = + used !== exportName ? Template.toNormalComment(exportName) + " " : ""; + const access = `${importVar}[${comment}${JSON.stringify(used)}]`; + if (isCall) { + if (callContext === false && asiSafe) { + return `(0,${access})`; + } else if (callContext === false) { + return `Object(${access})`; + } + } + return access; + } else { + return importVar; } + } - return ast; + blockPromise({ block, message }) { + if (!block || !block.chunkGroup || block.chunkGroup.chunks.length === 0) { + const comment = this.comment({ + message + }); + return `Promise.resolve(${comment.trim()})`; + } + const chunks = block.chunkGroup.chunks.filter( + chunk => !chunk.hasRuntime() && chunk.id !== null + ); + const comment = this.comment({ + message, + chunkName: block.chunkName, + chunkReason: block.chunkReason + }); + if (chunks.length === 1) { + const chunkId = JSON.stringify(chunks[0].id); + return `__webpack_require__.e(${comment}${chunkId})`; + } else if (chunks.length > 0) { + const requireChunkId = chunk => + `__webpack_require__.e(${JSON.stringify(chunk.id)})`; + return `Promise.all(${comment.trim()}[${chunks + .map(requireChunkId) + .join(", ")}])`; + } else { + return `Promise.resolve(${comment.trim()})`; + } } -} -// TODO remove in webpack 5 -Object.defineProperty(Parser.prototype, "getCommentOptions", { - configurable: false, - value: util.deprecate( - /** - * @deprecated - * @param {TODO} range Range - * @returns {void} - * @this {Parser} - */ - function(range) { - return this.parseCommentOptions(range).options; - }, - "Parser.getCommentOptions: Use Parser.parseCommentOptions(range) instead" - ) -}); + onError() { + return "__webpack_require__.oe"; + } -module.exports = Parser; + defineEsModuleFlagStatement({ exportsArgument }) { + return `__webpack_require__.r(${exportsArgument});\n`; + } +}; /***/ }), -/***/ 23999: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ 37098: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -70664,109 +68975,75 @@ module.exports = Parser; Author Tobias Koppers @sokra */ -const path = __webpack_require__(85622); - -const BasicEvaluatedExpression = __webpack_require__(96770); -const ConstDependency = __webpack_require__(71101); -const UnsupportedFeatureWarning = __webpack_require__(99953); -const ParserHelpers = exports; +const { ConcatSource } = __webpack_require__(53665); -ParserHelpers.addParsedVariableToModule = (parser, name, expression) => { - if (!parser.state.current.addVariable) return false; - var deps = []; - parser.parse(expression, { - current: { - addDependency: dep => { - dep.userRequest = name; - deps.push(dep); - } - }, - module: parser.state.module - }); - parser.state.current.addVariable(name, expression, deps); - return true; -}; +/** @typedef {import("./Compilation")} Compilation */ -ParserHelpers.requireFileAsExpression = (context, pathToModule) => { - var moduleJsPath = path.relative(context, pathToModule); - if (!/^[A-Z]:/i.test(moduleJsPath)) { - moduleJsPath = "./" + moduleJsPath.replace(/\\/g, "/"); +class SetVarMainTemplatePlugin { + /** + * @param {string} varExpression the accessor where the library is exported + * @param {boolean} copyObject specify copying the exports + */ + constructor(varExpression, copyObject) { + /** @type {string} */ + this.varExpression = varExpression; + /** @type {boolean} */ + this.copyObject = copyObject; } - return "require(" + JSON.stringify(moduleJsPath) + ")"; -}; - -ParserHelpers.toConstantDependency = (parser, value) => { - return function constDependency(expr) { - var dep = new ConstDependency(value, expr.range, false); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - return true; - }; -}; - -ParserHelpers.toConstantDependencyWithWebpackRequire = (parser, value) => { - return function constDependencyWithWebpackRequire(expr) { - var dep = new ConstDependency(value, expr.range, true); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - return true; - }; -}; -ParserHelpers.evaluateToString = value => { - return function stringExpression(expr) { - return new BasicEvaluatedExpression().setString(value).setRange(expr.range); - }; -}; + /** + * @param {Compilation} compilation the compilation instance + * @returns {void} + */ + apply(compilation) { + const { mainTemplate, chunkTemplate } = compilation; -ParserHelpers.evaluateToBoolean = value => { - return function booleanExpression(expr) { - return new BasicEvaluatedExpression() - .setBoolean(value) - .setRange(expr.range); - }; -}; + const onRenderWithEntry = (source, chunk, hash) => { + const varExpression = mainTemplate.getAssetPath(this.varExpression, { + hash, + chunk + }); + if (this.copyObject) { + return new ConcatSource( + `(function(e, a) { for(var i in a) e[i] = a[i]; }(${varExpression}, `, + source, + "))" + ); + } else { + const prefix = `${varExpression} =\n`; + return new ConcatSource(prefix, source); + } + }; -ParserHelpers.evaluateToIdentifier = (identifier, truthy) => { - return function identifierExpression(expr) { - let evex = new BasicEvaluatedExpression() - .setIdentifier(identifier) - .setRange(expr.range); - if (truthy === true) { - evex = evex.setTruthy(); - } else if (truthy === false) { - evex = evex.setFalsy(); + for (const template of [mainTemplate, chunkTemplate]) { + template.hooks.renderWithEntry.tap( + "SetVarMainTemplatePlugin", + onRenderWithEntry + ); } - return evex; - }; -}; -ParserHelpers.expressionIsUnsupported = (parser, message) => { - return function unsupportedExpression(expr) { - var dep = new ConstDependency("(void 0)", expr.range, false); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - if (!parser.state.module) return; - parser.state.module.warnings.push( - new UnsupportedFeatureWarning(parser.state.module, message, expr.loc) + mainTemplate.hooks.globalHashPaths.tap( + "SetVarMainTemplatePlugin", + paths => { + if (this.varExpression) paths.push(this.varExpression); + return paths; + } ); - return true; - }; -}; - -ParserHelpers.skipTraversal = function skipTraversal() { - return true; -}; + mainTemplate.hooks.hash.tap("SetVarMainTemplatePlugin", hash => { + hash.update("set var"); + hash.update(`${this.varExpression}`); + hash.update(`${this.copyObject}`); + }); + } +} -ParserHelpers.approve = function approve() { - return true; -}; +module.exports = SetVarMainTemplatePlugin; /***/ }), -/***/ 27850: +/***/ 19070: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -70775,452 +69052,101 @@ ParserHelpers.approve = function approve() { Author Tobias Koppers @sokra */ -const PrefetchDependency = __webpack_require__(14237); +const SingleEntryDependency = __webpack_require__(84828); -class PrefetchPlugin { - constructor(context, request) { - if (!request) { - this.request = context; - } else { - this.context = context; - this.request = request; - } +/** @typedef {import("./Compiler")} Compiler */ + +class SingleEntryPlugin { + /** + * An entry plugin which will handle + * creation of the SingleEntryDependency + * + * @param {string} context context path + * @param {string} entry entry path + * @param {string} name entry key name + */ + constructor(context, entry, name) { + this.context = context; + this.entry = entry; + this.name = name; } + /** + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { compiler.hooks.compilation.tap( - "PrefetchPlugin", + "SingleEntryPlugin", (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( - PrefetchDependency, + SingleEntryDependency, normalModuleFactory ); } ); - compiler.hooks.make.tapAsync("PrefetchPlugin", (compilation, callback) => { - compilation.prefetch( - this.context || compiler.context, - new PrefetchDependency(this.request), - callback - ); - }); + + compiler.hooks.make.tapAsync( + "SingleEntryPlugin", + (compilation, callback) => { + const { entry, name, context } = this; + + const dep = SingleEntryPlugin.createDependency(entry, name); + compilation.addEntry(context, dep, name, callback); + } + ); + } + + /** + * @param {string} entry entry request + * @param {string} name entry name + * @returns {SingleEntryDependency} the dependency + */ + static createDependency(entry, name) { + const dep = new SingleEntryDependency(entry); + dep.loc = { name }; + return dep; } } -module.exports = PrefetchPlugin; + +module.exports = SingleEntryPlugin; /***/ }), -/***/ 63123: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 12496: +/***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra + Author Sean Larkin @thelarkinn */ -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(26336); +const SizeFormatHelpers = exports; -/** @typedef {import("../declarations/plugins/ProgressPlugin").ProgressPluginArgument} ProgressPluginArgument */ -/** @typedef {import("../declarations/plugins/ProgressPlugin").ProgressPluginOptions} ProgressPluginOptions */ +SizeFormatHelpers.formatSize = size => { + if (typeof size !== "number" || Number.isNaN(size) === true) { + return "unknown size"; + } -const createDefaultHandler = (profile, logger) => { - let lastState; - let lastStateTime; + if (size <= 0) { + return "0 bytes"; + } - const defaultHandler = (percentage, msg, ...args) => { - logger.status(`${Math.floor(percentage * 100)}%`, msg, ...args); - if (profile) { - let state = msg; - state = state.replace(/^\d+\/\d+\s+/, ""); - if (percentage === 0) { - lastState = null; - lastStateTime = Date.now(); - } else if (state !== lastState || percentage === 1) { - const now = Date.now(); - if (lastState) { - const diff = now - lastStateTime; - const stateMsg = `${diff}ms ${lastState}`; - if (diff > 1000) { - logger.warn(stateMsg); - } else if (diff > 10) { - logger.info(stateMsg); - } else if (diff > 0) { - logger.log(stateMsg); - } else { - logger.debug(stateMsg); - } - } - lastState = state; - lastStateTime = now; - } - } - if (percentage === 1) logger.status(); - }; - - return defaultHandler; -}; - -class ProgressPlugin { - /** - * @param {ProgressPluginArgument} options options - */ - constructor(options) { - if (typeof options === "function") { - options = { - handler: options - }; - } - - options = options || {}; - validateOptions(schema, options, "Progress Plugin"); - options = Object.assign({}, ProgressPlugin.defaultOptions, options); - - this.profile = options.profile; - this.handler = options.handler; - this.modulesCount = options.modulesCount; - this.showEntries = options.entries; - this.showModules = options.modules; - this.showActiveModules = options.activeModules; - } - - apply(compiler) { - const { modulesCount } = this; - const handler = - this.handler || - createDefaultHandler( - this.profile, - compiler.getInfrastructureLogger("webpack.Progress") - ); - const showEntries = this.showEntries; - const showModules = this.showModules; - const showActiveModules = this.showActiveModules; - if (compiler.compilers) { - const states = new Array(compiler.compilers.length); - compiler.compilers.forEach((compiler, idx) => { - new ProgressPlugin((p, msg, ...args) => { - states[idx] = [p, msg, ...args]; - handler( - states - .map(state => (state && state[0]) || 0) - .reduce((a, b) => a + b) / states.length, - `[${idx}] ${msg}`, - ...args - ); - }).apply(compiler); - }); - } else { - let lastModulesCount = 0; - let lastEntriesCount = 0; - let moduleCount = modulesCount; - let entriesCount = 1; - let doneModules = 0; - let doneEntries = 0; - const activeModules = new Set(); - let lastActiveModule = ""; - - const update = () => { - const percentByModules = - doneModules / Math.max(lastModulesCount, moduleCount); - const percentByEntries = - doneEntries / Math.max(lastEntriesCount, entriesCount); - - const items = [ - 0.1 + Math.max(percentByModules, percentByEntries) * 0.6, - "building" - ]; - if (showEntries) { - items.push(`${doneEntries}/${entriesCount} entries`); - } - if (showModules) { - items.push(`${doneModules}/${moduleCount} modules`); - } - if (showActiveModules) { - items.push(`${activeModules.size} active`); - items.push(lastActiveModule); - } - handler(...items); - }; - - const moduleAdd = module => { - moduleCount++; - if (showActiveModules) { - const ident = module.identifier(); - if (ident) { - activeModules.add(ident); - lastActiveModule = ident; - } - } - update(); - }; - - const entryAdd = (entry, name) => { - entriesCount++; - update(); - }; - - const moduleDone = module => { - doneModules++; - if (showActiveModules) { - const ident = module.identifier(); - if (ident) { - activeModules.delete(ident); - if (lastActiveModule === ident) { - lastActiveModule = ""; - for (const m of activeModules) { - lastActiveModule = m; - } - } - } - } - update(); - }; - - const entryDone = (entry, name) => { - doneEntries++; - update(); - }; - - compiler.hooks.compilation.tap("ProgressPlugin", compilation => { - if (compilation.compiler.isChild()) return; - lastModulesCount = moduleCount; - lastEntriesCount = entriesCount; - moduleCount = entriesCount = 0; - doneModules = doneEntries = 0; - handler(0, "compiling"); - - compilation.hooks.buildModule.tap("ProgressPlugin", moduleAdd); - compilation.hooks.failedModule.tap("ProgressPlugin", moduleDone); - compilation.hooks.succeedModule.tap("ProgressPlugin", moduleDone); - - compilation.hooks.addEntry.tap("ProgressPlugin", entryAdd); - compilation.hooks.failedEntry.tap("ProgressPlugin", entryDone); - compilation.hooks.succeedEntry.tap("ProgressPlugin", entryDone); - - const hooks = { - finishModules: "finish module graph", - seal: "sealing", - beforeChunks: "chunk graph", - afterChunks: "after chunk graph", - optimizeDependenciesBasic: "basic dependencies optimization", - optimizeDependencies: "dependencies optimization", - optimizeDependenciesAdvanced: "advanced dependencies optimization", - afterOptimizeDependencies: "after dependencies optimization", - optimize: "optimizing", - optimizeModulesBasic: "basic module optimization", - optimizeModules: "module optimization", - optimizeModulesAdvanced: "advanced module optimization", - afterOptimizeModules: "after module optimization", - optimizeChunksBasic: "basic chunk optimization", - optimizeChunks: "chunk optimization", - optimizeChunksAdvanced: "advanced chunk optimization", - afterOptimizeChunks: "after chunk optimization", - optimizeTree: "module and chunk tree optimization", - afterOptimizeTree: "after module and chunk tree optimization", - optimizeChunkModulesBasic: "basic chunk modules optimization", - optimizeChunkModules: "chunk modules optimization", - optimizeChunkModulesAdvanced: "advanced chunk modules optimization", - afterOptimizeChunkModules: "after chunk modules optimization", - reviveModules: "module reviving", - optimizeModuleOrder: "module order optimization", - advancedOptimizeModuleOrder: "advanced module order optimization", - beforeModuleIds: "before module ids", - moduleIds: "module ids", - optimizeModuleIds: "module id optimization", - afterOptimizeModuleIds: "module id optimization", - reviveChunks: "chunk reviving", - optimizeChunkOrder: "chunk order optimization", - beforeChunkIds: "before chunk ids", - optimizeChunkIds: "chunk id optimization", - afterOptimizeChunkIds: "after chunk id optimization", - recordModules: "record modules", - recordChunks: "record chunks", - beforeHash: "hashing", - afterHash: "after hashing", - recordHash: "record hash", - beforeModuleAssets: "module assets processing", - beforeChunkAssets: "chunk assets processing", - additionalChunkAssets: "additional chunk assets processing", - record: "recording", - additionalAssets: "additional asset processing", - optimizeChunkAssets: "chunk asset optimization", - afterOptimizeChunkAssets: "after chunk asset optimization", - optimizeAssets: "asset optimization", - afterOptimizeAssets: "after asset optimization", - afterSeal: "after seal" - }; - const numberOfHooks = Object.keys(hooks).length; - Object.keys(hooks).forEach((name, idx) => { - const title = hooks[name]; - const percentage = (idx / numberOfHooks) * 0.25 + 0.7; - compilation.hooks[name].intercept({ - name: "ProgressPlugin", - context: true, - call: () => { - handler(percentage, title); - }, - tap: (context, tap) => { - if (context) { - // p is percentage from 0 to 1 - // args is any number of messages in a hierarchical matter - context.reportProgress = (p, ...args) => { - handler(percentage, title, tap.name, ...args); - }; - } - handler(percentage, title, tap.name); - } - }); - }); - }); - compiler.hooks.emit.intercept({ - name: "ProgressPlugin", - context: true, - call: () => { - handler(0.95, "emitting"); - }, - tap: (context, tap) => { - if (context) { - context.reportProgress = (p, ...args) => { - handler(0.95, "emitting", tap.name, ...args); - }; - } - handler(0.95, "emitting", tap.name); - } - }); - compiler.hooks.afterEmit.intercept({ - name: "ProgressPlugin", - context: true, - call: () => { - handler(0.98, "after emitting"); - }, - tap: (context, tap) => { - if (context) { - context.reportProgress = (p, ...args) => { - handler(0.98, "after emitting", tap.name, ...args); - }; - } - handler(0.98, "after emitting", tap.name); - } - }); - compiler.hooks.done.tap("ProgressPlugin", () => { - handler(1, ""); - }); - } - } -} + const abbreviations = ["bytes", "KiB", "MiB", "GiB"]; + const index = Math.floor(Math.log(size) / Math.log(1024)); -ProgressPlugin.defaultOptions = { - profile: false, - modulesCount: 500, - modules: true, - activeModules: true, - // TODO webpack 5 default this to true - entries: false + return `${+(size / Math.pow(1024, index)).toPrecision(3)} ${ + abbreviations[index] + }`; }; -module.exports = ProgressPlugin; - - -/***/ }), - -/***/ 72861: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const ParserHelpers = __webpack_require__(23999); -const ConstDependency = __webpack_require__(71101); - -const NullFactory = __webpack_require__(40438); - -class ProvidePlugin { - constructor(definitions) { - this.definitions = definitions; - } - - apply(compiler) { - const definitions = this.definitions; - compiler.hooks.compilation.tap( - "ProvidePlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set(ConstDependency, new NullFactory()); - compilation.dependencyTemplates.set( - ConstDependency, - new ConstDependency.Template() - ); - const handler = (parser, parserOptions) => { - Object.keys(definitions).forEach(name => { - var request = [].concat(definitions[name]); - var splittedName = name.split("."); - if (splittedName.length > 0) { - splittedName.slice(1).forEach((_, i) => { - const name = splittedName.slice(0, i + 1).join("."); - parser.hooks.canRename - .for(name) - .tap("ProvidePlugin", ParserHelpers.approve); - }); - } - parser.hooks.expression.for(name).tap("ProvidePlugin", expr => { - let nameIdentifier = name; - const scopedName = name.includes("."); - let expression = `require(${JSON.stringify(request[0])})`; - if (scopedName) { - nameIdentifier = `__webpack_provided_${name.replace( - /\./g, - "_dot_" - )}`; - } - if (request.length > 1) { - expression += request - .slice(1) - .map(r => `[${JSON.stringify(r)}]`) - .join(""); - } - if ( - !ParserHelpers.addParsedVariableToModule( - parser, - nameIdentifier, - expression - ) - ) { - return false; - } - if (scopedName) { - ParserHelpers.toConstantDependency( - parser, - nameIdentifier - )(expr); - } - return true; - }); - }); - }; - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ProvidePlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ProvidePlugin", handler); - - // Disable ProvidePlugin for javascript/esm, see https://github.com/webpack/webpack/issues/7032 - } - ); - } -} -module.exports = ProvidePlugin; - /***/ }), -/***/ 82353: +/***/ 24113: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -71230,61 +69156,54 @@ module.exports = ProvidePlugin; */ -const Module = __webpack_require__(75993); -const { OriginalSource, RawSource } = __webpack_require__(53665); - -module.exports = class RawModule extends Module { - constructor(source, identifier, readableIdentifier) { - super("javascript/dynamic", null); - this.sourceStr = source; - this.identifierStr = identifier || this.sourceStr; - this.readableIdentifierStr = readableIdentifier || this.identifierStr; - this.built = false; - } - - identifier() { - return this.identifierStr; - } - - size() { - return this.sourceStr.length; - } - - readableIdentifier(requestShortener) { - return requestShortener.shorten(this.readableIdentifierStr); - } - - needRebuild() { - return false; - } +const ModuleFilenameHelpers = __webpack_require__(71474); - build(options, compilations, resolver, fs, callback) { - this.built = true; - this.buildMeta = {}; - this.buildInfo = { - cacheable: true - }; - callback(); +class SourceMapDevToolModuleOptionsPlugin { + constructor(options) { + this.options = options; } - source() { - if (this.useSourceMap) { - return new OriginalSource(this.sourceStr, this.identifier()); - } else { - return new RawSource(this.sourceStr); + apply(compilation) { + const options = this.options; + if (options.module !== false) { + compilation.hooks.buildModule.tap( + "SourceMapDevToolModuleOptionsPlugin", + module => { + module.useSourceMap = true; + } + ); + } + if (options.lineToLine === true) { + compilation.hooks.buildModule.tap( + "SourceMapDevToolModuleOptionsPlugin", + module => { + module.lineToLine = true; + } + ); + } else if (options.lineToLine) { + compilation.hooks.buildModule.tap( + "SourceMapDevToolModuleOptionsPlugin", + module => { + if (!module.resource) return; + let resourcePath = module.resource; + const idx = resourcePath.indexOf("?"); + if (idx >= 0) resourcePath = resourcePath.substr(0, idx); + module.lineToLine = ModuleFilenameHelpers.matchObject( + options.lineToLine, + resourcePath + ); + } + ); } } +} - updateHash(hash) { - hash.update(this.sourceStr); - super.updateHash(hash); - } -}; +module.exports = SourceMapDevToolModuleOptionsPlugin; /***/ }), -/***/ 40355: +/***/ 11851: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -71294,260 +69213,423 @@ module.exports = class RawModule extends Module { */ -const identifierUtils = __webpack_require__(94658); +const path = __webpack_require__(85622); +const { ConcatSource, RawSource } = __webpack_require__(53665); +const ModuleFilenameHelpers = __webpack_require__(71474); +const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(24113); +const createHash = __webpack_require__(15660); +const { absolutify } = __webpack_require__(94658); -/** @typedef {import("./Compiler")} Compiler */ +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(7368); + +/** @typedef {import("../declarations/plugins/SourceMapDevToolPlugin").SourceMapDevToolPluginOptions} SourceMapDevToolPluginOptions */ /** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("source-map").RawSourceMap} SourceMap */ /** @typedef {import("./Module")} Module */ +/** @typedef {import("./Compilation")} Compilation */ +/** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Compilation")} SourceMapDefinition */ /** - * @typedef {Object} RecordsChunks - * @property {Record=} byName - * @property {Record=} bySource - * @property {number[]=} usedIds + * @typedef {object} SourceMapTask + * @property {Source} asset + * @property {Array} [modules] + * @property {string} source + * @property {string} file + * @property {SourceMap} sourceMap + * @property {Chunk} chunk */ /** - * @typedef {Object} RecordsModules - * @property {Record=} byIdentifier - * @property {Record=} bySource - * @property {Record=} usedIds + * @param {string} name file path + * @returns {string} file name */ +const basename = name => { + if (!name.includes("/")) return name; + return name.substr(name.lastIndexOf("/") + 1); +}; /** - * @typedef {Object} Records - * @property {RecordsChunks=} chunks - * @property {RecordsModules=} modules + * @type {WeakMap} */ +const assetsCache = new WeakMap(); -class RecordIdsPlugin { +/** + * Creating {@link SourceMapTask} for given file + * @param {string} file current compiled file + * @param {Source} asset the asset + * @param {Chunk} chunk related chunk + * @param {SourceMapDevToolPluginOptions} options source map options + * @param {Compilation} compilation compilation instance + * @returns {SourceMapTask | undefined} created task instance or `undefined` + */ +const getTaskForFile = (file, asset, chunk, options, compilation) => { + let source, sourceMap; /** - * @param {Object} options Options object - * @param {boolean=} options.portableIds true, when ids need to be portable + * Check if asset can build source map + */ + if (asset.sourceAndMap) { + const sourceAndMap = asset.sourceAndMap(options); + sourceMap = sourceAndMap.map; + source = sourceAndMap.source; + } else { + sourceMap = asset.map(options); + source = asset.source(); + } + if (!sourceMap || typeof source !== "string") return; + const context = compilation.options.context; + const modules = sourceMap.sources.map(source => { + if (source.startsWith("webpack://")) { + source = absolutify(context, source.slice(10)); + } + const module = compilation.findModule(source); + return module || source; + }); + + return { + chunk, + file, + asset, + source, + sourceMap, + modules + }; +}; + +class SourceMapDevToolPlugin { + /** + * @param {SourceMapDevToolPluginOptions} [options] options object + * @throws {Error} throws error, if got more than 1 arguments */ constructor(options) { - this.options = options || {}; + if (arguments.length > 1) { + throw new Error( + "SourceMapDevToolPlugin only takes one argument (pass an options object)" + ); + } + + if (!options) options = {}; + + validateOptions(schema, options, "SourceMap DevTool Plugin"); + + /** @type {string | false} */ + this.sourceMapFilename = options.filename; + /** @type {string | false} */ + this.sourceMappingURLComment = + options.append === false + ? false + : options.append || "\n//# sourceMappingURL=[url]"; + /** @type {string | Function} */ + this.moduleFilenameTemplate = + options.moduleFilenameTemplate || "webpack://[namespace]/[resourcePath]"; + /** @type {string | Function} */ + this.fallbackModuleFilenameTemplate = + options.fallbackModuleFilenameTemplate || + "webpack://[namespace]/[resourcePath]?[hash]"; + /** @type {string} */ + this.namespace = options.namespace || ""; + /** @type {SourceMapDevToolPluginOptions} */ + this.options = options; } /** - * @param {Compiler} compiler the Compiler + * Apply compiler + * @param {Compiler} compiler compiler instance * @returns {void} */ apply(compiler) { - const portableIds = this.options.portableIds; - compiler.hooks.compilation.tap("RecordIdsPlugin", compilation => { - compilation.hooks.recordModules.tap( - "RecordIdsPlugin", - /** - * @param {Module[]} modules the modules array - * @param {Records} records the records object - * @returns {void} - */ - (modules, records) => { - if (!records.modules) records.modules = {}; - if (!records.modules.byIdentifier) records.modules.byIdentifier = {}; - if (!records.modules.usedIds) records.modules.usedIds = {}; - for (const module of modules) { - if (typeof module.id !== "number") continue; - const identifier = portableIds - ? identifierUtils.makePathsRelative( - compiler.context, - module.identifier(), - compilation.cache - ) - : module.identifier(); - records.modules.byIdentifier[identifier] = module.id; - records.modules.usedIds[module.id] = module.id; - } - } - ); - compilation.hooks.reviveModules.tap( - "RecordIdsPlugin", + const sourceMapFilename = this.sourceMapFilename; + const sourceMappingURLComment = this.sourceMappingURLComment; + const moduleFilenameTemplate = this.moduleFilenameTemplate; + const namespace = this.namespace; + const fallbackModuleFilenameTemplate = this.fallbackModuleFilenameTemplate; + const requestShortener = compiler.requestShortener; + const options = this.options; + options.test = options.test || /\.(m?js|css)($|\?)/i; + + const matchObject = ModuleFilenameHelpers.matchObject.bind( + undefined, + options + ); + + compiler.hooks.compilation.tap("SourceMapDevToolPlugin", compilation => { + new SourceMapDevToolModuleOptionsPlugin(options).apply(compilation); + + compilation.hooks.afterOptimizeChunkAssets.tap( + /** @type {TODO} */ + ({ name: "SourceMapDevToolPlugin", context: true }), /** - * @param {Module[]} modules the modules array - * @param {Records} records the records object + * @param {object} context hook context + * @param {Array} chunks resulted chunks + * @throws {Error} throws error, if `sourceMapFilename === false && sourceMappingURLComment === false` * @returns {void} */ - (modules, records) => { - if (!records.modules) return; - if (records.modules.byIdentifier) { - /** @type {Set} */ - const usedIds = new Set(); - for (const module of modules) { - if (module.id !== null) continue; - const identifier = portableIds - ? identifierUtils.makePathsRelative( - compiler.context, - module.identifier(), - compilation.cache - ) - : module.identifier(); - const id = records.modules.byIdentifier[identifier]; - if (id === undefined) continue; - if (usedIds.has(id)) continue; - usedIds.add(id); - module.id = id; + (context, chunks) => { + /** @type {Map} */ + const moduleToSourceNameMapping = new Map(); + /** + * @type {Function} + * @returns {void} + */ + const reportProgress = + context && context.reportProgress + ? context.reportProgress + : () => {}; + + const files = []; + for (const chunk of chunks) { + for (const file of chunk.files) { + if (matchObject(file)) { + files.push({ + file, + chunk + }); + } } } - if (Array.isArray(records.modules.usedIds)) { - compilation.usedModuleIds = new Set(records.modules.usedIds); - } - } - ); - /** - * @param {Module} module the module - * @returns {string} the (portable) identifier - */ - const getModuleIdentifier = module => { - if (portableIds) { - return identifierUtils.makePathsRelative( - compiler.context, - module.identifier(), - compilation.cache - ); - } - return module.identifier(); - }; + reportProgress(0.0); + const tasks = []; + files.forEach(({ file, chunk }, idx) => { + const asset = compilation.getAsset(file).source; + const cache = assetsCache.get(asset); + /** + * If presented in cache, reassigns assets. Cache assets already have source maps. + */ + if (cache && cache.file === file) { + for (const cachedFile in cache.assets) { + if (cachedFile === file) { + compilation.updateAsset(cachedFile, cache.assets[cachedFile]); + } else { + compilation.emitAsset(cachedFile, cache.assets[cachedFile], { + development: true + }); + } + /** + * Add file to chunk, if not presented there + */ + if (cachedFile !== file) chunk.files.push(cachedFile); + } + return; + } - /** - * @param {Chunk} chunk the chunk - * @returns {string[]} sources of the chunk - */ - const getChunkSources = chunk => { - /** @type {string[]} */ - const sources = []; - for (const chunkGroup of chunk.groupsIterable) { - const index = chunkGroup.chunks.indexOf(chunk); - if (chunkGroup.name) { - sources.push(`${index} ${chunkGroup.name}`); - } else { - for (const origin of chunkGroup.origins) { - if (origin.module) { - if (origin.request) { - sources.push( - `${index} ${getModuleIdentifier(origin.module)} ${ - origin.request - }` - ); - } else if (typeof origin.loc === "string") { - sources.push( - `${index} ${getModuleIdentifier(origin.module)} ${ - origin.loc - }` - ); - } else if ( - origin.loc && - typeof origin.loc === "object" && - origin.loc.start - ) { - sources.push( - `${index} ${getModuleIdentifier( - origin.module - )} ${JSON.stringify(origin.loc.start)}` + reportProgress( + (0.5 * idx) / files.length, + file, + "generate SourceMap" + ); + /** @type {SourceMapTask | undefined} */ + const task = getTaskForFile( + file, + asset, + chunk, + options, + compilation + ); + + if (task) { + const modules = task.modules; + + for (let idx = 0; idx < modules.length; idx++) { + const module = modules[idx]; + if (!moduleToSourceNameMapping.get(module)) { + moduleToSourceNameMapping.set( + module, + ModuleFilenameHelpers.createFilename( + module, + { + moduleFilenameTemplate: moduleFilenameTemplate, + namespace: namespace + }, + requestShortener + ) ); } } + + tasks.push(task); } - } - } - return sources; - }; + }); - compilation.hooks.recordChunks.tap( - "RecordIdsPlugin", - /** - * @param {Chunk[]} chunks the chunks array - * @param {Records} records the records object - * @returns {void} - */ - (chunks, records) => { - if (!records.chunks) records.chunks = {}; - if (!records.chunks.byName) records.chunks.byName = {}; - if (!records.chunks.bySource) records.chunks.bySource = {}; - /** @type {Set} */ - const usedIds = new Set(); - for (const chunk of chunks) { - if (typeof chunk.id !== "number") continue; - const name = chunk.name; - if (name) records.chunks.byName[name] = chunk.id; - const sources = getChunkSources(chunk); - for (const source of sources) { - records.chunks.bySource[source] = chunk.id; + reportProgress(0.5, "resolve sources"); + /** @type {Set} */ + const usedNamesSet = new Set(moduleToSourceNameMapping.values()); + /** @type {Set} */ + const conflictDetectionSet = new Set(); + + /** + * all modules in defined order (longest identifier first) + * @type {Array} + */ + const allModules = Array.from(moduleToSourceNameMapping.keys()).sort( + (a, b) => { + const ai = typeof a === "string" ? a : a.identifier(); + const bi = typeof b === "string" ? b : b.identifier(); + return ai.length - bi.length; } - usedIds.add(chunk.id); - } - records.chunks.usedIds = Array.from(usedIds).sort(); - } - ); - compilation.hooks.reviveChunks.tap( - "RecordIdsPlugin", - /** - * @param {Chunk[]} chunks the chunks array - * @param {Records} records the records object - * @returns {void} - */ - (chunks, records) => { - if (!records.chunks) return; - /** @type {Set} */ - const usedIds = new Set(); - if (records.chunks.byName) { - for (const chunk of chunks) { - if (chunk.id !== null) continue; - if (!chunk.name) continue; - const id = records.chunks.byName[chunk.name]; - if (id === undefined) continue; - if (usedIds.has(id)) continue; - usedIds.add(id); - chunk.id = id; + ); + + // find modules with conflicting source names + for (let idx = 0; idx < allModules.length; idx++) { + const module = allModules[idx]; + let sourceName = moduleToSourceNameMapping.get(module); + let hasName = conflictDetectionSet.has(sourceName); + if (!hasName) { + conflictDetectionSet.add(sourceName); + continue; + } + + // try the fallback name first + sourceName = ModuleFilenameHelpers.createFilename( + module, + { + moduleFilenameTemplate: fallbackModuleFilenameTemplate, + namespace: namespace + }, + requestShortener + ); + hasName = usedNamesSet.has(sourceName); + if (!hasName) { + moduleToSourceNameMapping.set(module, sourceName); + usedNamesSet.add(sourceName); + continue; + } + + // elsewise just append stars until we have a valid name + while (hasName) { + sourceName += "*"; + hasName = usedNamesSet.has(sourceName); } + moduleToSourceNameMapping.set(module, sourceName); + usedNamesSet.add(sourceName); } - if (records.chunks.bySource) { - for (const chunk of chunks) { - const sources = getChunkSources(chunk); - for (const source of sources) { - const id = records.chunks.bySource[source]; - if (id === undefined) continue; - if (usedIds.has(id)) continue; - usedIds.add(id); - chunk.id = id; - break; + tasks.forEach((task, index) => { + reportProgress( + 0.5 + (0.5 * index) / tasks.length, + task.file, + "attach SourceMap" + ); + const assets = Object.create(null); + const chunk = task.chunk; + const file = task.file; + const asset = task.asset; + const sourceMap = task.sourceMap; + const source = task.source; + const modules = task.modules; + const moduleFilenames = modules.map(m => + moduleToSourceNameMapping.get(m) + ); + sourceMap.sources = moduleFilenames; + if (options.noSources) { + sourceMap.sourcesContent = undefined; + } + sourceMap.sourceRoot = options.sourceRoot || ""; + sourceMap.file = file; + assetsCache.set(asset, { file, assets }); + /** @type {string | false} */ + let currentSourceMappingURLComment = sourceMappingURLComment; + if ( + currentSourceMappingURLComment !== false && + /\.css($|\?)/i.test(file) + ) { + currentSourceMappingURLComment = currentSourceMappingURLComment.replace( + /^\n\/\/(.*)$/, + "\n/*$1*/" + ); + } + const sourceMapString = JSON.stringify(sourceMap); + if (sourceMapFilename) { + let filename = file; + let query = ""; + const idx = filename.indexOf("?"); + if (idx >= 0) { + query = filename.substr(idx); + filename = filename.substr(0, idx); + } + const pathParams = { + chunk, + filename: options.fileContext + ? path.relative(options.fileContext, filename) + : filename, + query, + basename: basename(filename), + contentHash: createHash("md4") + .update(sourceMapString) + .digest("hex") + }; + let sourceMapFile = compilation.getPath( + sourceMapFilename, + pathParams + ); + const sourceMapUrl = options.publicPath + ? options.publicPath + sourceMapFile.replace(/\\/g, "/") + : path + .relative(path.dirname(file), sourceMapFile) + .replace(/\\/g, "/"); + /** + * Add source map url to compilation asset, if {@link currentSourceMappingURLComment} presented + */ + if (currentSourceMappingURLComment !== false) { + const asset = new ConcatSource( + new RawSource(source), + compilation.getPath( + currentSourceMappingURLComment, + Object.assign({ url: sourceMapUrl }, pathParams) + ) + ); + assets[file] = asset; + compilation.updateAsset(file, asset); + } + /** + * Add source map file to compilation assets and chunk files + */ + const asset = new RawSource(sourceMapString); + assets[sourceMapFile] = asset; + compilation.emitAsset(sourceMapFile, asset, { + development: true + }); + chunk.files.push(sourceMapFile); + } else { + if (currentSourceMappingURLComment === false) { + throw new Error( + "SourceMapDevToolPlugin: append can't be false when no filename is provided" + ); } + /** + * Add source map as data url to asset + */ + const asset = new ConcatSource( + new RawSource(source), + currentSourceMappingURLComment + .replace(/\[map\]/g, () => sourceMapString) + .replace( + /\[url\]/g, + () => + `data:application/json;charset=utf-8;base64,${Buffer.from( + sourceMapString, + "utf-8" + ).toString("base64")}` + ) + ); + assets[file] = asset; + compilation.updateAsset(file, asset); } - } - if (Array.isArray(records.chunks.usedIds)) { - compilation.usedChunkIds = new Set(records.chunks.usedIds); - } + }); + reportProgress(1.0); } ); }); } } -module.exports = RecordIdsPlugin; - -/***/ }), - -/***/ 15377: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; - - -const WebpackError = __webpack_require__(97391); - -module.exports = class RemovedPluginError extends WebpackError { - constructor(message) { - super(message); - - Error.captureStackTrace(this, this.constructor); - } -}; +module.exports = SourceMapDevToolPlugin; /***/ }), -/***/ 54254: +/***/ 99977: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -71557,4156 +69639,3182 @@ module.exports = class RemovedPluginError extends WebpackError { */ -const path = __webpack_require__(85622); -const NORMALIZE_SLASH_DIRECTION_REGEXP = /\\/g; -const PATH_CHARS_REGEXP = /[-[\]{}()*+?.,\\^$|#\s]/g; -const SEPARATOR_REGEXP = /[/\\]$/; -const FRONT_OR_BACK_BANG_REGEXP = /^!|!$/g; -const INDEX_JS_REGEXP = /\/index.js(!|\?|\(query\))/g; -const MATCH_RESOURCE_REGEXP = /!=!/; +const RequestShortener = __webpack_require__(54254); +const SizeFormatHelpers = __webpack_require__(12496); +const formatLocation = __webpack_require__(49); +const identifierUtils = __webpack_require__(94658); +const compareLocations = __webpack_require__(22562); +const { LogType } = __webpack_require__(47194); -const normalizeBackSlashDirection = request => { - return request.replace(NORMALIZE_SLASH_DIRECTION_REGEXP, "/"); +const optionsOrFallback = (...args) => { + let optionValues = []; + optionValues.push(...args); + return optionValues.find(optionValue => optionValue !== undefined); }; -const createRegExpForPath = path => { - const regexpTypePartial = path.replace(PATH_CHARS_REGEXP, "\\$&"); - return new RegExp(`(^|!)${regexpTypePartial}`, "g"); +const compareId = (a, b) => { + if (typeof a !== typeof b) { + return typeof a < typeof b ? -1 : 1; + } + if (a < b) return -1; + if (a > b) return 1; + return 0; }; -class RequestShortener { - constructor(directory) { - directory = normalizeBackSlashDirection(directory); - if (SEPARATOR_REGEXP.test(directory)) { - directory = directory.substr(0, directory.length - 1); - } - - if (directory) { - this.currentDirectoryRegExp = createRegExpForPath(directory); - } - - const dirname = path.dirname(directory); - const endsWithSeparator = SEPARATOR_REGEXP.test(dirname); - const parentDirectory = endsWithSeparator - ? dirname.substr(0, dirname.length - 1) - : dirname; - if (parentDirectory && parentDirectory !== directory) { - this.parentDirectoryRegExp = createRegExpForPath(`${parentDirectory}/`); - } - - if (__dirname.length >= 2) { - const buildins = normalizeBackSlashDirection(path.join(__dirname, "..")); - const buildinsAsModule = - this.currentDirectoryRegExp && - this.currentDirectoryRegExp.test(buildins); - this.buildinsAsModule = buildinsAsModule; - this.buildinsRegExp = createRegExpForPath(buildins); - } - - this.cache = new Map(); +class Stats { + constructor(compilation) { + this.compilation = compilation; + this.hash = compilation.hash; + this.startTime = undefined; + this.endTime = undefined; } - shorten(request) { - if (!request) return request; - const cacheEntry = this.cache.get(request); - if (cacheEntry !== undefined) { - return cacheEntry; - } - let result = normalizeBackSlashDirection(request); - if (this.buildinsAsModule && this.buildinsRegExp) { - result = result.replace(this.buildinsRegExp, "!(webpack)"); - } - if (this.currentDirectoryRegExp) { - result = result.replace(this.currentDirectoryRegExp, "!."); - } - if (this.parentDirectoryRegExp) { - result = result.replace(this.parentDirectoryRegExp, "!../"); - } - if (!this.buildinsAsModule && this.buildinsRegExp) { - result = result.replace(this.buildinsRegExp, "!(webpack)"); + static filterWarnings(warnings, warningsFilter) { + // we dont have anything to filter so all warnings can be shown + if (!warningsFilter) { + return warnings; } - result = result.replace(INDEX_JS_REGEXP, "$1"); - result = result.replace(FRONT_OR_BACK_BANG_REGEXP, ""); - result = result.replace(MATCH_RESOURCE_REGEXP, " = "); - this.cache.set(request, result); - return result; - } -} - -module.exports = RequestShortener; - - -/***/ }), - -/***/ 88226: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -const ParserHelpers = __webpack_require__(23999); -const ConstDependency = __webpack_require__(71101); -const NullFactory = __webpack_require__(40438); - -module.exports = class RequireJsStuffPlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "RequireJsStuffPlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set(ConstDependency, new NullFactory()); - compilation.dependencyTemplates.set( - ConstDependency, - new ConstDependency.Template() - ); - const handler = (parser, parserOptions) => { - if (parserOptions.requireJs !== undefined && !parserOptions.requireJs) - return; - - parser.hooks.call - .for("require.config") - .tap( - "RequireJsStuffPlugin", - ParserHelpers.toConstantDependency(parser, "undefined") - ); - parser.hooks.call - .for("requirejs.config") - .tap( - "RequireJsStuffPlugin", - ParserHelpers.toConstantDependency(parser, "undefined") - ); - - parser.hooks.expression - .for("require.version") - .tap( - "RequireJsStuffPlugin", - ParserHelpers.toConstantDependency( - parser, - JSON.stringify("0.0.0") - ) - ); - parser.hooks.expression - .for("requirejs.onError") - .tap( - "RequireJsStuffPlugin", - ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - "__webpack_require__.oe" - ) - ); - }; - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("RequireJsStuffPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("RequireJsStuffPlugin", handler); + // create a chain of filters + // if they return "true" a warning should be suppressed + const normalizedWarningsFilters = [].concat(warningsFilter).map(filter => { + if (typeof filter === "string") { + return warning => warning.includes(filter); } - ); - } -}; - - -/***/ }), - -/***/ 50588: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ - - -const { Tapable, HookMap, SyncHook, SyncWaterfallHook } = __webpack_require__(92402); -const Factory = __webpack_require__(87450).ResolverFactory; -const { cachedCleverMerge } = __webpack_require__(67916); - -/** @typedef {import("enhanced-resolve").Resolver} Resolver */ -const EMTPY_RESOLVE_OPTIONS = {}; - -module.exports = class ResolverFactory extends Tapable { - constructor() { - super(); - this.hooks = { - resolveOptions: new HookMap( - () => new SyncWaterfallHook(["resolveOptions"]) - ), - resolver: new HookMap(() => new SyncHook(["resolver", "resolveOptions"])) - }; - this._pluginCompat.tap("ResolverFactory", options => { - let match; - match = /^resolve-options (.+)$/.exec(options.name); - if (match) { - this.hooks.resolveOptions - .for(match[1]) - .tap(options.fn.name || "unnamed compat plugin", options.fn); - return true; + if (filter instanceof RegExp) { + return warning => filter.test(warning); } - match = /^resolver (.+)$/.exec(options.name); - if (match) { - this.hooks.resolver - .for(match[1]) - .tap(options.fn.name || "unnamed compat plugin", options.fn); - return true; + + if (typeof filter === "function") { + return filter; } + + throw new Error( + `Can only filter warnings with Strings or RegExps. (Given: ${filter})` + ); + }); + return warnings.filter(warning => { + return !normalizedWarningsFilters.some(check => check(warning)); }); - this.cache2 = new Map(); } - get(type, resolveOptions) { - resolveOptions = resolveOptions || EMTPY_RESOLVE_OPTIONS; - const ident = `${type}|${JSON.stringify(resolveOptions)}`; - const resolver = this.cache2.get(ident); - if (resolver) return resolver; - const newResolver = this._create(type, resolveOptions); - this.cache2.set(ident, newResolver); - return newResolver; + formatFilePath(filePath) { + const OPTIONS_REGEXP = /^(\s|\S)*!/; + return filePath.includes("!") + ? `${filePath.replace(OPTIONS_REGEXP, "")} (${filePath})` + : `${filePath}`; } - _create(type, resolveOptions) { - const originalResolveOptions = Object.assign({}, resolveOptions); - resolveOptions = this.hooks.resolveOptions.for(type).call(resolveOptions); - const resolver = Factory.createResolver(resolveOptions); - if (!resolver) { - throw new Error("No resolver created"); - } - /** @type {Map} */ - const childCache = new Map(); - resolver.withOptions = options => { - const cacheEntry = childCache.get(options); - if (cacheEntry !== undefined) return cacheEntry; - const mergedOptions = cachedCleverMerge(originalResolveOptions, options); - const resolver = this.get(type, mergedOptions); - childCache.set(options, resolver); - return resolver; - }; - this.hooks.resolver.for(type).call(resolver, resolveOptions); - return resolver; + hasWarnings() { + return ( + this.compilation.warnings.length > 0 || + this.compilation.children.some(child => child.getStats().hasWarnings()) + ); } -}; - - -/***/ }), - -/***/ 84247: -/***/ (function(module) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -/* -: -: [] -: { - resource: { - test: , - include: , - exclude: , - }, - resource: , -> resource.test - test: , -> resource.test - include: , -> resource.include - exclude: , -> resource.exclude - resourceQuery: , - compiler: , - issuer: , - use: "loader", -> use[0].loader - loader: <>, -> use[0].loader - loaders: <>, -> use - options: {}, -> use[0].options, - query: {}, -> options - parser: {}, - use: [ - "loader" -> use[x].loader - ], - use: [ - { - loader: "loader", - options: {} - } - ], - rules: [ - - ], - oneOf: [ - - ] -} - -: /regExp/ -: function(arg) {} -: "starting" -: [] // or -: { and: [] } -: { or: [] } -: { not: [] } -: { test: , include: , exclude: } - - -normalized: - -{ - resource: function(), - resourceQuery: function(), - compiler: function(), - issuer: function(), - use: [ - { - loader: string, - options: string, - : - } - ], - rules: [], - oneOf: [], - : , -} - -*/ - - - -const notMatcher = matcher => { - return str => { - return !matcher(str); - }; -}; -const orMatcher = items => { - return str => { - for (let i = 0; i < items.length; i++) { - if (items[i](str)) return true; - } - return false; - }; -}; + hasErrors() { + return ( + this.compilation.errors.length > 0 || + this.compilation.children.some(child => child.getStats().hasErrors()) + ); + } -const andMatcher = items => { - return str => { - for (let i = 0; i < items.length; i++) { - if (!items[i](str)) return false; + // remove a prefixed "!" that can be specified to reverse sort order + normalizeFieldKey(field) { + if (field[0] === "!") { + return field.substr(1); } - return true; - }; -}; - -module.exports = class RuleSet { - constructor(rules) { - this.references = Object.create(null); - this.rules = RuleSet.normalizeRules(rules, this.references, "ref-"); + return field; } - static normalizeRules(rules, refs, ident) { - if (Array.isArray(rules)) { - return rules.map((rule, idx) => { - return RuleSet.normalizeRule(rule, refs, `${ident}-${idx}`); - }); - } else if (rules) { - return [RuleSet.normalizeRule(rules, refs, ident)]; - } else { - return []; + // if a field is prefixed by a "!" reverse sort order + sortOrderRegular(field) { + if (field[0] === "!") { + return false; } + return true; } - static normalizeRule(rule, refs, ident) { - if (typeof rule === "string") { - return { - use: [ - { - loader: rule - } - ] - }; - } - if (!rule) { - throw new Error("Unexcepted null when object was expected as rule"); - } - if (typeof rule !== "object") { - throw new Error( - "Unexcepted " + - typeof rule + - " when object was expected as rule (" + - rule + - ")" - ); + toJson(options, forToString) { + if (typeof options === "boolean" || typeof options === "string") { + options = Stats.presetToOptions(options); + } else if (!options) { + options = {}; } - const newRule = {}; - let useSource; - let resourceSource; - let condition; + const optionOrLocalFallback = (v, def) => + v !== undefined ? v : options.all !== undefined ? options.all : def; - const checkUseSource = newSource => { - if (useSource && useSource !== newSource) { - throw new Error( - RuleSet.buildErrorMessage( - rule, - new Error( - "Rule can only have one result source (provided " + - newSource + - " and " + - useSource + - ")" - ) - ) + const testAgainstGivenOption = item => { + if (typeof item === "string") { + const regExp = new RegExp( + `[\\\\/]${item.replace( + // eslint-disable-next-line no-useless-escape + /[-[\]{}()*+?.\\^$|]/g, + "\\$&" + )}([\\\\/]|$|!|\\?)` ); + return ident => regExp.test(ident); } - useSource = newSource; - }; - - const checkResourceSource = newSource => { - if (resourceSource && resourceSource !== newSource) { - throw new Error( - RuleSet.buildErrorMessage( - rule, - new Error( - "Rule can only have one resource source (provided " + - newSource + - " and " + - resourceSource + - ")" - ) - ) - ); + if (item && typeof item === "object" && typeof item.test === "function") { + return ident => item.test(ident); + } + if (typeof item === "function") { + return item; + } + if (typeof item === "boolean") { + return () => item; } - resourceSource = newSource; }; - if (rule.test || rule.include || rule.exclude) { - checkResourceSource("test + include + exclude"); - condition = { - test: rule.test, - include: rule.include, - exclude: rule.exclude - }; - try { - newRule.resource = RuleSet.normalizeCondition(condition); - } catch (error) { - throw new Error(RuleSet.buildErrorMessage(condition, error)); - } - } - - if (rule.resource) { - checkResourceSource("resource"); - try { - newRule.resource = RuleSet.normalizeCondition(rule.resource); - } catch (error) { - throw new Error(RuleSet.buildErrorMessage(rule.resource, error)); - } - } - - if (rule.realResource) { - try { - newRule.realResource = RuleSet.normalizeCondition(rule.realResource); - } catch (error) { - throw new Error(RuleSet.buildErrorMessage(rule.realResource, error)); - } - } - - if (rule.resourceQuery) { - try { - newRule.resourceQuery = RuleSet.normalizeCondition(rule.resourceQuery); - } catch (error) { - throw new Error(RuleSet.buildErrorMessage(rule.resourceQuery, error)); - } - } + const compilation = this.compilation; + const context = optionsOrFallback( + options.context, + compilation.compiler.context + ); + const requestShortener = + compilation.compiler.context === context + ? compilation.requestShortener + : new RequestShortener(context); + const showPerformance = optionOrLocalFallback(options.performance, true); + const showHash = optionOrLocalFallback(options.hash, true); + const showEnv = optionOrLocalFallback(options.env, false); + const showVersion = optionOrLocalFallback(options.version, true); + const showTimings = optionOrLocalFallback(options.timings, true); + const showBuiltAt = optionOrLocalFallback(options.builtAt, true); + const showAssets = optionOrLocalFallback(options.assets, true); + const showEntrypoints = optionOrLocalFallback(options.entrypoints, true); + const showChunkGroups = optionOrLocalFallback( + options.chunkGroups, + !forToString + ); + const showChunks = optionOrLocalFallback(options.chunks, !forToString); + const showChunkModules = optionOrLocalFallback(options.chunkModules, true); + const showChunkOrigins = optionOrLocalFallback( + options.chunkOrigins, + !forToString + ); + const showModules = optionOrLocalFallback(options.modules, true); + const showNestedModules = optionOrLocalFallback( + options.nestedModules, + true + ); + const showModuleAssets = optionOrLocalFallback( + options.moduleAssets, + !forToString + ); + const showDepth = optionOrLocalFallback(options.depth, !forToString); + const showCachedModules = optionOrLocalFallback(options.cached, true); + const showCachedAssets = optionOrLocalFallback(options.cachedAssets, true); + const showReasons = optionOrLocalFallback(options.reasons, !forToString); + const showUsedExports = optionOrLocalFallback( + options.usedExports, + !forToString + ); + const showProvidedExports = optionOrLocalFallback( + options.providedExports, + !forToString + ); + const showOptimizationBailout = optionOrLocalFallback( + options.optimizationBailout, + !forToString + ); + const showChildren = optionOrLocalFallback(options.children, true); + const showSource = optionOrLocalFallback(options.source, !forToString); + const showModuleTrace = optionOrLocalFallback(options.moduleTrace, true); + const showErrors = optionOrLocalFallback(options.errors, true); + const showErrorDetails = optionOrLocalFallback( + options.errorDetails, + !forToString + ); + const showWarnings = optionOrLocalFallback(options.warnings, true); + const warningsFilter = optionsOrFallback(options.warningsFilter, null); + const showPublicPath = optionOrLocalFallback( + options.publicPath, + !forToString + ); + const showLogging = optionOrLocalFallback( + options.logging, + forToString ? "info" : true + ); + const showLoggingTrace = optionOrLocalFallback( + options.loggingTrace, + !forToString + ); + const loggingDebug = [] + .concat(optionsOrFallback(options.loggingDebug, [])) + .map(testAgainstGivenOption); - if (rule.compiler) { - try { - newRule.compiler = RuleSet.normalizeCondition(rule.compiler); - } catch (error) { - throw new Error(RuleSet.buildErrorMessage(rule.compiler, error)); - } - } + const excludeModules = [] + .concat(optionsOrFallback(options.excludeModules, options.exclude, [])) + .map(testAgainstGivenOption); + const excludeAssets = [] + .concat(optionsOrFallback(options.excludeAssets, [])) + .map(testAgainstGivenOption); + const maxModules = optionsOrFallback( + options.maxModules, + forToString ? 15 : Infinity + ); + const sortModules = optionsOrFallback(options.modulesSort, "id"); + const sortChunks = optionsOrFallback(options.chunksSort, "id"); + const sortAssets = optionsOrFallback(options.assetsSort, ""); + const showOutputPath = optionOrLocalFallback( + options.outputPath, + !forToString + ); - if (rule.issuer) { - try { - newRule.issuer = RuleSet.normalizeCondition(rule.issuer); - } catch (error) { - throw new Error(RuleSet.buildErrorMessage(rule.issuer, error)); - } + if (!showCachedModules) { + excludeModules.push((ident, module) => !module.built); } - if (rule.loader && rule.loaders) { - throw new Error( - RuleSet.buildErrorMessage( - rule, - new Error( - "Provided loader and loaders for rule (use only one of them)" - ) - ) - ); - } + const createModuleFilter = () => { + let i = 0; + return module => { + if (excludeModules.length > 0) { + const ident = requestShortener.shorten(module.resource); + const excluded = excludeModules.some(fn => fn(ident, module)); + if (excluded) return false; + } + const result = i < maxModules; + i++; + return result; + }; + }; - const loader = rule.loaders || rule.loader; - if (typeof loader === "string" && !rule.options && !rule.query) { - checkUseSource("loader"); - newRule.use = RuleSet.normalizeUse(loader.split("!"), ident); - } else if (typeof loader === "string" && (rule.options || rule.query)) { - checkUseSource("loader + options/query"); - newRule.use = RuleSet.normalizeUse( - { - loader: loader, - options: rule.options, - query: rule.query - }, - ident - ); - } else if (loader && (rule.options || rule.query)) { - throw new Error( - RuleSet.buildErrorMessage( - rule, - new Error( - "options/query cannot be used with loaders (use options for each array item)" - ) - ) - ); - } else if (loader) { - checkUseSource("loaders"); - newRule.use = RuleSet.normalizeUse(loader, ident); - } else if (rule.options || rule.query) { - throw new Error( - RuleSet.buildErrorMessage( - rule, - new Error( - "options/query provided without loader (use loader + options)" - ) - ) - ); - } + const createAssetFilter = () => { + return asset => { + if (excludeAssets.length > 0) { + const ident = asset.name; + const excluded = excludeAssets.some(fn => fn(ident, asset)); + if (excluded) return false; + } + return showCachedAssets || asset.emitted; + }; + }; - if (rule.use) { - checkUseSource("use"); - newRule.use = RuleSet.normalizeUse(rule.use, ident); - } + const sortByFieldAndOrder = (fieldKey, a, b) => { + if (a[fieldKey] === null && b[fieldKey] === null) return 0; + if (a[fieldKey] === null) return 1; + if (b[fieldKey] === null) return -1; + if (a[fieldKey] === b[fieldKey]) return 0; + if (typeof a[fieldKey] !== typeof b[fieldKey]) + return typeof a[fieldKey] < typeof b[fieldKey] ? -1 : 1; + return a[fieldKey] < b[fieldKey] ? -1 : 1; + }; - if (rule.rules) { - newRule.rules = RuleSet.normalizeRules( - rule.rules, - refs, - `${ident}-rules` - ); - } + const sortByField = (field, originalArray) => { + const originalMap = originalArray.reduce((map, v, i) => { + map.set(v, i); + return map; + }, new Map()); + return (a, b) => { + if (field) { + const fieldKey = this.normalizeFieldKey(field); - if (rule.oneOf) { - newRule.oneOf = RuleSet.normalizeRules( - rule.oneOf, - refs, - `${ident}-oneOf` - ); - } + // if a field is prefixed with a "!" the sort is reversed! + const sortIsRegular = this.sortOrderRegular(field); - const keys = Object.keys(rule).filter(key => { - return ![ - "resource", - "resourceQuery", - "compiler", - "test", - "include", - "exclude", - "issuer", - "loader", - "options", - "query", - "loaders", - "use", - "rules", - "oneOf" - ].includes(key); - }); - for (const key of keys) { - newRule[key] = rule[key]; - } + const cmp = sortByFieldAndOrder( + fieldKey, + sortIsRegular ? a : b, + sortIsRegular ? b : a + ); + if (cmp) return cmp; + } + return originalMap.get(a) - originalMap.get(b); + }; + }; - if (Array.isArray(newRule.use)) { - for (const item of newRule.use) { - if (item.ident) { - refs[item.ident] = item.options; + const formatError = e => { + let text = ""; + if (typeof e === "string") { + e = { message: e }; + } + if (e.chunk) { + text += `chunk ${e.chunk.name || e.chunk.id}${ + e.chunk.hasRuntime() + ? " [entry]" + : e.chunk.canBeInitial() + ? " [initial]" + : "" + }\n`; + } + if (e.file) { + text += `${e.file}\n`; + } + if ( + e.module && + e.module.readableIdentifier && + typeof e.module.readableIdentifier === "function" + ) { + text += this.formatFilePath( + e.module.readableIdentifier(requestShortener) + ); + if (typeof e.loc === "object") { + const locInfo = formatLocation(e.loc); + if (locInfo) text += ` ${locInfo}`; } + text += "\n"; } - } - - return newRule; - } - - static buildErrorMessage(condition, error) { - const conditionAsText = JSON.stringify( - condition, - (key, value) => { - return value === undefined ? "undefined" : value; - }, - 2 - ); - return error.message + " in " + conditionAsText; - } - - static normalizeUse(use, ident) { - if (typeof use === "function") { - return data => RuleSet.normalizeUse(use(data), ident); - } - if (Array.isArray(use)) { - return use - .map((item, idx) => RuleSet.normalizeUse(item, `${ident}-${idx}`)) - .reduce((arr, items) => arr.concat(items), []); - } - return [RuleSet.normalizeUseItem(use, ident)]; - } - - static normalizeUseItemString(useItemString) { - const idx = useItemString.indexOf("?"); - if (idx >= 0) { - return { - loader: useItemString.substr(0, idx), - options: useItemString.substr(idx + 1) - }; - } - return { - loader: useItemString, - options: undefined + text += e.message; + if (showErrorDetails && e.details) { + text += `\n${e.details}`; + } + if (showErrorDetails && e.missing) { + text += e.missing.map(item => `\n[${item}]`).join(""); + } + if (showModuleTrace && e.origin) { + text += `\n @ ${this.formatFilePath( + e.origin.readableIdentifier(requestShortener) + )}`; + if (typeof e.originLoc === "object") { + const locInfo = formatLocation(e.originLoc); + if (locInfo) text += ` ${locInfo}`; + } + if (e.dependencies) { + for (const dep of e.dependencies) { + if (!dep.loc) continue; + if (typeof dep.loc === "string") continue; + const locInfo = formatLocation(dep.loc); + if (!locInfo) continue; + text += ` ${locInfo}`; + } + } + let current = e.origin; + while (current.issuer) { + current = current.issuer; + text += `\n @ ${current.readableIdentifier(requestShortener)}`; + } + } + return text; }; - } - static normalizeUseItem(item, ident) { - if (typeof item === "string") { - return RuleSet.normalizeUseItemString(item); - } + const obj = { + errors: compilation.errors.map(formatError), + warnings: Stats.filterWarnings( + compilation.warnings.map(formatError), + warningsFilter + ) + }; - const newItem = {}; + //We just hint other renderers since actually omitting + //errors/warnings from the JSON would be kind of weird. + Object.defineProperty(obj, "_showWarnings", { + value: showWarnings, + enumerable: false + }); + Object.defineProperty(obj, "_showErrors", { + value: showErrors, + enumerable: false + }); - if (item.options && item.query) { - throw new Error("Provided options and query in use"); + if (showVersion) { + obj.version = __webpack_require__(71618)/* .version */ .i8; } - if (!item.loader) { - throw new Error("No loader specified"); + if (showHash) obj.hash = this.hash; + if (showTimings && this.startTime && this.endTime) { + obj.time = this.endTime - this.startTime; } - newItem.options = item.options || item.query; - - if (typeof newItem.options === "object" && newItem.options) { - if (newItem.options.ident) { - newItem.ident = newItem.options.ident; - } else { - newItem.ident = ident; - } + if (showBuiltAt && this.endTime) { + obj.builtAt = this.endTime; } - const keys = Object.keys(item).filter(function(key) { - return !["options", "query"].includes(key); - }); - - for (const key of keys) { - newItem[key] = item[key]; + if (showEnv && options._env) { + obj.env = options._env; } - return newItem; - } - - static normalizeCondition(condition) { - if (!condition) throw new Error("Expected condition but got falsy value"); - if (typeof condition === "string") { - return str => str.indexOf(condition) === 0; - } - if (typeof condition === "function") { - return condition; - } - if (condition instanceof RegExp) { - return condition.test.bind(condition); + if (compilation.needAdditionalPass) { + obj.needAdditionalPass = true; } - if (Array.isArray(condition)) { - const items = condition.map(c => RuleSet.normalizeCondition(c)); - return orMatcher(items); + if (showPublicPath) { + obj.publicPath = this.compilation.mainTemplate.getPublicPath({ + hash: this.compilation.hash + }); } - if (typeof condition !== "object") { - throw Error( - "Unexcepted " + - typeof condition + - " when condition was expected (" + - condition + - ")" - ); + if (showOutputPath) { + obj.outputPath = this.compilation.mainTemplate.outputOptions.path; } + if (showAssets) { + const assetsByFile = {}; + const compilationAssets = compilation + .getAssets() + .sort((a, b) => (a.name < b.name ? -1 : 1)); + obj.assetsByChunkName = {}; + obj.assets = compilationAssets + .map(({ name, source, info }) => { + const obj = { + name, + size: source.size(), + chunks: [], + chunkNames: [], + info, + // TODO webpack 5: remove .emitted + emitted: source.emitted || compilation.emittedAssets.has(name) + }; - const matchers = []; - Object.keys(condition).forEach(key => { - const value = condition[key]; - switch (key) { - case "or": - case "include": - case "test": - if (value) matchers.push(RuleSet.normalizeCondition(value)); - break; - case "and": - if (value) { - const items = value.map(c => RuleSet.normalizeCondition(c)); - matchers.push(andMatcher(items)); - } - break; - case "not": - case "exclude": - if (value) { - const matcher = RuleSet.normalizeCondition(value); - matchers.push(notMatcher(matcher)); + if (showPerformance) { + obj.isOverSizeLimit = source.isOverSizeLimit; } - break; - default: - throw new Error("Unexcepted property " + key + " in condition"); - } - }); - if (matchers.length === 0) { - throw new Error("Excepted condition but got " + condition); - } - if (matchers.length === 1) { - return matchers[0]; - } - return andMatcher(matchers); - } - exec(data) { - const result = []; - this._run( - data, - { - rules: this.rules - }, - result - ); - return result; - } + assetsByFile[name] = obj; + return obj; + }) + .filter(createAssetFilter()); + obj.filteredAssets = compilationAssets.length - obj.assets.length; - _run(data, rule, result) { - // test conditions - if (rule.resource && !data.resource) return false; - if (rule.realResource && !data.realResource) return false; - if (rule.resourceQuery && !data.resourceQuery) return false; - if (rule.compiler && !data.compiler) return false; - if (rule.issuer && !data.issuer) return false; - if (rule.resource && !rule.resource(data.resource)) return false; - if (rule.realResource && !rule.realResource(data.realResource)) - return false; - if (data.issuer && rule.issuer && !rule.issuer(data.issuer)) return false; - if ( - data.resourceQuery && - rule.resourceQuery && - !rule.resourceQuery(data.resourceQuery) - ) { - return false; + for (const chunk of compilation.chunks) { + for (const asset of chunk.files) { + if (assetsByFile[asset]) { + for (const id of chunk.ids) { + assetsByFile[asset].chunks.push(id); + } + if (chunk.name) { + assetsByFile[asset].chunkNames.push(chunk.name); + if (obj.assetsByChunkName[chunk.name]) { + obj.assetsByChunkName[chunk.name] = [] + .concat(obj.assetsByChunkName[chunk.name]) + .concat([asset]); + } else { + obj.assetsByChunkName[chunk.name] = asset; + } + } + } + } + } + obj.assets.sort(sortByField(sortAssets, obj.assets)); } - if (data.compiler && rule.compiler && !rule.compiler(data.compiler)) { - return false; + + const fnChunkGroup = groupMap => { + const obj = {}; + for (const keyValuePair of groupMap) { + const name = keyValuePair[0]; + const cg = keyValuePair[1]; + const children = cg.getChildrenByOrders(); + obj[name] = { + chunks: cg.chunks.map(c => c.id), + assets: cg.chunks.reduce( + (array, c) => array.concat(c.files || []), + [] + ), + children: Object.keys(children).reduce((obj, key) => { + const groups = children[key]; + obj[key] = groups.map(group => ({ + name: group.name, + chunks: group.chunks.map(c => c.id), + assets: group.chunks.reduce( + (array, c) => array.concat(c.files || []), + [] + ) + })); + return obj; + }, Object.create(null)), + childAssets: Object.keys(children).reduce((obj, key) => { + const groups = children[key]; + obj[key] = Array.from( + groups.reduce((set, group) => { + for (const chunk of group.chunks) { + for (const asset of chunk.files) { + set.add(asset); + } + } + return set; + }, new Set()) + ); + return obj; + }, Object.create(null)) + }; + if (showPerformance) { + obj[name].isOverSizeLimit = cg.isOverSizeLimit; + } + } + + return obj; + }; + + if (showEntrypoints) { + obj.entrypoints = fnChunkGroup(compilation.entrypoints); } - // apply - const keys = Object.keys(rule).filter(key => { - return ![ - "resource", - "realResource", - "resourceQuery", - "compiler", - "issuer", - "rules", - "oneOf", - "use", - "enforce" - ].includes(key); - }); - for (const key of keys) { - result.push({ - type: key, - value: rule[key] - }); + if (showChunkGroups) { + obj.namedChunkGroups = fnChunkGroup(compilation.namedChunkGroups); } - if (rule.use) { - const process = use => { - if (typeof use === "function") { - process(use(data)); - } else if (Array.isArray(use)) { - use.forEach(process); - } else { - result.push({ - type: "use", - value: use, - enforce: rule.enforce + const fnModule = module => { + const path = []; + let current = module; + while (current.issuer) { + path.push((current = current.issuer)); + } + path.reverse(); + const obj = { + id: module.id, + identifier: module.identifier(), + name: module.readableIdentifier(requestShortener), + index: module.index, + index2: module.index2, + size: module.size(), + cacheable: module.buildInfo.cacheable, + built: !!module.built, + optional: module.optional, + prefetched: module.prefetched, + chunks: Array.from(module.chunksIterable, chunk => chunk.id), + issuer: module.issuer && module.issuer.identifier(), + issuerId: module.issuer && module.issuer.id, + issuerName: + module.issuer && module.issuer.readableIdentifier(requestShortener), + issuerPath: + module.issuer && + path.map(module => ({ + id: module.id, + identifier: module.identifier(), + name: module.readableIdentifier(requestShortener), + profile: module.profile + })), + profile: module.profile, + failed: !!module.error, + errors: module.errors ? module.errors.length : 0, + warnings: module.warnings ? module.warnings.length : 0 + }; + if (showModuleAssets) { + obj.assets = Object.keys(module.buildInfo.assets || {}); + } + if (showReasons) { + obj.reasons = module.reasons + .sort((a, b) => { + if (a.module && !b.module) return -1; + if (!a.module && b.module) return 1; + if (a.module && b.module) { + const cmp = compareId(a.module.id, b.module.id); + if (cmp) return cmp; + } + if (a.dependency && !b.dependency) return -1; + if (!a.dependency && b.dependency) return 1; + if (a.dependency && b.dependency) { + const cmp = compareLocations(a.dependency.loc, b.dependency.loc); + if (cmp) return cmp; + if (a.dependency.type < b.dependency.type) return -1; + if (a.dependency.type > b.dependency.type) return 1; + } + return 0; + }) + .map(reason => { + const obj = { + moduleId: reason.module ? reason.module.id : null, + moduleIdentifier: reason.module + ? reason.module.identifier() + : null, + module: reason.module + ? reason.module.readableIdentifier(requestShortener) + : null, + moduleName: reason.module + ? reason.module.readableIdentifier(requestShortener) + : null, + type: reason.dependency ? reason.dependency.type : null, + explanation: reason.explanation, + userRequest: reason.dependency + ? reason.dependency.userRequest + : null + }; + if (reason.dependency) { + const locInfo = formatLocation(reason.dependency.loc); + if (locInfo) { + obj.loc = locInfo; + } + } + return obj; }); + } + if (showUsedExports) { + if (module.used === true) { + obj.usedExports = module.usedExports; + } else if (module.used === false) { + obj.usedExports = false; } - }; - process(rule.use); - } - - if (rule.rules) { - for (let i = 0; i < rule.rules.length; i++) { - this._run(data, rule.rules[i], result); } + if (showProvidedExports) { + obj.providedExports = Array.isArray(module.buildMeta.providedExports) + ? module.buildMeta.providedExports + : null; + } + if (showOptimizationBailout) { + obj.optimizationBailout = module.optimizationBailout.map(item => { + if (typeof item === "function") return item(requestShortener); + return item; + }); + } + if (showDepth) { + obj.depth = module.depth; + } + if (showNestedModules) { + if (module.modules) { + const modules = module.modules; + obj.modules = modules + .sort(sortByField("depth", modules)) + .filter(createModuleFilter()) + .map(fnModule); + obj.filteredModules = modules.length - obj.modules.length; + obj.modules.sort(sortByField(sortModules, obj.modules)); + } + } + if (showSource && module._source) { + obj.source = module._source.source(); + } + return obj; + }; + if (showChunks) { + obj.chunks = compilation.chunks.map(chunk => { + const parents = new Set(); + const children = new Set(); + const siblings = new Set(); + const childIdByOrder = chunk.getChildIdsByOrders(); + for (const chunkGroup of chunk.groupsIterable) { + for (const parentGroup of chunkGroup.parentsIterable) { + for (const chunk of parentGroup.chunks) { + parents.add(chunk.id); + } + } + for (const childGroup of chunkGroup.childrenIterable) { + for (const chunk of childGroup.chunks) { + children.add(chunk.id); + } + } + for (const sibling of chunkGroup.chunks) { + if (sibling !== chunk) siblings.add(sibling.id); + } + } + const obj = { + id: chunk.id, + rendered: chunk.rendered, + initial: chunk.canBeInitial(), + entry: chunk.hasRuntime(), + recorded: chunk.recorded, + reason: chunk.chunkReason, + size: chunk.modulesSize(), + names: chunk.name ? [chunk.name] : [], + files: chunk.files.slice(), + hash: chunk.renderedHash, + siblings: Array.from(siblings).sort(compareId), + parents: Array.from(parents).sort(compareId), + children: Array.from(children).sort(compareId), + childrenByOrder: childIdByOrder + }; + if (showChunkModules) { + const modules = chunk.getModules(); + obj.modules = modules + .slice() + .sort(sortByField("depth", modules)) + .filter(createModuleFilter()) + .map(fnModule); + obj.filteredModules = chunk.getNumberOfModules() - obj.modules.length; + obj.modules.sort(sortByField(sortModules, obj.modules)); + } + if (showChunkOrigins) { + obj.origins = Array.from(chunk.groupsIterable, g => g.origins) + .reduce((a, b) => a.concat(b), []) + .map(origin => ({ + moduleId: origin.module ? origin.module.id : undefined, + module: origin.module ? origin.module.identifier() : "", + moduleIdentifier: origin.module ? origin.module.identifier() : "", + moduleName: origin.module + ? origin.module.readableIdentifier(requestShortener) + : "", + loc: formatLocation(origin.loc), + request: origin.request, + reasons: origin.reasons || [] + })) + .sort((a, b) => { + const cmp1 = compareId(a.moduleId, b.moduleId); + if (cmp1) return cmp1; + const cmp2 = compareId(a.loc, b.loc); + if (cmp2) return cmp2; + const cmp3 = compareId(a.request, b.request); + if (cmp3) return cmp3; + return 0; + }); + } + return obj; + }); + obj.chunks.sort(sortByField(sortChunks, obj.chunks)); } - - if (rule.oneOf) { - for (let i = 0; i < rule.oneOf.length; i++) { - if (this._run(data, rule.oneOf[i], result)) break; + if (showModules) { + obj.modules = compilation.modules + .slice() + .sort(sortByField("depth", compilation.modules)) + .filter(createModuleFilter()) + .map(fnModule); + obj.filteredModules = compilation.modules.length - obj.modules.length; + obj.modules.sort(sortByField(sortModules, obj.modules)); + } + if (showLogging) { + const util = __webpack_require__(31669); + obj.logging = {}; + let acceptedTypes; + let collapsedGroups = false; + switch (showLogging) { + case "none": + acceptedTypes = new Set([]); + break; + case "error": + acceptedTypes = new Set([LogType.error]); + break; + case "warn": + acceptedTypes = new Set([LogType.error, LogType.warn]); + break; + case "info": + acceptedTypes = new Set([LogType.error, LogType.warn, LogType.info]); + break; + case true: + case "log": + acceptedTypes = new Set([ + LogType.error, + LogType.warn, + LogType.info, + LogType.log, + LogType.group, + LogType.groupEnd, + LogType.groupCollapsed, + LogType.clear + ]); + break; + case "verbose": + acceptedTypes = new Set([ + LogType.error, + LogType.warn, + LogType.info, + LogType.log, + LogType.group, + LogType.groupEnd, + LogType.groupCollapsed, + LogType.profile, + LogType.profileEnd, + LogType.time, + LogType.status, + LogType.clear + ]); + collapsedGroups = true; + break; + } + for (const [origin, logEntries] of compilation.logging) { + const debugMode = loggingDebug.some(fn => fn(origin)); + let collapseCounter = 0; + let processedLogEntries = logEntries; + if (!debugMode) { + processedLogEntries = processedLogEntries.filter(entry => { + if (!acceptedTypes.has(entry.type)) return false; + if (!collapsedGroups) { + switch (entry.type) { + case LogType.groupCollapsed: + collapseCounter++; + return collapseCounter === 1; + case LogType.group: + if (collapseCounter > 0) collapseCounter++; + return collapseCounter === 0; + case LogType.groupEnd: + if (collapseCounter > 0) { + collapseCounter--; + return false; + } + return true; + default: + return collapseCounter === 0; + } + } + return true; + }); + } + processedLogEntries = processedLogEntries.map(entry => { + let message = undefined; + if (entry.type === LogType.time) { + message = `${entry.args[0]}: ${entry.args[1] * 1000 + + entry.args[2] / 1000000}ms`; + } else if (entry.args && entry.args.length > 0) { + message = util.format(entry.args[0], ...entry.args.slice(1)); + } + return { + type: + (debugMode || collapsedGroups) && + entry.type === LogType.groupCollapsed + ? LogType.group + : entry.type, + message, + trace: showLoggingTrace && entry.trace ? entry.trace : undefined + }; + }); + let name = identifierUtils + .makePathsRelative(context, origin, compilation.cache) + .replace(/\|/g, " "); + if (name in obj.logging) { + let i = 1; + while (`${name}#${i}` in obj.logging) { + i++; + } + name = `${name}#${i}`; + } + obj.logging[name] = { + entries: processedLogEntries, + filteredEntries: logEntries.length - processedLogEntries.length, + debug: debugMode + }; } } + if (showChildren) { + obj.children = compilation.children.map((child, idx) => { + const childOptions = Stats.getChildOptions(options, idx); + const obj = new Stats(child).toJson(childOptions, forToString); + delete obj.hash; + delete obj.version; + if (child.name) { + obj.name = identifierUtils.makePathsRelative( + context, + child.name, + compilation.cache + ); + } + return obj; + }); + } - return true; + return obj; } - findOptionsByIdent(ident) { - const options = this.references[ident]; - if (!options) { - throw new Error("Can't find options with ident '" + ident + "'"); + toString(options) { + if (typeof options === "boolean" || typeof options === "string") { + options = Stats.presetToOptions(options); + } else if (!options) { + options = {}; } - return options; - } -}; + const useColors = optionsOrFallback(options.colors, false); -/***/ }), + const obj = this.toJson(options, true); -/***/ 44006: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + return Stats.jsonToString(obj, useColors); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + static jsonToString(obj, useColors) { + const buf = []; + const defaultColors = { + bold: "\u001b[1m", + yellow: "\u001b[1m\u001b[33m", + red: "\u001b[1m\u001b[31m", + green: "\u001b[1m\u001b[32m", + cyan: "\u001b[1m\u001b[36m", + magenta: "\u001b[1m\u001b[35m" + }; -const Template = __webpack_require__(96066); - -/** @typedef {import("./Module")} Module */ + const colors = Object.keys(defaultColors).reduce( + (obj, color) => { + obj[color] = str => { + if (useColors) { + buf.push( + useColors === true || useColors[color] === undefined + ? defaultColors[color] + : useColors[color] + ); + } + buf.push(str); + if (useColors) { + buf.push("\u001b[39m\u001b[22m"); + } + }; + return obj; + }, + { + normal: str => buf.push(str) + } + ); -module.exports = class RuntimeTemplate { - constructor(outputOptions, requestShortener) { - this.outputOptions = outputOptions || {}; - this.requestShortener = requestShortener; - } + const coloredTime = time => { + let times = [800, 400, 200, 100]; + if (obj.time) { + times = [obj.time / 2, obj.time / 4, obj.time / 8, obj.time / 16]; + } + if (time < times[3]) colors.normal(`${time}ms`); + else if (time < times[2]) colors.bold(`${time}ms`); + else if (time < times[1]) colors.green(`${time}ms`); + else if (time < times[0]) colors.yellow(`${time}ms`); + else colors.red(`${time}ms`); + }; - /** - * Add a comment - * @param {object} options Information content of the comment - * @param {string=} options.request request string used originally - * @param {string=} options.chunkName name of the chunk referenced - * @param {string=} options.chunkReason reason information of the chunk - * @param {string=} options.message additional message - * @param {string=} options.exportName name of the export - * @returns {string} comment - */ - comment({ request, chunkName, chunkReason, message, exportName }) { - let content; - if (this.outputOptions.pathinfo) { - content = [message, request, chunkName, chunkReason] - .filter(Boolean) - .map(item => this.requestShortener.shorten(item)) - .join(" | "); - } else { - content = [message, chunkName, chunkReason] - .filter(Boolean) - .map(item => this.requestShortener.shorten(item)) - .join(" | "); - } - if (!content) return ""; - if (this.outputOptions.pathinfo) { - return Template.toComment(content) + " "; - } else { - return Template.toNormalComment(content) + " "; - } - } + const newline = () => buf.push("\n"); - throwMissingModuleErrorFunction({ request }) { - const err = `Cannot find module '${request}'`; - return `function webpackMissingModule() { var e = new Error(${JSON.stringify( - err - )}); e.code = 'MODULE_NOT_FOUND'; throw e; }`; - } + const getText = (arr, row, col) => { + return arr[row][col].value; + }; - missingModule({ request }) { - return `!(${this.throwMissingModuleErrorFunction({ request })}())`; - } + const table = (array, align, splitter) => { + const rows = array.length; + const cols = array[0].length; + const colSizes = new Array(cols); + for (let col = 0; col < cols; col++) { + colSizes[col] = 0; + } + for (let row = 0; row < rows; row++) { + for (let col = 0; col < cols; col++) { + const value = `${getText(array, row, col)}`; + if (value.length > colSizes[col]) { + colSizes[col] = value.length; + } + } + } + for (let row = 0; row < rows; row++) { + for (let col = 0; col < cols; col++) { + const format = array[row][col].color; + const value = `${getText(array, row, col)}`; + let l = value.length; + if (align[col] === "l") { + format(value); + } + for (; l < colSizes[col] && col !== cols - 1; l++) { + colors.normal(" "); + } + if (align[col] === "r") { + format(value); + } + if (col + 1 < cols && colSizes[col] !== 0) { + colors.normal(splitter || " "); + } + } + newline(); + } + }; - missingModuleStatement({ request }) { - return `${this.missingModule({ request })};\n`; - } + const getAssetColor = (asset, defaultColor) => { + if (asset.isOverSizeLimit) { + return colors.yellow; + } - missingModulePromise({ request }) { - return `Promise.resolve().then(${this.throwMissingModuleErrorFunction({ - request - })})`; - } + return defaultColor; + }; - moduleId({ module, request }) { - if (!module) { - return this.missingModule({ - request - }); + if (obj.hash) { + colors.normal("Hash: "); + colors.bold(obj.hash); + newline(); } - if (module.id === null) { - throw new Error( - `RuntimeTemplate.moduleId(): Module ${module.identifier()} has no id. This should not happen.` - ); + if (obj.version) { + colors.normal("Version: webpack "); + colors.bold(obj.version); + newline(); } - return `${this.comment({ request })}${JSON.stringify(module.id)}`; - } - - moduleRaw({ module, request }) { - if (!module) { - return this.missingModule({ - request - }); + if (typeof obj.time === "number") { + colors.normal("Time: "); + colors.bold(obj.time); + colors.normal("ms"); + newline(); } - return `__webpack_require__(${this.moduleId({ module, request })})`; - } - - moduleExports({ module, request }) { - return this.moduleRaw({ - module, - request - }); - } + if (typeof obj.builtAt === "number") { + const builtAtDate = new Date(obj.builtAt); + let timeZone = undefined; - moduleNamespace({ module, request, strict }) { - if (!module) { - return this.missingModule({ - request - }); - } - const moduleId = this.moduleId({ - module, - request - }); - const exportsType = module.buildMeta && module.buildMeta.exportsType; - if (exportsType === "namespace") { - const rawModule = this.moduleRaw({ - module, - request - }); - return rawModule; - } else if (exportsType === "named") { - return `__webpack_require__.t(${moduleId}, 3)`; - } else if (strict) { - return `__webpack_require__.t(${moduleId}, 1)`; - } else { - return `__webpack_require__.t(${moduleId}, 7)`; - } - } + try { + builtAtDate.toLocaleTimeString(); + } catch (err) { + // Force UTC if runtime timezone is unsupported + timeZone = "UTC"; + } - moduleNamespacePromise({ block, module, request, message, strict, weak }) { - if (!module) { - return this.missingModulePromise({ - request - }); - } - if (module.id === null) { - throw new Error( - `RuntimeTemplate.moduleNamespacePromise(): Module ${module.identifier()} has no id. This should not happen.` + colors.normal("Built at: "); + colors.normal( + builtAtDate.toLocaleDateString(undefined, { + day: "2-digit", + month: "2-digit", + year: "numeric", + timeZone + }) ); + colors.normal(" "); + colors.bold(builtAtDate.toLocaleTimeString(undefined, { timeZone })); + newline(); } - const promise = this.blockPromise({ - block, - message - }); - - let getModuleFunction; - let idExpr = JSON.stringify(module.id); - const comment = this.comment({ - request - }); - let header = ""; - if (weak) { - if (idExpr.length > 8) { - // 'var x="nnnnnn";x,"+x+",x' vs '"nnnnnn",nnnnnn,"nnnnnn"' - header += `var id = ${idExpr}; `; - idExpr = "id"; - } - header += `if(!__webpack_require__.m[${idExpr}]) { var e = new Error("Module '" + ${idExpr} + "' is not available (weak dependency)"); e.code = 'MODULE_NOT_FOUND'; throw e; } `; - } - const moduleId = this.moduleId({ - module, - request - }); - const exportsType = module.buildMeta && module.buildMeta.exportsType; - if (exportsType === "namespace") { - if (header) { - const rawModule = this.moduleRaw({ - module, - request - }); - getModuleFunction = `function() { ${header}return ${rawModule}; }`; - } else { - getModuleFunction = `__webpack_require__.bind(null, ${comment}${idExpr})`; - } - } else if (exportsType === "named") { - if (header) { - getModuleFunction = `function() { ${header}return __webpack_require__.t(${moduleId}, 3); }`; - } else { - getModuleFunction = `__webpack_require__.t.bind(null, ${comment}${idExpr}, 3)`; - } - } else if (strict) { - if (header) { - getModuleFunction = `function() { ${header}return __webpack_require__.t(${moduleId}, 1); }`; - } else { - getModuleFunction = `__webpack_require__.t.bind(null, ${comment}${idExpr}, 1)`; - } - } else { - if (header) { - getModuleFunction = `function() { ${header}return __webpack_require__.t(${moduleId}, 7); }`; - } else { - getModuleFunction = `__webpack_require__.t.bind(null, ${comment}${idExpr}, 7)`; - } + if (obj.env) { + colors.normal("Environment (--env): "); + colors.bold(JSON.stringify(obj.env, null, 2)); + newline(); } - - return `${promise || "Promise.resolve()"}.then(${getModuleFunction})`; - } - - /** - * - * @param {Object} options options object - * @param {boolean=} options.update whether a new variable should be created or the existing one updated - * @param {Module} options.module the module - * @param {string} options.request the request that should be printed as comment - * @param {string} options.importVar name of the import variable - * @param {Module} options.originModule module in which the statement is emitted - * @returns {string} the import statement - */ - importStatement({ update, module, request, importVar, originModule }) { - if (!module) { - return this.missingModuleStatement({ - request - }); + if (obj.publicPath) { + colors.normal("PublicPath: "); + colors.bold(obj.publicPath); + newline(); } - const moduleId = this.moduleId({ - module, - request - }); - const optDeclaration = update ? "" : "var "; - - const exportsType = module.buildMeta && module.buildMeta.exportsType; - let content = `/* harmony import */ ${optDeclaration}${importVar} = __webpack_require__(${moduleId});\n`; - if (!exportsType && !originModule.buildMeta.strictHarmonyModule) { - content += `/* harmony import */ ${optDeclaration}${importVar}_default = /*#__PURE__*/__webpack_require__.n(${importVar});\n`; - } - if (exportsType === "named") { - if (Array.isArray(module.buildMeta.providedExports)) { - content += `${optDeclaration}${importVar}_namespace = /*#__PURE__*/__webpack_require__.t(${moduleId}, 1);\n`; - } else { - content += `${optDeclaration}${importVar}_namespace = /*#__PURE__*/__webpack_require__.t(${moduleId});\n`; + if (obj.assets && obj.assets.length > 0) { + const t = [ + [ + { + value: "Asset", + color: colors.bold + }, + { + value: "Size", + color: colors.bold + }, + { + value: "Chunks", + color: colors.bold + }, + { + value: "", + color: colors.bold + }, + { + value: "", + color: colors.bold + }, + { + value: "Chunk Names", + color: colors.bold + } + ] + ]; + for (const asset of obj.assets) { + t.push([ + { + value: asset.name, + color: getAssetColor(asset, colors.green) + }, + { + value: SizeFormatHelpers.formatSize(asset.size), + color: getAssetColor(asset, colors.normal) + }, + { + value: asset.chunks.join(", "), + color: colors.bold + }, + { + value: [ + asset.emitted && "[emitted]", + asset.info.immutable && "[immutable]", + asset.info.development && "[dev]", + asset.info.hotModuleReplacement && "[hmr]" + ] + .filter(Boolean) + .join(" "), + color: colors.green + }, + { + value: asset.isOverSizeLimit ? "[big]" : "", + color: getAssetColor(asset, colors.normal) + }, + { + value: asset.chunkNames.join(", "), + color: colors.normal + } + ]); } + table(t, "rrrlll"); } - return content; - } - - exportFromImport({ - module, - request, - exportName, - originModule, - asiSafe, - isCall, - callContext, - importVar - }) { - if (!module) { - return this.missingModule({ - request - }); + if (obj.filteredAssets > 0) { + colors.normal(" "); + if (obj.assets.length > 0) colors.normal("+ "); + colors.normal(obj.filteredAssets); + if (obj.assets.length > 0) colors.normal(" hidden"); + colors.normal(obj.filteredAssets !== 1 ? " assets" : " asset"); + newline(); } - const exportsType = module.buildMeta && module.buildMeta.exportsType; - if (!exportsType) { - if (exportName === "default") { - if (!originModule.buildMeta.strictHarmonyModule) { - if (isCall) { - return `${importVar}_default()`; - } else if (asiSafe) { - return `(${importVar}_default())`; - } else { - return `${importVar}_default.a`; - } - } else { - return importVar; + const processChunkGroups = (namedGroups, prefix) => { + for (const name of Object.keys(namedGroups)) { + const cg = namedGroups[name]; + colors.normal(`${prefix} `); + colors.bold(name); + if (cg.isOverSizeLimit) { + colors.normal(" "); + colors.yellow("[big]"); } - } else if (originModule.buildMeta.strictHarmonyModule) { - if (exportName) { - return "/* non-default import from non-esm module */undefined"; - } else { - return `/*#__PURE__*/__webpack_require__.t(${importVar})`; + colors.normal(" ="); + for (const asset of cg.assets) { + colors.normal(" "); + colors.green(asset); + } + for (const name of Object.keys(cg.childAssets)) { + const assets = cg.childAssets[name]; + if (assets && assets.length > 0) { + colors.normal(" "); + colors.magenta(`(${name}:`); + for (const asset of assets) { + colors.normal(" "); + colors.green(asset); + } + colors.magenta(")"); + } } + newline(); } + }; + + if (obj.entrypoints) { + processChunkGroups(obj.entrypoints, "Entrypoint"); } - if (exportsType === "named") { - if (exportName === "default") { - return importVar; - } else if (!exportName) { - return `${importVar}_namespace`; + if (obj.namedChunkGroups) { + let outputChunkGroups = obj.namedChunkGroups; + if (obj.entrypoints) { + outputChunkGroups = Object.keys(outputChunkGroups) + .filter(name => !obj.entrypoints[name]) + .reduce((result, name) => { + result[name] = obj.namedChunkGroups[name]; + return result; + }, {}); } + processChunkGroups(outputChunkGroups, "Chunk Group"); } - if (exportName) { - const used = module.isUsed(exportName); - if (!used) { - const comment = Template.toNormalComment(`unused export ${exportName}`); - return `${comment} undefined`; + const modulesByIdentifier = {}; + if (obj.modules) { + for (const module of obj.modules) { + modulesByIdentifier[`$${module.identifier}`] = module; } - const comment = - used !== exportName ? Template.toNormalComment(exportName) + " " : ""; - const access = `${importVar}[${comment}${JSON.stringify(used)}]`; - if (isCall) { - if (callContext === false && asiSafe) { - return `(0,${access})`; - } else if (callContext === false) { - return `Object(${access})`; + } else if (obj.chunks) { + for (const chunk of obj.chunks) { + if (chunk.modules) { + for (const module of chunk.modules) { + modulesByIdentifier[`$${module.identifier}`] = module; + } } } - return access; - } else { - return importVar; } - } - blockPromise({ block, message }) { - if (!block || !block.chunkGroup || block.chunkGroup.chunks.length === 0) { - const comment = this.comment({ - message - }); - return `Promise.resolve(${comment.trim()})`; - } - const chunks = block.chunkGroup.chunks.filter( - chunk => !chunk.hasRuntime() && chunk.id !== null - ); - const comment = this.comment({ - message, - chunkName: block.chunkName, - chunkReason: block.chunkReason - }); - if (chunks.length === 1) { - const chunkId = JSON.stringify(chunks[0].id); - return `__webpack_require__.e(${comment}${chunkId})`; - } else if (chunks.length > 0) { - const requireChunkId = chunk => - `__webpack_require__.e(${JSON.stringify(chunk.id)})`; - return `Promise.all(${comment.trim()}[${chunks - .map(requireChunkId) - .join(", ")}])`; - } else { - return `Promise.resolve(${comment.trim()})`; - } - } - - onError() { - return "__webpack_require__.oe"; - } - - defineEsModuleFlagStatement({ exportsArgument }) { - return `__webpack_require__.r(${exportsArgument});\n`; - } -}; - - -/***/ }), - -/***/ 37098: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const { ConcatSource } = __webpack_require__(53665); - -/** @typedef {import("./Compilation")} Compilation */ - -class SetVarMainTemplatePlugin { - /** - * @param {string} varExpression the accessor where the library is exported - * @param {boolean} copyObject specify copying the exports - */ - constructor(varExpression, copyObject) { - /** @type {string} */ - this.varExpression = varExpression; - /** @type {boolean} */ - this.copyObject = copyObject; - } - - /** - * @param {Compilation} compilation the compilation instance - * @returns {void} - */ - apply(compilation) { - const { mainTemplate, chunkTemplate } = compilation; - - const onRenderWithEntry = (source, chunk, hash) => { - const varExpression = mainTemplate.getAssetPath(this.varExpression, { - hash, - chunk - }); - if (this.copyObject) { - return new ConcatSource( - `(function(e, a) { for(var i in a) e[i] = a[i]; }(${varExpression}, `, - source, - "))" + const processModuleAttributes = module => { + colors.normal(" "); + colors.normal(SizeFormatHelpers.formatSize(module.size)); + if (module.chunks) { + for (const chunk of module.chunks) { + colors.normal(" {"); + colors.yellow(chunk); + colors.normal("}"); + } + } + if (typeof module.depth === "number") { + colors.normal(` [depth ${module.depth}]`); + } + if (module.cacheable === false) { + colors.red(" [not cacheable]"); + } + if (module.optional) { + colors.yellow(" [optional]"); + } + if (module.built) { + colors.green(" [built]"); + } + if (module.assets && module.assets.length) { + colors.magenta( + ` [${module.assets.length} asset${ + module.assets.length === 1 ? "" : "s" + }]` ); - } else { - const prefix = `${varExpression} =\n`; - return new ConcatSource(prefix, source); } - }; - - for (const template of [mainTemplate, chunkTemplate]) { - template.hooks.renderWithEntry.tap( - "SetVarMainTemplatePlugin", - onRenderWithEntry - ); - } - - mainTemplate.hooks.globalHashPaths.tap( - "SetVarMainTemplatePlugin", - paths => { - if (this.varExpression) paths.push(this.varExpression); - return paths; + if (module.prefetched) { + colors.magenta(" [prefetched]"); } - ); - mainTemplate.hooks.hash.tap("SetVarMainTemplatePlugin", hash => { - hash.update("set var"); - hash.update(`${this.varExpression}`); - hash.update(`${this.copyObject}`); - }); - } -} - -module.exports = SetVarMainTemplatePlugin; - - -/***/ }), - -/***/ 19070: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -const SingleEntryDependency = __webpack_require__(84828); - -/** @typedef {import("./Compiler")} Compiler */ - -class SingleEntryPlugin { - /** - * An entry plugin which will handle - * creation of the SingleEntryDependency - * - * @param {string} context context path - * @param {string} entry entry path - * @param {string} name entry key name - */ - constructor(context, entry, name) { - this.context = context; - this.entry = entry; - this.name = name; - } - - /** - * @param {Compiler} compiler the compiler instance - * @returns {void} - */ - apply(compiler) { - compiler.hooks.compilation.tap( - "SingleEntryPlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set( - SingleEntryDependency, - normalModuleFactory + if (module.failed) colors.red(" [failed]"); + if (module.warnings) { + colors.yellow( + ` [${module.warnings} warning${module.warnings === 1 ? "" : "s"}]` ); } - ); - - compiler.hooks.make.tapAsync( - "SingleEntryPlugin", - (compilation, callback) => { - const { entry, name, context } = this; - - const dep = SingleEntryPlugin.createDependency(entry, name); - compilation.addEntry(context, dep, name, callback); + if (module.errors) { + colors.red( + ` [${module.errors} error${module.errors === 1 ? "" : "s"}]` + ); } - ); - } - - /** - * @param {string} entry entry request - * @param {string} name entry name - * @returns {SingleEntryDependency} the dependency - */ - static createDependency(entry, name) { - const dep = new SingleEntryDependency(entry); - dep.loc = { name }; - return dep; - } -} - -module.exports = SingleEntryPlugin; - - -/***/ }), - -/***/ 12496: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Sean Larkin @thelarkinn -*/ - - -const SizeFormatHelpers = exports; - -SizeFormatHelpers.formatSize = size => { - if (typeof size !== "number" || Number.isNaN(size) === true) { - return "unknown size"; - } - - if (size <= 0) { - return "0 bytes"; - } - - const abbreviations = ["bytes", "KiB", "MiB", "GiB"]; - const index = Math.floor(Math.log(size) / Math.log(1024)); - - return `${+(size / Math.pow(1024, index)).toPrecision(3)} ${ - abbreviations[index] - }`; -}; - - -/***/ }), - -/***/ 24113: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const ModuleFilenameHelpers = __webpack_require__(71474); - -class SourceMapDevToolModuleOptionsPlugin { - constructor(options) { - this.options = options; - } + }; - apply(compilation) { - const options = this.options; - if (options.module !== false) { - compilation.hooks.buildModule.tap( - "SourceMapDevToolModuleOptionsPlugin", - module => { - module.useSourceMap = true; + const processModuleContent = (module, prefix) => { + if (Array.isArray(module.providedExports)) { + colors.normal(prefix); + if (module.providedExports.length === 0) { + colors.cyan("[no exports]"); + } else { + colors.cyan(`[exports: ${module.providedExports.join(", ")}]`); } - ); - } - if (options.lineToLine === true) { - compilation.hooks.buildModule.tap( - "SourceMapDevToolModuleOptionsPlugin", - module => { - module.lineToLine = true; + newline(); + } + if (module.usedExports !== undefined) { + if (module.usedExports !== true) { + colors.normal(prefix); + if (module.usedExports === null) { + colors.cyan("[used exports unknown]"); + } else if (module.usedExports === false) { + colors.cyan("[no exports used]"); + } else if ( + Array.isArray(module.usedExports) && + module.usedExports.length === 0 + ) { + colors.cyan("[no exports used]"); + } else if (Array.isArray(module.usedExports)) { + const providedExportsCount = Array.isArray(module.providedExports) + ? module.providedExports.length + : null; + if ( + providedExportsCount !== null && + providedExportsCount === module.usedExports.length + ) { + colors.cyan("[all exports used]"); + } else { + colors.cyan( + `[only some exports used: ${module.usedExports.join(", ")}]` + ); + } + } + newline(); } - ); - } else if (options.lineToLine) { - compilation.hooks.buildModule.tap( - "SourceMapDevToolModuleOptionsPlugin", - module => { - if (!module.resource) return; - let resourcePath = module.resource; - const idx = resourcePath.indexOf("?"); - if (idx >= 0) resourcePath = resourcePath.substr(0, idx); - module.lineToLine = ModuleFilenameHelpers.matchObject( - options.lineToLine, - resourcePath - ); + } + if (Array.isArray(module.optimizationBailout)) { + for (const item of module.optimizationBailout) { + colors.normal(prefix); + colors.yellow(item); + newline(); } - ); - } - } -} - -module.exports = SourceMapDevToolModuleOptionsPlugin; - - -/***/ }), - -/***/ 11851: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const path = __webpack_require__(85622); -const { ConcatSource, RawSource } = __webpack_require__(53665); -const ModuleFilenameHelpers = __webpack_require__(71474); -const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(24113); -const createHash = __webpack_require__(15660); -const { absolutify } = __webpack_require__(94658); - -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(7368); - -/** @typedef {import("../declarations/plugins/SourceMapDevToolPlugin").SourceMapDevToolPluginOptions} SourceMapDevToolPluginOptions */ -/** @typedef {import("./Chunk")} Chunk */ -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("source-map").RawSourceMap} SourceMap */ -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./Compilation")} Compilation */ -/** @typedef {import("./Compiler")} Compiler */ -/** @typedef {import("./Compilation")} SourceMapDefinition */ - -/** - * @typedef {object} SourceMapTask - * @property {Source} asset - * @property {Array} [modules] - * @property {string} source - * @property {string} file - * @property {SourceMap} sourceMap - * @property {Chunk} chunk - */ - -/** - * @param {string} name file path - * @returns {string} file name - */ -const basename = name => { - if (!name.includes("/")) return name; - return name.substr(name.lastIndexOf("/") + 1); -}; + } + if (module.reasons) { + for (const reason of module.reasons) { + colors.normal(prefix); + if (reason.type) { + colors.normal(reason.type); + colors.normal(" "); + } + if (reason.userRequest) { + colors.cyan(reason.userRequest); + colors.normal(" "); + } + if (reason.moduleId !== null) { + colors.normal("["); + colors.normal(reason.moduleId); + colors.normal("]"); + } + if (reason.module && reason.module !== reason.moduleId) { + colors.normal(" "); + colors.magenta(reason.module); + } + if (reason.loc) { + colors.normal(" "); + colors.normal(reason.loc); + } + if (reason.explanation) { + colors.normal(" "); + colors.cyan(reason.explanation); + } + newline(); + } + } + if (module.profile) { + colors.normal(prefix); + let sum = 0; + if (module.issuerPath) { + for (const m of module.issuerPath) { + colors.normal("["); + colors.normal(m.id); + colors.normal("] "); + if (m.profile) { + const time = (m.profile.factory || 0) + (m.profile.building || 0); + coloredTime(time); + sum += time; + colors.normal(" "); + } + colors.normal("-> "); + } + } + for (const key of Object.keys(module.profile)) { + colors.normal(`${key}:`); + const time = module.profile[key]; + coloredTime(time); + colors.normal(" "); + sum += time; + } + colors.normal("= "); + coloredTime(sum); + newline(); + } + if (module.modules) { + processModulesList(module, prefix + "| "); + } + }; -/** - * @type {WeakMap} - */ -const assetsCache = new WeakMap(); + const processModulesList = (obj, prefix) => { + if (obj.modules) { + let maxModuleId = 0; + for (const module of obj.modules) { + if (typeof module.id === "number") { + if (maxModuleId < module.id) maxModuleId = module.id; + } + } + let contentPrefix = prefix + " "; + if (maxModuleId >= 10) contentPrefix += " "; + if (maxModuleId >= 100) contentPrefix += " "; + if (maxModuleId >= 1000) contentPrefix += " "; + for (const module of obj.modules) { + colors.normal(prefix); + const name = module.name || module.identifier; + if (typeof module.id === "string" || typeof module.id === "number") { + if (typeof module.id === "number") { + if (module.id < 1000 && maxModuleId >= 1000) colors.normal(" "); + if (module.id < 100 && maxModuleId >= 100) colors.normal(" "); + if (module.id < 10 && maxModuleId >= 10) colors.normal(" "); + } else { + if (maxModuleId >= 1000) colors.normal(" "); + if (maxModuleId >= 100) colors.normal(" "); + if (maxModuleId >= 10) colors.normal(" "); + } + if (name !== module.id) { + colors.normal("["); + colors.normal(module.id); + colors.normal("]"); + colors.normal(" "); + } else { + colors.normal("["); + colors.bold(module.id); + colors.normal("]"); + } + } + if (name !== module.id) { + colors.bold(name); + } + processModuleAttributes(module); + newline(); + processModuleContent(module, contentPrefix); + } + if (obj.filteredModules > 0) { + colors.normal(prefix); + colors.normal(" "); + if (obj.modules.length > 0) colors.normal(" + "); + colors.normal(obj.filteredModules); + if (obj.modules.length > 0) colors.normal(" hidden"); + colors.normal(obj.filteredModules !== 1 ? " modules" : " module"); + newline(); + } + } + }; -/** - * Creating {@link SourceMapTask} for given file - * @param {string} file current compiled file - * @param {Source} asset the asset - * @param {Chunk} chunk related chunk - * @param {SourceMapDevToolPluginOptions} options source map options - * @param {Compilation} compilation compilation instance - * @returns {SourceMapTask | undefined} created task instance or `undefined` - */ -const getTaskForFile = (file, asset, chunk, options, compilation) => { - let source, sourceMap; - /** - * Check if asset can build source map - */ - if (asset.sourceAndMap) { - const sourceAndMap = asset.sourceAndMap(options); - sourceMap = sourceAndMap.map; - source = sourceAndMap.source; - } else { - sourceMap = asset.map(options); - source = asset.source(); - } - if (!sourceMap || typeof source !== "string") return; - const context = compilation.options.context; - const modules = sourceMap.sources.map(source => { - if (source.startsWith("webpack://")) { - source = absolutify(context, source.slice(10)); + if (obj.chunks) { + for (const chunk of obj.chunks) { + colors.normal("chunk "); + if (chunk.id < 1000) colors.normal(" "); + if (chunk.id < 100) colors.normal(" "); + if (chunk.id < 10) colors.normal(" "); + colors.normal("{"); + colors.yellow(chunk.id); + colors.normal("} "); + colors.green(chunk.files.join(", ")); + if (chunk.names && chunk.names.length > 0) { + colors.normal(" ("); + colors.normal(chunk.names.join(", ")); + colors.normal(")"); + } + colors.normal(" "); + colors.normal(SizeFormatHelpers.formatSize(chunk.size)); + for (const id of chunk.parents) { + colors.normal(" <{"); + colors.yellow(id); + colors.normal("}>"); + } + for (const id of chunk.siblings) { + colors.normal(" ={"); + colors.yellow(id); + colors.normal("}="); + } + for (const id of chunk.children) { + colors.normal(" >{"); + colors.yellow(id); + colors.normal("}<"); + } + if (chunk.childrenByOrder) { + for (const name of Object.keys(chunk.childrenByOrder)) { + const children = chunk.childrenByOrder[name]; + colors.normal(" "); + colors.magenta(`(${name}:`); + for (const id of children) { + colors.normal(" {"); + colors.yellow(id); + colors.normal("}"); + } + colors.magenta(")"); + } + } + if (chunk.entry) { + colors.yellow(" [entry]"); + } else if (chunk.initial) { + colors.yellow(" [initial]"); + } + if (chunk.rendered) { + colors.green(" [rendered]"); + } + if (chunk.recorded) { + colors.green(" [recorded]"); + } + if (chunk.reason) { + colors.yellow(` ${chunk.reason}`); + } + newline(); + if (chunk.origins) { + for (const origin of chunk.origins) { + colors.normal(" > "); + if (origin.reasons && origin.reasons.length) { + colors.yellow(origin.reasons.join(" ")); + colors.normal(" "); + } + if (origin.request) { + colors.normal(origin.request); + colors.normal(" "); + } + if (origin.module) { + colors.normal("["); + colors.normal(origin.moduleId); + colors.normal("] "); + const module = modulesByIdentifier[`$${origin.module}`]; + if (module) { + colors.bold(module.name); + colors.normal(" "); + } + } + if (origin.loc) { + colors.normal(origin.loc); + } + newline(); + } + } + processModulesList(chunk, " "); + } } - const module = compilation.findModule(source); - return module || source; - }); - return { - chunk, - file, - asset, - source, - sourceMap, - modules - }; -}; + processModulesList(obj, ""); -class SourceMapDevToolPlugin { - /** - * @param {SourceMapDevToolPluginOptions} [options] options object - * @throws {Error} throws error, if got more than 1 arguments - */ - constructor(options) { - if (arguments.length > 1) { - throw new Error( - "SourceMapDevToolPlugin only takes one argument (pass an options object)" - ); + if (obj.logging) { + for (const origin of Object.keys(obj.logging)) { + const logData = obj.logging[origin]; + if (logData.entries.length > 0) { + newline(); + if (logData.debug) { + colors.red("DEBUG "); + } + colors.bold("LOG from " + origin); + newline(); + let indent = ""; + for (const entry of logData.entries) { + let color = colors.normal; + let prefix = " "; + switch (entry.type) { + case LogType.clear: + colors.normal(`${indent}-------`); + newline(); + continue; + case LogType.error: + color = colors.red; + prefix = " "; + break; + case LogType.warn: + color = colors.yellow; + prefix = " "; + break; + case LogType.info: + color = colors.green; + prefix = " "; + break; + case LogType.log: + color = colors.bold; + break; + case LogType.trace: + case LogType.debug: + color = colors.normal; + break; + case LogType.status: + color = colors.magenta; + prefix = " "; + break; + case LogType.profile: + color = colors.magenta; + prefix = "

"; + break; + case LogType.profileEnd: + color = colors.magenta; + prefix = "

"; + break; + case LogType.time: + color = colors.magenta; + prefix = " "; + break; + case LogType.group: + color = colors.cyan; + prefix = "<-> "; + break; + case LogType.groupCollapsed: + color = colors.cyan; + prefix = "<+> "; + break; + case LogType.groupEnd: + if (indent.length >= 2) + indent = indent.slice(0, indent.length - 2); + continue; + } + if (entry.message) { + for (const line of entry.message.split("\n")) { + colors.normal(`${indent}${prefix}`); + color(line); + newline(); + } + } + if (entry.trace) { + for (const line of entry.trace) { + colors.normal(`${indent}| ${line}`); + newline(); + } + } + switch (entry.type) { + case LogType.group: + indent += " "; + break; + } + } + if (logData.filteredEntries) { + colors.normal(`+ ${logData.filteredEntries} hidden lines`); + newline(); + } + } + } } - if (!options) options = {}; + if (obj._showWarnings && obj.warnings) { + for (const warning of obj.warnings) { + newline(); + colors.yellow(`WARNING in ${warning}`); + newline(); + } + } + if (obj._showErrors && obj.errors) { + for (const error of obj.errors) { + newline(); + colors.red(`ERROR in ${error}`); + newline(); + } + } + if (obj.children) { + for (const child of obj.children) { + const childString = Stats.jsonToString(child, useColors); + if (childString) { + if (child.name) { + colors.normal("Child "); + colors.bold(child.name); + colors.normal(":"); + } else { + colors.normal("Child"); + } + newline(); + buf.push(" "); + buf.push(childString.replace(/\n/g, "\n ")); + newline(); + } + } + } + if (obj.needAdditionalPass) { + colors.yellow( + "Compilation needs an additional pass and will compile again." + ); + } - validateOptions(schema, options, "SourceMap DevTool Plugin"); + while (buf[buf.length - 1] === "\n") { + buf.pop(); + } + return buf.join(""); + } - /** @type {string | false} */ - this.sourceMapFilename = options.filename; - /** @type {string | false} */ - this.sourceMappingURLComment = - options.append === false - ? false - : options.append || "\n//# sourceMappingURL=[url]"; - /** @type {string | Function} */ - this.moduleFilenameTemplate = - options.moduleFilenameTemplate || "webpack://[namespace]/[resourcePath]"; - /** @type {string | Function} */ - this.fallbackModuleFilenameTemplate = - options.fallbackModuleFilenameTemplate || - "webpack://[namespace]/[resourcePath]?[hash]"; - /** @type {string} */ - this.namespace = options.namespace || ""; - /** @type {SourceMapDevToolPluginOptions} */ - this.options = options; + static presetToOptions(name) { + // Accepted values: none, errors-only, minimal, normal, detailed, verbose + // Any other falsy value will behave as 'none', truthy values as 'normal' + const pn = + (typeof name === "string" && name.toLowerCase()) || name || "none"; + switch (pn) { + case "none": + return { + all: false + }; + case "verbose": + return { + entrypoints: true, + chunkGroups: true, + modules: false, + chunks: true, + chunkModules: true, + chunkOrigins: true, + depth: true, + env: true, + reasons: true, + usedExports: true, + providedExports: true, + optimizationBailout: true, + errorDetails: true, + publicPath: true, + logging: "verbose", + exclude: false, + maxModules: Infinity + }; + case "detailed": + return { + entrypoints: true, + chunkGroups: true, + chunks: true, + chunkModules: false, + chunkOrigins: true, + depth: true, + usedExports: true, + providedExports: true, + optimizationBailout: true, + errorDetails: true, + publicPath: true, + logging: true, + exclude: false, + maxModules: Infinity + }; + case "minimal": + return { + all: false, + modules: true, + maxModules: 0, + errors: true, + warnings: true, + logging: "warn" + }; + case "errors-only": + return { + all: false, + errors: true, + moduleTrace: true, + logging: "error" + }; + case "errors-warnings": + return { + all: false, + errors: true, + warnings: true, + logging: "warn" + }; + default: + return {}; + } } - /** - * Apply compiler - * @param {Compiler} compiler compiler instance - * @returns {void} - */ - apply(compiler) { - const sourceMapFilename = this.sourceMapFilename; - const sourceMappingURLComment = this.sourceMappingURLComment; - const moduleFilenameTemplate = this.moduleFilenameTemplate; - const namespace = this.namespace; - const fallbackModuleFilenameTemplate = this.fallbackModuleFilenameTemplate; - const requestShortener = compiler.requestShortener; - const options = this.options; - options.test = options.test || /\.(m?js|css)($|\?)/i; + static getChildOptions(options, idx) { + let innerOptions; + if (Array.isArray(options.children)) { + if (idx < options.children.length) { + innerOptions = options.children[idx]; + } + } else if (typeof options.children === "object" && options.children) { + innerOptions = options.children; + } + if (typeof innerOptions === "boolean" || typeof innerOptions === "string") { + innerOptions = Stats.presetToOptions(innerOptions); + } + if (!innerOptions) { + return options; + } + const childOptions = Object.assign({}, options); + delete childOptions.children; // do not inherit children + return Object.assign(childOptions, innerOptions); + } +} - const matchObject = ModuleFilenameHelpers.matchObject.bind( - undefined, - options - ); +module.exports = Stats; - compiler.hooks.compilation.tap("SourceMapDevToolPlugin", compilation => { - new SourceMapDevToolModuleOptionsPlugin(options).apply(compilation); - compilation.hooks.afterOptimizeChunkAssets.tap( - /** @type {TODO} */ - ({ name: "SourceMapDevToolPlugin", context: true }), - /** - * @param {object} context hook context - * @param {Array} chunks resulted chunks - * @throws {Error} throws error, if `sourceMapFilename === false && sourceMappingURLComment === false` - * @returns {void} - */ - (context, chunks) => { - /** @type {Map} */ - const moduleToSourceNameMapping = new Map(); - /** - * @type {Function} - * @returns {void} - */ - const reportProgress = - context && context.reportProgress - ? context.reportProgress - : () => {}; +/***/ }), - const files = []; - for (const chunk of chunks) { - for (const file of chunk.files) { - if (matchObject(file)) { - files.push({ - file, - chunk - }); - } - } - } +/***/ 97365: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - reportProgress(0.0); - const tasks = []; - files.forEach(({ file, chunk }, idx) => { - const asset = compilation.getAsset(file).source; - const cache = assetsCache.get(asset); - /** - * If presented in cache, reassigns assets. Cache assets already have source maps. - */ - if (cache && cache.file === file) { - for (const cachedFile in cache.assets) { - if (cachedFile === file) { - compilation.updateAsset(cachedFile, cache.assets[cachedFile]); - } else { - compilation.emitAsset(cachedFile, cache.assets[cachedFile], { - development: true - }); - } - /** - * Add file to chunk, if not presented there - */ - if (cachedFile !== file) chunk.files.push(cachedFile); - } - return; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Joel Denning @joeldenning + */ - reportProgress( - (0.5 * idx) / files.length, - file, - "generate SourceMap" - ); - /** @type {SourceMapTask | undefined} */ - const task = getTaskForFile( - file, - asset, - chunk, - options, - compilation - ); - if (task) { - const modules = task.modules; - for (let idx = 0; idx < modules.length; idx++) { - const module = modules[idx]; - if (!moduleToSourceNameMapping.get(module)) { - moduleToSourceNameMapping.set( - module, - ModuleFilenameHelpers.createFilename( - module, - { - moduleFilenameTemplate: moduleFilenameTemplate, - namespace: namespace - }, - requestShortener - ) - ); - } - } +const { ConcatSource } = __webpack_require__(53665); +const Template = __webpack_require__(96066); - tasks.push(task); - } - }); +/** @typedef {import("./Compilation")} Compilation */ - reportProgress(0.5, "resolve sources"); - /** @type {Set} */ - const usedNamesSet = new Set(moduleToSourceNameMapping.values()); - /** @type {Set} */ - const conflictDetectionSet = new Set(); +/** + * @typedef {Object} SystemMainTemplatePluginOptions + * @param {string=} name the library name + */ - /** - * all modules in defined order (longest identifier first) - * @type {Array} - */ - const allModules = Array.from(moduleToSourceNameMapping.keys()).sort( - (a, b) => { - const ai = typeof a === "string" ? a : a.identifier(); - const bi = typeof b === "string" ? b : b.identifier(); - return ai.length - bi.length; - } - ); +class SystemMainTemplatePlugin { + /** + * @param {SystemMainTemplatePluginOptions} options the plugin options + */ + constructor(options) { + this.name = options.name; + } - // find modules with conflicting source names - for (let idx = 0; idx < allModules.length; idx++) { - const module = allModules[idx]; - let sourceName = moduleToSourceNameMapping.get(module); - let hasName = conflictDetectionSet.has(sourceName); - if (!hasName) { - conflictDetectionSet.add(sourceName); - continue; - } + /** + * @param {Compilation} compilation the compilation instance + * @returns {void} + */ + apply(compilation) { + const { mainTemplate, chunkTemplate } = compilation; - // try the fallback name first - sourceName = ModuleFilenameHelpers.createFilename( - module, - { - moduleFilenameTemplate: fallbackModuleFilenameTemplate, - namespace: namespace - }, - requestShortener - ); - hasName = usedNamesSet.has(sourceName); - if (!hasName) { - moduleToSourceNameMapping.set(module, sourceName); - usedNamesSet.add(sourceName); - continue; - } + const onRenderWithEntry = (source, chunk, hash) => { + const externals = chunk.getModules().filter(m => m.external); - // elsewise just append stars until we have a valid name - while (hasName) { - sourceName += "*"; - hasName = usedNamesSet.has(sourceName); - } - moduleToSourceNameMapping.set(module, sourceName); - usedNamesSet.add(sourceName); - } - tasks.forEach((task, index) => { - reportProgress( - 0.5 + (0.5 * index) / tasks.length, - task.file, - "attach SourceMap" - ); - const assets = Object.create(null); - const chunk = task.chunk; - const file = task.file; - const asset = task.asset; - const sourceMap = task.sourceMap; - const source = task.source; - const modules = task.modules; - const moduleFilenames = modules.map(m => - moduleToSourceNameMapping.get(m) - ); - sourceMap.sources = moduleFilenames; - if (options.noSources) { - sourceMap.sourcesContent = undefined; - } - sourceMap.sourceRoot = options.sourceRoot || ""; - sourceMap.file = file; - assetsCache.set(asset, { file, assets }); - /** @type {string | false} */ - let currentSourceMappingURLComment = sourceMappingURLComment; - if ( - currentSourceMappingURLComment !== false && - /\.css($|\?)/i.test(file) - ) { - currentSourceMappingURLComment = currentSourceMappingURLComment.replace( - /^\n\/\/(.*)$/, - "\n/*$1*/" - ); - } - const sourceMapString = JSON.stringify(sourceMap); - if (sourceMapFilename) { - let filename = file; - let query = ""; - const idx = filename.indexOf("?"); - if (idx >= 0) { - query = filename.substr(idx); - filename = filename.substr(0, idx); - } - const pathParams = { - chunk, - filename: options.fileContext - ? path.relative(options.fileContext, filename) - : filename, - query, - basename: basename(filename), - contentHash: createHash("md4") - .update(sourceMapString) - .digest("hex") - }; - let sourceMapFile = compilation.getPath( - sourceMapFilename, - pathParams - ); - const sourceMapUrl = options.publicPath - ? options.publicPath + sourceMapFile.replace(/\\/g, "/") - : path - .relative(path.dirname(file), sourceMapFile) - .replace(/\\/g, "/"); - /** - * Add source map url to compilation asset, if {@link currentSourceMappingURLComment} presented - */ - if (currentSourceMappingURLComment !== false) { - const asset = new ConcatSource( - new RawSource(source), - compilation.getPath( - currentSourceMappingURLComment, - Object.assign({ url: sourceMapUrl }, pathParams) - ) - ); - assets[file] = asset; - compilation.updateAsset(file, asset); - } - /** - * Add source map file to compilation assets and chunk files - */ - const asset = new RawSource(sourceMapString); - assets[sourceMapFile] = asset; - compilation.emitAsset(sourceMapFile, asset, { - development: true - }); - chunk.files.push(sourceMapFile); - } else { - if (currentSourceMappingURLComment === false) { - throw new Error( - "SourceMapDevToolPlugin: append can't be false when no filename is provided" - ); - } - /** - * Add source map as data url to asset - */ - const asset = new ConcatSource( - new RawSource(source), - currentSourceMappingURLComment - .replace(/\[map\]/g, () => sourceMapString) - .replace( - /\[url\]/g, - () => - `data:application/json;charset=utf-8;base64,${Buffer.from( - sourceMapString, - "utf-8" - ).toString("base64")}` + // The name this bundle should be registered as with System + const name = this.name + ? `${JSON.stringify( + mainTemplate.getAssetPath(this.name, { hash, chunk }) + )}, ` + : ""; + + // The array of dependencies that are external to webpack and will be provided by System + const systemDependencies = JSON.stringify( + externals.map(m => + typeof m.request === "object" ? m.request.amd : m.request + ) + ); + + // The name of the variable provided by System for exporting + const dynamicExport = "__WEBPACK_DYNAMIC_EXPORT__"; + + // An array of the internal variable names for the webpack externals + const externalWebpackNames = externals.map( + m => `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(`${m.id}`)}__` + ); + + // Declaring variables for the internal variable names for the webpack externals + const externalVarDeclarations = + externalWebpackNames.length > 0 + ? `var ${externalWebpackNames.join(", ")};` + : ""; + + // The system.register format requires an array of setter functions for externals. + const setters = + externalWebpackNames.length === 0 + ? "" + : Template.asString([ + "setters: [", + Template.indent( + externalWebpackNames + .map(external => + Template.asString([ + "function(module) {", + Template.indent(`${external} = module;`), + "}" + ]) ) - ); - assets[file] = asset; - compilation.updateAsset(file, asset); - } - }); - reportProgress(1.0); - } + .join(",\n") + ), + "]," + ]); + + return new ConcatSource( + Template.asString([ + `System.register(${name}${systemDependencies}, function(${dynamicExport}) {`, + Template.indent([ + externalVarDeclarations, + "return {", + Template.indent([ + setters, + "execute: function() {", + Template.indent(`${dynamicExport}(`) + ]) + ]) + ]) + "\n", + source, + "\n" + + Template.asString([ + Template.indent([ + Template.indent([Template.indent([");"]), "}"]), + "};" + ]), + "})" + ]) + ); + }; + + for (const template of [mainTemplate, chunkTemplate]) { + template.hooks.renderWithEntry.tap( + "SystemMainTemplatePlugin", + onRenderWithEntry ); + } + + mainTemplate.hooks.globalHashPaths.tap( + "SystemMainTemplatePlugin", + paths => { + if (this.name) { + paths.push(this.name); + } + return paths; + } + ); + + mainTemplate.hooks.hash.tap("SystemMainTemplatePlugin", hash => { + hash.update("exports system"); + if (this.name) { + hash.update(this.name); + } }); } } -module.exports = SourceMapDevToolPlugin; +module.exports = SystemMainTemplatePlugin; /***/ }), -/***/ 99977: +/***/ 96066: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("./ModuleTemplate")} ModuleTemplate */ +/** @typedef {import("webpack-sources").ConcatSource} ConcatSource */ +const { ConcatSource } = __webpack_require__(53665); +const HotUpdateChunk = __webpack_require__(26782); -const RequestShortener = __webpack_require__(54254); -const SizeFormatHelpers = __webpack_require__(12496); -const formatLocation = __webpack_require__(49); -const identifierUtils = __webpack_require__(94658); -const compareLocations = __webpack_require__(22562); -const { LogType } = __webpack_require__(47194); +const START_LOWERCASE_ALPHABET_CODE = "a".charCodeAt(0); +const START_UPPERCASE_ALPHABET_CODE = "A".charCodeAt(0); +const DELTA_A_TO_Z = "z".charCodeAt(0) - START_LOWERCASE_ALPHABET_CODE + 1; +const FUNCTION_CONTENT_REGEX = /^function\s?\(\)\s?\{\r?\n?|\r?\n?\}$/g; +const INDENT_MULTILINE_REGEX = /^\t/gm; +const LINE_SEPARATOR_REGEX = /\r?\n/g; +const IDENTIFIER_NAME_REPLACE_REGEX = /^([^a-zA-Z$_])/; +const IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX = /[^a-zA-Z0-9$]+/g; +const COMMENT_END_REGEX = /\*\//g; +const PATH_NAME_NORMALIZE_REPLACE_REGEX = /[^a-zA-Z0-9_!§$()=\-^°]+/g; +const MATCH_PADDED_HYPHENS_REPLACE_REGEX = /^-|-$/g; -const optionsOrFallback = (...args) => { - let optionValues = []; - optionValues.push(...args); - return optionValues.find(optionValue => optionValue !== undefined); -}; +/** @typedef {import("webpack-sources").Source} Source */ -const compareId = (a, b) => { - if (typeof a !== typeof b) { - return typeof a < typeof b ? -1 : 1; - } - if (a < b) return -1; - if (a > b) return 1; +/** + * @typedef {Object} HasId + * @property {number | string} id + */ + +/** + * @typedef {function(Module, number): boolean} ModuleFilterPredicate + */ + +/** + * @param {HasId} a first id object to be sorted + * @param {HasId} b second id object to be sorted against + * @returns {-1|0|1} the sort value + */ +const stringifyIdSortPredicate = (a, b) => { + const aId = a.id + ""; + const bId = b.id + ""; + if (aId < bId) return -1; + if (aId > bId) return 1; return 0; }; -class Stats { - constructor(compilation) { - this.compilation = compilation; - this.hash = compilation.hash; - this.startTime = undefined; - this.endTime = undefined; +class Template { + /** + * + * @param {Function} fn a runtime function (.runtime.js) "template" + * @returns {string} the updated and normalized function string + */ + static getFunctionContent(fn) { + return fn + .toString() + .replace(FUNCTION_CONTENT_REGEX, "") + .replace(INDENT_MULTILINE_REGEX, "") + .replace(LINE_SEPARATOR_REGEX, "\n"); } - static filterWarnings(warnings, warningsFilter) { - // we dont have anything to filter so all warnings can be shown - if (!warningsFilter) { - return warnings; - } + /** + * @param {string} str the string converted to identifier + * @returns {string} created identifier + */ + static toIdentifier(str) { + if (typeof str !== "string") return ""; + return str + .replace(IDENTIFIER_NAME_REPLACE_REGEX, "_$1") + .replace(IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX, "_"); + } + /** + * + * @param {string} str string to be converted to commented in bundle code + * @returns {string} returns a commented version of string + */ + static toComment(str) { + if (!str) return ""; + return `/*! ${str.replace(COMMENT_END_REGEX, "* /")} */`; + } - // create a chain of filters - // if they return "true" a warning should be suppressed - const normalizedWarningsFilters = [].concat(warningsFilter).map(filter => { - if (typeof filter === "string") { - return warning => warning.includes(filter); - } + /** + * + * @param {string} str string to be converted to "normal comment" + * @returns {string} returns a commented version of string + */ + static toNormalComment(str) { + if (!str) return ""; + return `/* ${str.replace(COMMENT_END_REGEX, "* /")} */`; + } - if (filter instanceof RegExp) { - return warning => filter.test(warning); - } + /** + * @param {string} str string path to be normalized + * @returns {string} normalized bundle-safe path + */ + static toPath(str) { + if (typeof str !== "string") return ""; + return str + .replace(PATH_NAME_NORMALIZE_REPLACE_REGEX, "-") + .replace(MATCH_PADDED_HYPHENS_REPLACE_REGEX, ""); + } - if (typeof filter === "function") { - return filter; - } + // map number to a single character a-z, A-Z or <_ + number> if number is too big + /** + * + * @param {number} n number to convert to ident + * @returns {string} returns single character ident + */ + static numberToIdentifer(n) { + // lower case + if (n < DELTA_A_TO_Z) { + return String.fromCharCode(START_LOWERCASE_ALPHABET_CODE + n); + } - throw new Error( - `Can only filter warnings with Strings or RegExps. (Given: ${filter})` + // upper case + if (n < DELTA_A_TO_Z * 2) { + return String.fromCharCode( + START_UPPERCASE_ALPHABET_CODE + n - DELTA_A_TO_Z ); - }); - return warnings.filter(warning => { - return !normalizedWarningsFilters.some(check => check(warning)); - }); - } - - formatFilePath(filePath) { - const OPTIONS_REGEXP = /^(\s|\S)*!/; - return filePath.includes("!") - ? `${filePath.replace(OPTIONS_REGEXP, "")} (${filePath})` - : `${filePath}`; - } + } - hasWarnings() { + // use multiple letters return ( - this.compilation.warnings.length > 0 || - this.compilation.children.some(child => child.getStats().hasWarnings()) + Template.numberToIdentifer(n % (2 * DELTA_A_TO_Z)) + + Template.numberToIdentifer(Math.floor(n / (2 * DELTA_A_TO_Z))) ); } - hasErrors() { - return ( - this.compilation.errors.length > 0 || - this.compilation.children.some(child => child.getStats().hasErrors()) - ); + /** + * + * @param {string | string[]} s string to convert to identity + * @returns {string} converted identity + */ + static indent(s) { + if (Array.isArray(s)) { + return s.map(Template.indent).join("\n"); + } else { + const str = s.trimRight(); + if (!str) return ""; + const ind = str[0] === "\n" ? "" : "\t"; + return ind + str.replace(/\n([^\n])/g, "\n\t$1"); + } } - // remove a prefixed "!" that can be specified to reverse sort order - normalizeFieldKey(field) { - if (field[0] === "!") { - return field.substr(1); - } - return field; + /** + * + * @param {string|string[]} s string to create prefix for + * @param {string} prefix prefix to compose + * @returns {string} returns new prefix string + */ + static prefix(s, prefix) { + const str = Template.asString(s).trim(); + if (!str) return ""; + const ind = str[0] === "\n" ? "" : prefix; + return ind + str.replace(/\n([^\n])/g, "\n" + prefix + "$1"); } - // if a field is prefixed by a "!" reverse sort order - sortOrderRegular(field) { - if (field[0] === "!") { - return false; + /** + * + * @param {string|string[]} str string or string collection + * @returns {string} returns a single string from array + */ + static asString(str) { + if (Array.isArray(str)) { + return str.join("\n"); } - return true; + return str; } - toJson(options, forToString) { - if (typeof options === "boolean" || typeof options === "string") { - options = Stats.presetToOptions(options); - } else if (!options) { - options = {}; + /** + * @typedef {Object} WithId + * @property {string|number} id + */ + + /** + * @param {WithId[]} modules a collection of modules to get array bounds for + * @returns {[number, number] | false} returns the upper and lower array bounds + * or false if not every module has a number based id + */ + static getModulesArrayBounds(modules) { + let maxId = -Infinity; + let minId = Infinity; + for (const module of modules) { + if (typeof module.id !== "number") return false; + if (maxId < module.id) maxId = /** @type {number} */ (module.id); + if (minId > module.id) minId = /** @type {number} */ (module.id); + } + if (minId < 16 + ("" + minId).length) { + // add minId x ',' instead of 'Array(minId).concat(…)' + minId = 0; } + const objectOverhead = modules + .map(module => (module.id + "").length + 2) + .reduce((a, b) => a + b, -1); + const arrayOverhead = + minId === 0 ? maxId : 16 + ("" + minId).length + maxId; + return arrayOverhead < objectOverhead ? [minId, maxId] : false; + } - const optionOrLocalFallback = (v, def) => - v !== undefined ? v : options.all !== undefined ? options.all : def; - - const testAgainstGivenOption = item => { - if (typeof item === "string") { - const regExp = new RegExp( - `[\\\\/]${item.replace( - // eslint-disable-next-line no-useless-escape - /[-[\]{}()*+?.\\^$|]/g, - "\\$&" - )}([\\\\/]|$|!|\\?)` - ); - return ident => regExp.test(ident); - } - if (item && typeof item === "object" && typeof item.test === "function") { - return ident => item.test(ident); - } - if (typeof item === "function") { - return item; - } - if (typeof item === "boolean") { - return () => item; - } - }; - - const compilation = this.compilation; - const context = optionsOrFallback( - options.context, - compilation.compiler.context - ); - const requestShortener = - compilation.compiler.context === context - ? compilation.requestShortener - : new RequestShortener(context); - const showPerformance = optionOrLocalFallback(options.performance, true); - const showHash = optionOrLocalFallback(options.hash, true); - const showEnv = optionOrLocalFallback(options.env, false); - const showVersion = optionOrLocalFallback(options.version, true); - const showTimings = optionOrLocalFallback(options.timings, true); - const showBuiltAt = optionOrLocalFallback(options.builtAt, true); - const showAssets = optionOrLocalFallback(options.assets, true); - const showEntrypoints = optionOrLocalFallback(options.entrypoints, true); - const showChunkGroups = optionOrLocalFallback( - options.chunkGroups, - !forToString - ); - const showChunks = optionOrLocalFallback(options.chunks, !forToString); - const showChunkModules = optionOrLocalFallback(options.chunkModules, true); - const showChunkOrigins = optionOrLocalFallback( - options.chunkOrigins, - !forToString - ); - const showModules = optionOrLocalFallback(options.modules, true); - const showNestedModules = optionOrLocalFallback( - options.nestedModules, - true - ); - const showModuleAssets = optionOrLocalFallback( - options.moduleAssets, - !forToString - ); - const showDepth = optionOrLocalFallback(options.depth, !forToString); - const showCachedModules = optionOrLocalFallback(options.cached, true); - const showCachedAssets = optionOrLocalFallback(options.cachedAssets, true); - const showReasons = optionOrLocalFallback(options.reasons, !forToString); - const showUsedExports = optionOrLocalFallback( - options.usedExports, - !forToString - ); - const showProvidedExports = optionOrLocalFallback( - options.providedExports, - !forToString - ); - const showOptimizationBailout = optionOrLocalFallback( - options.optimizationBailout, - !forToString - ); - const showChildren = optionOrLocalFallback(options.children, true); - const showSource = optionOrLocalFallback(options.source, !forToString); - const showModuleTrace = optionOrLocalFallback(options.moduleTrace, true); - const showErrors = optionOrLocalFallback(options.errors, true); - const showErrorDetails = optionOrLocalFallback( - options.errorDetails, - !forToString - ); - const showWarnings = optionOrLocalFallback(options.warnings, true); - const warningsFilter = optionsOrFallback(options.warningsFilter, null); - const showPublicPath = optionOrLocalFallback( - options.publicPath, - !forToString - ); - const showLogging = optionOrLocalFallback( - options.logging, - forToString ? "info" : true - ); - const showLoggingTrace = optionOrLocalFallback( - options.loggingTrace, - !forToString - ); - const loggingDebug = [] - .concat(optionsOrFallback(options.loggingDebug, [])) - .map(testAgainstGivenOption); - - const excludeModules = [] - .concat(optionsOrFallback(options.excludeModules, options.exclude, [])) - .map(testAgainstGivenOption); - const excludeAssets = [] - .concat(optionsOrFallback(options.excludeAssets, [])) - .map(testAgainstGivenOption); - const maxModules = optionsOrFallback( - options.maxModules, - forToString ? 15 : Infinity - ); - const sortModules = optionsOrFallback(options.modulesSort, "id"); - const sortChunks = optionsOrFallback(options.chunksSort, "id"); - const sortAssets = optionsOrFallback(options.assetsSort, ""); - const showOutputPath = optionOrLocalFallback( - options.outputPath, - !forToString - ); - - if (!showCachedModules) { - excludeModules.push((ident, module) => !module.built); + /** + * @param {Chunk} chunk chunk whose modules will be rendered + * @param {ModuleFilterPredicate} filterFn function used to filter modules from chunk to render + * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance used to render modules + * @param {TODO | TODO[]} dependencyTemplates templates needed for each module to render dependencies + * @param {string=} prefix applying prefix strings + * @returns {ConcatSource} rendered chunk modules in a Source object + */ + static renderChunkModules( + chunk, + filterFn, + moduleTemplate, + dependencyTemplates, + prefix = "" + ) { + const source = new ConcatSource(); + const modules = chunk.getModules().filter(filterFn); + let removedModules; + if (chunk instanceof HotUpdateChunk) { + removedModules = chunk.removedModules; } - - const createModuleFilter = () => { - let i = 0; - return module => { - if (excludeModules.length > 0) { - const ident = requestShortener.shorten(module.resource); - const excluded = excludeModules.some(fn => fn(ident, module)); - if (excluded) return false; - } - const result = i < maxModules; - i++; - return result; - }; - }; - - const createAssetFilter = () => { - return asset => { - if (excludeAssets.length > 0) { - const ident = asset.name; - const excluded = excludeAssets.some(fn => fn(ident, asset)); - if (excluded) return false; - } - return showCachedAssets || asset.emitted; - }; - }; - - const sortByFieldAndOrder = (fieldKey, a, b) => { - if (a[fieldKey] === null && b[fieldKey] === null) return 0; - if (a[fieldKey] === null) return 1; - if (b[fieldKey] === null) return -1; - if (a[fieldKey] === b[fieldKey]) return 0; - if (typeof a[fieldKey] !== typeof b[fieldKey]) - return typeof a[fieldKey] < typeof b[fieldKey] ? -1 : 1; - return a[fieldKey] < b[fieldKey] ? -1 : 1; - }; - - const sortByField = (field, originalArray) => { - const originalMap = originalArray.reduce((map, v, i) => { - map.set(v, i); - return map; - }, new Map()); - return (a, b) => { - if (field) { - const fieldKey = this.normalizeFieldKey(field); - - // if a field is prefixed with a "!" the sort is reversed! - const sortIsRegular = this.sortOrderRegular(field); - - const cmp = sortByFieldAndOrder( - fieldKey, - sortIsRegular ? a : b, - sortIsRegular ? b : a - ); - if (cmp) return cmp; - } - return originalMap.get(a) - originalMap.get(b); + if ( + modules.length === 0 && + (!removedModules || removedModules.length === 0) + ) { + source.add("[]"); + return source; + } + /** @type {{id: string|number, source: Source|string}[]} */ + const allModules = modules.map(module => { + return { + id: module.id, + source: moduleTemplate.render(module, dependencyTemplates, { + chunk + }) }; - }; - - const formatError = e => { - let text = ""; - if (typeof e === "string") { - e = { message: e }; + }); + if (removedModules && removedModules.length > 0) { + for (const id of removedModules) { + allModules.push({ + id, + source: "false" + }); } - if (e.chunk) { - text += `chunk ${e.chunk.name || e.chunk.id}${ - e.chunk.hasRuntime() - ? " [entry]" - : e.chunk.canBeInitial() - ? " [initial]" - : "" - }\n`; + } + const bounds = Template.getModulesArrayBounds(allModules); + if (bounds) { + // Render a spare array + const minId = bounds[0]; + const maxId = bounds[1]; + if (minId !== 0) { + source.add(`Array(${minId}).concat(`); } - if (e.file) { - text += `${e.file}\n`; + source.add("[\n"); + /** @type {Map} */ + const modules = new Map(); + for (const module of allModules) { + modules.set(module.id, module); } - if ( - e.module && - e.module.readableIdentifier && - typeof e.module.readableIdentifier === "function" - ) { - text += this.formatFilePath( - e.module.readableIdentifier(requestShortener) - ); - if (typeof e.loc === "object") { - const locInfo = formatLocation(e.loc); - if (locInfo) text += ` ${locInfo}`; + for (let idx = minId; idx <= maxId; idx++) { + const module = modules.get(idx); + if (idx !== minId) { + source.add(",\n"); + } + source.add(`/* ${idx} */`); + if (module) { + source.add("\n"); + source.add(module.source); } - text += "\n"; - } - text += e.message; - if (showErrorDetails && e.details) { - text += `\n${e.details}`; } - if (showErrorDetails && e.missing) { - text += e.missing.map(item => `\n[${item}]`).join(""); + source.add("\n" + prefix + "]"); + if (minId !== 0) { + source.add(")"); } - if (showModuleTrace && e.origin) { - text += `\n @ ${this.formatFilePath( - e.origin.readableIdentifier(requestShortener) - )}`; - if (typeof e.originLoc === "object") { - const locInfo = formatLocation(e.originLoc); - if (locInfo) text += ` ${locInfo}`; - } - if (e.dependencies) { - for (const dep of e.dependencies) { - if (!dep.loc) continue; - if (typeof dep.loc === "string") continue; - const locInfo = formatLocation(dep.loc); - if (!locInfo) continue; - text += ` ${locInfo}`; - } - } - let current = e.origin; - while (current.issuer) { - current = current.issuer; - text += `\n @ ${current.readableIdentifier(requestShortener)}`; + } else { + // Render an object + source.add("{\n"); + allModules.sort(stringifyIdSortPredicate).forEach((module, idx) => { + if (idx !== 0) { + source.add(",\n"); } - } - return text; - }; - - const obj = { - errors: compilation.errors.map(formatError), - warnings: Stats.filterWarnings( - compilation.warnings.map(formatError), - warningsFilter - ) - }; + source.add(`\n/***/ ${JSON.stringify(module.id)}:\n`); + source.add(module.source); + }); + source.add(`\n\n${prefix}}`); + } + return source; + } +} - //We just hint other renderers since actually omitting - //errors/warnings from the JSON would be kind of weird. - Object.defineProperty(obj, "_showWarnings", { - value: showWarnings, - enumerable: false - }); - Object.defineProperty(obj, "_showErrors", { - value: showErrors, - enumerable: false - }); +module.exports = Template; - if (showVersion) { - obj.version = __webpack_require__(71618)/* .version */ .i8; - } - if (showHash) obj.hash = this.hash; - if (showTimings && this.startTime && this.endTime) { - obj.time = this.endTime - this.startTime; - } +/***/ }), - if (showBuiltAt && this.endTime) { - obj.builtAt = this.endTime; - } +/***/ 76032: +/***/ (function(module) { - if (showEnv && options._env) { - obj.env = options._env; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Jason Anderson @diurnalist +*/ - if (compilation.needAdditionalPass) { - obj.needAdditionalPass = true; - } - if (showPublicPath) { - obj.publicPath = this.compilation.mainTemplate.getPublicPath({ - hash: this.compilation.hash - }); - } - if (showOutputPath) { - obj.outputPath = this.compilation.mainTemplate.outputOptions.path; - } - if (showAssets) { - const assetsByFile = {}; - const compilationAssets = compilation - .getAssets() - .sort((a, b) => (a.name < b.name ? -1 : 1)); - obj.assetsByChunkName = {}; - obj.assets = compilationAssets - .map(({ name, source, info }) => { - const obj = { - name, - size: source.size(), - chunks: [], - chunkNames: [], - info, - // TODO webpack 5: remove .emitted - emitted: source.emitted || compilation.emittedAssets.has(name) - }; - if (showPerformance) { - obj.isOverSizeLimit = source.isOverSizeLimit; - } +const REGEXP_HASH = /\[hash(?::(\d+))?\]/gi, + REGEXP_CHUNKHASH = /\[chunkhash(?::(\d+))?\]/gi, + REGEXP_MODULEHASH = /\[modulehash(?::(\d+))?\]/gi, + REGEXP_CONTENTHASH = /\[contenthash(?::(\d+))?\]/gi, + REGEXP_NAME = /\[name\]/gi, + REGEXP_ID = /\[id\]/gi, + REGEXP_MODULEID = /\[moduleid\]/gi, + REGEXP_FILE = /\[file\]/gi, + REGEXP_QUERY = /\[query\]/gi, + REGEXP_FILEBASE = /\[filebase\]/gi, + REGEXP_URL = /\[url\]/gi; - assetsByFile[name] = obj; - return obj; - }) - .filter(createAssetFilter()); - obj.filteredAssets = compilationAssets.length - obj.assets.length; +// Using global RegExp for .test is dangerous +// We use a normal RegExp instead of .test +const REGEXP_HASH_FOR_TEST = new RegExp(REGEXP_HASH.source, "i"), + REGEXP_CHUNKHASH_FOR_TEST = new RegExp(REGEXP_CHUNKHASH.source, "i"), + REGEXP_CONTENTHASH_FOR_TEST = new RegExp(REGEXP_CONTENTHASH.source, "i"), + REGEXP_NAME_FOR_TEST = new RegExp(REGEXP_NAME.source, "i"); - for (const chunk of compilation.chunks) { - for (const asset of chunk.files) { - if (assetsByFile[asset]) { - for (const id of chunk.ids) { - assetsByFile[asset].chunks.push(id); - } - if (chunk.name) { - assetsByFile[asset].chunkNames.push(chunk.name); - if (obj.assetsByChunkName[chunk.name]) { - obj.assetsByChunkName[chunk.name] = [] - .concat(obj.assetsByChunkName[chunk.name]) - .concat([asset]); - } else { - obj.assetsByChunkName[chunk.name] = asset; - } - } - } - } - } - obj.assets.sort(sortByField(sortAssets, obj.assets)); +const withHashLength = (replacer, handlerFn, assetInfo) => { + const fn = (match, hashLength, ...args) => { + if (assetInfo) assetInfo.immutable = true; + const length = hashLength && parseInt(hashLength, 10); + if (length && handlerFn) { + return handlerFn(length); } + const hash = replacer(match, hashLength, ...args); + return length ? hash.slice(0, length) : hash; + }; + return fn; +}; - const fnChunkGroup = groupMap => { - const obj = {}; - for (const keyValuePair of groupMap) { - const name = keyValuePair[0]; - const cg = keyValuePair[1]; - const children = cg.getChildrenByOrders(); - obj[name] = { - chunks: cg.chunks.map(c => c.id), - assets: cg.chunks.reduce( - (array, c) => array.concat(c.files || []), - [] - ), - children: Object.keys(children).reduce((obj, key) => { - const groups = children[key]; - obj[key] = groups.map(group => ({ - name: group.name, - chunks: group.chunks.map(c => c.id), - assets: group.chunks.reduce( - (array, c) => array.concat(c.files || []), - [] - ) - })); - return obj; - }, Object.create(null)), - childAssets: Object.keys(children).reduce((obj, key) => { - const groups = children[key]; - obj[key] = Array.from( - groups.reduce((set, group) => { - for (const chunk of group.chunks) { - for (const asset of chunk.files) { - set.add(asset); - } - } - return set; - }, new Set()) - ); - return obj; - }, Object.create(null)) - }; - if (showPerformance) { - obj[name].isOverSizeLimit = cg.isOverSizeLimit; - } +const getReplacer = (value, allowEmpty) => { + const fn = (match, ...args) => { + // last argument in replacer is the entire input string + const input = args[args.length - 1]; + if (value === null || value === undefined) { + if (!allowEmpty) { + throw new Error( + `Path variable ${match} not implemented in this context: ${input}` + ); } - - return obj; - }; - - if (showEntrypoints) { - obj.entrypoints = fnChunkGroup(compilation.entrypoints); + return ""; + } else { + return `${escapePathVariables(value)}`; } + }; + return fn; +}; - if (showChunkGroups) { - obj.namedChunkGroups = fnChunkGroup(compilation.namedChunkGroups); - } +const escapePathVariables = value => { + return typeof value === "string" + ? value.replace(/\[(\\*[\w:]+\\*)\]/gi, "[\\$1\\]") + : value; +}; - const fnModule = module => { - const path = []; - let current = module; - while (current.issuer) { - path.push((current = current.issuer)); - } - path.reverse(); - const obj = { - id: module.id, - identifier: module.identifier(), - name: module.readableIdentifier(requestShortener), - index: module.index, - index2: module.index2, - size: module.size(), - cacheable: module.buildInfo.cacheable, - built: !!module.built, - optional: module.optional, - prefetched: module.prefetched, - chunks: Array.from(module.chunksIterable, chunk => chunk.id), - issuer: module.issuer && module.issuer.identifier(), - issuerId: module.issuer && module.issuer.id, - issuerName: - module.issuer && module.issuer.readableIdentifier(requestShortener), - issuerPath: - module.issuer && - path.map(module => ({ - id: module.id, - identifier: module.identifier(), - name: module.readableIdentifier(requestShortener), - profile: module.profile - })), - profile: module.profile, - failed: !!module.error, - errors: module.errors ? module.errors.length : 0, - warnings: module.warnings ? module.warnings.length : 0 - }; - if (showModuleAssets) { - obj.assets = Object.keys(module.buildInfo.assets || {}); - } - if (showReasons) { - obj.reasons = module.reasons - .sort((a, b) => { - if (a.module && !b.module) return -1; - if (!a.module && b.module) return 1; - if (a.module && b.module) { - const cmp = compareId(a.module.id, b.module.id); - if (cmp) return cmp; - } - if (a.dependency && !b.dependency) return -1; - if (!a.dependency && b.dependency) return 1; - if (a.dependency && b.dependency) { - const cmp = compareLocations(a.dependency.loc, b.dependency.loc); - if (cmp) return cmp; - if (a.dependency.type < b.dependency.type) return -1; - if (a.dependency.type > b.dependency.type) return 1; - } - return 0; - }) - .map(reason => { - const obj = { - moduleId: reason.module ? reason.module.id : null, - moduleIdentifier: reason.module - ? reason.module.identifier() - : null, - module: reason.module - ? reason.module.readableIdentifier(requestShortener) - : null, - moduleName: reason.module - ? reason.module.readableIdentifier(requestShortener) - : null, - type: reason.dependency ? reason.dependency.type : null, - explanation: reason.explanation, - userRequest: reason.dependency - ? reason.dependency.userRequest - : null - }; - if (reason.dependency) { - const locInfo = formatLocation(reason.dependency.loc); - if (locInfo) { - obj.loc = locInfo; - } - } - return obj; - }); - } - if (showUsedExports) { - if (module.used === true) { - obj.usedExports = module.usedExports; - } else if (module.used === false) { - obj.usedExports = false; - } - } - if (showProvidedExports) { - obj.providedExports = Array.isArray(module.buildMeta.providedExports) - ? module.buildMeta.providedExports - : null; - } - if (showOptimizationBailout) { - obj.optimizationBailout = module.optimizationBailout.map(item => { - if (typeof item === "function") return item(requestShortener); - return item; - }); - } - if (showDepth) { - obj.depth = module.depth; - } - if (showNestedModules) { - if (module.modules) { - const modules = module.modules; - obj.modules = modules - .sort(sortByField("depth", modules)) - .filter(createModuleFilter()) - .map(fnModule); - obj.filteredModules = modules.length - obj.modules.length; - obj.modules.sort(sortByField(sortModules, obj.modules)); - } - } - if (showSource && module._source) { - obj.source = module._source.source(); - } - return obj; - }; - if (showChunks) { - obj.chunks = compilation.chunks.map(chunk => { - const parents = new Set(); - const children = new Set(); - const siblings = new Set(); - const childIdByOrder = chunk.getChildIdsByOrders(); - for (const chunkGroup of chunk.groupsIterable) { - for (const parentGroup of chunkGroup.parentsIterable) { - for (const chunk of parentGroup.chunks) { - parents.add(chunk.id); - } - } - for (const childGroup of chunkGroup.childrenIterable) { - for (const chunk of childGroup.chunks) { - children.add(chunk.id); - } - } - for (const sibling of chunkGroup.chunks) { - if (sibling !== chunk) siblings.add(sibling.id); - } - } - const obj = { - id: chunk.id, - rendered: chunk.rendered, - initial: chunk.canBeInitial(), - entry: chunk.hasRuntime(), - recorded: chunk.recorded, - reason: chunk.chunkReason, - size: chunk.modulesSize(), - names: chunk.name ? [chunk.name] : [], - files: chunk.files.slice(), - hash: chunk.renderedHash, - siblings: Array.from(siblings).sort(compareId), - parents: Array.from(parents).sort(compareId), - children: Array.from(children).sort(compareId), - childrenByOrder: childIdByOrder - }; - if (showChunkModules) { - const modules = chunk.getModules(); - obj.modules = modules - .slice() - .sort(sortByField("depth", modules)) - .filter(createModuleFilter()) - .map(fnModule); - obj.filteredModules = chunk.getNumberOfModules() - obj.modules.length; - obj.modules.sort(sortByField(sortModules, obj.modules)); - } - if (showChunkOrigins) { - obj.origins = Array.from(chunk.groupsIterable, g => g.origins) - .reduce((a, b) => a.concat(b), []) - .map(origin => ({ - moduleId: origin.module ? origin.module.id : undefined, - module: origin.module ? origin.module.identifier() : "", - moduleIdentifier: origin.module ? origin.module.identifier() : "", - moduleName: origin.module - ? origin.module.readableIdentifier(requestShortener) - : "", - loc: formatLocation(origin.loc), - request: origin.request, - reasons: origin.reasons || [] - })) - .sort((a, b) => { - const cmp1 = compareId(a.moduleId, b.moduleId); - if (cmp1) return cmp1; - const cmp2 = compareId(a.loc, b.loc); - if (cmp2) return cmp2; - const cmp3 = compareId(a.request, b.request); - if (cmp3) return cmp3; - return 0; - }); - } - return obj; - }); - obj.chunks.sort(sortByField(sortChunks, obj.chunks)); - } - if (showModules) { - obj.modules = compilation.modules - .slice() - .sort(sortByField("depth", compilation.modules)) - .filter(createModuleFilter()) - .map(fnModule); - obj.filteredModules = compilation.modules.length - obj.modules.length; - obj.modules.sort(sortByField(sortModules, obj.modules)); - } - if (showLogging) { - const util = __webpack_require__(31669); - obj.logging = {}; - let acceptedTypes; - let collapsedGroups = false; - switch (showLogging) { - case "none": - acceptedTypes = new Set([]); - break; - case "error": - acceptedTypes = new Set([LogType.error]); - break; - case "warn": - acceptedTypes = new Set([LogType.error, LogType.warn]); - break; - case "info": - acceptedTypes = new Set([LogType.error, LogType.warn, LogType.info]); - break; - case true: - case "log": - acceptedTypes = new Set([ - LogType.error, - LogType.warn, - LogType.info, - LogType.log, - LogType.group, - LogType.groupEnd, - LogType.groupCollapsed, - LogType.clear - ]); - break; - case "verbose": - acceptedTypes = new Set([ - LogType.error, - LogType.warn, - LogType.info, - LogType.log, - LogType.group, - LogType.groupEnd, - LogType.groupCollapsed, - LogType.profile, - LogType.profileEnd, - LogType.time, - LogType.status, - LogType.clear - ]); - collapsedGroups = true; - break; - } - for (const [origin, logEntries] of compilation.logging) { - const debugMode = loggingDebug.some(fn => fn(origin)); - let collapseCounter = 0; - let processedLogEntries = logEntries; - if (!debugMode) { - processedLogEntries = processedLogEntries.filter(entry => { - if (!acceptedTypes.has(entry.type)) return false; - if (!collapsedGroups) { - switch (entry.type) { - case LogType.groupCollapsed: - collapseCounter++; - return collapseCounter === 1; - case LogType.group: - if (collapseCounter > 0) collapseCounter++; - return collapseCounter === 0; - case LogType.groupEnd: - if (collapseCounter > 0) { - collapseCounter--; - return false; - } - return true; - default: - return collapseCounter === 0; - } - } - return true; - }); - } - processedLogEntries = processedLogEntries.map(entry => { - let message = undefined; - if (entry.type === LogType.time) { - message = `${entry.args[0]}: ${entry.args[1] * 1000 + - entry.args[2] / 1000000}ms`; - } else if (entry.args && entry.args.length > 0) { - message = util.format(entry.args[0], ...entry.args.slice(1)); - } - return { - type: - (debugMode || collapsedGroups) && - entry.type === LogType.groupCollapsed - ? LogType.group - : entry.type, - message, - trace: showLoggingTrace && entry.trace ? entry.trace : undefined - }; - }); - let name = identifierUtils - .makePathsRelative(context, origin, compilation.cache) - .replace(/\|/g, " "); - if (name in obj.logging) { - let i = 1; - while (`${name}#${i}` in obj.logging) { - i++; - } - name = `${name}#${i}`; - } - obj.logging[name] = { - entries: processedLogEntries, - filteredEntries: logEntries.length - processedLogEntries.length, - debug: debugMode - }; - } - } - if (showChildren) { - obj.children = compilation.children.map((child, idx) => { - const childOptions = Stats.getChildOptions(options, idx); - const obj = new Stats(child).toJson(childOptions, forToString); - delete obj.hash; - delete obj.version; - if (child.name) { - obj.name = identifierUtils.makePathsRelative( - context, - child.name, - compilation.cache - ); - } - return obj; - }); - } +const replacePathVariables = (path, data, assetInfo) => { + const chunk = data.chunk; + const chunkId = chunk && chunk.id; + const chunkName = chunk && (chunk.name || chunk.id); + const chunkHash = chunk && (chunk.renderedHash || chunk.hash); + const chunkHashWithLength = chunk && chunk.hashWithLength; + const contentHashType = data.contentHashType; + const contentHash = + (chunk && chunk.contentHash && chunk.contentHash[contentHashType]) || + data.contentHash; + const contentHashWithLength = + (chunk && + chunk.contentHashWithLength && + chunk.contentHashWithLength[contentHashType]) || + data.contentHashWithLength; + const module = data.module; + const moduleId = module && module.id; + const moduleHash = module && (module.renderedHash || module.hash); + const moduleHashWithLength = module && module.hashWithLength; - return obj; + if (typeof path === "function") { + path = path(data); } - toString(options) { - if (typeof options === "boolean" || typeof options === "string") { - options = Stats.presetToOptions(options); - } else if (!options) { - options = {}; - } - - const useColors = optionsOrFallback(options.colors, false); + if ( + data.noChunkHash && + (REGEXP_CHUNKHASH_FOR_TEST.test(path) || + REGEXP_CONTENTHASH_FOR_TEST.test(path)) + ) { + throw new Error( + `Cannot use [chunkhash] or [contenthash] for chunk in '${path}' (use [hash] instead)` + ); + } - const obj = this.toJson(options, true); + return ( + path + .replace( + REGEXP_HASH, + withHashLength(getReplacer(data.hash), data.hashWithLength, assetInfo) + ) + .replace( + REGEXP_CHUNKHASH, + withHashLength(getReplacer(chunkHash), chunkHashWithLength, assetInfo) + ) + .replace( + REGEXP_CONTENTHASH, + withHashLength( + getReplacer(contentHash), + contentHashWithLength, + assetInfo + ) + ) + .replace( + REGEXP_MODULEHASH, + withHashLength(getReplacer(moduleHash), moduleHashWithLength, assetInfo) + ) + .replace(REGEXP_ID, getReplacer(chunkId)) + .replace(REGEXP_MODULEID, getReplacer(moduleId)) + .replace(REGEXP_NAME, getReplacer(chunkName)) + .replace(REGEXP_FILE, getReplacer(data.filename)) + .replace(REGEXP_FILEBASE, getReplacer(data.basename)) + // query is optional, it's OK if it's in a path but there's nothing to replace it with + .replace(REGEXP_QUERY, getReplacer(data.query, true)) + // only available in sourceMappingURLComment + .replace(REGEXP_URL, getReplacer(data.url)) + .replace(/\[\\(\\*[\w:]+\\*)\\\]/gi, "[$1]") + ); +}; - return Stats.jsonToString(obj, useColors); - } +class TemplatedPathPlugin { + apply(compiler) { + compiler.hooks.compilation.tap("TemplatedPathPlugin", compilation => { + const mainTemplate = compilation.mainTemplate; - static jsonToString(obj, useColors) { - const buf = []; + mainTemplate.hooks.assetPath.tap( + "TemplatedPathPlugin", + replacePathVariables + ); - const defaultColors = { - bold: "\u001b[1m", - yellow: "\u001b[1m\u001b[33m", - red: "\u001b[1m\u001b[31m", - green: "\u001b[1m\u001b[32m", - cyan: "\u001b[1m\u001b[36m", - magenta: "\u001b[1m\u001b[35m" - }; + mainTemplate.hooks.globalHash.tap( + "TemplatedPathPlugin", + (chunk, paths) => { + const outputOptions = mainTemplate.outputOptions; + const publicPath = outputOptions.publicPath || ""; + const filename = outputOptions.filename || ""; + const chunkFilename = + outputOptions.chunkFilename || outputOptions.filename; + if ( + REGEXP_HASH_FOR_TEST.test(publicPath) || + REGEXP_CHUNKHASH_FOR_TEST.test(publicPath) || + REGEXP_CONTENTHASH_FOR_TEST.test(publicPath) || + REGEXP_NAME_FOR_TEST.test(publicPath) + ) + return true; + if (REGEXP_HASH_FOR_TEST.test(filename)) return true; + if (REGEXP_HASH_FOR_TEST.test(chunkFilename)) return true; + if (REGEXP_HASH_FOR_TEST.test(paths.join("|"))) return true; + } + ); - const colors = Object.keys(defaultColors).reduce( - (obj, color) => { - obj[color] = str => { - if (useColors) { - buf.push( - useColors === true || useColors[color] === undefined - ? defaultColors[color] - : useColors[color] + mainTemplate.hooks.hashForChunk.tap( + "TemplatedPathPlugin", + (hash, chunk) => { + const outputOptions = mainTemplate.outputOptions; + const chunkFilename = + outputOptions.chunkFilename || outputOptions.filename; + if (REGEXP_CHUNKHASH_FOR_TEST.test(chunkFilename)) { + hash.update(JSON.stringify(chunk.getChunkMaps(true).hash)); + } + if (REGEXP_CONTENTHASH_FOR_TEST.test(chunkFilename)) { + hash.update( + JSON.stringify( + chunk.getChunkMaps(true).contentHash.javascript || {} + ) ); } - buf.push(str); - if (useColors) { - buf.push("\u001b[39m\u001b[22m"); + if (REGEXP_NAME_FOR_TEST.test(chunkFilename)) { + hash.update(JSON.stringify(chunk.getChunkMaps(true).name)); } - }; - return obj; - }, - { - normal: str => buf.push(str) - } - ); + } + ); + }); + } +} - const coloredTime = time => { - let times = [800, 400, 200, 100]; - if (obj.time) { - times = [obj.time / 2, obj.time / 4, obj.time / 8, obj.time / 16]; - } - if (time < times[3]) colors.normal(`${time}ms`); - else if (time < times[2]) colors.bold(`${time}ms`); - else if (time < times[1]) colors.green(`${time}ms`); - else if (time < times[0]) colors.yellow(`${time}ms`); - else colors.red(`${time}ms`); - }; +module.exports = TemplatedPathPlugin; - const newline = () => buf.push("\n"); - const getText = (arr, row, col) => { - return arr[row][col].value; - }; +/***/ }), - const table = (array, align, splitter) => { - const rows = array.length; - const cols = array[0].length; - const colSizes = new Array(cols); - for (let col = 0; col < cols; col++) { - colSizes[col] = 0; - } - for (let row = 0; row < rows; row++) { - for (let col = 0; col < cols; col++) { - const value = `${getText(array, row, col)}`; - if (value.length > colSizes[col]) { - colSizes[col] = value.length; - } - } - } - for (let row = 0; row < rows; row++) { - for (let col = 0; col < cols; col++) { - const format = array[row][col].color; - const value = `${getText(array, row, col)}`; - let l = value.length; - if (align[col] === "l") { - format(value); - } - for (; l < colSizes[col] && col !== cols - 1; l++) { - colors.normal(" "); - } - if (align[col] === "r") { - format(value); - } - if (col + 1 < cols && colSizes[col] !== 0) { - colors.normal(splitter || " "); - } - } - newline(); - } - }; +/***/ 75374: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - const getAssetColor = (asset, defaultColor) => { - if (asset.isOverSizeLimit) { - return colors.yellow; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - return defaultColor; - }; - if (obj.hash) { - colors.normal("Hash: "); - colors.bold(obj.hash); - newline(); - } - if (obj.version) { - colors.normal("Version: webpack "); - colors.bold(obj.version); - newline(); - } - if (typeof obj.time === "number") { - colors.normal("Time: "); - colors.bold(obj.time); - colors.normal("ms"); - newline(); - } - if (typeof obj.builtAt === "number") { - const builtAtDate = new Date(obj.builtAt); - let timeZone = undefined; +const { ConcatSource, OriginalSource } = __webpack_require__(53665); +const Template = __webpack_require__(96066); - try { - builtAtDate.toLocaleTimeString(); - } catch (err) { - // Force UTC if runtime timezone is unsupported - timeZone = "UTC"; - } +/** @typedef {import("../declarations/WebpackOptions").LibraryCustomUmdObject} LibraryCustomUmdObject */ +/** @typedef {import("./Compilation")} Compilation */ - colors.normal("Built at: "); - colors.normal( - builtAtDate.toLocaleDateString(undefined, { - day: "2-digit", - month: "2-digit", - year: "numeric", - timeZone - }) - ); - colors.normal(" "); - colors.bold(builtAtDate.toLocaleTimeString(undefined, { timeZone })); - newline(); - } - if (obj.env) { - colors.normal("Environment (--env): "); - colors.bold(JSON.stringify(obj.env, null, 2)); - newline(); - } - if (obj.publicPath) { - colors.normal("PublicPath: "); - colors.bold(obj.publicPath); - newline(); - } +/** + * @param {string[]} accessor the accessor to convert to path + * @returns {string} the path + */ +const accessorToObjectAccess = accessor => { + return accessor.map(a => `[${JSON.stringify(a)}]`).join(""); +}; - if (obj.assets && obj.assets.length > 0) { - const t = [ - [ - { - value: "Asset", - color: colors.bold - }, - { - value: "Size", - color: colors.bold - }, - { - value: "Chunks", - color: colors.bold - }, - { - value: "", - color: colors.bold - }, - { - value: "", - color: colors.bold - }, - { - value: "Chunk Names", - color: colors.bold - } - ] - ]; - for (const asset of obj.assets) { - t.push([ - { - value: asset.name, - color: getAssetColor(asset, colors.green) - }, - { - value: SizeFormatHelpers.formatSize(asset.size), - color: getAssetColor(asset, colors.normal) - }, - { - value: asset.chunks.join(", "), - color: colors.bold - }, - { - value: [ - asset.emitted && "[emitted]", - asset.info.immutable && "[immutable]", - asset.info.development && "[dev]", - asset.info.hotModuleReplacement && "[hmr]" - ] - .filter(Boolean) - .join(" "), - color: colors.green - }, - { - value: asset.isOverSizeLimit ? "[big]" : "", - color: getAssetColor(asset, colors.normal) - }, - { - value: asset.chunkNames.join(", "), - color: colors.normal - } - ]); - } - table(t, "rrrlll"); - } - if (obj.filteredAssets > 0) { - colors.normal(" "); - if (obj.assets.length > 0) colors.normal("+ "); - colors.normal(obj.filteredAssets); - if (obj.assets.length > 0) colors.normal(" hidden"); - colors.normal(obj.filteredAssets !== 1 ? " assets" : " asset"); - newline(); - } +/** + * @param {string=} base the path prefix + * @param {string|string[]} accessor the accessor + * @param {string=} joinWith the element separator + * @returns {string} the path + */ +const accessorAccess = (base, accessor, joinWith = ", ") => { + const accessors = Array.isArray(accessor) ? accessor : [accessor]; + return accessors + .map((_, idx) => { + const a = base + ? base + accessorToObjectAccess(accessors.slice(0, idx + 1)) + : accessors[0] + accessorToObjectAccess(accessors.slice(1, idx + 1)); + if (idx === accessors.length - 1) return a; + if (idx === 0 && base === undefined) + return `${a} = typeof ${a} === "object" ? ${a} : {}`; + return `${a} = ${a} || {}`; + }) + .join(joinWith); +}; - const processChunkGroups = (namedGroups, prefix) => { - for (const name of Object.keys(namedGroups)) { - const cg = namedGroups[name]; - colors.normal(`${prefix} `); - colors.bold(name); - if (cg.isOverSizeLimit) { - colors.normal(" "); - colors.yellow("[big]"); - } - colors.normal(" ="); - for (const asset of cg.assets) { - colors.normal(" "); - colors.green(asset); - } - for (const name of Object.keys(cg.childAssets)) { - const assets = cg.childAssets[name]; - if (assets && assets.length > 0) { - colors.normal(" "); - colors.magenta(`(${name}:`); - for (const asset of assets) { - colors.normal(" "); - colors.green(asset); - } - colors.magenta(")"); - } - } - newline(); - } - }; +/** @typedef {string | string[] | LibraryCustomUmdObject} UmdMainTemplatePluginName */ - if (obj.entrypoints) { - processChunkGroups(obj.entrypoints, "Entrypoint"); - } +/** + * @typedef {Object} AuxiliaryCommentObject + * @property {string} root + * @property {string} commonjs + * @property {string} commonjs2 + * @property {string} amd + */ - if (obj.namedChunkGroups) { - let outputChunkGroups = obj.namedChunkGroups; - if (obj.entrypoints) { - outputChunkGroups = Object.keys(outputChunkGroups) - .filter(name => !obj.entrypoints[name]) - .reduce((result, name) => { - result[name] = obj.namedChunkGroups[name]; - return result; - }, {}); - } - processChunkGroups(outputChunkGroups, "Chunk Group"); +/** + * @typedef {Object} UmdMainTemplatePluginOption + * @property {boolean=} optionalAmdExternalAsGlobal + * @property {boolean} namedDefine + * @property {string | AuxiliaryCommentObject} auxiliaryComment + */ + +class UmdMainTemplatePlugin { + /** + * @param {UmdMainTemplatePluginName} name the name of the UMD library + * @param {UmdMainTemplatePluginOption} options the plugin option + */ + constructor(name, options) { + if (typeof name === "object" && !Array.isArray(name)) { + this.name = name.root || name.amd || name.commonjs; + this.names = name; + } else { + this.name = name; + this.names = { + commonjs: name, + root: name, + amd: name + }; } + this.optionalAmdExternalAsGlobal = options.optionalAmdExternalAsGlobal; + this.namedDefine = options.namedDefine; + this.auxiliaryComment = options.auxiliaryComment; + } - const modulesByIdentifier = {}; - if (obj.modules) { - for (const module of obj.modules) { - modulesByIdentifier[`$${module.identifier}`] = module; - } - } else if (obj.chunks) { - for (const chunk of obj.chunks) { - if (chunk.modules) { - for (const module of chunk.modules) { - modulesByIdentifier[`$${module.identifier}`] = module; + /** + * @param {Compilation} compilation the compilation instance + * @returns {void} + */ + apply(compilation) { + const { mainTemplate, chunkTemplate, runtimeTemplate } = compilation; + + const onRenderWithEntry = (source, chunk, hash) => { + let externals = chunk + .getModules() + .filter( + m => + m.external && + (m.externalType === "umd" || m.externalType === "umd2") + ); + const optionalExternals = []; + let requiredExternals = []; + if (this.optionalAmdExternalAsGlobal) { + for (const m of externals) { + if (m.optional) { + optionalExternals.push(m); + } else { + requiredExternals.push(m); } } + externals = requiredExternals.concat(optionalExternals); + } else { + requiredExternals = externals; } - } - const processModuleAttributes = module => { - colors.normal(" "); - colors.normal(SizeFormatHelpers.formatSize(module.size)); - if (module.chunks) { - for (const chunk of module.chunks) { - colors.normal(" {"); - colors.yellow(chunk); - colors.normal("}"); - } - } - if (typeof module.depth === "number") { - colors.normal(` [depth ${module.depth}]`); - } - if (module.cacheable === false) { - colors.red(" [not cacheable]"); - } - if (module.optional) { - colors.yellow(" [optional]"); - } - if (module.built) { - colors.green(" [built]"); - } - if (module.assets && module.assets.length) { - colors.magenta( - ` [${module.assets.length} asset${ - module.assets.length === 1 ? "" : "s" - }]` - ); - } - if (module.prefetched) { - colors.magenta(" [prefetched]"); - } - if (module.failed) colors.red(" [failed]"); - if (module.warnings) { - colors.yellow( - ` [${module.warnings} warning${module.warnings === 1 ? "" : "s"}]` + const replaceKeys = str => { + return mainTemplate.getAssetPath(str, { + hash, + chunk + }); + }; + + const externalsDepsArray = modules => { + return `[${replaceKeys( + modules + .map(m => + JSON.stringify( + typeof m.request === "object" ? m.request.amd : m.request + ) + ) + .join(", ") + )}]`; + }; + + const externalsRootArray = modules => { + return replaceKeys( + modules + .map(m => { + let request = m.request; + if (typeof request === "object") request = request.root; + return `root${accessorToObjectAccess([].concat(request))}`; + }) + .join(", ") ); - } - if (module.errors) { - colors.red( - ` [${module.errors} error${module.errors === 1 ? "" : "s"}]` + }; + + const externalsRequireArray = type => { + return replaceKeys( + externals + .map(m => { + let expr; + let request = m.request; + if (typeof request === "object") { + request = request[type]; + } + if (request === undefined) { + throw new Error( + "Missing external configuration for type:" + type + ); + } + if (Array.isArray(request)) { + expr = `require(${JSON.stringify( + request[0] + )})${accessorToObjectAccess(request.slice(1))}`; + } else { + expr = `require(${JSON.stringify(request)})`; + } + if (m.optional) { + expr = `(function webpackLoadOptionalExternalModule() { try { return ${expr}; } catch(e) {} }())`; + } + return expr; + }) + .join(", ") ); - } - }; + }; - const processModuleContent = (module, prefix) => { - if (Array.isArray(module.providedExports)) { - colors.normal(prefix); - if (module.providedExports.length === 0) { - colors.cyan("[no exports]"); - } else { - colors.cyan(`[exports: ${module.providedExports.join(", ")}]`); - } - newline(); - } - if (module.usedExports !== undefined) { - if (module.usedExports !== true) { - colors.normal(prefix); - if (module.usedExports === null) { - colors.cyan("[used exports unknown]"); - } else if (module.usedExports === false) { - colors.cyan("[no exports used]"); - } else if ( - Array.isArray(module.usedExports) && - module.usedExports.length === 0 - ) { - colors.cyan("[no exports used]"); - } else if (Array.isArray(module.usedExports)) { - const providedExportsCount = Array.isArray(module.providedExports) - ? module.providedExports.length - : null; - if ( - providedExportsCount !== null && - providedExportsCount === module.usedExports.length - ) { - colors.cyan("[all exports used]"); - } else { - colors.cyan( - `[only some exports used: ${module.usedExports.join(", ")}]` - ); - } - } - newline(); - } + const externalsArguments = modules => { + return modules + .map( + m => + `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(`${m.id}`)}__` + ) + .join(", "); + }; + + const libraryName = library => { + return JSON.stringify(replaceKeys([].concat(library).pop())); + }; + + let amdFactory; + if (optionalExternals.length > 0) { + const wrapperArguments = externalsArguments(requiredExternals); + const factoryArguments = + requiredExternals.length > 0 + ? externalsArguments(requiredExternals) + + ", " + + externalsRootArray(optionalExternals) + : externalsRootArray(optionalExternals); + amdFactory = + `function webpackLoadOptionalExternalModuleAmd(${wrapperArguments}) {\n` + + ` return factory(${factoryArguments});\n` + + " }"; + } else { + amdFactory = "factory"; } - if (Array.isArray(module.optimizationBailout)) { - for (const item of module.optimizationBailout) { - colors.normal(prefix); - colors.yellow(item); - newline(); + + const auxiliaryComment = this.auxiliaryComment; + + const getAuxilaryComment = type => { + if (auxiliaryComment) { + if (typeof auxiliaryComment === "string") + return "\t//" + auxiliaryComment + "\n"; + if (auxiliaryComment[type]) + return "\t//" + auxiliaryComment[type] + "\n"; } - } - if (module.reasons) { - for (const reason of module.reasons) { - colors.normal(prefix); - if (reason.type) { - colors.normal(reason.type); - colors.normal(" "); - } - if (reason.userRequest) { - colors.cyan(reason.userRequest); - colors.normal(" "); - } - if (reason.moduleId !== null) { - colors.normal("["); - colors.normal(reason.moduleId); - colors.normal("]"); - } - if (reason.module && reason.module !== reason.moduleId) { - colors.normal(" "); - colors.magenta(reason.module); - } - if (reason.loc) { - colors.normal(" "); - colors.normal(reason.loc); - } - if (reason.explanation) { - colors.normal(" "); - colors.cyan(reason.explanation); - } - newline(); - } - } - if (module.profile) { - colors.normal(prefix); - let sum = 0; - if (module.issuerPath) { - for (const m of module.issuerPath) { - colors.normal("["); - colors.normal(m.id); - colors.normal("] "); - if (m.profile) { - const time = (m.profile.factory || 0) + (m.profile.building || 0); - coloredTime(time); - sum += time; - colors.normal(" "); - } - colors.normal("-> "); - } - } - for (const key of Object.keys(module.profile)) { - colors.normal(`${key}:`); - const time = module.profile[key]; - coloredTime(time); - colors.normal(" "); - sum += time; - } - colors.normal("= "); - coloredTime(sum); - newline(); - } - if (module.modules) { - processModulesList(module, prefix + "| "); - } - }; + return ""; + }; - const processModulesList = (obj, prefix) => { - if (obj.modules) { - let maxModuleId = 0; - for (const module of obj.modules) { - if (typeof module.id === "number") { - if (maxModuleId < module.id) maxModuleId = module.id; - } - } - let contentPrefix = prefix + " "; - if (maxModuleId >= 10) contentPrefix += " "; - if (maxModuleId >= 100) contentPrefix += " "; - if (maxModuleId >= 1000) contentPrefix += " "; - for (const module of obj.modules) { - colors.normal(prefix); - const name = module.name || module.identifier; - if (typeof module.id === "string" || typeof module.id === "number") { - if (typeof module.id === "number") { - if (module.id < 1000 && maxModuleId >= 1000) colors.normal(" "); - if (module.id < 100 && maxModuleId >= 100) colors.normal(" "); - if (module.id < 10 && maxModuleId >= 10) colors.normal(" "); - } else { - if (maxModuleId >= 1000) colors.normal(" "); - if (maxModuleId >= 100) colors.normal(" "); - if (maxModuleId >= 10) colors.normal(" "); - } - if (name !== module.id) { - colors.normal("["); - colors.normal(module.id); - colors.normal("]"); - colors.normal(" "); - } else { - colors.normal("["); - colors.bold(module.id); - colors.normal("]"); - } - } - if (name !== module.id) { - colors.bold(name); - } - processModuleAttributes(module); - newline(); - processModuleContent(module, contentPrefix); - } - if (obj.filteredModules > 0) { - colors.normal(prefix); - colors.normal(" "); - if (obj.modules.length > 0) colors.normal(" + "); - colors.normal(obj.filteredModules); - if (obj.modules.length > 0) colors.normal(" hidden"); - colors.normal(obj.filteredModules !== 1 ? " modules" : " module"); - newline(); - } - } + return new ConcatSource( + new OriginalSource( + "(function webpackUniversalModuleDefinition(root, factory) {\n" + + getAuxilaryComment("commonjs2") + + " if(typeof exports === 'object' && typeof module === 'object')\n" + + " module.exports = factory(" + + externalsRequireArray("commonjs2") + + ");\n" + + getAuxilaryComment("amd") + + " else if(typeof define === 'function' && define.amd)\n" + + (requiredExternals.length > 0 + ? this.names.amd && this.namedDefine === true + ? " define(" + + libraryName(this.names.amd) + + ", " + + externalsDepsArray(requiredExternals) + + ", " + + amdFactory + + ");\n" + : " define(" + + externalsDepsArray(requiredExternals) + + ", " + + amdFactory + + ");\n" + : this.names.amd && this.namedDefine === true + ? " define(" + + libraryName(this.names.amd) + + ", [], " + + amdFactory + + ");\n" + : " define([], " + amdFactory + ");\n") + + (this.names.root || this.names.commonjs + ? getAuxilaryComment("commonjs") + + " else if(typeof exports === 'object')\n" + + " exports[" + + libraryName(this.names.commonjs || this.names.root) + + "] = factory(" + + externalsRequireArray("commonjs") + + ");\n" + + getAuxilaryComment("root") + + " else\n" + + " " + + replaceKeys( + accessorAccess("root", this.names.root || this.names.commonjs) + ) + + " = factory(" + + externalsRootArray(externals) + + ");\n" + : " else {\n" + + (externals.length > 0 + ? " var a = typeof exports === 'object' ? factory(" + + externalsRequireArray("commonjs") + + ") : factory(" + + externalsRootArray(externals) + + ");\n" + : " var a = factory();\n") + + " for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n" + + " }\n") + + `})(${ + runtimeTemplate.outputOptions.globalObject + }, function(${externalsArguments(externals)}) {\nreturn `, + "webpack/universalModuleDefinition" + ), + source, + ";\n})" + ); }; - if (obj.chunks) { - for (const chunk of obj.chunks) { - colors.normal("chunk "); - if (chunk.id < 1000) colors.normal(" "); - if (chunk.id < 100) colors.normal(" "); - if (chunk.id < 10) colors.normal(" "); - colors.normal("{"); - colors.yellow(chunk.id); - colors.normal("} "); - colors.green(chunk.files.join(", ")); - if (chunk.names && chunk.names.length > 0) { - colors.normal(" ("); - colors.normal(chunk.names.join(", ")); - colors.normal(")"); - } - colors.normal(" "); - colors.normal(SizeFormatHelpers.formatSize(chunk.size)); - for (const id of chunk.parents) { - colors.normal(" <{"); - colors.yellow(id); - colors.normal("}>"); - } - for (const id of chunk.siblings) { - colors.normal(" ={"); - colors.yellow(id); - colors.normal("}="); - } - for (const id of chunk.children) { - colors.normal(" >{"); - colors.yellow(id); - colors.normal("}<"); - } - if (chunk.childrenByOrder) { - for (const name of Object.keys(chunk.childrenByOrder)) { - const children = chunk.childrenByOrder[name]; - colors.normal(" "); - colors.magenta(`(${name}:`); - for (const id of children) { - colors.normal(" {"); - colors.yellow(id); - colors.normal("}"); - } - colors.magenta(")"); - } - } - if (chunk.entry) { - colors.yellow(" [entry]"); - } else if (chunk.initial) { - colors.yellow(" [initial]"); - } - if (chunk.rendered) { - colors.green(" [rendered]"); - } - if (chunk.recorded) { - colors.green(" [recorded]"); - } - if (chunk.reason) { - colors.yellow(` ${chunk.reason}`); - } - newline(); - if (chunk.origins) { - for (const origin of chunk.origins) { - colors.normal(" > "); - if (origin.reasons && origin.reasons.length) { - colors.yellow(origin.reasons.join(" ")); - colors.normal(" "); - } - if (origin.request) { - colors.normal(origin.request); - colors.normal(" "); - } - if (origin.module) { - colors.normal("["); - colors.normal(origin.moduleId); - colors.normal("] "); - const module = modulesByIdentifier[`$${origin.module}`]; - if (module) { - colors.bold(module.name); - colors.normal(" "); - } - } - if (origin.loc) { - colors.normal(origin.loc); - } - newline(); - } - } - processModulesList(chunk, " "); - } - } - - processModulesList(obj, ""); - - if (obj.logging) { - for (const origin of Object.keys(obj.logging)) { - const logData = obj.logging[origin]; - if (logData.entries.length > 0) { - newline(); - if (logData.debug) { - colors.red("DEBUG "); - } - colors.bold("LOG from " + origin); - newline(); - let indent = ""; - for (const entry of logData.entries) { - let color = colors.normal; - let prefix = " "; - switch (entry.type) { - case LogType.clear: - colors.normal(`${indent}-------`); - newline(); - continue; - case LogType.error: - color = colors.red; - prefix = " "; - break; - case LogType.warn: - color = colors.yellow; - prefix = " "; - break; - case LogType.info: - color = colors.green; - prefix = " "; - break; - case LogType.log: - color = colors.bold; - break; - case LogType.trace: - case LogType.debug: - color = colors.normal; - break; - case LogType.status: - color = colors.magenta; - prefix = " "; - break; - case LogType.profile: - color = colors.magenta; - prefix = "

"; - break; - case LogType.profileEnd: - color = colors.magenta; - prefix = "

"; - break; - case LogType.time: - color = colors.magenta; - prefix = " "; - break; - case LogType.group: - color = colors.cyan; - prefix = "<-> "; - break; - case LogType.groupCollapsed: - color = colors.cyan; - prefix = "<+> "; - break; - case LogType.groupEnd: - if (indent.length >= 2) - indent = indent.slice(0, indent.length - 2); - continue; - } - if (entry.message) { - for (const line of entry.message.split("\n")) { - colors.normal(`${indent}${prefix}`); - color(line); - newline(); - } - } - if (entry.trace) { - for (const line of entry.trace) { - colors.normal(`${indent}| ${line}`); - newline(); - } - } - switch (entry.type) { - case LogType.group: - indent += " "; - break; - } - } - if (logData.filteredEntries) { - colors.normal(`+ ${logData.filteredEntries} hidden lines`); - newline(); - } - } - } - } - - if (obj._showWarnings && obj.warnings) { - for (const warning of obj.warnings) { - newline(); - colors.yellow(`WARNING in ${warning}`); - newline(); - } - } - if (obj._showErrors && obj.errors) { - for (const error of obj.errors) { - newline(); - colors.red(`ERROR in ${error}`); - newline(); - } - } - if (obj.children) { - for (const child of obj.children) { - const childString = Stats.jsonToString(child, useColors); - if (childString) { - if (child.name) { - colors.normal("Child "); - colors.bold(child.name); - colors.normal(":"); - } else { - colors.normal("Child"); - } - newline(); - buf.push(" "); - buf.push(childString.replace(/\n/g, "\n ")); - newline(); - } - } - } - if (obj.needAdditionalPass) { - colors.yellow( - "Compilation needs an additional pass and will compile again." + for (const template of [mainTemplate, chunkTemplate]) { + template.hooks.renderWithEntry.tap( + "UmdMainTemplatePlugin", + onRenderWithEntry ); } - while (buf[buf.length - 1] === "\n") { - buf.pop(); - } - return buf.join(""); - } - - static presetToOptions(name) { - // Accepted values: none, errors-only, minimal, normal, detailed, verbose - // Any other falsy value will behave as 'none', truthy values as 'normal' - const pn = - (typeof name === "string" && name.toLowerCase()) || name || "none"; - switch (pn) { - case "none": - return { - all: false - }; - case "verbose": - return { - entrypoints: true, - chunkGroups: true, - modules: false, - chunks: true, - chunkModules: true, - chunkOrigins: true, - depth: true, - env: true, - reasons: true, - usedExports: true, - providedExports: true, - optimizationBailout: true, - errorDetails: true, - publicPath: true, - logging: "verbose", - exclude: false, - maxModules: Infinity - }; - case "detailed": - return { - entrypoints: true, - chunkGroups: true, - chunks: true, - chunkModules: false, - chunkOrigins: true, - depth: true, - usedExports: true, - providedExports: true, - optimizationBailout: true, - errorDetails: true, - publicPath: true, - logging: true, - exclude: false, - maxModules: Infinity - }; - case "minimal": - return { - all: false, - modules: true, - maxModules: 0, - errors: true, - warnings: true, - logging: "warn" - }; - case "errors-only": - return { - all: false, - errors: true, - moduleTrace: true, - logging: "error" - }; - case "errors-warnings": - return { - all: false, - errors: true, - warnings: true, - logging: "warn" - }; - default: - return {}; - } - } + mainTemplate.hooks.globalHashPaths.tap("UmdMainTemplatePlugin", paths => { + if (this.names.root) paths = paths.concat(this.names.root); + if (this.names.amd) paths = paths.concat(this.names.amd); + if (this.names.commonjs) paths = paths.concat(this.names.commonjs); + return paths; + }); - static getChildOptions(options, idx) { - let innerOptions; - if (Array.isArray(options.children)) { - if (idx < options.children.length) { - innerOptions = options.children[idx]; - } - } else if (typeof options.children === "object" && options.children) { - innerOptions = options.children; - } - if (typeof innerOptions === "boolean" || typeof innerOptions === "string") { - innerOptions = Stats.presetToOptions(innerOptions); - } - if (!innerOptions) { - return options; - } - const childOptions = Object.assign({}, options); - delete childOptions.children; // do not inherit children - return Object.assign(childOptions, innerOptions); + mainTemplate.hooks.hash.tap("UmdMainTemplatePlugin", hash => { + hash.update("umd"); + hash.update(`${this.names.root}`); + hash.update(`${this.names.amd}`); + hash.update(`${this.names.commonjs}`); + }); } } -module.exports = Stats; +module.exports = UmdMainTemplatePlugin; /***/ }), -/***/ 97365: +/***/ 99953: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Joel Denning @joeldenning - */ + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +const WebpackError = __webpack_require__(97391); -const { ConcatSource } = __webpack_require__(53665); -const Template = __webpack_require__(96066); +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ -/** @typedef {import("./Compilation")} Compilation */ - -/** - * @typedef {Object} SystemMainTemplatePluginOptions - * @param {string=} name the library name - */ - -class SystemMainTemplatePlugin { +class UnsupportedFeatureWarning extends WebpackError { /** - * @param {SystemMainTemplatePluginOptions} options the plugin options + * @param {Module} module module relevant to warning + * @param {string} message description of warning + * @param {DependencyLocation} loc location start and end positions of the module */ - constructor(options) { - this.name = options.name; + constructor(module, message, loc) { + super(message); + + this.name = "UnsupportedFeatureWarning"; + this.module = module; + this.loc = loc; + this.hideStack = true; + + Error.captureStackTrace(this, this.constructor); } +} + +module.exports = UnsupportedFeatureWarning; + + +/***/ }), + +/***/ 73554: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +const ConstDependency = __webpack_require__(71101); + +/** @typedef {import("./Compiler")} Compiler */ + +class UseStrictPlugin { /** - * @param {Compilation} compilation the compilation instance + * @param {Compiler} compiler Webpack Compiler * @returns {void} */ - apply(compilation) { - const { mainTemplate, chunkTemplate } = compilation; - - const onRenderWithEntry = (source, chunk, hash) => { - const externals = chunk.getModules().filter(m => m.external); + apply(compiler) { + compiler.hooks.compilation.tap( + "UseStrictPlugin", + (compilation, { normalModuleFactory }) => { + const handler = parser => { + parser.hooks.program.tap("UseStrictPlugin", ast => { + const firstNode = ast.body[0]; + if ( + firstNode && + firstNode.type === "ExpressionStatement" && + firstNode.expression.type === "Literal" && + firstNode.expression.value === "use strict" + ) { + // Remove "use strict" expression. It will be added later by the renderer again. + // This is necessary in order to not break the strict mode when webpack prepends code. + // @see https://github.com/webpack/webpack/issues/1970 + const dep = new ConstDependency("", firstNode.range); + dep.loc = firstNode.loc; + parser.state.current.addDependency(dep); + parser.state.module.buildInfo.strict = true; + } + }); + }; - // The name this bundle should be registered as with System - const name = this.name - ? `${JSON.stringify( - mainTemplate.getAssetPath(this.name, { hash, chunk }) - )}, ` - : ""; + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("UseStrictPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("UseStrictPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/esm") + .tap("UseStrictPlugin", handler); + } + ); + } +} - // The array of dependencies that are external to webpack and will be provided by System - const systemDependencies = JSON.stringify( - externals.map(m => - typeof m.request === "object" ? m.request.amd : m.request - ) - ); +module.exports = UseStrictPlugin; - // The name of the variable provided by System for exporting - const dynamicExport = "__WEBPACK_DYNAMIC_EXPORT__"; - // An array of the internal variable names for the webpack externals - const externalWebpackNames = externals.map( - m => `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(`${m.id}`)}__` - ); +/***/ }), - // Declaring variables for the internal variable names for the webpack externals - const externalVarDeclarations = - externalWebpackNames.length > 0 - ? `var ${externalWebpackNames.join(", ")};` - : ""; +/***/ 40269: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // The system.register format requires an array of setter functions for externals. - const setters = - externalWebpackNames.length === 0 - ? "" - : Template.asString([ - "setters: [", - Template.indent( - externalWebpackNames - .map(external => - Template.asString([ - "function(module) {", - Template.indent(`${external} = module;`), - "}" - ]) - ) - .join(",\n") - ), - "]," - ]); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - return new ConcatSource( - Template.asString([ - `System.register(${name}${systemDependencies}, function(${dynamicExport}) {`, - Template.indent([ - externalVarDeclarations, - "return {", - Template.indent([ - setters, - "execute: function() {", - Template.indent(`${dynamicExport}(`) - ]) - ]) - ]) + "\n", - source, - "\n" + - Template.asString([ - Template.indent([ - Template.indent([Template.indent([");"]), "}"]), - "};" - ]), - "})" - ]) - ); - }; - for (const template of [mainTemplate, chunkTemplate]) { - template.hooks.renderWithEntry.tap( - "SystemMainTemplatePlugin", - onRenderWithEntry - ); - } +const CaseSensitiveModulesWarning = __webpack_require__(8335); - mainTemplate.hooks.globalHashPaths.tap( - "SystemMainTemplatePlugin", - paths => { - if (this.name) { - paths.push(this.name); - } - return paths; +class WarnCaseSensitiveModulesPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "WarnCaseSensitiveModulesPlugin", + compilation => { + compilation.hooks.seal.tap("WarnCaseSensitiveModulesPlugin", () => { + const moduleWithoutCase = new Map(); + for (const module of compilation.modules) { + const identifier = module.identifier().toLowerCase(); + const array = moduleWithoutCase.get(identifier); + if (array) { + array.push(module); + } else { + moduleWithoutCase.set(identifier, [module]); + } + } + for (const pair of moduleWithoutCase) { + const array = pair[1]; + if (array.length > 1) { + compilation.warnings.push(new CaseSensitiveModulesWarning(array)); + } + } + }); } ); + } +} - mainTemplate.hooks.hash.tap("SystemMainTemplatePlugin", hash => { - hash.update("exports system"); - if (this.name) { - hash.update(this.name); - } +module.exports = WarnCaseSensitiveModulesPlugin; + + +/***/ }), + +/***/ 71245: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const NoModeWarning = __webpack_require__(45759); + +class WarnNoModeSetPlugin { + apply(compiler) { + compiler.hooks.thisCompilation.tap("WarnNoModeSetPlugin", compilation => { + compilation.warnings.push(new NoModeWarning()); }); } } -module.exports = SystemMainTemplatePlugin; +module.exports = WarnNoModeSetPlugin; /***/ }), -/***/ 96066: +/***/ 88015: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./Chunk")} Chunk */ -/** @typedef {import("./ModuleTemplate")} ModuleTemplate */ -/** @typedef {import("webpack-sources").ConcatSource} ConcatSource */ -const { ConcatSource } = __webpack_require__(53665); -const HotUpdateChunk = __webpack_require__(26782); -const START_LOWERCASE_ALPHABET_CODE = "a".charCodeAt(0); -const START_UPPERCASE_ALPHABET_CODE = "A".charCodeAt(0); -const DELTA_A_TO_Z = "z".charCodeAt(0) - START_LOWERCASE_ALPHABET_CODE + 1; -const FUNCTION_CONTENT_REGEX = /^function\s?\(\)\s?\{\r?\n?|\r?\n?\}$/g; -const INDENT_MULTILINE_REGEX = /^\t/gm; -const LINE_SEPARATOR_REGEX = /\r?\n/g; -const IDENTIFIER_NAME_REPLACE_REGEX = /^([^a-zA-Z$_])/; -const IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX = /[^a-zA-Z0-9$]+/g; -const COMMENT_END_REGEX = /\*\//g; -const PATH_NAME_NORMALIZE_REPLACE_REGEX = /[^a-zA-Z0-9_!§$()=\-^°]+/g; -const MATCH_PADDED_HYPHENS_REPLACE_REGEX = /^-|-$/g; +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(97009); -/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("../declarations/plugins/WatchIgnorePlugin").WatchIgnorePluginOptions} WatchIgnorePluginOptions */ -/** - * @typedef {Object} HasId - * @property {number | string} id - */ +class IgnoringWatchFileSystem { + constructor(wfs, paths) { + this.wfs = wfs; + this.paths = paths; + } -/** - * @typedef {function(Module, number): boolean} ModuleFilterPredicate - */ + watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) { + const ignored = path => + this.paths.some(p => + p instanceof RegExp ? p.test(path) : path.indexOf(p) === 0 + ); -/** - * @param {HasId} a first id object to be sorted - * @param {HasId} b second id object to be sorted against - * @returns {-1|0|1} the sort value - */ -const stringifyIdSortPredicate = (a, b) => { - const aId = a.id + ""; - const bId = b.id + ""; - if (aId < bId) return -1; - if (aId > bId) return 1; - return 0; -}; + const notIgnored = path => !ignored(path); -class Template { - /** - * - * @param {Function} fn a runtime function (.runtime.js) "template" - * @returns {string} the updated and normalized function string - */ - static getFunctionContent(fn) { - return fn - .toString() - .replace(FUNCTION_CONTENT_REGEX, "") - .replace(INDENT_MULTILINE_REGEX, "") - .replace(LINE_SEPARATOR_REGEX, "\n"); - } + const ignoredFiles = files.filter(ignored); + const ignoredDirs = dirs.filter(ignored); - /** - * @param {string} str the string converted to identifier - * @returns {string} created identifier - */ - static toIdentifier(str) { - if (typeof str !== "string") return ""; - return str - .replace(IDENTIFIER_NAME_REPLACE_REGEX, "_$1") - .replace(IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX, "_"); - } - /** - * - * @param {string} str string to be converted to commented in bundle code - * @returns {string} returns a commented version of string - */ - static toComment(str) { - if (!str) return ""; - return `/*! ${str.replace(COMMENT_END_REGEX, "* /")} */`; + const watcher = this.wfs.watch( + files.filter(notIgnored), + dirs.filter(notIgnored), + missing, + startTime, + options, + ( + err, + filesModified, + dirsModified, + missingModified, + fileTimestamps, + dirTimestamps, + removedFiles + ) => { + if (err) return callback(err); + for (const path of ignoredFiles) { + fileTimestamps.set(path, 1); + } + + for (const path of ignoredDirs) { + dirTimestamps.set(path, 1); + } + + callback( + err, + filesModified, + dirsModified, + missingModified, + fileTimestamps, + dirTimestamps, + removedFiles + ); + }, + callbackUndelayed + ); + + return { + close: () => watcher.close(), + pause: () => watcher.pause(), + getContextTimestamps: () => { + const dirTimestamps = watcher.getContextTimestamps(); + for (const path of ignoredDirs) { + dirTimestamps.set(path, 1); + } + return dirTimestamps; + }, + getFileTimestamps: () => { + const fileTimestamps = watcher.getFileTimestamps(); + for (const path of ignoredFiles) { + fileTimestamps.set(path, 1); + } + return fileTimestamps; + } + }; } +} +class WatchIgnorePlugin { /** - * - * @param {string} str string to be converted to "normal comment" - * @returns {string} returns a commented version of string + * @param {WatchIgnorePluginOptions} paths list of paths */ - static toNormalComment(str) { - if (!str) return ""; - return `/* ${str.replace(COMMENT_END_REGEX, "* /")} */`; + constructor(paths) { + validateOptions(schema, paths, "Watch Ignore Plugin"); + this.paths = paths; } - /** - * @param {string} str string path to be normalized - * @returns {string} normalized bundle-safe path - */ - static toPath(str) { - if (typeof str !== "string") return ""; - return str - .replace(PATH_NAME_NORMALIZE_REPLACE_REGEX, "-") - .replace(MATCH_PADDED_HYPHENS_REPLACE_REGEX, ""); + apply(compiler) { + compiler.hooks.afterEnvironment.tap("WatchIgnorePlugin", () => { + compiler.watchFileSystem = new IgnoringWatchFileSystem( + compiler.watchFileSystem, + this.paths + ); + }); } +} - // map number to a single character a-z, A-Z or <_ + number> if number is too big - /** - * - * @param {number} n number to convert to ident - * @returns {string} returns single character ident - */ - static numberToIdentifer(n) { - // lower case - if (n < DELTA_A_TO_Z) { - return String.fromCharCode(START_LOWERCASE_ALPHABET_CODE + n); - } +module.exports = WatchIgnorePlugin; - // upper case - if (n < DELTA_A_TO_Z * 2) { - return String.fromCharCode( - START_UPPERCASE_ALPHABET_CODE + n - DELTA_A_TO_Z - ); - } - // use multiple letters - return ( - Template.numberToIdentifer(n % (2 * DELTA_A_TO_Z)) + - Template.numberToIdentifer(Math.floor(n / (2 * DELTA_A_TO_Z))) - ); - } +/***/ }), - /** - * - * @param {string | string[]} s string to convert to identity - * @returns {string} converted identity - */ - static indent(s) { - if (Array.isArray(s)) { - return s.map(Template.indent).join("\n"); +/***/ 29580: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Stats = __webpack_require__(99977); + +class Watching { + constructor(compiler, watchOptions, handler) { + this.startTime = null; + this.invalid = false; + this.handler = handler; + this.callbacks = []; + this.closed = false; + this.suspended = false; + if (typeof watchOptions === "number") { + this.watchOptions = { + aggregateTimeout: watchOptions + }; + } else if (watchOptions && typeof watchOptions === "object") { + this.watchOptions = Object.assign({}, watchOptions); } else { - const str = s.trimRight(); - if (!str) return ""; - const ind = str[0] === "\n" ? "" : "\t"; - return ind + str.replace(/\n([^\n])/g, "\n\t$1"); + this.watchOptions = {}; } - } + this.watchOptions.aggregateTimeout = + this.watchOptions.aggregateTimeout || 200; + this.compiler = compiler; + this.running = true; + this.compiler.readRecords(err => { + if (err) return this._done(err); - /** - * - * @param {string|string[]} s string to create prefix for - * @param {string} prefix prefix to compose - * @returns {string} returns new prefix string - */ - static prefix(s, prefix) { - const str = Template.asString(s).trim(); - if (!str) return ""; - const ind = str[0] === "\n" ? "" : prefix; - return ind + str.replace(/\n([^\n])/g, "\n" + prefix + "$1"); + this._go(); + }); } - /** - * - * @param {string|string[]} str string or string collection - * @returns {string} returns a single string from array - */ - static asString(str) { - if (Array.isArray(str)) { - return str.join("\n"); - } - return str; - } + _go() { + this.startTime = Date.now(); + this.running = true; + this.invalid = false; + this.compiler.hooks.watchRun.callAsync(this.compiler, err => { + if (err) return this._done(err); + const onCompiled = (err, compilation) => { + if (err) return this._done(err); + if (this.invalid) return this._done(); - /** - * @typedef {Object} WithId - * @property {string|number} id - */ + if (this.compiler.hooks.shouldEmit.call(compilation) === false) { + return this._done(null, compilation); + } - /** - * @param {WithId[]} modules a collection of modules to get array bounds for - * @returns {[number, number] | false} returns the upper and lower array bounds - * or false if not every module has a number based id - */ - static getModulesArrayBounds(modules) { - let maxId = -Infinity; - let minId = Infinity; - for (const module of modules) { - if (typeof module.id !== "number") return false; - if (maxId < module.id) maxId = /** @type {number} */ (module.id); - if (minId > module.id) minId = /** @type {number} */ (module.id); - } - if (minId < 16 + ("" + minId).length) { - // add minId x ',' instead of 'Array(minId).concat(…)' - minId = 0; - } - const objectOverhead = modules - .map(module => (module.id + "").length + 2) - .reduce((a, b) => a + b, -1); - const arrayOverhead = - minId === 0 ? maxId : 16 + ("" + minId).length + maxId; - return arrayOverhead < objectOverhead ? [minId, maxId] : false; - } + this.compiler.emitAssets(compilation, err => { + if (err) return this._done(err); + if (this.invalid) return this._done(); + this.compiler.emitRecords(err => { + if (err) return this._done(err); - /** - * @param {Chunk} chunk chunk whose modules will be rendered - * @param {ModuleFilterPredicate} filterFn function used to filter modules from chunk to render - * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance used to render modules - * @param {TODO | TODO[]} dependencyTemplates templates needed for each module to render dependencies - * @param {string=} prefix applying prefix strings - * @returns {ConcatSource} rendered chunk modules in a Source object - */ - static renderChunkModules( - chunk, - filterFn, - moduleTemplate, - dependencyTemplates, - prefix = "" - ) { - const source = new ConcatSource(); - const modules = chunk.getModules().filter(filterFn); - let removedModules; - if (chunk instanceof HotUpdateChunk) { - removedModules = chunk.removedModules; - } - if ( - modules.length === 0 && - (!removedModules || removedModules.length === 0) - ) { - source.add("[]"); - return source; - } - /** @type {{id: string|number, source: Source|string}[]} */ - const allModules = modules.map(module => { - return { - id: module.id, - source: moduleTemplate.render(module, dependencyTemplates, { - chunk - }) + if (compilation.hooks.needAdditionalPass.call()) { + compilation.needAdditionalPass = true; + + const stats = new Stats(compilation); + stats.startTime = this.startTime; + stats.endTime = Date.now(); + this.compiler.hooks.done.callAsync(stats, err => { + if (err) return this._done(err); + + this.compiler.hooks.additionalPass.callAsync(err => { + if (err) return this._done(err); + this.compiler.compile(onCompiled); + }); + }); + return; + } + return this._done(null, compilation); + }); + }); }; + this.compiler.compile(onCompiled); }); - if (removedModules && removedModules.length > 0) { - for (const id of removedModules) { - allModules.push({ - id, - source: "false" - }); - } + } + + _getStats(compilation) { + const stats = new Stats(compilation); + stats.startTime = this.startTime; + stats.endTime = Date.now(); + return stats; + } + + _done(err, compilation) { + this.running = false; + if (this.invalid) return this._go(); + + const stats = compilation ? this._getStats(compilation) : null; + if (err) { + this.compiler.hooks.failed.call(err); + this.handler(err, stats); + return; } - const bounds = Template.getModulesArrayBounds(allModules); - if (bounds) { - // Render a spare array - const minId = bounds[0]; - const maxId = bounds[1]; - if (minId !== 0) { - source.add(`Array(${minId}).concat(`); - } - source.add("[\n"); - /** @type {Map} */ - const modules = new Map(); - for (const module of allModules) { - modules.set(module.id, module); + this.compiler.hooks.done.callAsync(stats, () => { + this.handler(null, stats); + if (!this.closed) { + this.watch( + Array.from(compilation.fileDependencies), + Array.from(compilation.contextDependencies), + Array.from(compilation.missingDependencies) + ); } - for (let idx = minId; idx <= maxId; idx++) { - const module = modules.get(idx); - if (idx !== minId) { - source.add(",\n"); + for (const cb of this.callbacks) cb(); + this.callbacks.length = 0; + }); + } + + watch(files, dirs, missing) { + this.pausedWatcher = null; + this.watcher = this.compiler.watchFileSystem.watch( + files, + dirs, + missing, + this.startTime, + this.watchOptions, + ( + err, + filesModified, + contextModified, + missingModified, + fileTimestamps, + contextTimestamps, + removedFiles + ) => { + this.pausedWatcher = this.watcher; + this.watcher = null; + if (err) { + return this.handler(err); } - source.add(`/* ${idx} */`); - if (module) { - source.add("\n"); - source.add(module.source); + this.compiler.fileTimestamps = fileTimestamps; + this.compiler.contextTimestamps = contextTimestamps; + this.compiler.removedFiles = removedFiles; + if (!this.suspended) { + this._invalidate(); } + }, + (fileName, changeTime) => { + this.compiler.hooks.invalid.call(fileName, changeTime); } - source.add("\n" + prefix + "]"); - if (minId !== 0) { - source.add(")"); - } + ); + } + + invalidate(callback) { + if (callback) { + this.callbacks.push(callback); + } + if (this.watcher) { + this.compiler.fileTimestamps = this.watcher.getFileTimestamps(); + this.compiler.contextTimestamps = this.watcher.getContextTimestamps(); + } + return this._invalidate(); + } + + _invalidate() { + if (this.watcher) { + this.pausedWatcher = this.watcher; + this.watcher.pause(); + this.watcher = null; + } + + if (this.running) { + this.invalid = true; + return false; } else { - // Render an object - source.add("{\n"); - allModules.sort(stringifyIdSortPredicate).forEach((module, idx) => { - if (idx !== 0) { - source.add(",\n"); - } - source.add(`\n/***/ ${JSON.stringify(module.id)}:\n`); - source.add(module.source); - }); - source.add(`\n\n${prefix}}`); + this._go(); + } + } + + suspend() { + this.suspended = true; + this.invalid = false; + } + + resume() { + if (this.suspended) { + this.suspended = false; + this._invalidate(); + } + } + + close(callback) { + const finalCallback = () => { + this.compiler.hooks.watchClose.call(); + this.compiler.running = false; + this.compiler.watchMode = false; + if (callback !== undefined) callback(); + }; + + this.closed = true; + if (this.watcher) { + this.watcher.close(); + this.watcher = null; + } + if (this.pausedWatcher) { + this.pausedWatcher.close(); + this.pausedWatcher = null; + } + if (this.running) { + this.invalid = true; + this._done = finalCallback; + } else { + finalCallback(); } - return source; } } -module.exports = Template; +module.exports = Watching; /***/ }), -/***/ 76032: -/***/ (function(module) { +/***/ 97391: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Jason Anderson @diurnalist + Author Jarid Margolin @jaridmargolin */ -const REGEXP_HASH = /\[hash(?::(\d+))?\]/gi, - REGEXP_CHUNKHASH = /\[chunkhash(?::(\d+))?\]/gi, - REGEXP_MODULEHASH = /\[modulehash(?::(\d+))?\]/gi, - REGEXP_CONTENTHASH = /\[contenthash(?::(\d+))?\]/gi, - REGEXP_NAME = /\[name\]/gi, - REGEXP_ID = /\[id\]/gi, - REGEXP_MODULEID = /\[moduleid\]/gi, - REGEXP_FILE = /\[file\]/gi, - REGEXP_QUERY = /\[query\]/gi, - REGEXP_FILEBASE = /\[filebase\]/gi, - REGEXP_URL = /\[url\]/gi; - -// Using global RegExp for .test is dangerous -// We use a normal RegExp instead of .test -const REGEXP_HASH_FOR_TEST = new RegExp(REGEXP_HASH.source, "i"), - REGEXP_CHUNKHASH_FOR_TEST = new RegExp(REGEXP_CHUNKHASH.source, "i"), - REGEXP_CONTENTHASH_FOR_TEST = new RegExp(REGEXP_CONTENTHASH.source, "i"), - REGEXP_NAME_FOR_TEST = new RegExp(REGEXP_NAME.source, "i"); - -const withHashLength = (replacer, handlerFn, assetInfo) => { - const fn = (match, hashLength, ...args) => { - if (assetInfo) assetInfo.immutable = true; - const length = hashLength && parseInt(hashLength, 10); - if (length && handlerFn) { - return handlerFn(length); - } - const hash = replacer(match, hashLength, ...args); - return length ? hash.slice(0, length) : hash; - }; - return fn; -}; - -const getReplacer = (value, allowEmpty) => { - const fn = (match, ...args) => { - // last argument in replacer is the entire input string - const input = args[args.length - 1]; - if (value === null || value === undefined) { - if (!allowEmpty) { - throw new Error( - `Path variable ${match} not implemented in this context: ${input}` - ); - } - return ""; - } else { - return `${escapePathVariables(value)}`; - } - }; - return fn; -}; - -const escapePathVariables = value => { - return typeof value === "string" - ? value.replace(/\[(\\*[\w:]+\\*)\]/gi, "[\\$1\\]") - : value; -}; +const inspect = __webpack_require__(31669).inspect.custom; -const replacePathVariables = (path, data, assetInfo) => { - const chunk = data.chunk; - const chunkId = chunk && chunk.id; - const chunkName = chunk && (chunk.name || chunk.id); - const chunkHash = chunk && (chunk.renderedHash || chunk.hash); - const chunkHashWithLength = chunk && chunk.hashWithLength; - const contentHashType = data.contentHashType; - const contentHash = - (chunk && chunk.contentHash && chunk.contentHash[contentHashType]) || - data.contentHash; - const contentHashWithLength = - (chunk && - chunk.contentHashWithLength && - chunk.contentHashWithLength[contentHashType]) || - data.contentHashWithLength; - const module = data.module; - const moduleId = module && module.id; - const moduleHash = module && (module.renderedHash || module.hash); - const moduleHashWithLength = module && module.hashWithLength; +class WebpackError extends Error { + /** + * Creates an instance of WebpackError. + * @param {string=} message error message + */ + constructor(message) { + super(message); - if (typeof path === "function") { - path = path(data); - } + this.details = undefined; + this.missing = undefined; + this.origin = undefined; + this.dependencies = undefined; + this.module = undefined; - if ( - data.noChunkHash && - (REGEXP_CHUNKHASH_FOR_TEST.test(path) || - REGEXP_CONTENTHASH_FOR_TEST.test(path)) - ) { - throw new Error( - `Cannot use [chunkhash] or [contenthash] for chunk in '${path}' (use [hash] instead)` - ); + Error.captureStackTrace(this, this.constructor); } - return ( - path - .replace( - REGEXP_HASH, - withHashLength(getReplacer(data.hash), data.hashWithLength, assetInfo) - ) - .replace( - REGEXP_CHUNKHASH, - withHashLength(getReplacer(chunkHash), chunkHashWithLength, assetInfo) - ) - .replace( - REGEXP_CONTENTHASH, - withHashLength( - getReplacer(contentHash), - contentHashWithLength, - assetInfo - ) - ) - .replace( - REGEXP_MODULEHASH, - withHashLength(getReplacer(moduleHash), moduleHashWithLength, assetInfo) - ) - .replace(REGEXP_ID, getReplacer(chunkId)) - .replace(REGEXP_MODULEID, getReplacer(moduleId)) - .replace(REGEXP_NAME, getReplacer(chunkName)) - .replace(REGEXP_FILE, getReplacer(data.filename)) - .replace(REGEXP_FILEBASE, getReplacer(data.basename)) - // query is optional, it's OK if it's in a path but there's nothing to replace it with - .replace(REGEXP_QUERY, getReplacer(data.query, true)) - // only available in sourceMappingURLComment - .replace(REGEXP_URL, getReplacer(data.url)) - .replace(/\[\\(\\*[\w:]+\\*)\\\]/gi, "[$1]") - ); -}; - -class TemplatedPathPlugin { - apply(compiler) { - compiler.hooks.compilation.tap("TemplatedPathPlugin", compilation => { - const mainTemplate = compilation.mainTemplate; - - mainTemplate.hooks.assetPath.tap( - "TemplatedPathPlugin", - replacePathVariables - ); - - mainTemplate.hooks.globalHash.tap( - "TemplatedPathPlugin", - (chunk, paths) => { - const outputOptions = mainTemplate.outputOptions; - const publicPath = outputOptions.publicPath || ""; - const filename = outputOptions.filename || ""; - const chunkFilename = - outputOptions.chunkFilename || outputOptions.filename; - if ( - REGEXP_HASH_FOR_TEST.test(publicPath) || - REGEXP_CHUNKHASH_FOR_TEST.test(publicPath) || - REGEXP_CONTENTHASH_FOR_TEST.test(publicPath) || - REGEXP_NAME_FOR_TEST.test(publicPath) - ) - return true; - if (REGEXP_HASH_FOR_TEST.test(filename)) return true; - if (REGEXP_HASH_FOR_TEST.test(chunkFilename)) return true; - if (REGEXP_HASH_FOR_TEST.test(paths.join("|"))) return true; - } - ); - - mainTemplate.hooks.hashForChunk.tap( - "TemplatedPathPlugin", - (hash, chunk) => { - const outputOptions = mainTemplate.outputOptions; - const chunkFilename = - outputOptions.chunkFilename || outputOptions.filename; - if (REGEXP_CHUNKHASH_FOR_TEST.test(chunkFilename)) { - hash.update(JSON.stringify(chunk.getChunkMaps(true).hash)); - } - if (REGEXP_CONTENTHASH_FOR_TEST.test(chunkFilename)) { - hash.update( - JSON.stringify( - chunk.getChunkMaps(true).contentHash.javascript || {} - ) - ); - } - if (REGEXP_NAME_FOR_TEST.test(chunkFilename)) { - hash.update(JSON.stringify(chunk.getChunkMaps(true).name)); - } - } - ); - }); + [inspect]() { + return this.stack + (this.details ? `\n${this.details}` : ""); } } -module.exports = TemplatedPathPlugin; +module.exports = WebpackError; /***/ }), -/***/ 75374: +/***/ 2779: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -75716,455 +72824,551 @@ module.exports = TemplatedPathPlugin; */ -const { ConcatSource, OriginalSource } = __webpack_require__(53665); -const Template = __webpack_require__(96066); +const OptionsApply = __webpack_require__(4428); -/** @typedef {import("../declarations/WebpackOptions").LibraryCustomUmdObject} LibraryCustomUmdObject */ -/** @typedef {import("./Compilation")} Compilation */ +const JavascriptModulesPlugin = __webpack_require__(10339); +const JsonModulesPlugin = __webpack_require__(2859); +const WebAssemblyModulesPlugin = __webpack_require__(99510); -/** - * @param {string[]} accessor the accessor to convert to path - * @returns {string} the path - */ -const accessorToObjectAccess = accessor => { - return accessor.map(a => `[${JSON.stringify(a)}]`).join(""); -}; +const LoaderTargetPlugin = __webpack_require__(95154); +const FunctionModulePlugin = __webpack_require__(31221); +const EvalDevToolModulePlugin = __webpack_require__(65200); +const SourceMapDevToolPlugin = __webpack_require__(11851); +const EvalSourceMapDevToolPlugin = __webpack_require__(99994); -/** - * @param {string=} base the path prefix - * @param {string|string[]} accessor the accessor - * @param {string=} joinWith the element separator - * @returns {string} the path - */ -const accessorAccess = (base, accessor, joinWith = ", ") => { - const accessors = Array.isArray(accessor) ? accessor : [accessor]; - return accessors - .map((_, idx) => { - const a = base - ? base + accessorToObjectAccess(accessors.slice(0, idx + 1)) - : accessors[0] + accessorToObjectAccess(accessors.slice(1, idx + 1)); - if (idx === accessors.length - 1) return a; - if (idx === 0 && base === undefined) - return `${a} = typeof ${a} === "object" ? ${a} : {}`; - return `${a} = ${a} || {}`; - }) - .join(joinWith); -}; +const EntryOptionPlugin = __webpack_require__(14604); +const RecordIdsPlugin = __webpack_require__(40355); -/** @typedef {string | string[] | LibraryCustomUmdObject} UmdMainTemplatePluginName */ +const APIPlugin = __webpack_require__(71118); +const ConstPlugin = __webpack_require__(84072); +const CommonJsStuffPlugin = __webpack_require__(85736); +const CompatibilityPlugin = __webpack_require__(85918); -/** - * @typedef {Object} AuxiliaryCommentObject - * @property {string} root - * @property {string} commonjs - * @property {string} commonjs2 - * @property {string} amd - */ +const TemplatedPathPlugin = __webpack_require__(76032); +const WarnCaseSensitiveModulesPlugin = __webpack_require__(40269); +const UseStrictPlugin = __webpack_require__(73554); -/** - * @typedef {Object} UmdMainTemplatePluginOption - * @property {boolean=} optionalAmdExternalAsGlobal - * @property {boolean} namedDefine - * @property {string | AuxiliaryCommentObject} auxiliaryComment - */ +const LoaderPlugin = __webpack_require__(31559); +const CommonJsPlugin = __webpack_require__(85358); +const HarmonyModulesPlugin = __webpack_require__(66792); +const SystemPlugin = __webpack_require__(68166); +const ImportPlugin = __webpack_require__(58839); +const RequireContextPlugin = __webpack_require__(89042); +const RequireEnsurePlugin = __webpack_require__(98655); +const RequireIncludePlugin = __webpack_require__(16522); -class UmdMainTemplatePlugin { - /** - * @param {UmdMainTemplatePluginName} name the name of the UMD library - * @param {UmdMainTemplatePluginOption} options the plugin option - */ - constructor(name, options) { - if (typeof name === "object" && !Array.isArray(name)) { - this.name = name.root || name.amd || name.commonjs; - this.names = name; - } else { - this.name = name; - this.names = { - commonjs: name, - root: name, - amd: name - }; - } - this.optionalAmdExternalAsGlobal = options.optionalAmdExternalAsGlobal; - this.namedDefine = options.namedDefine; - this.auxiliaryComment = options.auxiliaryComment; +const { cachedCleverMerge } = __webpack_require__(67916); + +/** @typedef {import("../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ +/** @typedef {import("./Compiler")} Compiler */ + +class WebpackOptionsApply extends OptionsApply { + constructor() { + super(); } /** - * @param {Compilation} compilation the compilation instance - * @returns {void} + * @param {WebpackOptions} options options object + * @param {Compiler} compiler compiler object + * @returns {WebpackOptions} options object */ - apply(compilation) { - const { mainTemplate, chunkTemplate, runtimeTemplate } = compilation; + process(options, compiler) { + let ExternalsPlugin; + compiler.outputPath = options.output.path; + compiler.recordsInputPath = options.recordsInputPath || options.recordsPath; + compiler.recordsOutputPath = + options.recordsOutputPath || options.recordsPath; + compiler.name = options.name; + // TODO webpack 5 refactor this to MultiCompiler.setDependencies() with a WeakMap + // @ts-ignore TODO + compiler.dependencies = options.dependencies; + if (typeof options.target === "string") { + let JsonpTemplatePlugin; + let FetchCompileWasmTemplatePlugin; + let ReadFileCompileWasmTemplatePlugin; + let NodeSourcePlugin; + let NodeTargetPlugin; + let NodeTemplatePlugin; - const onRenderWithEntry = (source, chunk, hash) => { - let externals = chunk - .getModules() - .filter( - m => - m.external && - (m.externalType === "umd" || m.externalType === "umd2") - ); - const optionalExternals = []; - let requiredExternals = []; - if (this.optionalAmdExternalAsGlobal) { - for (const m of externals) { - if (m.optional) { - optionalExternals.push(m); - } else { - requiredExternals.push(m); - } + switch (options.target) { + case "web": + JsonpTemplatePlugin = __webpack_require__(92764); + FetchCompileWasmTemplatePlugin = __webpack_require__(52669); + NodeSourcePlugin = __webpack_require__(9128); + new JsonpTemplatePlugin().apply(compiler); + new FetchCompileWasmTemplatePlugin({ + mangleImports: options.optimization.mangleWasmImports + }).apply(compiler); + new FunctionModulePlugin().apply(compiler); + new NodeSourcePlugin(options.node).apply(compiler); + new LoaderTargetPlugin(options.target).apply(compiler); + break; + case "webworker": { + let WebWorkerTemplatePlugin = __webpack_require__(21328); + FetchCompileWasmTemplatePlugin = __webpack_require__(52669); + NodeSourcePlugin = __webpack_require__(9128); + new WebWorkerTemplatePlugin().apply(compiler); + new FetchCompileWasmTemplatePlugin({ + mangleImports: options.optimization.mangleWasmImports + }).apply(compiler); + new FunctionModulePlugin().apply(compiler); + new NodeSourcePlugin(options.node).apply(compiler); + new LoaderTargetPlugin(options.target).apply(compiler); + break; } - externals = requiredExternals.concat(optionalExternals); - } else { - requiredExternals = externals; + case "node": + case "async-node": + NodeTemplatePlugin = __webpack_require__(90010); + ReadFileCompileWasmTemplatePlugin = __webpack_require__(73839); + NodeTargetPlugin = __webpack_require__(59743); + new NodeTemplatePlugin({ + asyncChunkLoading: options.target === "async-node" + }).apply(compiler); + new ReadFileCompileWasmTemplatePlugin({ + mangleImports: options.optimization.mangleWasmImports + }).apply(compiler); + new FunctionModulePlugin().apply(compiler); + new NodeTargetPlugin().apply(compiler); + new LoaderTargetPlugin("node").apply(compiler); + break; + case "node-webkit": + JsonpTemplatePlugin = __webpack_require__(92764); + NodeTargetPlugin = __webpack_require__(59743); + ExternalsPlugin = __webpack_require__(75705); + new JsonpTemplatePlugin().apply(compiler); + new FunctionModulePlugin().apply(compiler); + new NodeTargetPlugin().apply(compiler); + new ExternalsPlugin("commonjs", "nw.gui").apply(compiler); + new LoaderTargetPlugin(options.target).apply(compiler); + break; + case "electron-main": + NodeTemplatePlugin = __webpack_require__(90010); + NodeTargetPlugin = __webpack_require__(59743); + ExternalsPlugin = __webpack_require__(75705); + new NodeTemplatePlugin({ + asyncChunkLoading: true + }).apply(compiler); + new FunctionModulePlugin().apply(compiler); + new NodeTargetPlugin().apply(compiler); + new ExternalsPlugin("commonjs", [ + "app", + "auto-updater", + "browser-window", + "clipboard", + "content-tracing", + "crash-reporter", + "dialog", + "electron", + "global-shortcut", + "ipc", + "ipc-main", + "menu", + "menu-item", + "native-image", + "original-fs", + "power-monitor", + "power-save-blocker", + "protocol", + "screen", + "session", + "shell", + "tray", + "web-contents" + ]).apply(compiler); + new LoaderTargetPlugin(options.target).apply(compiler); + break; + case "electron-renderer": + case "electron-preload": + FetchCompileWasmTemplatePlugin = __webpack_require__(52669); + NodeTargetPlugin = __webpack_require__(59743); + ExternalsPlugin = __webpack_require__(75705); + if (options.target === "electron-renderer") { + JsonpTemplatePlugin = __webpack_require__(92764); + new JsonpTemplatePlugin().apply(compiler); + } else if (options.target === "electron-preload") { + NodeTemplatePlugin = __webpack_require__(90010); + new NodeTemplatePlugin({ + asyncChunkLoading: true + }).apply(compiler); + } + new FetchCompileWasmTemplatePlugin({ + mangleImports: options.optimization.mangleWasmImports + }).apply(compiler); + new FunctionModulePlugin().apply(compiler); + new NodeTargetPlugin().apply(compiler); + new ExternalsPlugin("commonjs", [ + "clipboard", + "crash-reporter", + "desktop-capturer", + "electron", + "ipc", + "ipc-renderer", + "native-image", + "original-fs", + "remote", + "screen", + "shell", + "web-frame" + ]).apply(compiler); + new LoaderTargetPlugin(options.target).apply(compiler); + break; + default: + throw new Error("Unsupported target '" + options.target + "'."); } + } + // @ts-ignore This is always true, which is good this way + else if (options.target !== false) { + options.target(compiler); + } else { + throw new Error("Unsupported target '" + options.target + "'."); + } - const replaceKeys = str => { - return mainTemplate.getAssetPath(str, { - hash, - chunk - }); - }; - - const externalsDepsArray = modules => { - return `[${replaceKeys( - modules - .map(m => - JSON.stringify( - typeof m.request === "object" ? m.request.amd : m.request - ) - ) - .join(", ") - )}]`; - }; - - const externalsRootArray = modules => { - return replaceKeys( - modules - .map(m => { - let request = m.request; - if (typeof request === "object") request = request.root; - return `root${accessorToObjectAccess([].concat(request))}`; - }) - .join(", ") - ); - }; - - const externalsRequireArray = type => { - return replaceKeys( - externals - .map(m => { - let expr; - let request = m.request; - if (typeof request === "object") { - request = request[type]; - } - if (request === undefined) { - throw new Error( - "Missing external configuration for type:" + type - ); - } - if (Array.isArray(request)) { - expr = `require(${JSON.stringify( - request[0] - )})${accessorToObjectAccess(request.slice(1))}`; - } else { - expr = `require(${JSON.stringify(request)})`; - } - if (m.optional) { - expr = `(function webpackLoadOptionalExternalModule() { try { return ${expr}; } catch(e) {} }())`; - } - return expr; - }) - .join(", ") - ); - }; - - const externalsArguments = modules => { - return modules - .map( - m => - `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(`${m.id}`)}__` - ) - .join(", "); - }; - - const libraryName = library => { - return JSON.stringify(replaceKeys([].concat(library).pop())); - }; - - let amdFactory; - if (optionalExternals.length > 0) { - const wrapperArguments = externalsArguments(requiredExternals); - const factoryArguments = - requiredExternals.length > 0 - ? externalsArguments(requiredExternals) + - ", " + - externalsRootArray(optionalExternals) - : externalsRootArray(optionalExternals); - amdFactory = - `function webpackLoadOptionalExternalModuleAmd(${wrapperArguments}) {\n` + - ` return factory(${factoryArguments});\n` + - " }"; - } else { - amdFactory = "factory"; - } + if (options.output.library || options.output.libraryTarget !== "var") { + const LibraryTemplatePlugin = __webpack_require__(65237); + new LibraryTemplatePlugin( + options.output.library, + options.output.libraryTarget, + options.output.umdNamedDefine, + options.output.auxiliaryComment || "", + options.output.libraryExport + ).apply(compiler); + } + if (options.externals) { + ExternalsPlugin = __webpack_require__(75705); + new ExternalsPlugin( + options.output.libraryTarget, + options.externals + ).apply(compiler); + } - const auxiliaryComment = this.auxiliaryComment; + let noSources; + let legacy; + let modern; + let comment; + if ( + options.devtool && + (options.devtool.includes("sourcemap") || + options.devtool.includes("source-map")) + ) { + const hidden = options.devtool.includes("hidden"); + const inline = options.devtool.includes("inline"); + const evalWrapped = options.devtool.includes("eval"); + const cheap = options.devtool.includes("cheap"); + const moduleMaps = options.devtool.includes("module"); + noSources = options.devtool.includes("nosources"); + legacy = options.devtool.includes("@"); + modern = options.devtool.includes("#"); + comment = + legacy && modern + ? "\n/*\n//@ source" + + "MappingURL=[url]\n//# source" + + "MappingURL=[url]\n*/" + : legacy + ? "\n/*\n//@ source" + "MappingURL=[url]\n*/" + : modern + ? "\n//# source" + "MappingURL=[url]" + : null; + const Plugin = evalWrapped + ? EvalSourceMapDevToolPlugin + : SourceMapDevToolPlugin; + new Plugin({ + filename: inline ? null : options.output.sourceMapFilename, + moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate, + fallbackModuleFilenameTemplate: + options.output.devtoolFallbackModuleFilenameTemplate, + append: hidden ? false : comment, + module: moduleMaps ? true : cheap ? false : true, + columns: cheap ? false : true, + lineToLine: options.output.devtoolLineToLine, + noSources: noSources, + namespace: options.output.devtoolNamespace + }).apply(compiler); + } else if (options.devtool && options.devtool.includes("eval")) { + legacy = options.devtool.includes("@"); + modern = options.devtool.includes("#"); + comment = + legacy && modern + ? "\n//@ sourceURL=[url]\n//# sourceURL=[url]" + : legacy + ? "\n//@ sourceURL=[url]" + : modern + ? "\n//# sourceURL=[url]" + : null; + new EvalDevToolModulePlugin({ + sourceUrlComment: comment, + moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate, + namespace: options.output.devtoolNamespace + }).apply(compiler); + } - const getAuxilaryComment = type => { - if (auxiliaryComment) { - if (typeof auxiliaryComment === "string") - return "\t//" + auxiliaryComment + "\n"; - if (auxiliaryComment[type]) - return "\t//" + auxiliaryComment[type] + "\n"; - } - return ""; - }; + new JavascriptModulesPlugin().apply(compiler); + new JsonModulesPlugin().apply(compiler); + new WebAssemblyModulesPlugin({ + mangleImports: options.optimization.mangleWasmImports + }).apply(compiler); - return new ConcatSource( - new OriginalSource( - "(function webpackUniversalModuleDefinition(root, factory) {\n" + - getAuxilaryComment("commonjs2") + - " if(typeof exports === 'object' && typeof module === 'object')\n" + - " module.exports = factory(" + - externalsRequireArray("commonjs2") + - ");\n" + - getAuxilaryComment("amd") + - " else if(typeof define === 'function' && define.amd)\n" + - (requiredExternals.length > 0 - ? this.names.amd && this.namedDefine === true - ? " define(" + - libraryName(this.names.amd) + - ", " + - externalsDepsArray(requiredExternals) + - ", " + - amdFactory + - ");\n" - : " define(" + - externalsDepsArray(requiredExternals) + - ", " + - amdFactory + - ");\n" - : this.names.amd && this.namedDefine === true - ? " define(" + - libraryName(this.names.amd) + - ", [], " + - amdFactory + - ");\n" - : " define([], " + amdFactory + ");\n") + - (this.names.root || this.names.commonjs - ? getAuxilaryComment("commonjs") + - " else if(typeof exports === 'object')\n" + - " exports[" + - libraryName(this.names.commonjs || this.names.root) + - "] = factory(" + - externalsRequireArray("commonjs") + - ");\n" + - getAuxilaryComment("root") + - " else\n" + - " " + - replaceKeys( - accessorAccess("root", this.names.root || this.names.commonjs) - ) + - " = factory(" + - externalsRootArray(externals) + - ");\n" - : " else {\n" + - (externals.length > 0 - ? " var a = typeof exports === 'object' ? factory(" + - externalsRequireArray("commonjs") + - ") : factory(" + - externalsRootArray(externals) + - ");\n" - : " var a = factory();\n") + - " for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n" + - " }\n") + - `})(${ - runtimeTemplate.outputOptions.globalObject - }, function(${externalsArguments(externals)}) {\nreturn `, - "webpack/universalModuleDefinition" - ), - source, - ";\n})" - ); - }; + new EntryOptionPlugin().apply(compiler); + compiler.hooks.entryOption.call(options.context, options.entry); - for (const template of [mainTemplate, chunkTemplate]) { - template.hooks.renderWithEntry.tap( - "UmdMainTemplatePlugin", - onRenderWithEntry - ); + new CompatibilityPlugin().apply(compiler); + new HarmonyModulesPlugin(options.module).apply(compiler); + if (options.amd !== false) { + const AMDPlugin = __webpack_require__(85812); + const RequireJsStuffPlugin = __webpack_require__(88226); + new AMDPlugin(options.module, options.amd || {}).apply(compiler); + new RequireJsStuffPlugin().apply(compiler); } + new CommonJsPlugin(options.module).apply(compiler); + new LoaderPlugin().apply(compiler); + if (options.node !== false) { + const NodeStuffPlugin = __webpack_require__(28386); + new NodeStuffPlugin(options.node).apply(compiler); + } + new CommonJsStuffPlugin().apply(compiler); + new APIPlugin().apply(compiler); + new ConstPlugin().apply(compiler); + new UseStrictPlugin().apply(compiler); + new RequireIncludePlugin().apply(compiler); + new RequireEnsurePlugin().apply(compiler); + new RequireContextPlugin( + options.resolve.modules, + options.resolve.extensions, + options.resolve.mainFiles + ).apply(compiler); + new ImportPlugin(options.module).apply(compiler); + new SystemPlugin(options.module).apply(compiler); - mainTemplate.hooks.globalHashPaths.tap("UmdMainTemplatePlugin", paths => { - if (this.names.root) paths = paths.concat(this.names.root); - if (this.names.amd) paths = paths.concat(this.names.amd); - if (this.names.commonjs) paths = paths.concat(this.names.commonjs); - return paths; - }); - - mainTemplate.hooks.hash.tap("UmdMainTemplatePlugin", hash => { - hash.update("umd"); - hash.update(`${this.names.root}`); - hash.update(`${this.names.amd}`); - hash.update(`${this.names.commonjs}`); - }); - } -} + if (typeof options.mode !== "string") { + const WarnNoModeSetPlugin = __webpack_require__(71245); + new WarnNoModeSetPlugin().apply(compiler); + } -module.exports = UmdMainTemplatePlugin; - - -/***/ }), - -/***/ 99953: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const WebpackError = __webpack_require__(97391); - -/** @typedef {import("./Module")} Module */ -/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ - -class UnsupportedFeatureWarning extends WebpackError { - /** - * @param {Module} module module relevant to warning - * @param {string} message description of warning - * @param {DependencyLocation} loc location start and end positions of the module - */ - constructor(module, message, loc) { - super(message); - - this.name = "UnsupportedFeatureWarning"; - this.module = module; - this.loc = loc; - this.hideStack = true; - - Error.captureStackTrace(this, this.constructor); - } -} - -module.exports = UnsupportedFeatureWarning; - - -/***/ }), - -/***/ 73554: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const ConstDependency = __webpack_require__(71101); - -/** @typedef {import("./Compiler")} Compiler */ - -class UseStrictPlugin { - /** - * @param {Compiler} compiler Webpack Compiler - * @returns {void} - */ - apply(compiler) { - compiler.hooks.compilation.tap( - "UseStrictPlugin", - (compilation, { normalModuleFactory }) => { - const handler = parser => { - parser.hooks.program.tap("UseStrictPlugin", ast => { - const firstNode = ast.body[0]; - if ( - firstNode && - firstNode.type === "ExpressionStatement" && - firstNode.expression.type === "Literal" && - firstNode.expression.value === "use strict" - ) { - // Remove "use strict" expression. It will be added later by the renderer again. - // This is necessary in order to not break the strict mode when webpack prepends code. - // @see https://github.com/webpack/webpack/issues/1970 - const dep = new ConstDependency("", firstNode.range); - dep.loc = firstNode.loc; - parser.state.current.addDependency(dep); - parser.state.module.buildInfo.strict = true; - } - }); - }; - - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("UseStrictPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("UseStrictPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("UseStrictPlugin", handler); + const EnsureChunkConditionsPlugin = __webpack_require__(29720); + new EnsureChunkConditionsPlugin().apply(compiler); + if (options.optimization.removeAvailableModules) { + const RemoveParentModulesPlugin = __webpack_require__(58142); + new RemoveParentModulesPlugin().apply(compiler); + } + if (options.optimization.removeEmptyChunks) { + const RemoveEmptyChunksPlugin = __webpack_require__(78085); + new RemoveEmptyChunksPlugin().apply(compiler); + } + if (options.optimization.mergeDuplicateChunks) { + const MergeDuplicateChunksPlugin = __webpack_require__(46214); + new MergeDuplicateChunksPlugin().apply(compiler); + } + if (options.optimization.flagIncludedChunks) { + const FlagIncludedChunksPlugin = __webpack_require__(25850); + new FlagIncludedChunksPlugin().apply(compiler); + } + if (options.optimization.sideEffects) { + const SideEffectsFlagPlugin = __webpack_require__(83654); + new SideEffectsFlagPlugin().apply(compiler); + } + if (options.optimization.providedExports) { + const FlagDependencyExportsPlugin = __webpack_require__(73599); + new FlagDependencyExportsPlugin().apply(compiler); + } + if (options.optimization.usedExports) { + const FlagDependencyUsagePlugin = __webpack_require__(33632); + new FlagDependencyUsagePlugin().apply(compiler); + } + if (options.optimization.concatenateModules) { + const ModuleConcatenationPlugin = __webpack_require__(45184); + new ModuleConcatenationPlugin().apply(compiler); + } + if (options.optimization.splitChunks) { + const SplitChunksPlugin = __webpack_require__(60474); + new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler); + } + if (options.optimization.runtimeChunk) { + const RuntimeChunkPlugin = __webpack_require__(76894); + new RuntimeChunkPlugin(options.optimization.runtimeChunk).apply(compiler); + } + if (options.optimization.noEmitOnErrors) { + const NoEmitOnErrorsPlugin = __webpack_require__(22615); + new NoEmitOnErrorsPlugin().apply(compiler); + } + if (options.optimization.checkWasmTypes) { + const WasmFinalizeExportsPlugin = __webpack_require__(10557); + new WasmFinalizeExportsPlugin().apply(compiler); + } + let moduleIds = options.optimization.moduleIds; + if (moduleIds === undefined) { + // TODO webpack 5 remove all these options + if (options.optimization.occurrenceOrder) { + moduleIds = "size"; } - ); - } -} - -module.exports = UseStrictPlugin; - + if (options.optimization.namedModules) { + moduleIds = "named"; + } + if (options.optimization.hashedModuleIds) { + moduleIds = "hashed"; + } + if (moduleIds === undefined) { + moduleIds = "natural"; + } + } + if (moduleIds) { + const NamedModulesPlugin = __webpack_require__(86707); + const HashedModuleIdsPlugin = __webpack_require__(50268); + const OccurrenceModuleOrderPlugin = __webpack_require__(62000); + switch (moduleIds) { + case "natural": + // TODO webpack 5: see hint in Compilation.sortModules + break; + case "named": + new NamedModulesPlugin().apply(compiler); + break; + case "hashed": + new HashedModuleIdsPlugin().apply(compiler); + break; + case "size": + new OccurrenceModuleOrderPlugin({ + prioritiseInitial: true + }).apply(compiler); + break; + case "total-size": + new OccurrenceModuleOrderPlugin({ + prioritiseInitial: false + }).apply(compiler); + break; + default: + throw new Error( + `webpack bug: moduleIds: ${moduleIds} is not implemented` + ); + } + } + let chunkIds = options.optimization.chunkIds; + if (chunkIds === undefined) { + // TODO webpack 5 remove all these options + if (options.optimization.occurrenceOrder) { + // This looks weird but it's for backward-compat + // This bug already existed before adding this feature + chunkIds = "total-size"; + } + if (options.optimization.namedChunks) { + chunkIds = "named"; + } + if (chunkIds === undefined) { + chunkIds = "natural"; + } + } + if (chunkIds) { + const NaturalChunkOrderPlugin = __webpack_require__(68053); + const NamedChunksPlugin = __webpack_require__(70419); + const OccurrenceChunkOrderPlugin = __webpack_require__(83741); + switch (chunkIds) { + case "natural": + new NaturalChunkOrderPlugin().apply(compiler); + break; + case "named": + // TODO webapck 5: for backward-compat this need to have OccurrenceChunkOrderPlugin too + // The NamedChunksPlugin doesn't give every chunk a name + // This should be fixed, and the OccurrenceChunkOrderPlugin should be removed here. + new OccurrenceChunkOrderPlugin({ + prioritiseInitial: false + }).apply(compiler); + new NamedChunksPlugin().apply(compiler); + break; + case "size": + new OccurrenceChunkOrderPlugin({ + prioritiseInitial: true + }).apply(compiler); + break; + case "total-size": + new OccurrenceChunkOrderPlugin({ + prioritiseInitial: false + }).apply(compiler); + break; + default: + throw new Error( + `webpack bug: chunkIds: ${chunkIds} is not implemented` + ); + } + } + if (options.optimization.nodeEnv) { + const DefinePlugin = __webpack_require__(97374); + new DefinePlugin({ + "process.env.NODE_ENV": JSON.stringify(options.optimization.nodeEnv) + }).apply(compiler); + } + if (options.optimization.minimize) { + for (const minimizer of options.optimization.minimizer) { + if (typeof minimizer === "function") { + minimizer.call(compiler, compiler); + } else { + minimizer.apply(compiler); + } + } + } -/***/ }), + if (options.performance) { + const SizeLimitsPlugin = __webpack_require__(68310); + new SizeLimitsPlugin(options.performance).apply(compiler); + } -/***/ 40269: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + new TemplatedPathPlugin().apply(compiler); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + new RecordIdsPlugin({ + portableIds: options.optimization.portableRecords + }).apply(compiler); + new WarnCaseSensitiveModulesPlugin().apply(compiler); -const CaseSensitiveModulesWarning = __webpack_require__(8335); + if (options.cache) { + const CachePlugin = __webpack_require__(6465); + new CachePlugin( + typeof options.cache === "object" ? options.cache : null + ).apply(compiler); + } -class WarnCaseSensitiveModulesPlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "WarnCaseSensitiveModulesPlugin", - compilation => { - compilation.hooks.seal.tap("WarnCaseSensitiveModulesPlugin", () => { - const moduleWithoutCase = new Map(); - for (const module of compilation.modules) { - const identifier = module.identifier().toLowerCase(); - const array = moduleWithoutCase.get(identifier); - if (array) { - array.push(module); - } else { - moduleWithoutCase.set(identifier, [module]); - } - } - for (const pair of moduleWithoutCase) { - const array = pair[1]; - if (array.length > 1) { - compilation.warnings.push(new CaseSensitiveModulesWarning(array)); - } - } - }); - } - ); + compiler.hooks.afterPlugins.call(compiler); + if (!compiler.inputFileSystem) { + throw new Error("No input filesystem provided"); + } + compiler.resolverFactory.hooks.resolveOptions + .for("normal") + .tap("WebpackOptionsApply", resolveOptions => { + return Object.assign( + { + fileSystem: compiler.inputFileSystem + }, + cachedCleverMerge(options.resolve, resolveOptions) + ); + }); + compiler.resolverFactory.hooks.resolveOptions + .for("context") + .tap("WebpackOptionsApply", resolveOptions => { + return Object.assign( + { + fileSystem: compiler.inputFileSystem, + resolveToContext: true + }, + cachedCleverMerge(options.resolve, resolveOptions) + ); + }); + compiler.resolverFactory.hooks.resolveOptions + .for("loader") + .tap("WebpackOptionsApply", resolveOptions => { + return Object.assign( + { + fileSystem: compiler.inputFileSystem + }, + cachedCleverMerge(options.resolveLoader, resolveOptions) + ); + }); + compiler.hooks.afterResolvers.call(compiler); + return options; } } -module.exports = WarnCaseSensitiveModulesPlugin; +module.exports = WebpackOptionsApply; /***/ }), -/***/ 71245: +/***/ 60016: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -76174,2468 +73378,2754 @@ module.exports = WarnCaseSensitiveModulesPlugin; */ -const NoModeWarning = __webpack_require__(45759); - -class WarnNoModeSetPlugin { - apply(compiler) { - compiler.hooks.thisCompilation.tap("WarnNoModeSetPlugin", compilation => { - compilation.warnings.push(new NoModeWarning()); - }); - } -} - -module.exports = WarnNoModeSetPlugin; - - -/***/ }), - -/***/ 88015: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +const path = __webpack_require__(85622); +const OptionsDefaulter = __webpack_require__(3414); +const Template = __webpack_require__(96066); -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(97009); +const isProductionLikeMode = options => { + return options.mode === "production" || !options.mode; +}; -/** @typedef {import("../declarations/plugins/WatchIgnorePlugin").WatchIgnorePluginOptions} WatchIgnorePluginOptions */ +const isWebLikeTarget = options => { + return options.target === "web" || options.target === "webworker"; +}; -class IgnoringWatchFileSystem { - constructor(wfs, paths) { - this.wfs = wfs; - this.paths = paths; +const getDevtoolNamespace = library => { + // if options.output.library is a string + if (Array.isArray(library)) { + return library.join("."); + } else if (typeof library === "object") { + return getDevtoolNamespace(library.root); } + return library || ""; +}; - watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) { - const ignored = path => - this.paths.some(p => - p instanceof RegExp ? p.test(path) : path.indexOf(p) === 0 - ); - - const notIgnored = path => !ignored(path); +class WebpackOptionsDefaulter extends OptionsDefaulter { + constructor() { + super(); - const ignoredFiles = files.filter(ignored); - const ignoredDirs = dirs.filter(ignored); + this.set("entry", "./src"); - const watcher = this.wfs.watch( - files.filter(notIgnored), - dirs.filter(notIgnored), - missing, - startTime, - options, - ( - err, - filesModified, - dirsModified, - missingModified, - fileTimestamps, - dirTimestamps, - removedFiles - ) => { - if (err) return callback(err); - for (const path of ignoredFiles) { - fileTimestamps.set(path, 1); - } + this.set("devtool", "make", options => + options.mode === "development" ? "eval" : false + ); + this.set("cache", "make", options => options.mode === "development"); - for (const path of ignoredDirs) { - dirTimestamps.set(path, 1); - } + this.set("context", process.cwd()); + this.set("target", "web"); - callback( - err, - filesModified, - dirsModified, - missingModified, - fileTimestamps, - dirTimestamps, - removedFiles - ); + this.set("module", "call", value => Object.assign({}, value)); + this.set("module.unknownContextRequest", "."); + this.set("module.unknownContextRegExp", false); + this.set("module.unknownContextRecursive", true); + this.set("module.unknownContextCritical", true); + this.set("module.exprContextRequest", "."); + this.set("module.exprContextRegExp", false); + this.set("module.exprContextRecursive", true); + this.set("module.exprContextCritical", true); + this.set("module.wrappedContextRegExp", /.*/); + this.set("module.wrappedContextRecursive", true); + this.set("module.wrappedContextCritical", false); + this.set("module.strictExportPresence", false); + this.set("module.strictThisContextOnImports", false); + this.set("module.unsafeCache", "make", options => !!options.cache); + this.set("module.rules", []); + this.set("module.defaultRules", "make", options => [ + { + type: "javascript/auto", + resolve: {} }, - callbackUndelayed - ); - - return { - close: () => watcher.close(), - pause: () => watcher.pause(), - getContextTimestamps: () => { - const dirTimestamps = watcher.getContextTimestamps(); - for (const path of ignoredDirs) { - dirTimestamps.set(path, 1); + { + test: /\.mjs$/i, + type: "javascript/esm", + resolve: { + mainFields: + options.target === "web" || + options.target === "webworker" || + options.target === "electron-renderer" + ? ["browser", "main"] + : ["main"] } - return dirTimestamps; }, - getFileTimestamps: () => { - const fileTimestamps = watcher.getFileTimestamps(); - for (const path of ignoredFiles) { - fileTimestamps.set(path, 1); - } - return fileTimestamps; + { + test: /\.json$/i, + type: "json" + }, + { + test: /\.wasm$/i, + type: "webassembly/experimental" } - }; - } -} - -class WatchIgnorePlugin { - /** - * @param {WatchIgnorePluginOptions} paths list of paths - */ - constructor(paths) { - validateOptions(schema, paths, "Watch Ignore Plugin"); - this.paths = paths; - } + ]); - apply(compiler) { - compiler.hooks.afterEnvironment.tap("WatchIgnorePlugin", () => { - compiler.watchFileSystem = new IgnoringWatchFileSystem( - compiler.watchFileSystem, - this.paths + this.set("output", "call", (value, options) => { + if (typeof value === "string") { + return { + filename: value + }; + } else if (typeof value !== "object") { + return {}; + } else { + return Object.assign({}, value); + } + }); + + this.set("output.filename", "[name].js"); + this.set("output.chunkFilename", "make", options => { + const filename = options.output.filename; + if (typeof filename !== "function") { + const hasName = filename.includes("[name]"); + const hasId = filename.includes("[id]"); + const hasChunkHash = filename.includes("[chunkhash]"); + // Anything changing depending on chunk is fine + if (hasChunkHash || hasName || hasId) return filename; + // Elsewise prefix "[id]." in front of the basename to make it changing + return filename.replace(/(^|\/)([^/]*(?:\?|$))/, "$1[id].$2"); + } + return "[id].js"; + }); + this.set("output.webassemblyModuleFilename", "[modulehash].module.wasm"); + this.set("output.library", ""); + this.set("output.hotUpdateFunction", "make", options => { + return Template.toIdentifier( + "webpackHotUpdate" + Template.toIdentifier(options.output.library) + ); + }); + this.set("output.jsonpFunction", "make", options => { + return Template.toIdentifier( + "webpackJsonp" + Template.toIdentifier(options.output.library) + ); + }); + this.set("output.chunkCallbackName", "make", options => { + return Template.toIdentifier( + "webpackChunk" + Template.toIdentifier(options.output.library) + ); + }); + this.set("output.globalObject", "make", options => { + switch (options.target) { + case "web": + case "electron-renderer": + case "node-webkit": + return "window"; + case "webworker": + return "self"; + case "node": + case "async-node": + case "electron-main": + return "global"; + default: + return "self"; + } + }); + this.set("output.devtoolNamespace", "make", options => { + return getDevtoolNamespace(options.output.library); + }); + this.set("output.libraryTarget", "var"); + this.set("output.path", path.join(process.cwd(), "dist")); + this.set( + "output.pathinfo", + "make", + options => options.mode === "development" + ); + this.set("output.sourceMapFilename", "[file].map[query]"); + this.set("output.hotUpdateChunkFilename", "[id].[hash].hot-update.js"); + this.set("output.hotUpdateMainFilename", "[hash].hot-update.json"); + this.set("output.crossOriginLoading", false); + this.set("output.jsonpScriptType", false); + this.set("output.chunkLoadTimeout", 120000); + this.set("output.hashFunction", "md4"); + this.set("output.hashDigest", "hex"); + this.set("output.hashDigestLength", 20); + this.set("output.devtoolLineToLine", false); + this.set("output.strictModuleExceptionHandling", false); + + this.set("node", "call", value => { + if (typeof value === "boolean") { + return value; + } else { + return Object.assign({}, value); + } + }); + this.set("node.console", false); + this.set("node.process", true); + this.set("node.global", true); + this.set("node.Buffer", true); + this.set("node.setImmediate", true); + this.set("node.__filename", "mock"); + this.set("node.__dirname", "mock"); + + this.set("performance", "call", (value, options) => { + if (value === false) return false; + if ( + value === undefined && + (!isProductionLikeMode(options) || !isWebLikeTarget(options)) + ) + return false; + return Object.assign({}, value); + }); + this.set("performance.maxAssetSize", 250000); + this.set("performance.maxEntrypointSize", 250000); + this.set("performance.hints", "make", options => + isProductionLikeMode(options) ? "warning" : false + ); + + this.set("optimization", "call", value => Object.assign({}, value)); + // TODO webpack 5: Disable by default in a modes + this.set( + "optimization.removeAvailableModules", + "make", + options => options.mode !== "development" + ); + this.set("optimization.removeEmptyChunks", true); + this.set("optimization.mergeDuplicateChunks", true); + this.set("optimization.flagIncludedChunks", "make", options => + isProductionLikeMode(options) + ); + // TODO webpack 5 add `moduleIds: "named"` default for development + // TODO webpack 5 add `moduleIds: "size"` default for production + // TODO webpack 5 remove optimization.occurrenceOrder + this.set("optimization.occurrenceOrder", "make", options => + isProductionLikeMode(options) + ); + this.set("optimization.sideEffects", "make", options => + isProductionLikeMode(options) + ); + this.set("optimization.providedExports", true); + this.set("optimization.usedExports", "make", options => + isProductionLikeMode(options) + ); + this.set("optimization.concatenateModules", "make", options => + isProductionLikeMode(options) + ); + this.set("optimization.splitChunks", {}); + this.set("optimization.splitChunks.hidePathInfo", "make", options => { + return isProductionLikeMode(options); + }); + this.set("optimization.splitChunks.chunks", "async"); + this.set("optimization.splitChunks.minSize", "make", options => { + return isProductionLikeMode(options) ? 30000 : 10000; + }); + this.set("optimization.splitChunks.minChunks", 1); + this.set("optimization.splitChunks.maxAsyncRequests", "make", options => { + return isProductionLikeMode(options) ? 5 : Infinity; + }); + this.set("optimization.splitChunks.automaticNameDelimiter", "~"); + this.set("optimization.splitChunks.automaticNameMaxLength", 109); + this.set("optimization.splitChunks.maxInitialRequests", "make", options => { + return isProductionLikeMode(options) ? 3 : Infinity; + }); + this.set("optimization.splitChunks.name", true); + this.set("optimization.splitChunks.cacheGroups", {}); + this.set("optimization.splitChunks.cacheGroups.default", { + automaticNamePrefix: "", + reuseExistingChunk: true, + minChunks: 2, + priority: -20 + }); + this.set("optimization.splitChunks.cacheGroups.vendors", { + automaticNamePrefix: "vendors", + test: /[\\/]node_modules[\\/]/, + priority: -10 + }); + this.set("optimization.runtimeChunk", "call", value => { + if (value === "single") { + return { + name: "runtime" + }; + } + if (value === true || value === "multiple") { + return { + name: entrypoint => `runtime~${entrypoint.name}` + }; + } + return value; + }); + this.set("optimization.noEmitOnErrors", "make", options => + isProductionLikeMode(options) + ); + this.set("optimization.checkWasmTypes", "make", options => + isProductionLikeMode(options) + ); + this.set("optimization.mangleWasmImports", false); + // TODO webpack 5 remove optimization.namedModules + this.set( + "optimization.namedModules", + "make", + options => options.mode === "development" + ); + this.set("optimization.hashedModuleIds", false); + // TODO webpack 5 add `chunkIds: "named"` default for development + // TODO webpack 5 add `chunkIds: "size"` default for production + // TODO webpack 5 remove optimization.namedChunks + this.set( + "optimization.namedChunks", + "make", + options => options.mode === "development" + ); + this.set( + "optimization.portableRecords", + "make", + options => + !!( + options.recordsInputPath || + options.recordsOutputPath || + options.recordsPath + ) + ); + this.set("optimization.minimize", "make", options => + isProductionLikeMode(options) + ); + this.set("optimization.minimizer", "make", options => [ + { + apply: compiler => { + // Lazy load the Terser plugin + const TerserPlugin = __webpack_require__(89301); + const SourceMapDevToolPlugin = __webpack_require__(11851); + new TerserPlugin({ + cache: true, + parallel: true, + sourceMap: + (options.devtool && /source-?map/.test(options.devtool)) || + (options.plugins && + options.plugins.some(p => p instanceof SourceMapDevToolPlugin)) + }).apply(compiler); + } + } + ]); + this.set("optimization.nodeEnv", "make", options => { + // TODO: In webpack 5, it should return `false` when mode is `none` + return options.mode || "production"; + }); + + this.set("resolve", "call", value => Object.assign({}, value)); + this.set("resolve.unsafeCache", true); + this.set("resolve.modules", ["node_modules"]); + this.set("resolve.extensions", [".wasm", ".mjs", ".js", ".json"]); + this.set("resolve.mainFiles", ["index"]); + this.set("resolve.aliasFields", "make", options => { + if ( + options.target === "web" || + options.target === "webworker" || + options.target === "electron-renderer" + ) { + return ["browser"]; + } else { + return []; + } + }); + this.set("resolve.mainFields", "make", options => { + if ( + options.target === "web" || + options.target === "webworker" || + options.target === "electron-renderer" + ) { + return ["browser", "module", "main"]; + } else { + return ["module", "main"]; + } + }); + this.set("resolve.cacheWithContext", "make", options => { + return ( + Array.isArray(options.resolve.plugins) && + options.resolve.plugins.length > 0 + ); + }); + + this.set("resolveLoader", "call", value => Object.assign({}, value)); + this.set("resolveLoader.unsafeCache", true); + this.set("resolveLoader.mainFields", ["loader", "main"]); + this.set("resolveLoader.extensions", [".js", ".json"]); + this.set("resolveLoader.mainFiles", ["index"]); + this.set("resolveLoader.roots", "make", options => [options.context]); + this.set("resolveLoader.cacheWithContext", "make", options => { + return ( + Array.isArray(options.resolveLoader.plugins) && + options.resolveLoader.plugins.length > 0 ); }); + + this.set("infrastructureLogging", "call", value => + Object.assign({}, value) + ); + this.set("infrastructureLogging.level", "info"); + this.set("infrastructureLogging.debug", false); } } -module.exports = WatchIgnorePlugin; +module.exports = WebpackOptionsDefaulter; /***/ }), -/***/ 29580: +/***/ 285: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra + Author Gajus Kuizinas @gajus */ -const Stats = __webpack_require__(99977); +const WebpackError = __webpack_require__(97391); +const webpackOptionsSchema = __webpack_require__(37863); -class Watching { - constructor(compiler, watchOptions, handler) { - this.startTime = null; - this.invalid = false; - this.handler = handler; - this.callbacks = []; - this.closed = false; - this.suspended = false; - if (typeof watchOptions === "number") { - this.watchOptions = { - aggregateTimeout: watchOptions - }; - } else if (watchOptions && typeof watchOptions === "object") { - this.watchOptions = Object.assign({}, watchOptions); - } else { - this.watchOptions = {}; +const getSchemaPart = (path, parents, additionalPath) => { + parents = parents || 0; + path = path.split("/"); + path = path.slice(0, path.length - parents); + if (additionalPath) { + additionalPath = additionalPath.split("/"); + path = path.concat(additionalPath); + } + let schemaPart = webpackOptionsSchema; + for (let i = 1; i < path.length; i++) { + const inner = schemaPart[path[i]]; + if (inner) schemaPart = inner; + } + return schemaPart; +}; + +const getSchemaPartText = (schemaPart, additionalPath) => { + if (additionalPath) { + for (let i = 0; i < additionalPath.length; i++) { + const inner = schemaPart[additionalPath[i]]; + if (inner) schemaPart = inner; } - this.watchOptions.aggregateTimeout = - this.watchOptions.aggregateTimeout || 200; - this.compiler = compiler; - this.running = true; - this.compiler.readRecords(err => { - if (err) return this._done(err); + } + while (schemaPart.$ref) { + schemaPart = getSchemaPart(schemaPart.$ref); + } + let schemaText = WebpackOptionsValidationError.formatSchema(schemaPart); + if (schemaPart.description) { + schemaText += `\n-> ${schemaPart.description}`; + } + return schemaText; +}; - this._go(); - }); +const getSchemaPartDescription = schemaPart => { + while (schemaPart.$ref) { + schemaPart = getSchemaPart(schemaPart.$ref); + } + if (schemaPart.description) { + return `\n-> ${schemaPart.description}`; } + return ""; +}; - _go() { - this.startTime = Date.now(); - this.running = true; - this.invalid = false; - this.compiler.hooks.watchRun.callAsync(this.compiler, err => { - if (err) return this._done(err); - const onCompiled = (err, compilation) => { - if (err) return this._done(err); - if (this.invalid) return this._done(); +const SPECIFICITY = { + type: 1, + oneOf: 1, + anyOf: 1, + allOf: 1, + additionalProperties: 2, + enum: 1, + instanceof: 1, + required: 2, + minimum: 2, + uniqueItems: 2, + minLength: 2, + minItems: 2, + minProperties: 2, + absolutePath: 2 +}; - if (this.compiler.hooks.shouldEmit.call(compilation) === false) { - return this._done(null, compilation); - } +const filterMax = (array, fn) => { + const max = array.reduce((max, item) => Math.max(max, fn(item)), 0); + return array.filter(item => fn(item) === max); +}; - this.compiler.emitAssets(compilation, err => { - if (err) return this._done(err); - if (this.invalid) return this._done(); - this.compiler.emitRecords(err => { - if (err) return this._done(err); +const filterChildren = children => { + children = filterMax(children, err => + err.dataPath ? err.dataPath.length : 0 + ); + children = filterMax(children, err => SPECIFICITY[err.keyword] || 2); + return children; +}; - if (compilation.hooks.needAdditionalPass.call()) { - compilation.needAdditionalPass = true; +const indent = (str, prefix, firstLine) => { + if (firstLine) { + return prefix + str.replace(/\n(?!$)/g, "\n" + prefix); + } else { + return str.replace(/\n(?!$)/g, `\n${prefix}`); + } +}; - const stats = new Stats(compilation); - stats.startTime = this.startTime; - stats.endTime = Date.now(); - this.compiler.hooks.done.callAsync(stats, err => { - if (err) return this._done(err); +class WebpackOptionsValidationError extends WebpackError { + constructor(validationErrors) { + super( + "Invalid configuration object. " + + "Webpack has been initialised using a configuration object that does not match the API schema.\n" + + validationErrors + .map( + err => + " - " + + indent( + WebpackOptionsValidationError.formatValidationError(err), + " ", + false + ) + ) + .join("\n") + ); - this.compiler.hooks.additionalPass.callAsync(err => { - if (err) return this._done(err); - this.compiler.compile(onCompiled); - }); - }); - return; - } - return this._done(null, compilation); - }); - }); - }; - this.compiler.compile(onCompiled); - }); - } + this.name = "WebpackOptionsValidationError"; + this.validationErrors = validationErrors; - _getStats(compilation) { - const stats = new Stats(compilation); - stats.startTime = this.startTime; - stats.endTime = Date.now(); - return stats; + Error.captureStackTrace(this, this.constructor); } - _done(err, compilation) { - this.running = false; - if (this.invalid) return this._go(); + static formatSchema(schema, prevSchemas) { + prevSchemas = prevSchemas || []; - const stats = compilation ? this._getStats(compilation) : null; - if (err) { - this.compiler.hooks.failed.call(err); - this.handler(err, stats); - return; - } - this.compiler.hooks.done.callAsync(stats, () => { - this.handler(null, stats); - if (!this.closed) { - this.watch( - Array.from(compilation.fileDependencies), - Array.from(compilation.contextDependencies), - Array.from(compilation.missingDependencies) + const formatInnerSchema = (innerSchema, addSelf) => { + if (!addSelf) { + return WebpackOptionsValidationError.formatSchema( + innerSchema, + prevSchemas ); } - for (const cb of this.callbacks) cb(); - this.callbacks.length = 0; - }); - } + if (prevSchemas.includes(innerSchema)) { + return "(recursive)"; + } + return WebpackOptionsValidationError.formatSchema( + innerSchema, + prevSchemas.concat(schema) + ); + }; - watch(files, dirs, missing) { - this.pausedWatcher = null; - this.watcher = this.compiler.watchFileSystem.watch( - files, - dirs, - missing, - this.startTime, - this.watchOptions, - ( - err, - filesModified, - contextModified, - missingModified, - fileTimestamps, - contextTimestamps, - removedFiles - ) => { - this.pausedWatcher = this.watcher; - this.watcher = null; - if (err) { - return this.handler(err); - } - this.compiler.fileTimestamps = fileTimestamps; - this.compiler.contextTimestamps = contextTimestamps; - this.compiler.removedFiles = removedFiles; - if (!this.suspended) { - this._invalidate(); - } - }, - (fileName, changeTime) => { - this.compiler.hooks.invalid.call(fileName, changeTime); + if (schema.type === "string") { + if (schema.minLength === 1) { + return "non-empty string"; } - ); - } - - invalidate(callback) { - if (callback) { - this.callbacks.push(callback); + if (schema.minLength > 1) { + return `string (min length ${schema.minLength})`; + } + return "string"; } - if (this.watcher) { - this.compiler.fileTimestamps = this.watcher.getFileTimestamps(); - this.compiler.contextTimestamps = this.watcher.getContextTimestamps(); + if (schema.type === "boolean") { + return "boolean"; } - return this._invalidate(); - } - - _invalidate() { - if (this.watcher) { - this.pausedWatcher = this.watcher; - this.watcher.pause(); - this.watcher = null; + if (schema.type === "number") { + return "number"; } - - if (this.running) { - this.invalid = true; - return false; - } else { - this._go(); + if (schema.type === "object") { + if (schema.properties) { + const required = schema.required || []; + return `object { ${Object.keys(schema.properties) + .map(property => { + if (!required.includes(property)) return property + "?"; + return property; + }) + .concat(schema.additionalProperties ? ["…"] : []) + .join(", ")} }`; + } + if (schema.additionalProperties) { + return `object { : ${formatInnerSchema( + schema.additionalProperties + )} }`; + } + return "object"; + } + if (schema.type === "array") { + return `[${formatInnerSchema(schema.items)}]`; } - } - - suspend() { - this.suspended = true; - this.invalid = false; - } - resume() { - if (this.suspended) { - this.suspended = false; - this._invalidate(); + switch (schema.instanceof) { + case "Function": + return "function"; + case "RegExp": + return "RegExp"; } - } - close(callback) { - const finalCallback = () => { - this.compiler.hooks.watchClose.call(); - this.compiler.running = false; - this.compiler.watchMode = false; - if (callback !== undefined) callback(); - }; + if (schema.enum) { + return schema.enum.map(item => JSON.stringify(item)).join(" | "); + } - this.closed = true; - if (this.watcher) { - this.watcher.close(); - this.watcher = null; + if (schema.$ref) { + return formatInnerSchema(getSchemaPart(schema.$ref), true); } - if (this.pausedWatcher) { - this.pausedWatcher.close(); - this.pausedWatcher = null; + if (schema.allOf) { + return schema.allOf.map(formatInnerSchema).join(" & "); } - if (this.running) { - this.invalid = true; - this._done = finalCallback; + if (schema.oneOf) { + return schema.oneOf.map(formatInnerSchema).join(" | "); + } + if (schema.anyOf) { + return schema.anyOf.map(formatInnerSchema).join(" | "); + } + return JSON.stringify(schema, null, 2); + } + + static formatValidationError(err) { + const dataPath = `configuration${err.dataPath}`; + if (err.keyword === "additionalProperties") { + const baseMessage = `${dataPath} has an unknown property '${ + err.params.additionalProperty + }'. These properties are valid:\n${getSchemaPartText(err.parentSchema)}`; + if (!err.dataPath) { + switch (err.params.additionalProperty) { + case "debug": + return ( + `${baseMessage}\n` + + "The 'debug' property was removed in webpack 2.0.0.\n" + + "Loaders should be updated to allow passing this option via loader options in module.rules.\n" + + "Until loaders are updated one can use the LoaderOptionsPlugin to switch loaders into debug mode:\n" + + "plugins: [\n" + + " new webpack.LoaderOptionsPlugin({\n" + + " debug: true\n" + + " })\n" + + "]" + ); + } + return ( + `${baseMessage}\n` + + "For typos: please correct them.\n" + + "For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration.\n" + + " Loaders should be updated to allow passing options via loader options in module.rules.\n" + + " Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:\n" + + " plugins: [\n" + + " new webpack.LoaderOptionsPlugin({\n" + + " // test: /\\.xxx$/, // may apply this only for some modules\n" + + " options: {\n" + + ` ${err.params.additionalProperty}: …\n` + + " }\n" + + " })\n" + + " ]" + ); + } + return baseMessage; + } else if (err.keyword === "oneOf" || err.keyword === "anyOf") { + if (err.children && err.children.length > 0) { + if (err.schema.length === 1) { + const lastChild = err.children[err.children.length - 1]; + const remainingChildren = err.children.slice( + 0, + err.children.length - 1 + ); + return WebpackOptionsValidationError.formatValidationError( + Object.assign({}, lastChild, { + children: remainingChildren, + parentSchema: Object.assign( + {}, + err.parentSchema, + lastChild.parentSchema + ) + }) + ); + } + const children = filterChildren(err.children); + if (children.length === 1) { + return WebpackOptionsValidationError.formatValidationError( + children[0] + ); + } + return ( + `${dataPath} should be one of these:\n${getSchemaPartText( + err.parentSchema + )}\n` + + `Details:\n${children + .map( + err => + " * " + + indent( + WebpackOptionsValidationError.formatValidationError(err), + " ", + false + ) + ) + .join("\n")}` + ); + } + return `${dataPath} should be one of these:\n${getSchemaPartText( + err.parentSchema + )}`; + } else if (err.keyword === "enum") { + if ( + err.parentSchema && + err.parentSchema.enum && + err.parentSchema.enum.length === 1 + ) { + return `${dataPath} should be ${getSchemaPartText(err.parentSchema)}`; + } + return `${dataPath} should be one of these:\n${getSchemaPartText( + err.parentSchema + )}`; + } else if (err.keyword === "allOf") { + return `${dataPath} should be:\n${getSchemaPartText(err.parentSchema)}`; + } else if (err.keyword === "type") { + switch (err.params.type) { + case "object": + return `${dataPath} should be an object.${getSchemaPartDescription( + err.parentSchema + )}`; + case "string": + return `${dataPath} should be a string.${getSchemaPartDescription( + err.parentSchema + )}`; + case "boolean": + return `${dataPath} should be a boolean.${getSchemaPartDescription( + err.parentSchema + )}`; + case "number": + return `${dataPath} should be a number.${getSchemaPartDescription( + err.parentSchema + )}`; + case "array": + return `${dataPath} should be an array:\n${getSchemaPartText( + err.parentSchema + )}`; + } + return `${dataPath} should be ${err.params.type}:\n${getSchemaPartText( + err.parentSchema + )}`; + } else if (err.keyword === "instanceof") { + return `${dataPath} should be an instance of ${getSchemaPartText( + err.parentSchema + )}`; + } else if (err.keyword === "required") { + const missingProperty = err.params.missingProperty.replace(/^\./, ""); + return `${dataPath} misses the property '${missingProperty}'.\n${getSchemaPartText( + err.parentSchema, + ["properties", missingProperty] + )}`; + } else if (err.keyword === "minimum") { + return `${dataPath} ${err.message}.${getSchemaPartDescription( + err.parentSchema + )}`; + } else if (err.keyword === "uniqueItems") { + return `${dataPath} should not contain the item '${ + err.data[err.params.i] + }' twice.${getSchemaPartDescription(err.parentSchema)}`; + } else if ( + err.keyword === "minLength" || + err.keyword === "minItems" || + err.keyword === "minProperties" + ) { + if (err.params.limit === 1) { + switch (err.keyword) { + case "minLength": + return `${dataPath} should be an non-empty string.${getSchemaPartDescription( + err.parentSchema + )}`; + case "minItems": + return `${dataPath} should be an non-empty array.${getSchemaPartDescription( + err.parentSchema + )}`; + case "minProperties": + return `${dataPath} should be an non-empty object.${getSchemaPartDescription( + err.parentSchema + )}`; + } + return `${dataPath} should be not empty.${getSchemaPartDescription( + err.parentSchema + )}`; + } else { + return `${dataPath} ${err.message}${getSchemaPartDescription( + err.parentSchema + )}`; + } + } else if (err.keyword === "not") { + return `${dataPath} should not be ${getSchemaPartText( + err.schema + )}\n${getSchemaPartText(err.parentSchema)}`; + } else if (err.keyword === "absolutePath") { + const baseMessage = `${dataPath}: ${ + err.message + }${getSchemaPartDescription(err.parentSchema)}`; + if (dataPath === "configuration.output.filename") { + return ( + `${baseMessage}\n` + + "Please use output.path to specify absolute path and output.filename for the file name." + ); + } + return baseMessage; } else { - finalCallback(); + return `${dataPath} ${err.message} (${JSON.stringify( + err, + null, + 2 + )}).\n${getSchemaPartText(err.parentSchema)}`; } } } -module.exports = Watching; +module.exports = WebpackOptionsValidationError; /***/ }), -/***/ 97391: +/***/ 52337: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Jarid Margolin @jaridmargolin + Author Tobias Koppers @sokra */ -const inspect = __webpack_require__(31669).inspect.custom; -class WebpackError extends Error { - /** - * Creates an instance of WebpackError. - * @param {string=} message error message - */ - constructor(message) { - super(message); +const AsyncDependencyToInitialChunkError = __webpack_require__(67089); +const GraphHelpers = __webpack_require__(32973); - this.details = undefined; - this.missing = undefined; - this.origin = undefined; - this.dependencies = undefined; - this.module = undefined; +/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ +/** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("./ChunkGroup")} ChunkGroup */ +/** @typedef {import("./Compilation")} Compilation */ +/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ +/** @typedef {import("./Dependency")} Dependency */ +/** @typedef {import("./Entrypoint")} Entrypoint */ +/** @typedef {import("./Module")} Module */ - Error.captureStackTrace(this, this.constructor); - } +/** + * @typedef {Object} QueueItem + * @property {number} action + * @property {DependenciesBlock} block + * @property {Module} module + * @property {Chunk} chunk + * @property {ChunkGroup} chunkGroup + */ - [inspect]() { - return this.stack + (this.details ? `\n${this.details}` : ""); - } -} +/** + * @typedef {Object} ChunkGroupInfo + * @property {ChunkGroup} chunkGroup the chunk group + * @property {Set} minAvailableModules current minimal set of modules available at this point + * @property {boolean} minAvailableModulesOwned true, if minAvailableModules is owned and can be modified + * @property {Set[]} availableModulesToBeMerged enqueued updates to the minimal set of available modules + * @property {QueueItem[]} skippedItems queue items that were skipped because module is already available in parent chunks (need to reconsider when minAvailableModules is shrinking) + * @property {Set} resultingAvailableModules set of modules available including modules from this chunk group + * @property {Set} children set of children chunk groups, that will be revisited when availableModules shrink + */ -module.exports = WebpackError; +/** + * @typedef {Object} ChunkGroupDep + * @property {AsyncDependenciesBlock} block referencing block + * @property {ChunkGroup} chunkGroup referenced chunk group + */ +/** + * @template T + * @param {Set} a first set + * @param {Set} b second set + * @returns {number} cmp + */ +const bySetSize = (a, b) => { + return b.size - a.size; +}; -/***/ }), +/** + * Extracts simplified info from the modules and their dependencies + * @param {Compilation} compilation the compilation + * @returns {Map, blocks: AsyncDependenciesBlock[]}>} the mapping block to modules and inner blocks + */ +const extraceBlockInfoMap = compilation => { + /** @type {Map, blocks: AsyncDependenciesBlock[]}>} */ + const blockInfoMap = new Map(); -/***/ 2779: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** + * @param {Dependency} d dependency to iterate over + * @returns {void} + */ + const iteratorDependency = d => { + // We skip Dependencies without Reference + const ref = compilation.getDependencyReference(currentModule, d); + if (!ref) { + return; + } + // We skip Dependencies without Module pointer + const refModule = ref.module; + if (!refModule) { + return; + } + // We skip weak Dependencies + if (ref.weak) { + return; + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + blockInfoModules.add(refModule); + }; + /** + * @param {AsyncDependenciesBlock} b blocks to prepare + * @returns {void} + */ + const iteratorBlockPrepare = b => { + blockInfoBlocks.push(b); + blockQueue.push(b); + }; -const OptionsApply = __webpack_require__(4428); + /** @type {Module} */ + let currentModule; + /** @type {DependenciesBlock} */ + let block; + /** @type {DependenciesBlock[]} */ + let blockQueue; + /** @type {Set} */ + let blockInfoModules; + /** @type {AsyncDependenciesBlock[]} */ + let blockInfoBlocks; -const JavascriptModulesPlugin = __webpack_require__(10339); -const JsonModulesPlugin = __webpack_require__(2859); -const WebAssemblyModulesPlugin = __webpack_require__(99510); + for (const module of compilation.modules) { + blockQueue = [module]; + currentModule = module; + while (blockQueue.length > 0) { + block = blockQueue.pop(); + blockInfoModules = new Set(); + blockInfoBlocks = []; -const LoaderTargetPlugin = __webpack_require__(95154); -const FunctionModulePlugin = __webpack_require__(31221); -const EvalDevToolModulePlugin = __webpack_require__(65200); -const SourceMapDevToolPlugin = __webpack_require__(11851); -const EvalSourceMapDevToolPlugin = __webpack_require__(99994); + if (block.variables) { + for (const variable of block.variables) { + for (const dep of variable.dependencies) iteratorDependency(dep); + } + } -const EntryOptionPlugin = __webpack_require__(14604); -const RecordIdsPlugin = __webpack_require__(40355); + if (block.dependencies) { + for (const dep of block.dependencies) iteratorDependency(dep); + } -const APIPlugin = __webpack_require__(71118); -const ConstPlugin = __webpack_require__(84072); -const CommonJsStuffPlugin = __webpack_require__(85736); -const CompatibilityPlugin = __webpack_require__(85918); + if (block.blocks) { + for (const b of block.blocks) iteratorBlockPrepare(b); + } -const TemplatedPathPlugin = __webpack_require__(76032); -const WarnCaseSensitiveModulesPlugin = __webpack_require__(40269); -const UseStrictPlugin = __webpack_require__(73554); + const blockInfo = { + modules: blockInfoModules, + blocks: blockInfoBlocks + }; + blockInfoMap.set(block, blockInfo); + } + } -const LoaderPlugin = __webpack_require__(31559); -const CommonJsPlugin = __webpack_require__(85358); -const HarmonyModulesPlugin = __webpack_require__(66792); -const SystemPlugin = __webpack_require__(68166); -const ImportPlugin = __webpack_require__(58839); -const RequireContextPlugin = __webpack_require__(89042); -const RequireEnsurePlugin = __webpack_require__(98655); -const RequireIncludePlugin = __webpack_require__(16522); + return blockInfoMap; +}; -const { cachedCleverMerge } = __webpack_require__(67916); +/** + * + * @param {Compilation} compilation the compilation + * @param {Entrypoint[]} inputChunkGroups input groups + * @param {Map} chunkGroupInfoMap mapping from chunk group to available modules + * @param {Map} chunkDependencies dependencies for chunk groups + * @param {Set} blocksWithNestedBlocks flag for blocks that have nested blocks + * @param {Set} allCreatedChunkGroups filled with all chunk groups that are created here + */ +const visitModules = ( + compilation, + inputChunkGroups, + chunkGroupInfoMap, + chunkDependencies, + blocksWithNestedBlocks, + allCreatedChunkGroups +) => { + const logger = compilation.getLogger("webpack.buildChunkGraph.visitModules"); + const { namedChunkGroups } = compilation; -/** @typedef {import("../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ -/** @typedef {import("./Compiler")} Compiler */ + logger.time("prepare"); + const blockInfoMap = extraceBlockInfoMap(compilation); -class WebpackOptionsApply extends OptionsApply { - constructor() { - super(); + /** @type {Map} */ + const chunkGroupCounters = new Map(); + for (const chunkGroup of inputChunkGroups) { + chunkGroupCounters.set(chunkGroup, { + index: 0, + index2: 0 + }); } + let nextFreeModuleIndex = 0; + let nextFreeModuleIndex2 = 0; + + /** @type {Map} */ + const blockChunkGroups = new Map(); + + const ADD_AND_ENTER_MODULE = 0; + const ENTER_MODULE = 1; + const PROCESS_BLOCK = 2; + const LEAVE_MODULE = 3; + /** - * @param {WebpackOptions} options options object - * @param {Compiler} compiler compiler object - * @returns {WebpackOptions} options object + * @param {QueueItem[]} queue the queue array (will be mutated) + * @param {ChunkGroup} chunkGroup chunk group + * @returns {QueueItem[]} the queue array again */ - process(options, compiler) { - let ExternalsPlugin; - compiler.outputPath = options.output.path; - compiler.recordsInputPath = options.recordsInputPath || options.recordsPath; - compiler.recordsOutputPath = - options.recordsOutputPath || options.recordsPath; - compiler.name = options.name; - // TODO webpack 5 refactor this to MultiCompiler.setDependencies() with a WeakMap - // @ts-ignore TODO - compiler.dependencies = options.dependencies; - if (typeof options.target === "string") { - let JsonpTemplatePlugin; - let FetchCompileWasmTemplatePlugin; - let ReadFileCompileWasmTemplatePlugin; - let NodeSourcePlugin; - let NodeTargetPlugin; - let NodeTemplatePlugin; + const reduceChunkGroupToQueueItem = (queue, chunkGroup) => { + for (const chunk of chunkGroup.chunks) { + const module = chunk.entryModule; + queue.push({ + action: ENTER_MODULE, + block: module, + module, + chunk, + chunkGroup + }); + } + chunkGroupInfoMap.set(chunkGroup, { + chunkGroup, + minAvailableModules: new Set(), + minAvailableModulesOwned: true, + availableModulesToBeMerged: [], + skippedItems: [], + resultingAvailableModules: undefined, + children: undefined + }); + return queue; + }; - switch (options.target) { - case "web": - JsonpTemplatePlugin = __webpack_require__(92764); - FetchCompileWasmTemplatePlugin = __webpack_require__(52669); - NodeSourcePlugin = __webpack_require__(9128); - new JsonpTemplatePlugin().apply(compiler); - new FetchCompileWasmTemplatePlugin({ - mangleImports: options.optimization.mangleWasmImports - }).apply(compiler); - new FunctionModulePlugin().apply(compiler); - new NodeSourcePlugin(options.node).apply(compiler); - new LoaderTargetPlugin(options.target).apply(compiler); - break; - case "webworker": { - let WebWorkerTemplatePlugin = __webpack_require__(21328); - FetchCompileWasmTemplatePlugin = __webpack_require__(52669); - NodeSourcePlugin = __webpack_require__(9128); - new WebWorkerTemplatePlugin().apply(compiler); - new FetchCompileWasmTemplatePlugin({ - mangleImports: options.optimization.mangleWasmImports - }).apply(compiler); - new FunctionModulePlugin().apply(compiler); - new NodeSourcePlugin(options.node).apply(compiler); - new LoaderTargetPlugin(options.target).apply(compiler); - break; - } - case "node": - case "async-node": - NodeTemplatePlugin = __webpack_require__(90010); - ReadFileCompileWasmTemplatePlugin = __webpack_require__(73839); - NodeTargetPlugin = __webpack_require__(59743); - new NodeTemplatePlugin({ - asyncChunkLoading: options.target === "async-node" - }).apply(compiler); - new ReadFileCompileWasmTemplatePlugin({ - mangleImports: options.optimization.mangleWasmImports - }).apply(compiler); - new FunctionModulePlugin().apply(compiler); - new NodeTargetPlugin().apply(compiler); - new LoaderTargetPlugin("node").apply(compiler); - break; - case "node-webkit": - JsonpTemplatePlugin = __webpack_require__(92764); - NodeTargetPlugin = __webpack_require__(59743); - ExternalsPlugin = __webpack_require__(75705); - new JsonpTemplatePlugin().apply(compiler); - new FunctionModulePlugin().apply(compiler); - new NodeTargetPlugin().apply(compiler); - new ExternalsPlugin("commonjs", "nw.gui").apply(compiler); - new LoaderTargetPlugin(options.target).apply(compiler); - break; - case "electron-main": - NodeTemplatePlugin = __webpack_require__(90010); - NodeTargetPlugin = __webpack_require__(59743); - ExternalsPlugin = __webpack_require__(75705); - new NodeTemplatePlugin({ - asyncChunkLoading: true - }).apply(compiler); - new FunctionModulePlugin().apply(compiler); - new NodeTargetPlugin().apply(compiler); - new ExternalsPlugin("commonjs", [ - "app", - "auto-updater", - "browser-window", - "clipboard", - "content-tracing", - "crash-reporter", - "dialog", - "electron", - "global-shortcut", - "ipc", - "ipc-main", - "menu", - "menu-item", - "native-image", - "original-fs", - "power-monitor", - "power-save-blocker", - "protocol", - "screen", - "session", - "shell", - "tray", - "web-contents" - ]).apply(compiler); - new LoaderTargetPlugin(options.target).apply(compiler); - break; - case "electron-renderer": - case "electron-preload": - FetchCompileWasmTemplatePlugin = __webpack_require__(52669); - NodeTargetPlugin = __webpack_require__(59743); - ExternalsPlugin = __webpack_require__(75705); - if (options.target === "electron-renderer") { - JsonpTemplatePlugin = __webpack_require__(92764); - new JsonpTemplatePlugin().apply(compiler); - } else if (options.target === "electron-preload") { - NodeTemplatePlugin = __webpack_require__(90010); - new NodeTemplatePlugin({ - asyncChunkLoading: true - }).apply(compiler); - } - new FetchCompileWasmTemplatePlugin({ - mangleImports: options.optimization.mangleWasmImports - }).apply(compiler); - new FunctionModulePlugin().apply(compiler); - new NodeTargetPlugin().apply(compiler); - new ExternalsPlugin("commonjs", [ - "clipboard", - "crash-reporter", - "desktop-capturer", - "electron", - "ipc", - "ipc-renderer", - "native-image", - "original-fs", - "remote", - "screen", - "shell", - "web-frame" - ]).apply(compiler); - new LoaderTargetPlugin(options.target).apply(compiler); - break; - default: - throw new Error("Unsupported target '" + options.target + "'."); + // Start with the provided modules/chunks + /** @type {QueueItem[]} */ + let queue = inputChunkGroups + .reduce(reduceChunkGroupToQueueItem, []) + .reverse(); + /** @type {Map>} */ + const queueConnect = new Map(); + /** @type {Set} */ + const outdatedChunkGroupInfo = new Set(); + /** @type {QueueItem[]} */ + let queueDelayed = []; + + logger.timeEnd("prepare"); + + /** @type {Module} */ + let module; + /** @type {Chunk} */ + let chunk; + /** @type {ChunkGroup} */ + let chunkGroup; + /** @type {DependenciesBlock} */ + let block; + /** @type {Set} */ + let minAvailableModules; + /** @type {QueueItem[]} */ + let skippedItems; + + // For each async Block in graph + /** + * @param {AsyncDependenciesBlock} b iterating over each Async DepBlock + * @returns {void} + */ + const iteratorBlock = b => { + // 1. We create a chunk for this Block + // but only once (blockChunkGroups map) + let c = blockChunkGroups.get(b); + if (c === undefined) { + c = namedChunkGroups.get(b.chunkName); + if (c && c.isInitial()) { + compilation.errors.push( + new AsyncDependencyToInitialChunkError(b.chunkName, module, b.loc) + ); + c = chunkGroup; + } else { + c = compilation.addChunkInGroup( + b.groupOptions || b.chunkName, + module, + b.loc, + b.request + ); + chunkGroupCounters.set(c, { index: 0, index2: 0 }); + blockChunkGroups.set(b, c); + allCreatedChunkGroups.add(c); } - } - // @ts-ignore This is always true, which is good this way - else if (options.target !== false) { - options.target(compiler); } else { - throw new Error("Unsupported target '" + options.target + "'."); + // TODO webpack 5 remove addOptions check + if (c.addOptions) c.addOptions(b.groupOptions); + c.addOrigin(module, b.loc, b.request); } - if (options.output.library || options.output.libraryTarget !== "var") { - const LibraryTemplatePlugin = __webpack_require__(65237); - new LibraryTemplatePlugin( - options.output.library, - options.output.libraryTarget, - options.output.umdNamedDefine, - options.output.auxiliaryComment || "", - options.output.libraryExport - ).apply(compiler); - } - if (options.externals) { - ExternalsPlugin = __webpack_require__(75705); - new ExternalsPlugin( - options.output.libraryTarget, - options.externals - ).apply(compiler); - } + // 2. We store the Block+Chunk mapping as dependency for the chunk + let deps = chunkDependencies.get(chunkGroup); + if (!deps) chunkDependencies.set(chunkGroup, (deps = [])); + deps.push({ + block: b, + chunkGroup: c + }); - let noSources; - let legacy; - let modern; - let comment; - if ( - options.devtool && - (options.devtool.includes("sourcemap") || - options.devtool.includes("source-map")) - ) { - const hidden = options.devtool.includes("hidden"); - const inline = options.devtool.includes("inline"); - const evalWrapped = options.devtool.includes("eval"); - const cheap = options.devtool.includes("cheap"); - const moduleMaps = options.devtool.includes("module"); - noSources = options.devtool.includes("nosources"); - legacy = options.devtool.includes("@"); - modern = options.devtool.includes("#"); - comment = - legacy && modern - ? "\n/*\n//@ source" + - "MappingURL=[url]\n//# source" + - "MappingURL=[url]\n*/" - : legacy - ? "\n/*\n//@ source" + "MappingURL=[url]\n*/" - : modern - ? "\n//# source" + "MappingURL=[url]" - : null; - const Plugin = evalWrapped - ? EvalSourceMapDevToolPlugin - : SourceMapDevToolPlugin; - new Plugin({ - filename: inline ? null : options.output.sourceMapFilename, - moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate, - fallbackModuleFilenameTemplate: - options.output.devtoolFallbackModuleFilenameTemplate, - append: hidden ? false : comment, - module: moduleMaps ? true : cheap ? false : true, - columns: cheap ? false : true, - lineToLine: options.output.devtoolLineToLine, - noSources: noSources, - namespace: options.output.devtoolNamespace - }).apply(compiler); - } else if (options.devtool && options.devtool.includes("eval")) { - legacy = options.devtool.includes("@"); - modern = options.devtool.includes("#"); - comment = - legacy && modern - ? "\n//@ sourceURL=[url]\n//# sourceURL=[url]" - : legacy - ? "\n//@ sourceURL=[url]" - : modern - ? "\n//# sourceURL=[url]" - : null; - new EvalDevToolModulePlugin({ - sourceUrlComment: comment, - moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate, - namespace: options.output.devtoolNamespace - }).apply(compiler); + // 3. We create/update the chunk group info + let connectList = queueConnect.get(chunkGroup); + if (connectList === undefined) { + connectList = new Set(); + queueConnect.set(chunkGroup, connectList); } + connectList.add(c); - new JavascriptModulesPlugin().apply(compiler); - new JsonModulesPlugin().apply(compiler); - new WebAssemblyModulesPlugin({ - mangleImports: options.optimization.mangleWasmImports - }).apply(compiler); + // 4. We enqueue the DependenciesBlock for traversal + queueDelayed.push({ + action: PROCESS_BLOCK, + block: b, + module: module, + chunk: c.chunks[0], + chunkGroup: c + }); + }; - new EntryOptionPlugin().apply(compiler); - compiler.hooks.entryOption.call(options.context, options.entry); + // Iterative traversal of the Module graph + // Recursive would be simpler to write but could result in Stack Overflows + while (queue.length) { + logger.time("visiting"); + while (queue.length) { + const queueItem = queue.pop(); + module = queueItem.module; + block = queueItem.block; + chunk = queueItem.chunk; + if (chunkGroup !== queueItem.chunkGroup) { + chunkGroup = queueItem.chunkGroup; + const chunkGroupInfo = chunkGroupInfoMap.get(chunkGroup); + minAvailableModules = chunkGroupInfo.minAvailableModules; + skippedItems = chunkGroupInfo.skippedItems; + } - new CompatibilityPlugin().apply(compiler); - new HarmonyModulesPlugin(options.module).apply(compiler); - if (options.amd !== false) { - const AMDPlugin = __webpack_require__(85812); - const RequireJsStuffPlugin = __webpack_require__(88226); - new AMDPlugin(options.module, options.amd || {}).apply(compiler); - new RequireJsStuffPlugin().apply(compiler); - } - new CommonJsPlugin(options.module).apply(compiler); - new LoaderPlugin().apply(compiler); - if (options.node !== false) { - const NodeStuffPlugin = __webpack_require__(28386); - new NodeStuffPlugin(options.node).apply(compiler); - } - new CommonJsStuffPlugin().apply(compiler); - new APIPlugin().apply(compiler); - new ConstPlugin().apply(compiler); - new UseStrictPlugin().apply(compiler); - new RequireIncludePlugin().apply(compiler); - new RequireEnsurePlugin().apply(compiler); - new RequireContextPlugin( - options.resolve.modules, - options.resolve.extensions, - options.resolve.mainFiles - ).apply(compiler); - new ImportPlugin(options.module).apply(compiler); - new SystemPlugin(options.module).apply(compiler); + switch (queueItem.action) { + case ADD_AND_ENTER_MODULE: { + if (minAvailableModules.has(module)) { + // already in parent chunks + // skip it for now, but enqueue for rechecking when minAvailableModules shrinks + skippedItems.push(queueItem); + break; + } + // We connect Module and Chunk when not already done + if (chunk.addModule(module)) { + module.addChunk(chunk); + } else { + // already connected, skip it + break; + } + } + // fallthrough + case ENTER_MODULE: { + if (chunkGroup !== undefined) { + const index = chunkGroup.getModuleIndex(module); + if (index === undefined) { + chunkGroup.setModuleIndex( + module, + chunkGroupCounters.get(chunkGroup).index++ + ); + } + } - if (typeof options.mode !== "string") { - const WarnNoModeSetPlugin = __webpack_require__(71245); - new WarnNoModeSetPlugin().apply(compiler); - } + if (module.index === null) { + module.index = nextFreeModuleIndex++; + } - const EnsureChunkConditionsPlugin = __webpack_require__(29720); - new EnsureChunkConditionsPlugin().apply(compiler); - if (options.optimization.removeAvailableModules) { - const RemoveParentModulesPlugin = __webpack_require__(58142); - new RemoveParentModulesPlugin().apply(compiler); + queue.push({ + action: LEAVE_MODULE, + block, + module, + chunk, + chunkGroup + }); + } + // fallthrough + case PROCESS_BLOCK: { + // get prepared block info + const blockInfo = blockInfoMap.get(block); + + // Buffer items because order need to be reverse to get indicies correct + const skipBuffer = []; + const queueBuffer = []; + // Traverse all referenced modules + for (const refModule of blockInfo.modules) { + if (chunk.containsModule(refModule)) { + // skip early if already connected + continue; + } + if (minAvailableModules.has(refModule)) { + // already in parent chunks, skip it for now + skipBuffer.push({ + action: ADD_AND_ENTER_MODULE, + block: refModule, + module: refModule, + chunk, + chunkGroup + }); + continue; + } + // enqueue the add and enter to enter in the correct order + // this is relevant with circular dependencies + queueBuffer.push({ + action: ADD_AND_ENTER_MODULE, + block: refModule, + module: refModule, + chunk, + chunkGroup + }); + } + // Add buffered items in reversed order + for (let i = skipBuffer.length - 1; i >= 0; i--) { + skippedItems.push(skipBuffer[i]); + } + for (let i = queueBuffer.length - 1; i >= 0; i--) { + queue.push(queueBuffer[i]); + } + + // Traverse all Blocks + for (const block of blockInfo.blocks) iteratorBlock(block); + + if (blockInfo.blocks.length > 0 && module !== block) { + blocksWithNestedBlocks.add(block); + } + break; + } + case LEAVE_MODULE: { + if (chunkGroup !== undefined) { + const index = chunkGroup.getModuleIndex2(module); + if (index === undefined) { + chunkGroup.setModuleIndex2( + module, + chunkGroupCounters.get(chunkGroup).index2++ + ); + } + } + + if (module.index2 === null) { + module.index2 = nextFreeModuleIndex2++; + } + break; + } + } } - if (options.optimization.removeEmptyChunks) { - const RemoveEmptyChunksPlugin = __webpack_require__(78085); - new RemoveEmptyChunksPlugin().apply(compiler); - } - if (options.optimization.mergeDuplicateChunks) { - const MergeDuplicateChunksPlugin = __webpack_require__(46214); - new MergeDuplicateChunksPlugin().apply(compiler); - } - if (options.optimization.flagIncludedChunks) { - const FlagIncludedChunksPlugin = __webpack_require__(25850); - new FlagIncludedChunksPlugin().apply(compiler); - } - if (options.optimization.sideEffects) { - const SideEffectsFlagPlugin = __webpack_require__(83654); - new SideEffectsFlagPlugin().apply(compiler); - } - if (options.optimization.providedExports) { - const FlagDependencyExportsPlugin = __webpack_require__(73599); - new FlagDependencyExportsPlugin().apply(compiler); - } - if (options.optimization.usedExports) { - const FlagDependencyUsagePlugin = __webpack_require__(33632); - new FlagDependencyUsagePlugin().apply(compiler); - } - if (options.optimization.concatenateModules) { - const ModuleConcatenationPlugin = __webpack_require__(45184); - new ModuleConcatenationPlugin().apply(compiler); - } - if (options.optimization.splitChunks) { - const SplitChunksPlugin = __webpack_require__(60474); - new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler); - } - if (options.optimization.runtimeChunk) { - const RuntimeChunkPlugin = __webpack_require__(76894); - new RuntimeChunkPlugin(options.optimization.runtimeChunk).apply(compiler); - } - if (options.optimization.noEmitOnErrors) { - const NoEmitOnErrorsPlugin = __webpack_require__(22615); - new NoEmitOnErrorsPlugin().apply(compiler); - } - if (options.optimization.checkWasmTypes) { - const WasmFinalizeExportsPlugin = __webpack_require__(10557); - new WasmFinalizeExportsPlugin().apply(compiler); - } - let moduleIds = options.optimization.moduleIds; - if (moduleIds === undefined) { - // TODO webpack 5 remove all these options - if (options.optimization.occurrenceOrder) { - moduleIds = "size"; - } - if (options.optimization.namedModules) { - moduleIds = "named"; - } - if (options.optimization.hashedModuleIds) { - moduleIds = "hashed"; - } - if (moduleIds === undefined) { - moduleIds = "natural"; - } - } - if (moduleIds) { - const NamedModulesPlugin = __webpack_require__(86707); - const HashedModuleIdsPlugin = __webpack_require__(50268); - const OccurrenceModuleOrderPlugin = __webpack_require__(62000); - switch (moduleIds) { - case "natural": - // TODO webpack 5: see hint in Compilation.sortModules - break; - case "named": - new NamedModulesPlugin().apply(compiler); - break; - case "hashed": - new HashedModuleIdsPlugin().apply(compiler); - break; - case "size": - new OccurrenceModuleOrderPlugin({ - prioritiseInitial: true - }).apply(compiler); - break; - case "total-size": - new OccurrenceModuleOrderPlugin({ - prioritiseInitial: false - }).apply(compiler); - break; - default: - throw new Error( - `webpack bug: moduleIds: ${moduleIds} is not implemented` + logger.timeEnd("visiting"); + + while (queueConnect.size > 0) { + logger.time("calculating available modules"); + + // Figure out new parents for chunk groups + // to get new available modules for these children + for (const [chunkGroup, targets] of queueConnect) { + const info = chunkGroupInfoMap.get(chunkGroup); + let minAvailableModules = info.minAvailableModules; + + // 1. Create a new Set of available modules at this points + const resultingAvailableModules = new Set(minAvailableModules); + for (const chunk of chunkGroup.chunks) { + for (const m of chunk.modulesIterable) { + resultingAvailableModules.add(m); + } + } + info.resultingAvailableModules = resultingAvailableModules; + if (info.children === undefined) { + info.children = targets; + } else { + for (const target of targets) { + info.children.add(target); + } + } + + // 2. Update chunk group info + for (const target of targets) { + let chunkGroupInfo = chunkGroupInfoMap.get(target); + if (chunkGroupInfo === undefined) { + chunkGroupInfo = { + chunkGroup: target, + minAvailableModules: undefined, + minAvailableModulesOwned: undefined, + availableModulesToBeMerged: [], + skippedItems: [], + resultingAvailableModules: undefined, + children: undefined + }; + chunkGroupInfoMap.set(target, chunkGroupInfo); + } + chunkGroupInfo.availableModulesToBeMerged.push( + resultingAvailableModules ); + outdatedChunkGroupInfo.add(chunkGroupInfo); + } } - } - let chunkIds = options.optimization.chunkIds; - if (chunkIds === undefined) { - // TODO webpack 5 remove all these options - if (options.optimization.occurrenceOrder) { - // This looks weird but it's for backward-compat - // This bug already existed before adding this feature - chunkIds = "total-size"; - } - if (options.optimization.namedChunks) { - chunkIds = "named"; - } - if (chunkIds === undefined) { - chunkIds = "natural"; - } - } - if (chunkIds) { - const NaturalChunkOrderPlugin = __webpack_require__(68053); - const NamedChunksPlugin = __webpack_require__(70419); - const OccurrenceChunkOrderPlugin = __webpack_require__(83741); - switch (chunkIds) { - case "natural": - new NaturalChunkOrderPlugin().apply(compiler); - break; - case "named": - // TODO webapck 5: for backward-compat this need to have OccurrenceChunkOrderPlugin too - // The NamedChunksPlugin doesn't give every chunk a name - // This should be fixed, and the OccurrenceChunkOrderPlugin should be removed here. - new OccurrenceChunkOrderPlugin({ - prioritiseInitial: false - }).apply(compiler); - new NamedChunksPlugin().apply(compiler); - break; - case "size": - new OccurrenceChunkOrderPlugin({ - prioritiseInitial: true - }).apply(compiler); - break; - case "total-size": - new OccurrenceChunkOrderPlugin({ - prioritiseInitial: false - }).apply(compiler); - break; - default: - throw new Error( - `webpack bug: chunkIds: ${chunkIds} is not implemented` - ); + queueConnect.clear(); + logger.timeEnd("calculating available modules"); + + if (outdatedChunkGroupInfo.size > 0) { + logger.time("merging available modules"); + // Execute the merge + for (const info of outdatedChunkGroupInfo) { + const availableModulesToBeMerged = info.availableModulesToBeMerged; + let cachedMinAvailableModules = info.minAvailableModules; + + // 1. Get minimal available modules + // It doesn't make sense to traverse a chunk again with more available modules. + // This step calculates the minimal available modules and skips traversal when + // the list didn't shrink. + if (availableModulesToBeMerged.length > 1) { + availableModulesToBeMerged.sort(bySetSize); + } + let changed = false; + for (const availableModules of availableModulesToBeMerged) { + if (cachedMinAvailableModules === undefined) { + cachedMinAvailableModules = availableModules; + info.minAvailableModules = cachedMinAvailableModules; + info.minAvailableModulesOwned = false; + changed = true; + } else { + if (info.minAvailableModulesOwned) { + // We own it and can modify it + for (const m of cachedMinAvailableModules) { + if (!availableModules.has(m)) { + cachedMinAvailableModules.delete(m); + changed = true; + } + } + } else { + for (const m of cachedMinAvailableModules) { + if (!availableModules.has(m)) { + // cachedMinAvailableModules need to be modified + // but we don't own it + // construct a new Set as intersection of cachedMinAvailableModules and availableModules + /** @type {Set} */ + const newSet = new Set(); + const iterator = cachedMinAvailableModules[ + Symbol.iterator + ](); + /** @type {IteratorResult} */ + let it; + while (!(it = iterator.next()).done) { + const module = it.value; + if (module === m) break; + newSet.add(module); + } + while (!(it = iterator.next()).done) { + const module = it.value; + if (availableModules.has(module)) { + newSet.add(module); + } + } + cachedMinAvailableModules = newSet; + info.minAvailableModulesOwned = true; + info.minAvailableModules = newSet; + + // Update the cache from the first queue + // if the chunkGroup is currently cached + if (chunkGroup === info.chunkGroup) { + minAvailableModules = cachedMinAvailableModules; + } + + changed = true; + break; + } + } + } + } + } + availableModulesToBeMerged.length = 0; + if (!changed) continue; + + // 2. Reconsider skipped items + for (const queueItem of info.skippedItems) { + queue.push(queueItem); + } + info.skippedItems.length = 0; + + // 3. Reconsider children chunk groups + if (info.children !== undefined) { + const chunkGroup = info.chunkGroup; + for (const c of info.children) { + let connectList = queueConnect.get(chunkGroup); + if (connectList === undefined) { + connectList = new Set(); + queueConnect.set(chunkGroup, connectList); + } + connectList.add(c); + } + } + } + outdatedChunkGroupInfo.clear(); + logger.timeEnd("merging available modules"); } } - if (options.optimization.nodeEnv) { - const DefinePlugin = __webpack_require__(97374); - new DefinePlugin({ - "process.env.NODE_ENV": JSON.stringify(options.optimization.nodeEnv) - }).apply(compiler); + + // Run queueDelayed when all items of the queue are processed + // This is important to get the global indicing correct + // Async blocks should be processed after all sync blocks are processed + if (queue.length === 0) { + const tempQueue = queue; + queue = queueDelayed.reverse(); + queueDelayed = tempQueue; } - if (options.optimization.minimize) { - for (const minimizer of options.optimization.minimizer) { - if (typeof minimizer === "function") { - minimizer.call(compiler, compiler); - } else { - minimizer.apply(compiler); - } + } +}; + +/** + * + * @param {Set} blocksWithNestedBlocks flag for blocks that have nested blocks + * @param {Map} chunkDependencies dependencies for chunk groups + * @param {Map} chunkGroupInfoMap mapping from chunk group to available modules + */ +const connectChunkGroups = ( + blocksWithNestedBlocks, + chunkDependencies, + chunkGroupInfoMap +) => { + /** @type {Set} */ + let resultingAvailableModules; + + /** + * Helper function to check if all modules of a chunk are available + * + * @param {ChunkGroup} chunkGroup the chunkGroup to scan + * @param {Set} availableModules the comparitor set + * @returns {boolean} return true if all modules of a chunk are available + */ + const areModulesAvailable = (chunkGroup, availableModules) => { + for (const chunk of chunkGroup.chunks) { + for (const module of chunk.modulesIterable) { + if (!availableModules.has(module)) return false; } } + return true; + }; - if (options.performance) { - const SizeLimitsPlugin = __webpack_require__(68310); - new SizeLimitsPlugin(options.performance).apply(compiler); + // For each edge in the basic chunk graph + /** + * @param {ChunkGroupDep} dep the dependency used for filtering + * @returns {boolean} used to filter "edges" (aka Dependencies) that were pointing + * to modules that are already available. Also filters circular dependencies in the chunks graph + */ + const filterFn = dep => { + const depChunkGroup = dep.chunkGroup; + // TODO is this needed? + if (blocksWithNestedBlocks.has(dep.block)) return true; + if (areModulesAvailable(depChunkGroup, resultingAvailableModules)) { + return false; // break all modules are already available } + return true; + }; - new TemplatedPathPlugin().apply(compiler); + // For all deps, check if chunk groups need to be connected + for (const [chunkGroup, deps] of chunkDependencies) { + if (deps.length === 0) continue; - new RecordIdsPlugin({ - portableIds: options.optimization.portableRecords - }).apply(compiler); + // 1. Get info from chunk group info map + const info = chunkGroupInfoMap.get(chunkGroup); + resultingAvailableModules = info.resultingAvailableModules; - new WarnCaseSensitiveModulesPlugin().apply(compiler); + // 2. Foreach edge + for (let i = 0; i < deps.length; i++) { + const dep = deps[i]; - if (options.cache) { - const CachePlugin = __webpack_require__(6465); - new CachePlugin( - typeof options.cache === "object" ? options.cache : null - ).apply(compiler); + // Filter inline, rather than creating a new array from `.filter()` + // TODO check if inlining filterFn makes sense here + if (!filterFn(dep)) { + continue; + } + const depChunkGroup = dep.chunkGroup; + const depBlock = dep.block; + + // 5. Connect block with chunk + GraphHelpers.connectDependenciesBlockAndChunkGroup( + depBlock, + depChunkGroup + ); + + // 6. Connect chunk with parent + GraphHelpers.connectChunkGroupParentAndChild(chunkGroup, depChunkGroup); } + } +}; - compiler.hooks.afterPlugins.call(compiler); - if (!compiler.inputFileSystem) { - throw new Error("No input filesystem provided"); +/** + * Remove all unconnected chunk groups + * @param {Compilation} compilation the compilation + * @param {Iterable} allCreatedChunkGroups all chunk groups that where created before + */ +const cleanupUnconnectedGroups = (compilation, allCreatedChunkGroups) => { + for (const chunkGroup of allCreatedChunkGroups) { + if (chunkGroup.getNumberOfParents() === 0) { + for (const chunk of chunkGroup.chunks) { + const idx = compilation.chunks.indexOf(chunk); + if (idx >= 0) compilation.chunks.splice(idx, 1); + chunk.remove("unconnected"); + } + chunkGroup.remove("unconnected"); } - compiler.resolverFactory.hooks.resolveOptions - .for("normal") - .tap("WebpackOptionsApply", resolveOptions => { - return Object.assign( - { - fileSystem: compiler.inputFileSystem - }, - cachedCleverMerge(options.resolve, resolveOptions) - ); - }); - compiler.resolverFactory.hooks.resolveOptions - .for("context") - .tap("WebpackOptionsApply", resolveOptions => { - return Object.assign( - { - fileSystem: compiler.inputFileSystem, - resolveToContext: true - }, - cachedCleverMerge(options.resolve, resolveOptions) - ); - }); - compiler.resolverFactory.hooks.resolveOptions - .for("loader") - .tap("WebpackOptionsApply", resolveOptions => { - return Object.assign( - { - fileSystem: compiler.inputFileSystem - }, - cachedCleverMerge(options.resolveLoader, resolveOptions) - ); - }); - compiler.hooks.afterResolvers.call(compiler); - return options; } -} +}; -module.exports = WebpackOptionsApply; +/** + * This method creates the Chunk graph from the Module graph + * @param {Compilation} compilation the compilation + * @param {Entrypoint[]} inputChunkGroups chunk groups which are processed + * @returns {void} + */ +const buildChunkGraph = (compilation, inputChunkGroups) => { + // SHARED STATE + /** @type {Map} */ + const chunkDependencies = new Map(); -/***/ }), + /** @type {Set} */ + const allCreatedChunkGroups = new Set(); -/***/ 60016: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** @type {Map} */ + const chunkGroupInfoMap = new Map(); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + /** @type {Set} */ + const blocksWithNestedBlocks = new Set(); + // PART ONE -const path = __webpack_require__(85622); + visitModules( + compilation, + inputChunkGroups, + chunkGroupInfoMap, + chunkDependencies, + blocksWithNestedBlocks, + allCreatedChunkGroups + ); -const OptionsDefaulter = __webpack_require__(3414); -const Template = __webpack_require__(96066); + // PART TWO -const isProductionLikeMode = options => { - return options.mode === "production" || !options.mode; -}; + connectChunkGroups( + blocksWithNestedBlocks, + chunkDependencies, + chunkGroupInfoMap + ); -const isWebLikeTarget = options => { - return options.target === "web" || options.target === "webworker"; -}; + // Cleaup work -const getDevtoolNamespace = library => { - // if options.output.library is a string - if (Array.isArray(library)) { - return library.join("."); - } else if (typeof library === "object") { - return getDevtoolNamespace(library.root); - } - return library || ""; + cleanupUnconnectedGroups(compilation, allCreatedChunkGroups); }; -class WebpackOptionsDefaulter extends OptionsDefaulter { - constructor() { - super(); +module.exports = buildChunkGraph; - this.set("entry", "./src"); - this.set("devtool", "make", options => - options.mode === "development" ? "eval" : false - ); - this.set("cache", "make", options => options.mode === "development"); +/***/ }), - this.set("context", process.cwd()); - this.set("target", "web"); +/***/ 22562: +/***/ (function(module) { - this.set("module", "call", value => Object.assign({}, value)); - this.set("module.unknownContextRequest", "."); - this.set("module.unknownContextRegExp", false); - this.set("module.unknownContextRecursive", true); - this.set("module.unknownContextCritical", true); - this.set("module.exprContextRequest", "."); - this.set("module.exprContextRegExp", false); - this.set("module.exprContextRecursive", true); - this.set("module.exprContextCritical", true); - this.set("module.wrappedContextRegExp", /.*/); - this.set("module.wrappedContextRecursive", true); - this.set("module.wrappedContextCritical", false); - this.set("module.strictExportPresence", false); - this.set("module.strictThisContextOnImports", false); - this.set("module.unsafeCache", "make", options => !!options.cache); - this.set("module.rules", []); - this.set("module.defaultRules", "make", options => [ - { - type: "javascript/auto", - resolve: {} - }, - { - test: /\.mjs$/i, - type: "javascript/esm", - resolve: { - mainFields: - options.target === "web" || - options.target === "webworker" || - options.target === "electron-renderer" - ? ["browser", "main"] - : ["main"] - } - }, - { - test: /\.json$/i, - type: "json" - }, - { - test: /\.wasm$/i, - type: "webassembly/experimental" - } - ]); - - this.set("output", "call", (value, options) => { - if (typeof value === "string") { - return { - filename: value - }; - } else if (typeof value !== "object") { - return {}; - } else { - return Object.assign({}, value); - } - }); - - this.set("output.filename", "[name].js"); - this.set("output.chunkFilename", "make", options => { - const filename = options.output.filename; - if (typeof filename !== "function") { - const hasName = filename.includes("[name]"); - const hasId = filename.includes("[id]"); - const hasChunkHash = filename.includes("[chunkhash]"); - // Anything changing depending on chunk is fine - if (hasChunkHash || hasName || hasId) return filename; - // Elsewise prefix "[id]." in front of the basename to make it changing - return filename.replace(/(^|\/)([^/]*(?:\?|$))/, "$1[id].$2"); - } - return "[id].js"; - }); - this.set("output.webassemblyModuleFilename", "[modulehash].module.wasm"); - this.set("output.library", ""); - this.set("output.hotUpdateFunction", "make", options => { - return Template.toIdentifier( - "webpackHotUpdate" + Template.toIdentifier(options.output.library) - ); - }); - this.set("output.jsonpFunction", "make", options => { - return Template.toIdentifier( - "webpackJsonp" + Template.toIdentifier(options.output.library) - ); - }); - this.set("output.chunkCallbackName", "make", options => { - return Template.toIdentifier( - "webpackChunk" + Template.toIdentifier(options.output.library) - ); - }); - this.set("output.globalObject", "make", options => { - switch (options.target) { - case "web": - case "electron-renderer": - case "node-webkit": - return "window"; - case "webworker": - return "self"; - case "node": - case "async-node": - case "electron-main": - return "global"; - default: - return "self"; - } - }); - this.set("output.devtoolNamespace", "make", options => { - return getDevtoolNamespace(options.output.library); - }); - this.set("output.libraryTarget", "var"); - this.set("output.path", path.join(process.cwd(), "dist")); - this.set( - "output.pathinfo", - "make", - options => options.mode === "development" - ); - this.set("output.sourceMapFilename", "[file].map[query]"); - this.set("output.hotUpdateChunkFilename", "[id].[hash].hot-update.js"); - this.set("output.hotUpdateMainFilename", "[hash].hot-update.json"); - this.set("output.crossOriginLoading", false); - this.set("output.jsonpScriptType", false); - this.set("output.chunkLoadTimeout", 120000); - this.set("output.hashFunction", "md4"); - this.set("output.hashDigest", "hex"); - this.set("output.hashDigestLength", 20); - this.set("output.devtoolLineToLine", false); - this.set("output.strictModuleExceptionHandling", false); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - this.set("node", "call", value => { - if (typeof value === "boolean") { - return value; - } else { - return Object.assign({}, value); - } - }); - this.set("node.console", false); - this.set("node.process", true); - this.set("node.global", true); - this.set("node.Buffer", true); - this.set("node.setImmediate", true); - this.set("node.__filename", "mock"); - this.set("node.__dirname", "mock"); - this.set("performance", "call", (value, options) => { - if (value === false) return false; - if ( - value === undefined && - (!isProductionLikeMode(options) || !isWebLikeTarget(options)) - ) - return false; - return Object.assign({}, value); - }); - this.set("performance.maxAssetSize", 250000); - this.set("performance.maxEntrypointSize", 250000); - this.set("performance.hints", "make", options => - isProductionLikeMode(options) ? "warning" : false - ); +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ - this.set("optimization", "call", value => Object.assign({}, value)); - // TODO webpack 5: Disable by default in a modes - this.set( - "optimization.removeAvailableModules", - "make", - options => options.mode !== "development" - ); - this.set("optimization.removeEmptyChunks", true); - this.set("optimization.mergeDuplicateChunks", true); - this.set("optimization.flagIncludedChunks", "make", options => - isProductionLikeMode(options) - ); - // TODO webpack 5 add `moduleIds: "named"` default for development - // TODO webpack 5 add `moduleIds: "size"` default for production - // TODO webpack 5 remove optimization.occurrenceOrder - this.set("optimization.occurrenceOrder", "make", options => - isProductionLikeMode(options) - ); - this.set("optimization.sideEffects", "make", options => - isProductionLikeMode(options) - ); - this.set("optimization.providedExports", true); - this.set("optimization.usedExports", "make", options => - isProductionLikeMode(options) - ); - this.set("optimization.concatenateModules", "make", options => - isProductionLikeMode(options) - ); - this.set("optimization.splitChunks", {}); - this.set("optimization.splitChunks.hidePathInfo", "make", options => { - return isProductionLikeMode(options); - }); - this.set("optimization.splitChunks.chunks", "async"); - this.set("optimization.splitChunks.minSize", "make", options => { - return isProductionLikeMode(options) ? 30000 : 10000; - }); - this.set("optimization.splitChunks.minChunks", 1); - this.set("optimization.splitChunks.maxAsyncRequests", "make", options => { - return isProductionLikeMode(options) ? 5 : Infinity; - }); - this.set("optimization.splitChunks.automaticNameDelimiter", "~"); - this.set("optimization.splitChunks.automaticNameMaxLength", 109); - this.set("optimization.splitChunks.maxInitialRequests", "make", options => { - return isProductionLikeMode(options) ? 3 : Infinity; - }); - this.set("optimization.splitChunks.name", true); - this.set("optimization.splitChunks.cacheGroups", {}); - this.set("optimization.splitChunks.cacheGroups.default", { - automaticNamePrefix: "", - reuseExistingChunk: true, - minChunks: 2, - priority: -20 - }); - this.set("optimization.splitChunks.cacheGroups.vendors", { - automaticNamePrefix: "vendors", - test: /[\\/]node_modules[\\/]/, - priority: -10 - }); - this.set("optimization.runtimeChunk", "call", value => { - if (value === "single") { - return { - name: "runtime" - }; - } - if (value === true || value === "multiple") { - return { - name: entrypoint => `runtime~${entrypoint.name}` - }; - } - return value; - }); - this.set("optimization.noEmitOnErrors", "make", options => - isProductionLikeMode(options) - ); - this.set("optimization.checkWasmTypes", "make", options => - isProductionLikeMode(options) - ); - this.set("optimization.mangleWasmImports", false); - // TODO webpack 5 remove optimization.namedModules - this.set( - "optimization.namedModules", - "make", - options => options.mode === "development" - ); - this.set("optimization.hashedModuleIds", false); - // TODO webpack 5 add `chunkIds: "named"` default for development - // TODO webpack 5 add `chunkIds: "size"` default for production - // TODO webpack 5 remove optimization.namedChunks - this.set( - "optimization.namedChunks", - "make", - options => options.mode === "development" - ); - this.set( - "optimization.portableRecords", - "make", - options => - !!( - options.recordsInputPath || - options.recordsOutputPath || - options.recordsPath - ) - ); - this.set("optimization.minimize", "make", options => - isProductionLikeMode(options) - ); - this.set("optimization.minimizer", "make", options => [ - { - apply: compiler => { - // Lazy load the Terser plugin - const TerserPlugin = __webpack_require__(89301); - const SourceMapDevToolPlugin = __webpack_require__(11851); - new TerserPlugin({ - cache: true, - parallel: true, - sourceMap: - (options.devtool && /source-?map/.test(options.devtool)) || - (options.plugins && - options.plugins.some(p => p instanceof SourceMapDevToolPlugin)) - }).apply(compiler); - } +// TODO webpack 5 remove string type from a and b +/** + * Compare two locations + * @param {string|DependencyLocation} a A location node + * @param {string|DependencyLocation} b A location node + * @returns {-1|0|1} sorting comparator value + */ +module.exports = (a, b) => { + if (typeof a === "string") { + if (typeof b === "string") { + if (a < b) return -1; + if (a > b) return 1; + return 0; + } else if (typeof b === "object") { + return 1; + } else { + return 0; + } + } else if (typeof a === "object") { + if (typeof b === "string") { + return -1; + } else if (typeof b === "object") { + if ("start" in a && "start" in b) { + const ap = a.start; + const bp = b.start; + if (ap.line < bp.line) return -1; + if (ap.line > bp.line) return 1; + if (ap.column < bp.column) return -1; + if (ap.column > bp.column) return 1; } - ]); - this.set("optimization.nodeEnv", "make", options => { - // TODO: In webpack 5, it should return `false` when mode is `none` - return options.mode || "production"; - }); - - this.set("resolve", "call", value => Object.assign({}, value)); - this.set("resolve.unsafeCache", true); - this.set("resolve.modules", ["node_modules"]); - this.set("resolve.extensions", [".wasm", ".mjs", ".js", ".json"]); - this.set("resolve.mainFiles", ["index"]); - this.set("resolve.aliasFields", "make", options => { - if ( - options.target === "web" || - options.target === "webworker" || - options.target === "electron-renderer" - ) { - return ["browser"]; - } else { - return []; + if ("name" in a && "name" in b) { + if (a.name < b.name) return -1; + if (a.name > b.name) return 1; } - }); - this.set("resolve.mainFields", "make", options => { - if ( - options.target === "web" || - options.target === "webworker" || - options.target === "electron-renderer" - ) { - return ["browser", "module", "main"]; - } else { - return ["module", "main"]; + if ("index" in a && "index" in b) { + if (a.index < b.index) return -1; + if (a.index > b.index) return 1; } - }); - this.set("resolve.cacheWithContext", "make", options => { - return ( - Array.isArray(options.resolve.plugins) && - options.resolve.plugins.length > 0 - ); - }); - - this.set("resolveLoader", "call", value => Object.assign({}, value)); - this.set("resolveLoader.unsafeCache", true); - this.set("resolveLoader.mainFields", ["loader", "main"]); - this.set("resolveLoader.extensions", [".js", ".json"]); - this.set("resolveLoader.mainFiles", ["index"]); - this.set("resolveLoader.roots", "make", options => [options.context]); - this.set("resolveLoader.cacheWithContext", "make", options => { - return ( - Array.isArray(options.resolveLoader.plugins) && - options.resolveLoader.plugins.length > 0 - ); - }); - - this.set("infrastructureLogging", "call", value => - Object.assign({}, value) - ); - this.set("infrastructureLogging.level", "info"); - this.set("infrastructureLogging.debug", false); + return 0; + } else { + return 0; + } } -} - -module.exports = WebpackOptionsDefaulter; +}; /***/ }), -/***/ 285: +/***/ 72890: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Gajus Kuizinas @gajus -*/ +const fs = __webpack_require__(35747); +const path = __webpack_require__(85622); +const mkdirp = __webpack_require__(50998); +const { Tracer } = __webpack_require__(92430); +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(49049); +/** @typedef {import("../../declarations/plugins/debug/ProfilingPlugin").ProfilingPluginOptions} ProfilingPluginOptions */ -const WebpackError = __webpack_require__(97391); -const webpackOptionsSchema = __webpack_require__(37863); +let inspector = undefined; -const getSchemaPart = (path, parents, additionalPath) => { - parents = parents || 0; - path = path.split("/"); - path = path.slice(0, path.length - parents); - if (additionalPath) { - additionalPath = additionalPath.split("/"); - path = path.concat(additionalPath); +try { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + inspector = __webpack_require__(57012); +} catch (e) { + console.log("Unable to CPU profile in < node 8.0"); +} + +class Profiler { + constructor(inspector) { + this.session = undefined; + this.inspector = inspector; } - let schemaPart = webpackOptionsSchema; - for (let i = 1; i < path.length; i++) { - const inner = schemaPart[path[i]]; - if (inner) schemaPart = inner; + + hasSession() { + return this.session !== undefined; } - return schemaPart; -}; -const getSchemaPartText = (schemaPart, additionalPath) => { - if (additionalPath) { - for (let i = 0; i < additionalPath.length; i++) { - const inner = schemaPart[additionalPath[i]]; - if (inner) schemaPart = inner; + startProfiling() { + if (this.inspector === undefined) { + return Promise.resolve(); } - } - while (schemaPart.$ref) { - schemaPart = getSchemaPart(schemaPart.$ref); - } - let schemaText = WebpackOptionsValidationError.formatSchema(schemaPart); - if (schemaPart.description) { - schemaText += `\n-> ${schemaPart.description}`; - } - return schemaText; -}; -const getSchemaPartDescription = schemaPart => { - while (schemaPart.$ref) { - schemaPart = getSchemaPart(schemaPart.$ref); - } - if (schemaPart.description) { - return `\n-> ${schemaPart.description}`; + try { + this.session = new inspector.Session(); + this.session.connect(); + } catch (_) { + this.session = undefined; + return Promise.resolve(); + } + + return Promise.all([ + this.sendCommand("Profiler.setSamplingInterval", { + interval: 100 + }), + this.sendCommand("Profiler.enable"), + this.sendCommand("Profiler.start") + ]); } - return ""; -}; -const SPECIFICITY = { - type: 1, - oneOf: 1, - anyOf: 1, - allOf: 1, - additionalProperties: 2, - enum: 1, - instanceof: 1, - required: 2, - minimum: 2, - uniqueItems: 2, - minLength: 2, - minItems: 2, - minProperties: 2, - absolutePath: 2 -}; + sendCommand(method, params) { + if (this.hasSession()) { + return new Promise((res, rej) => { + return this.session.post(method, params, (err, params) => { + if (err !== null) { + rej(err); + } else { + res(params); + } + }); + }); + } else { + return Promise.resolve(); + } + } -const filterMax = (array, fn) => { - const max = array.reduce((max, item) => Math.max(max, fn(item)), 0); - return array.filter(item => fn(item) === max); -}; + destroy() { + if (this.hasSession()) { + this.session.disconnect(); + } -const filterChildren = children => { - children = filterMax(children, err => - err.dataPath ? err.dataPath.length : 0 - ); - children = filterMax(children, err => SPECIFICITY[err.keyword] || 2); - return children; -}; + return Promise.resolve(); + } -const indent = (str, prefix, firstLine) => { - if (firstLine) { - return prefix + str.replace(/\n(?!$)/g, "\n" + prefix); - } else { - return str.replace(/\n(?!$)/g, `\n${prefix}`); + stopProfiling() { + return this.sendCommand("Profiler.stop"); } -}; +} -class WebpackOptionsValidationError extends WebpackError { - constructor(validationErrors) { - super( - "Invalid configuration object. " + - "Webpack has been initialised using a configuration object that does not match the API schema.\n" + - validationErrors - .map( - err => - " - " + - indent( - WebpackOptionsValidationError.formatValidationError(err), - " ", - false - ) - ) - .join("\n") - ); - - this.name = "WebpackOptionsValidationError"; - this.validationErrors = validationErrors; +/** + * an object that wraps Tracer and Profiler with a counter + * @typedef {Object} Trace + * @property {Tracer} trace instance of Tracer + * @property {number} counter Counter + * @property {Profiler} profiler instance of Profiler + * @property {Function} end the end function + */ - Error.captureStackTrace(this, this.constructor); +/** + * @param {string} outputPath The location where to write the log. + * @returns {Trace} The trace object + */ +const createTrace = outputPath => { + const trace = new Tracer({ + noStream: true + }); + const profiler = new Profiler(inspector); + if (/\/|\\/.test(outputPath)) { + const dirPath = path.dirname(outputPath); + mkdirp.sync(dirPath); } + const fsStream = fs.createWriteStream(outputPath); - static formatSchema(schema, prevSchemas) { - prevSchemas = prevSchemas || []; - - const formatInnerSchema = (innerSchema, addSelf) => { - if (!addSelf) { - return WebpackOptionsValidationError.formatSchema( - innerSchema, - prevSchemas - ); - } - if (prevSchemas.includes(innerSchema)) { - return "(recursive)"; - } - return WebpackOptionsValidationError.formatSchema( - innerSchema, - prevSchemas.concat(schema) - ); - }; + let counter = 0; - if (schema.type === "string") { - if (schema.minLength === 1) { - return "non-empty string"; - } - if (schema.minLength > 1) { - return `string (min length ${schema.minLength})`; + trace.pipe(fsStream); + // These are critical events that need to be inserted so that tools like + // chrome dev tools can load the profile. + trace.instantEvent({ + name: "TracingStartedInPage", + id: ++counter, + cat: ["disabled-by-default-devtools.timeline"], + args: { + data: { + sessionId: "-1", + page: "0xfff", + frames: [ + { + frame: "0xfff", + url: "webpack", + name: "" + } + ] } - return "string"; - } - if (schema.type === "boolean") { - return "boolean"; } - if (schema.type === "number") { - return "number"; - } - if (schema.type === "object") { - if (schema.properties) { - const required = schema.required || []; - return `object { ${Object.keys(schema.properties) - .map(property => { - if (!required.includes(property)) return property + "?"; - return property; - }) - .concat(schema.additionalProperties ? ["…"] : []) - .join(", ")} }`; - } - if (schema.additionalProperties) { - return `object { : ${formatInnerSchema( - schema.additionalProperties - )} }`; + }); + + trace.instantEvent({ + name: "TracingStartedInBrowser", + id: ++counter, + cat: ["disabled-by-default-devtools.timeline"], + args: { + data: { + sessionId: "-1" } - return "object"; - } - if (schema.type === "array") { - return `[${formatInnerSchema(schema.items)}]`; } + }); - switch (schema.instanceof) { - case "Function": - return "function"; - case "RegExp": - return "RegExp"; + return { + trace, + counter, + profiler, + end: callback => { + // Wait until the write stream finishes. + fsStream.on("finish", () => { + callback(); + }); + // Tear down the readable trace stream. + trace.push(null); } + }; +}; - if (schema.enum) { - return schema.enum.map(item => JSON.stringify(item)).join(" | "); - } +const pluginName = "ProfilingPlugin"; - if (schema.$ref) { - return formatInnerSchema(getSchemaPart(schema.$ref), true); - } - if (schema.allOf) { - return schema.allOf.map(formatInnerSchema).join(" & "); - } - if (schema.oneOf) { - return schema.oneOf.map(formatInnerSchema).join(" | "); - } - if (schema.anyOf) { - return schema.anyOf.map(formatInnerSchema).join(" | "); - } - return JSON.stringify(schema, null, 2); +class ProfilingPlugin { + /** + * @param {ProfilingPluginOptions=} opts options object + */ + constructor(opts) { + validateOptions(schema, opts || {}, "Profiling plugin"); + opts = opts || {}; + this.outputPath = opts.outputPath || "events.json"; } - static formatValidationError(err) { - const dataPath = `configuration${err.dataPath}`; - if (err.keyword === "additionalProperties") { - const baseMessage = `${dataPath} has an unknown property '${ - err.params.additionalProperty - }'. These properties are valid:\n${getSchemaPartText(err.parentSchema)}`; - if (!err.dataPath) { - switch (err.params.additionalProperty) { - case "debug": - return ( - `${baseMessage}\n` + - "The 'debug' property was removed in webpack 2.0.0.\n" + - "Loaders should be updated to allow passing this option via loader options in module.rules.\n" + - "Until loaders are updated one can use the LoaderOptionsPlugin to switch loaders into debug mode:\n" + - "plugins: [\n" + - " new webpack.LoaderOptionsPlugin({\n" + - " debug: true\n" + - " })\n" + - "]" - ); - } - return ( - `${baseMessage}\n` + - "For typos: please correct them.\n" + - "For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration.\n" + - " Loaders should be updated to allow passing options via loader options in module.rules.\n" + - " Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:\n" + - " plugins: [\n" + - " new webpack.LoaderOptionsPlugin({\n" + - " // test: /\\.xxx$/, // may apply this only for some modules\n" + - " options: {\n" + - ` ${err.params.additionalProperty}: …\n` + - " }\n" + - " })\n" + - " ]" - ); - } - return baseMessage; - } else if (err.keyword === "oneOf" || err.keyword === "anyOf") { - if (err.children && err.children.length > 0) { - if (err.schema.length === 1) { - const lastChild = err.children[err.children.length - 1]; - const remainingChildren = err.children.slice( - 0, - err.children.length - 1 - ); - return WebpackOptionsValidationError.formatValidationError( - Object.assign({}, lastChild, { - children: remainingChildren, - parentSchema: Object.assign( - {}, - err.parentSchema, - lastChild.parentSchema - ) - }) - ); - } - const children = filterChildren(err.children); - if (children.length === 1) { - return WebpackOptionsValidationError.formatValidationError( - children[0] - ); - } - return ( - `${dataPath} should be one of these:\n${getSchemaPartText( - err.parentSchema - )}\n` + - `Details:\n${children - .map( - err => - " * " + - indent( - WebpackOptionsValidationError.formatValidationError(err), - " ", - false - ) - ) - .join("\n")}` + apply(compiler) { + const tracer = createTrace(this.outputPath); + tracer.profiler.startProfiling(); + + // Compiler Hooks + Object.keys(compiler.hooks).forEach(hookName => { + compiler.hooks[hookName].intercept( + makeInterceptorFor("Compiler", tracer)(hookName) + ); + }); + + Object.keys(compiler.resolverFactory.hooks).forEach(hookName => { + compiler.resolverFactory.hooks[hookName].intercept( + makeInterceptorFor("Resolver", tracer)(hookName) + ); + }); + + compiler.hooks.compilation.tap( + pluginName, + (compilation, { normalModuleFactory, contextModuleFactory }) => { + interceptAllHooksFor(compilation, tracer, "Compilation"); + interceptAllHooksFor( + normalModuleFactory, + tracer, + "Normal Module Factory" ); - } - return `${dataPath} should be one of these:\n${getSchemaPartText( - err.parentSchema - )}`; - } else if (err.keyword === "enum") { - if ( - err.parentSchema && - err.parentSchema.enum && - err.parentSchema.enum.length === 1 - ) { - return `${dataPath} should be ${getSchemaPartText(err.parentSchema)}`; - } - return `${dataPath} should be one of these:\n${getSchemaPartText( - err.parentSchema - )}`; - } else if (err.keyword === "allOf") { - return `${dataPath} should be:\n${getSchemaPartText(err.parentSchema)}`; - } else if (err.keyword === "type") { - switch (err.params.type) { - case "object": - return `${dataPath} should be an object.${getSchemaPartDescription( - err.parentSchema - )}`; - case "string": - return `${dataPath} should be a string.${getSchemaPartDescription( - err.parentSchema - )}`; - case "boolean": - return `${dataPath} should be a boolean.${getSchemaPartDescription( - err.parentSchema - )}`; - case "number": - return `${dataPath} should be a number.${getSchemaPartDescription( - err.parentSchema - )}`; - case "array": - return `${dataPath} should be an array:\n${getSchemaPartText( - err.parentSchema - )}`; - } - return `${dataPath} should be ${err.params.type}:\n${getSchemaPartText( - err.parentSchema - )}`; - } else if (err.keyword === "instanceof") { - return `${dataPath} should be an instance of ${getSchemaPartText( - err.parentSchema - )}`; - } else if (err.keyword === "required") { - const missingProperty = err.params.missingProperty.replace(/^\./, ""); - return `${dataPath} misses the property '${missingProperty}'.\n${getSchemaPartText( - err.parentSchema, - ["properties", missingProperty] - )}`; - } else if (err.keyword === "minimum") { - return `${dataPath} ${err.message}.${getSchemaPartDescription( - err.parentSchema - )}`; - } else if (err.keyword === "uniqueItems") { - return `${dataPath} should not contain the item '${ - err.data[err.params.i] - }' twice.${getSchemaPartDescription(err.parentSchema)}`; - } else if ( - err.keyword === "minLength" || - err.keyword === "minItems" || - err.keyword === "minProperties" - ) { - if (err.params.limit === 1) { - switch (err.keyword) { - case "minLength": - return `${dataPath} should be an non-empty string.${getSchemaPartDescription( - err.parentSchema - )}`; - case "minItems": - return `${dataPath} should be an non-empty array.${getSchemaPartDescription( - err.parentSchema - )}`; - case "minProperties": - return `${dataPath} should be an non-empty object.${getSchemaPartDescription( - err.parentSchema - )}`; - } - return `${dataPath} should be not empty.${getSchemaPartDescription( - err.parentSchema - )}`; - } else { - return `${dataPath} ${err.message}${getSchemaPartDescription( - err.parentSchema - )}`; - } - } else if (err.keyword === "not") { - return `${dataPath} should not be ${getSchemaPartText( - err.schema - )}\n${getSchemaPartText(err.parentSchema)}`; - } else if (err.keyword === "absolutePath") { - const baseMessage = `${dataPath}: ${ - err.message - }${getSchemaPartDescription(err.parentSchema)}`; - if (dataPath === "configuration.output.filename") { - return ( - `${baseMessage}\n` + - "Please use output.path to specify absolute path and output.filename for the file name." + interceptAllHooksFor( + contextModuleFactory, + tracer, + "Context Module Factory" ); + interceptAllParserHooks(normalModuleFactory, tracer); + interceptTemplateInstancesFrom(compilation, tracer); } - return baseMessage; - } else { - return `${dataPath} ${err.message} (${JSON.stringify( - err, - null, - 2 - )}).\n${getSchemaPartText(err.parentSchema)}`; - } - } -} - -module.exports = WebpackOptionsValidationError; + ); + // We need to write out the CPU profile when we are all done. + compiler.hooks.done.tapAsync( + { + name: pluginName, + stage: Infinity + }, + (stats, callback) => { + tracer.profiler.stopProfiling().then(parsedResults => { + if (parsedResults === undefined) { + tracer.profiler.destroy(); + tracer.trace.flush(); + tracer.end(callback); + return; + } -/***/ }), + const cpuStartTime = parsedResults.profile.startTime; + const cpuEndTime = parsedResults.profile.endTime; -/***/ 52337: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + tracer.trace.completeEvent({ + name: "TaskQueueManager::ProcessTaskFromWorkQueue", + id: ++tracer.counter, + cat: ["toplevel"], + ts: cpuStartTime, + args: { + src_file: "../../ipc/ipc_moji_bootstrap.cc", + src_func: "Accept" + } + }); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + tracer.trace.completeEvent({ + name: "EvaluateScript", + id: ++tracer.counter, + cat: ["devtools.timeline"], + ts: cpuStartTime, + dur: cpuEndTime - cpuStartTime, + args: { + data: { + url: "webpack", + lineNumber: 1, + columnNumber: 1, + frame: "0xFFF" + } + } + }); + tracer.trace.instantEvent({ + name: "CpuProfile", + id: ++tracer.counter, + cat: ["disabled-by-default-devtools.timeline"], + ts: cpuEndTime, + args: { + data: { + cpuProfile: parsedResults.profile + } + } + }); + tracer.profiler.destroy(); + tracer.trace.flush(); + tracer.end(callback); + }); + } + ); + } +} -const AsyncDependencyToInitialChunkError = __webpack_require__(67089); -const GraphHelpers = __webpack_require__(32973); +const interceptTemplateInstancesFrom = (compilation, tracer) => { + const { + mainTemplate, + chunkTemplate, + hotUpdateChunkTemplate, + moduleTemplates + } = compilation; -/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ -/** @typedef {import("./Chunk")} Chunk */ -/** @typedef {import("./ChunkGroup")} ChunkGroup */ -/** @typedef {import("./Compilation")} Compilation */ -/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ -/** @typedef {import("./Dependency")} Dependency */ -/** @typedef {import("./Entrypoint")} Entrypoint */ -/** @typedef {import("./Module")} Module */ + const { javascript, webassembly } = moduleTemplates; -/** - * @typedef {Object} QueueItem - * @property {number} action - * @property {DependenciesBlock} block - * @property {Module} module - * @property {Chunk} chunk - * @property {ChunkGroup} chunkGroup - */ + [ + { + instance: mainTemplate, + name: "MainTemplate" + }, + { + instance: chunkTemplate, + name: "ChunkTemplate" + }, + { + instance: hotUpdateChunkTemplate, + name: "HotUpdateChunkTemplate" + }, + { + instance: javascript, + name: "JavaScriptModuleTemplate" + }, + { + instance: webassembly, + name: "WebAssemblyModuleTemplate" + } + ].forEach(templateObject => { + Object.keys(templateObject.instance.hooks).forEach(hookName => { + templateObject.instance.hooks[hookName].intercept( + makeInterceptorFor(templateObject.name, tracer)(hookName) + ); + }); + }); +}; -/** - * @typedef {Object} ChunkGroupInfo - * @property {ChunkGroup} chunkGroup the chunk group - * @property {Set} minAvailableModules current minimal set of modules available at this point - * @property {boolean} minAvailableModulesOwned true, if minAvailableModules is owned and can be modified - * @property {Set[]} availableModulesToBeMerged enqueued updates to the minimal set of available modules - * @property {QueueItem[]} skippedItems queue items that were skipped because module is already available in parent chunks (need to reconsider when minAvailableModules is shrinking) - * @property {Set} resultingAvailableModules set of modules available including modules from this chunk group - * @property {Set} children set of children chunk groups, that will be revisited when availableModules shrink - */ +const interceptAllHooksFor = (instance, tracer, logLabel) => { + if (Reflect.has(instance, "hooks")) { + Object.keys(instance.hooks).forEach(hookName => { + instance.hooks[hookName].intercept( + makeInterceptorFor(logLabel, tracer)(hookName) + ); + }); + } +}; -/** - * @typedef {Object} ChunkGroupDep - * @property {AsyncDependenciesBlock} block referencing block - * @property {ChunkGroup} chunkGroup referenced chunk group - */ +const interceptAllParserHooks = (moduleFactory, tracer) => { + const moduleTypes = [ + "javascript/auto", + "javascript/dynamic", + "javascript/esm", + "json", + "webassembly/experimental" + ]; -/** - * @template T - * @param {Set} a first set - * @param {Set} b second set - * @returns {number} cmp - */ -const bySetSize = (a, b) => { - return b.size - a.size; + moduleTypes.forEach(moduleType => { + moduleFactory.hooks.parser + .for(moduleType) + .tap("ProfilingPlugin", (parser, parserOpts) => { + interceptAllHooksFor(parser, tracer, "Parser"); + }); + }); }; +const makeInterceptorFor = (instance, tracer) => hookName => ({ + register: ({ name, type, context, fn }) => { + const newFn = makeNewProfiledTapFn(hookName, tracer, { + name, + type, + fn + }); + return { + name, + type, + context, + fn: newFn + }; + } +}); + +// TODO improve typing +/** @typedef {(...args: TODO[]) => void | Promise} PluginFunction */ + /** - * Extracts simplified info from the modules and their dependencies - * @param {Compilation} compilation the compilation - * @returns {Map, blocks: AsyncDependenciesBlock[]}>} the mapping block to modules and inner blocks + * @param {string} hookName Name of the hook to profile. + * @param {Trace} tracer The trace object. + * @param {object} options Options for the profiled fn. + * @param {string} options.name Plugin name + * @param {string} options.type Plugin type (sync | async | promise) + * @param {PluginFunction} options.fn Plugin function + * @returns {PluginFunction} Chainable hooked function. */ -const extraceBlockInfoMap = compilation => { - /** @type {Map, blocks: AsyncDependenciesBlock[]}>} */ - const blockInfoMap = new Map(); +const makeNewProfiledTapFn = (hookName, tracer, { name, type, fn }) => { + const defaultCategory = ["blink.user_timing"]; - /** - * @param {Dependency} d dependency to iterate over - * @returns {void} - */ - const iteratorDependency = d => { - // We skip Dependencies without Reference - const ref = compilation.getDependencyReference(currentModule, d); - if (!ref) { - return; - } - // We skip Dependencies without Module pointer - const refModule = ref.module; - if (!refModule) { - return; - } - // We skip weak Dependencies - if (ref.weak) { - return; - } + switch (type) { + case "promise": + return (...args) => { + const id = ++tracer.counter; + tracer.trace.begin({ + name, + id, + cat: defaultCategory + }); + const promise = /** @type {Promise<*>} */ (fn(...args)); + return promise.then(r => { + tracer.trace.end({ + name, + id, + cat: defaultCategory + }); + return r; + }); + }; + case "async": + return (...args) => { + const id = ++tracer.counter; + tracer.trace.begin({ + name, + id, + cat: defaultCategory + }); + const callback = args.pop(); + fn(...args, (...r) => { + tracer.trace.end({ + name, + id, + cat: defaultCategory + }); + callback(...r); + }); + }; + case "sync": + return (...args) => { + const id = ++tracer.counter; + // Do not instrument ourself due to the CPU + // profile needing to be the last event in the trace. + if (name === pluginName) { + return fn(...args); + } - blockInfoModules.add(refModule); - }; + tracer.trace.begin({ + name, + id, + cat: defaultCategory + }); + let r; + try { + r = fn(...args); + } catch (error) { + tracer.trace.end({ + name, + id, + cat: defaultCategory + }); + throw error; + } + tracer.trace.end({ + name, + id, + cat: defaultCategory + }); + return r; + }; + default: + break; + } +}; - /** - * @param {AsyncDependenciesBlock} b blocks to prepare - * @returns {void} - */ - const iteratorBlockPrepare = b => { - blockInfoBlocks.push(b); - blockQueue.push(b); - }; +module.exports = ProfilingPlugin; +module.exports.Profiler = Profiler; - /** @type {Module} */ - let currentModule; - /** @type {DependenciesBlock} */ - let block; - /** @type {DependenciesBlock[]} */ - let blockQueue; - /** @type {Set} */ - let blockInfoModules; - /** @type {AsyncDependenciesBlock[]} */ - let blockInfoBlocks; - for (const module of compilation.modules) { - blockQueue = [module]; - currentModule = module; - while (blockQueue.length > 0) { - block = blockQueue.pop(); - blockInfoModules = new Set(); - blockInfoBlocks = []; +/***/ }), - if (block.variables) { - for (const variable of block.variables) { - for (const dep of variable.dependencies) iteratorDependency(dep); - } - } +/***/ 67045: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (block.dependencies) { - for (const dep of block.dependencies) iteratorDependency(dep); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (block.blocks) { - for (const b of block.blocks) iteratorBlockPrepare(b); - } +const NullDependency = __webpack_require__(5088); - const blockInfo = { - modules: blockInfoModules, - blocks: blockInfoBlocks - }; - blockInfoMap.set(block, blockInfo); - } +class AMDDefineDependency extends NullDependency { + constructor(range, arrayRange, functionRange, objectRange, namedModule) { + super(); + this.range = range; + this.arrayRange = arrayRange; + this.functionRange = functionRange; + this.objectRange = objectRange; + this.namedModule = namedModule; + this.localModule = null; } - return blockInfoMap; -}; - -/** - * - * @param {Compilation} compilation the compilation - * @param {Entrypoint[]} inputChunkGroups input groups - * @param {Map} chunkGroupInfoMap mapping from chunk group to available modules - * @param {Map} chunkDependencies dependencies for chunk groups - * @param {Set} blocksWithNestedBlocks flag for blocks that have nested blocks - * @param {Set} allCreatedChunkGroups filled with all chunk groups that are created here - */ -const visitModules = ( - compilation, - inputChunkGroups, - chunkGroupInfoMap, - chunkDependencies, - blocksWithNestedBlocks, - allCreatedChunkGroups -) => { - const logger = compilation.getLogger("webpack.buildChunkGraph.visitModules"); - const { namedChunkGroups } = compilation; + get type() { + return "amd define"; + } +} - logger.time("prepare"); - const blockInfoMap = extraceBlockInfoMap(compilation); +AMDDefineDependency.Template = class AMDDefineDependencyTemplate { + get definitions() { + return { + f: [ + "var __WEBPACK_AMD_DEFINE_RESULT__;", + `!(__WEBPACK_AMD_DEFINE_RESULT__ = (#).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))` + ], + o: ["", "!(module.exports = #)"], + of: [ + "var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;", + `!(__WEBPACK_AMD_DEFINE_FACTORY__ = (#), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))` + ], + af: [ + "var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;", + `!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_RESULT__ = (#).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))` + ], + ao: ["", "!(#, module.exports = #)"], + aof: [ + "var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;", + `!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_FACTORY__ = (#), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))` + ], + lf: [ + "var XXX, XXXmodule;", + "!(XXXmodule = { id: YYY, exports: {}, loaded: false }, XXX = #.call(XXXmodule.exports, __webpack_require__, XXXmodule.exports, XXXmodule), XXXmodule.loaded = true, XXX === undefined && (XXX = XXXmodule.exports))" + ], + lo: ["var XXX;", "!(XXX = #)"], + lof: [ + "var XXX, XXXfactory, XXXmodule;", + "!(XXXfactory = (#), (XXXmodule = { id: YYY, exports: {}, loaded: false }), XXX = (typeof XXXfactory === 'function' ? (XXXfactory.call(XXXmodule.exports, __webpack_require__, XXXmodule.exports, XXXmodule)) : XXXfactory), (XXXmodule.loaded = true), XXX === undefined && (XXX = XXXmodule.exports))" + ], + laf: [ + "var __WEBPACK_AMD_DEFINE_ARRAY__, XXX;", + "!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, XXX = ((#).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)))" + ], + lao: ["var XXX;", "!(#, XXX = #)"], + laof: [ + "var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_FACTORY__, XXX;", + `!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_FACTORY__ = (#), + XXX = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__))` + ] + }; + } - /** @type {Map} */ - const chunkGroupCounters = new Map(); - for (const chunkGroup of inputChunkGroups) { - chunkGroupCounters.set(chunkGroup, { - index: 0, - index2: 0 - }); + apply(dependency, source) { + const branch = this.branch(dependency); + const defAndText = this.definitions[branch]; + const definitions = defAndText[0]; + const text = defAndText[1]; + this.replace(dependency, source, definitions, text); } - let nextFreeModuleIndex = 0; - let nextFreeModuleIndex2 = 0; + localModuleVar(dependency) { + return ( + dependency.localModule && + dependency.localModule.used && + dependency.localModule.variableName() + ); + } - /** @type {Map} */ - const blockChunkGroups = new Map(); + branch(dependency) { + const localModuleVar = this.localModuleVar(dependency) ? "l" : ""; + const arrayRange = dependency.arrayRange ? "a" : ""; + const objectRange = dependency.objectRange ? "o" : ""; + const functionRange = dependency.functionRange ? "f" : ""; + return localModuleVar + arrayRange + objectRange + functionRange; + } - const ADD_AND_ENTER_MODULE = 0; - const ENTER_MODULE = 1; - const PROCESS_BLOCK = 2; - const LEAVE_MODULE = 3; + replace(dependency, source, definition, text) { + const localModuleVar = this.localModuleVar(dependency); + if (localModuleVar) { + text = text.replace(/XXX/g, localModuleVar.replace(/\$/g, "$$$$")); + definition = definition.replace( + /XXX/g, + localModuleVar.replace(/\$/g, "$$$$") + ); + } - /** - * @param {QueueItem[]} queue the queue array (will be mutated) - * @param {ChunkGroup} chunkGroup chunk group - * @returns {QueueItem[]} the queue array again - */ - const reduceChunkGroupToQueueItem = (queue, chunkGroup) => { - for (const chunk of chunkGroup.chunks) { - const module = chunk.entryModule; - queue.push({ - action: ENTER_MODULE, - block: module, - module, - chunk, - chunkGroup - }); + if (dependency.namedModule) { + text = text.replace(/YYY/g, JSON.stringify(dependency.namedModule)); } - chunkGroupInfoMap.set(chunkGroup, { - chunkGroup, - minAvailableModules: new Set(), - minAvailableModulesOwned: true, - availableModulesToBeMerged: [], - skippedItems: [], - resultingAvailableModules: undefined, - children: undefined - }); - return queue; - }; - // Start with the provided modules/chunks - /** @type {QueueItem[]} */ - let queue = inputChunkGroups - .reduce(reduceChunkGroupToQueueItem, []) - .reverse(); - /** @type {Map>} */ - const queueConnect = new Map(); - /** @type {Set} */ - const outdatedChunkGroupInfo = new Set(); - /** @type {QueueItem[]} */ - let queueDelayed = []; + const texts = text.split("#"); - logger.timeEnd("prepare"); + if (definition) source.insert(0, definition); - /** @type {Module} */ - let module; - /** @type {Chunk} */ - let chunk; - /** @type {ChunkGroup} */ - let chunkGroup; - /** @type {DependenciesBlock} */ - let block; - /** @type {Set} */ - let minAvailableModules; - /** @type {QueueItem[]} */ - let skippedItems; + let current = dependency.range[0]; + if (dependency.arrayRange) { + source.replace(current, dependency.arrayRange[0] - 1, texts.shift()); + current = dependency.arrayRange[1]; + } - // For each async Block in graph - /** - * @param {AsyncDependenciesBlock} b iterating over each Async DepBlock - * @returns {void} - */ - const iteratorBlock = b => { - // 1. We create a chunk for this Block - // but only once (blockChunkGroups map) - let c = blockChunkGroups.get(b); - if (c === undefined) { - c = namedChunkGroups.get(b.chunkName); - if (c && c.isInitial()) { - compilation.errors.push( - new AsyncDependencyToInitialChunkError(b.chunkName, module, b.loc) - ); - c = chunkGroup; - } else { - c = compilation.addChunkInGroup( - b.groupOptions || b.chunkName, - module, - b.loc, - b.request - ); - chunkGroupCounters.set(c, { index: 0, index2: 0 }); - blockChunkGroups.set(b, c); - allCreatedChunkGroups.add(c); - } - } else { - // TODO webpack 5 remove addOptions check - if (c.addOptions) c.addOptions(b.groupOptions); - c.addOrigin(module, b.loc, b.request); + if (dependency.objectRange) { + source.replace(current, dependency.objectRange[0] - 1, texts.shift()); + current = dependency.objectRange[1]; + } else if (dependency.functionRange) { + source.replace(current, dependency.functionRange[0] - 1, texts.shift()); + current = dependency.functionRange[1]; } + source.replace(current, dependency.range[1] - 1, texts.shift()); + if (texts.length > 0) throw new Error("Implementation error"); + } +}; - // 2. We store the Block+Chunk mapping as dependency for the chunk - let deps = chunkDependencies.get(chunkGroup); - if (!deps) chunkDependencies.set(chunkGroup, (deps = [])); - deps.push({ - block: b, - chunkGroup: c - }); +module.exports = AMDDefineDependency; - // 3. We create/update the chunk group info - let connectList = queueConnect.get(chunkGroup); - if (connectList === undefined) { - connectList = new Set(); - queueConnect.set(chunkGroup, connectList); - } - connectList.add(c); - // 4. We enqueue the DependenciesBlock for traversal - queueDelayed.push({ - action: PROCESS_BLOCK, - block: b, - module: module, - chunk: c.chunks[0], - chunkGroup: c - }); - }; +/***/ }), - // Iterative traversal of the Module graph - // Recursive would be simpler to write but could result in Stack Overflows - while (queue.length) { - logger.time("visiting"); - while (queue.length) { - const queueItem = queue.pop(); - module = queueItem.module; - block = queueItem.block; - chunk = queueItem.chunk; - if (chunkGroup !== queueItem.chunkGroup) { - chunkGroup = queueItem.chunkGroup; - const chunkGroupInfo = chunkGroupInfoMap.get(chunkGroup); - minAvailableModules = chunkGroupInfo.minAvailableModules; - skippedItems = chunkGroupInfo.skippedItems; - } +/***/ 27057: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - switch (queueItem.action) { - case ADD_AND_ENTER_MODULE: { - if (minAvailableModules.has(module)) { - // already in parent chunks - // skip it for now, but enqueue for rechecking when minAvailableModules shrinks - skippedItems.push(queueItem); - break; - } - // We connect Module and Chunk when not already done - if (chunk.addModule(module)) { - module.addChunk(chunk); - } else { - // already connected, skip it - break; - } - } - // fallthrough - case ENTER_MODULE: { - if (chunkGroup !== undefined) { - const index = chunkGroup.getModuleIndex(module); - if (index === undefined) { - chunkGroup.setModuleIndex( - module, - chunkGroupCounters.get(chunkGroup).index++ - ); - } - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (module.index === null) { - module.index = nextFreeModuleIndex++; - } - queue.push({ - action: LEAVE_MODULE, - block, - module, - chunk, - chunkGroup - }); - } - // fallthrough - case PROCESS_BLOCK: { - // get prepared block info - const blockInfo = blockInfoMap.get(block); +const AMDRequireItemDependency = __webpack_require__(34345); +const AMDRequireContextDependency = __webpack_require__(99890); +const ConstDependency = __webpack_require__(71101); +const AMDDefineDependency = __webpack_require__(67045); +const AMDRequireArrayDependency = __webpack_require__(63960); +const LocalModuleDependency = __webpack_require__(56570); +const ContextDependencyHelpers = __webpack_require__(5594); +const LocalModulesHelpers = __webpack_require__(39658); - // Buffer items because order need to be reverse to get indicies correct - const skipBuffer = []; - const queueBuffer = []; - // Traverse all referenced modules - for (const refModule of blockInfo.modules) { - if (chunk.containsModule(refModule)) { - // skip early if already connected - continue; - } - if (minAvailableModules.has(refModule)) { - // already in parent chunks, skip it for now - skipBuffer.push({ - action: ADD_AND_ENTER_MODULE, - block: refModule, - module: refModule, - chunk, - chunkGroup - }); - continue; - } - // enqueue the add and enter to enter in the correct order - // this is relevant with circular dependencies - queueBuffer.push({ - action: ADD_AND_ENTER_MODULE, - block: refModule, - module: refModule, - chunk, - chunkGroup - }); - } - // Add buffered items in reversed order - for (let i = skipBuffer.length - 1; i >= 0; i--) { - skippedItems.push(skipBuffer[i]); - } - for (let i = queueBuffer.length - 1; i >= 0; i--) { - queue.push(queueBuffer[i]); - } +const isBoundFunctionExpression = expr => { + if (expr.type !== "CallExpression") return false; + if (expr.callee.type !== "MemberExpression") return false; + if (expr.callee.computed) return false; + if (expr.callee.object.type !== "FunctionExpression") return false; + if (expr.callee.property.type !== "Identifier") return false; + if (expr.callee.property.name !== "bind") return false; + return true; +}; - // Traverse all Blocks - for (const block of blockInfo.blocks) iteratorBlock(block); +const isUnboundFunctionExpression = expr => { + if (expr.type === "FunctionExpression") return true; + if (expr.type === "ArrowFunctionExpression") return true; + return false; +}; - if (blockInfo.blocks.length > 0 && module !== block) { - blocksWithNestedBlocks.add(block); - } - break; - } - case LEAVE_MODULE: { - if (chunkGroup !== undefined) { - const index = chunkGroup.getModuleIndex2(module); - if (index === undefined) { - chunkGroup.setModuleIndex2( - module, - chunkGroupCounters.get(chunkGroup).index2++ - ); - } - } +const isCallable = expr => { + if (isUnboundFunctionExpression(expr)) return true; + if (isBoundFunctionExpression(expr)) return true; + return false; +}; - if (module.index2 === null) { - module.index2 = nextFreeModuleIndex2++; - } - break; +class AMDDefineDependencyParserPlugin { + constructor(options) { + this.options = options; + } + + apply(parser) { + parser.hooks.call + .for("define") + .tap( + "AMDDefineDependencyParserPlugin", + this.processCallDefine.bind(this, parser) + ); + } + + processArray(parser, expr, param, identifiers, namedModule) { + if (param.isArray()) { + param.items.forEach((param, idx) => { + if ( + param.isString() && + ["require", "module", "exports"].includes(param.string) + ) + identifiers[idx] = param.string; + const result = this.processItem(parser, expr, param, namedModule); + if (result === undefined) { + this.processContext(parser, expr, param); + } + }); + return true; + } else if (param.isConstArray()) { + const deps = []; + param.array.forEach((request, idx) => { + let dep; + let localModule; + if (request === "require") { + identifiers[idx] = request; + dep = "__webpack_require__"; + } else if (["exports", "module"].includes(request)) { + identifiers[idx] = request; + dep = request; + } else if ( + (localModule = LocalModulesHelpers.getLocalModule( + parser.state, + request + )) + ) { + dep = new LocalModuleDependency(localModule, undefined, false); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + } else { + dep = this.newRequireItemDependency(request); + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + } + deps.push(dep); + }); + const dep = this.newRequireArrayDependency(deps, param.range); + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; + } + } + processItem(parser, expr, param, namedModule) { + if (param.isConditional()) { + param.options.forEach(param => { + const result = this.processItem(parser, expr, param); + if (result === undefined) { + this.processContext(parser, expr, param); } + }); + return true; + } else if (param.isString()) { + let dep, localModule; + if (param.string === "require") { + dep = new ConstDependency("__webpack_require__", param.range); + } else if (["require", "exports", "module"].includes(param.string)) { + dep = new ConstDependency(param.string, param.range); + } else if ( + (localModule = LocalModulesHelpers.getLocalModule( + parser.state, + param.string, + namedModule + )) + ) { + dep = new LocalModuleDependency(localModule, param.range, false); + } else { + dep = this.newRequireItemDependency(param.string, param.range); } + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; } - logger.timeEnd("visiting"); - - while (queueConnect.size > 0) { - logger.time("calculating available modules"); - - // Figure out new parents for chunk groups - // to get new available modules for these children - for (const [chunkGroup, targets] of queueConnect) { - const info = chunkGroupInfoMap.get(chunkGroup); - let minAvailableModules = info.minAvailableModules; + } + processContext(parser, expr, param) { + const dep = ContextDependencyHelpers.create( + AMDRequireContextDependency, + param.range, + param, + expr, + this.options, + {}, + parser + ); + if (!dep) return; + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; + } - // 1. Create a new Set of available modules at this points - const resultingAvailableModules = new Set(minAvailableModules); - for (const chunk of chunkGroup.chunks) { - for (const m of chunk.modulesIterable) { - resultingAvailableModules.add(m); - } + processCallDefine(parser, expr) { + let array, fn, obj, namedModule; + switch (expr.arguments.length) { + case 1: + if (isCallable(expr.arguments[0])) { + // define(f() {…}) + fn = expr.arguments[0]; + } else if (expr.arguments[0].type === "ObjectExpression") { + // define({…}) + obj = expr.arguments[0]; + } else { + // define(expr) + // unclear if function or object + obj = fn = expr.arguments[0]; } - info.resultingAvailableModules = resultingAvailableModules; - if (info.children === undefined) { - info.children = targets; + break; + case 2: + if (expr.arguments[0].type === "Literal") { + namedModule = expr.arguments[0].value; + // define("…", …) + if (isCallable(expr.arguments[1])) { + // define("…", f() {…}) + fn = expr.arguments[1]; + } else if (expr.arguments[1].type === "ObjectExpression") { + // define("…", {…}) + obj = expr.arguments[1]; + } else { + // define("…", expr) + // unclear if function or object + obj = fn = expr.arguments[1]; + } } else { - for (const target of targets) { - info.children.add(target); + array = expr.arguments[0]; + if (isCallable(expr.arguments[1])) { + // define([…], f() {}) + fn = expr.arguments[1]; + } else if (expr.arguments[1].type === "ObjectExpression") { + // define([…], {…}) + obj = expr.arguments[1]; + } else { + // define([…], expr) + // unclear if function or object + obj = fn = expr.arguments[1]; } } - - // 2. Update chunk group info - for (const target of targets) { - let chunkGroupInfo = chunkGroupInfoMap.get(target); - if (chunkGroupInfo === undefined) { - chunkGroupInfo = { - chunkGroup: target, - minAvailableModules: undefined, - minAvailableModulesOwned: undefined, - availableModulesToBeMerged: [], - skippedItems: [], - resultingAvailableModules: undefined, - children: undefined - }; - chunkGroupInfoMap.set(target, chunkGroupInfo); - } - chunkGroupInfo.availableModulesToBeMerged.push( - resultingAvailableModules - ); - outdatedChunkGroupInfo.add(chunkGroupInfo); + break; + case 3: + // define("…", […], f() {…}) + namedModule = expr.arguments[0].value; + array = expr.arguments[1]; + if (isCallable(expr.arguments[2])) { + // define("…", […], f() {}) + fn = expr.arguments[2]; + } else if (expr.arguments[2].type === "ObjectExpression") { + // define("…", […], {…}) + obj = expr.arguments[2]; + } else { + // define("…", […], expr) + // unclear if function or object + obj = fn = expr.arguments[2]; + } + break; + default: + return; + } + let fnParams = null; + let fnParamsOffset = 0; + if (fn) { + if (isUnboundFunctionExpression(fn)) { + fnParams = fn.params; + } else if (isBoundFunctionExpression(fn)) { + fnParams = fn.callee.object.params; + fnParamsOffset = fn.arguments.length - 1; + if (fnParamsOffset < 0) { + fnParamsOffset = 0; } } - queueConnect.clear(); - logger.timeEnd("calculating available modules"); - - if (outdatedChunkGroupInfo.size > 0) { - logger.time("merging available modules"); - // Execute the merge - for (const info of outdatedChunkGroupInfo) { - const availableModulesToBeMerged = info.availableModulesToBeMerged; - let cachedMinAvailableModules = info.minAvailableModules; - - // 1. Get minimal available modules - // It doesn't make sense to traverse a chunk again with more available modules. - // This step calculates the minimal available modules and skips traversal when - // the list didn't shrink. - if (availableModulesToBeMerged.length > 1) { - availableModulesToBeMerged.sort(bySetSize); - } - let changed = false; - for (const availableModules of availableModulesToBeMerged) { - if (cachedMinAvailableModules === undefined) { - cachedMinAvailableModules = availableModules; - info.minAvailableModules = cachedMinAvailableModules; - info.minAvailableModulesOwned = false; - changed = true; - } else { - if (info.minAvailableModulesOwned) { - // We own it and can modify it - for (const m of cachedMinAvailableModules) { - if (!availableModules.has(m)) { - cachedMinAvailableModules.delete(m); - changed = true; - } - } - } else { - for (const m of cachedMinAvailableModules) { - if (!availableModules.has(m)) { - // cachedMinAvailableModules need to be modified - // but we don't own it - // construct a new Set as intersection of cachedMinAvailableModules and availableModules - /** @type {Set} */ - const newSet = new Set(); - const iterator = cachedMinAvailableModules[ - Symbol.iterator - ](); - /** @type {IteratorResult} */ - let it; - while (!(it = iterator.next()).done) { - const module = it.value; - if (module === m) break; - newSet.add(module); - } - while (!(it = iterator.next()).done) { - const module = it.value; - if (availableModules.has(module)) { - newSet.add(module); - } - } - cachedMinAvailableModules = newSet; - info.minAvailableModulesOwned = true; - info.minAvailableModules = newSet; - - // Update the cache from the first queue - // if the chunkGroup is currently cached - if (chunkGroup === info.chunkGroup) { - minAvailableModules = cachedMinAvailableModules; - } - - changed = true; - break; - } - } - } - } + } + let fnRenames = parser.scope.renames.createChild(); + if (array) { + const identifiers = {}; + const param = parser.evaluateExpression(array); + const result = this.processArray( + parser, + expr, + param, + identifiers, + namedModule + ); + if (!result) return; + if (fnParams) { + fnParams = fnParams.slice(fnParamsOffset).filter((param, idx) => { + if (identifiers[idx]) { + fnRenames.set(param.name, identifiers[idx]); + return false; } - availableModulesToBeMerged.length = 0; - if (!changed) continue; - - // 2. Reconsider skipped items - for (const queueItem of info.skippedItems) { - queue.push(queueItem); + return true; + }); + } + } else { + const identifiers = ["require", "exports", "module"]; + if (fnParams) { + fnParams = fnParams.slice(fnParamsOffset).filter((param, idx) => { + if (identifiers[idx]) { + fnRenames.set(param.name, identifiers[idx]); + return false; } - info.skippedItems.length = 0; - - // 3. Reconsider children chunk groups - if (info.children !== undefined) { - const chunkGroup = info.chunkGroup; - for (const c of info.children) { - let connectList = queueConnect.get(chunkGroup); - if (connectList === undefined) { - connectList = new Set(); - queueConnect.set(chunkGroup, connectList); - } - connectList.add(c); - } + return true; + }); + } + } + let inTry; + if (fn && isUnboundFunctionExpression(fn)) { + inTry = parser.scope.inTry; + parser.inScope(fnParams, () => { + parser.scope.renames = fnRenames; + parser.scope.inTry = inTry; + if (fn.body.type === "BlockStatement") { + parser.walkStatement(fn.body); + } else { + parser.walkExpression(fn.body); + } + }); + } else if (fn && isBoundFunctionExpression(fn)) { + inTry = parser.scope.inTry; + parser.inScope( + fn.callee.object.params.filter( + i => !["require", "module", "exports"].includes(i.name) + ), + () => { + parser.scope.renames = fnRenames; + parser.scope.inTry = inTry; + if (fn.callee.object.body.type === "BlockStatement") { + parser.walkStatement(fn.callee.object.body); + } else { + parser.walkExpression(fn.callee.object.body); } } - outdatedChunkGroupInfo.clear(); - logger.timeEnd("merging available modules"); + ); + if (fn.arguments) { + parser.walkExpressions(fn.arguments); } + } else if (fn || obj) { + parser.walkExpression(fn || obj); } - // Run queueDelayed when all items of the queue are processed - // This is important to get the global indicing correct - // Async blocks should be processed after all sync blocks are processed - if (queue.length === 0) { - const tempQueue = queue; - queue = queueDelayed.reverse(); - queueDelayed = tempQueue; - } - } -}; - -/** - * - * @param {Set} blocksWithNestedBlocks flag for blocks that have nested blocks - * @param {Map} chunkDependencies dependencies for chunk groups - * @param {Map} chunkGroupInfoMap mapping from chunk group to available modules - */ -const connectChunkGroups = ( - blocksWithNestedBlocks, - chunkDependencies, - chunkGroupInfoMap -) => { - /** @type {Set} */ - let resultingAvailableModules; - - /** - * Helper function to check if all modules of a chunk are available - * - * @param {ChunkGroup} chunkGroup the chunkGroup to scan - * @param {Set} availableModules the comparitor set - * @returns {boolean} return true if all modules of a chunk are available - */ - const areModulesAvailable = (chunkGroup, availableModules) => { - for (const chunk of chunkGroup.chunks) { - for (const module of chunk.modulesIterable) { - if (!availableModules.has(module)) return false; - } + const dep = this.newDefineDependency( + expr.range, + array ? array.range : null, + fn ? fn.range : null, + obj ? obj.range : null, + namedModule ? namedModule : null + ); + dep.loc = expr.loc; + if (namedModule) { + dep.localModule = LocalModulesHelpers.addLocalModule( + parser.state, + namedModule + ); } + parser.state.current.addDependency(dep); return true; - }; + } - // For each edge in the basic chunk graph - /** - * @param {ChunkGroupDep} dep the dependency used for filtering - * @returns {boolean} used to filter "edges" (aka Dependencies) that were pointing - * to modules that are already available. Also filters circular dependencies in the chunks graph - */ - const filterFn = dep => { - const depChunkGroup = dep.chunkGroup; - // TODO is this needed? - if (blocksWithNestedBlocks.has(dep.block)) return true; - if (areModulesAvailable(depChunkGroup, resultingAvailableModules)) { - return false; // break all modules are already available - } - return true; - }; + newDefineDependency( + range, + arrayRange, + functionRange, + objectRange, + namedModule + ) { + return new AMDDefineDependency( + range, + arrayRange, + functionRange, + objectRange, + namedModule + ); + } + newRequireArrayDependency(depsArray, range) { + return new AMDRequireArrayDependency(depsArray, range); + } + newRequireItemDependency(request, range) { + return new AMDRequireItemDependency(request, range); + } +} +module.exports = AMDDefineDependencyParserPlugin; - // For all deps, check if chunk groups need to be connected - for (const [chunkGroup, deps] of chunkDependencies) { - if (deps.length === 0) continue; - // 1. Get info from chunk group info map - const info = chunkGroupInfoMap.get(chunkGroup); - resultingAvailableModules = info.resultingAvailableModules; +/***/ }), - // 2. Foreach edge - for (let i = 0; i < deps.length; i++) { - const dep = deps[i]; +/***/ 85812: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // Filter inline, rather than creating a new array from `.filter()` - // TODO check if inlining filterFn makes sense here - if (!filterFn(dep)) { - continue; - } - const depChunkGroup = dep.chunkGroup; - const depBlock = dep.block; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // 5. Connect block with chunk - GraphHelpers.connectDependenciesBlockAndChunkGroup( - depBlock, - depChunkGroup - ); - // 6. Connect chunk with parent - GraphHelpers.connectChunkGroupParentAndChild(chunkGroup, depChunkGroup); - } - } -}; +const path = __webpack_require__(85622); +const AMDRequireDependency = __webpack_require__(73985); +const AMDRequireItemDependency = __webpack_require__(34345); +const AMDRequireArrayDependency = __webpack_require__(63960); +const AMDRequireContextDependency = __webpack_require__(99890); +const AMDDefineDependency = __webpack_require__(67045); +const UnsupportedDependency = __webpack_require__(15826); +const LocalModuleDependency = __webpack_require__(56570); -/** - * Remove all unconnected chunk groups - * @param {Compilation} compilation the compilation - * @param {Iterable} allCreatedChunkGroups all chunk groups that where created before - */ -const cleanupUnconnectedGroups = (compilation, allCreatedChunkGroups) => { - for (const chunkGroup of allCreatedChunkGroups) { - if (chunkGroup.getNumberOfParents() === 0) { - for (const chunk of chunkGroup.chunks) { - const idx = compilation.chunks.indexOf(chunk); - if (idx >= 0) compilation.chunks.splice(idx, 1); - chunk.remove("unconnected"); - } - chunkGroup.remove("unconnected"); - } +const NullFactory = __webpack_require__(40438); + +const AMDRequireDependenciesBlockParserPlugin = __webpack_require__(9994); +const AMDDefineDependencyParserPlugin = __webpack_require__(27057); + +const AliasPlugin = __webpack_require__(15005); + +const ParserHelpers = __webpack_require__(23999); + +class AMDPlugin { + constructor(options, amdOptions) { + this.amdOptions = amdOptions; + this.options = options; } -}; -/** - * This method creates the Chunk graph from the Module graph - * @param {Compilation} compilation the compilation - * @param {Entrypoint[]} inputChunkGroups chunk groups which are processed - * @returns {void} - */ -const buildChunkGraph = (compilation, inputChunkGroups) => { - // SHARED STATE + apply(compiler) { + const options = this.options; + const amdOptions = this.amdOptions; + compiler.hooks.compilation.tap( + "AMDPlugin", + (compilation, { contextModuleFactory, normalModuleFactory }) => { + compilation.dependencyFactories.set( + AMDRequireDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + AMDRequireDependency, + new AMDRequireDependency.Template() + ); - /** @type {Map} */ - const chunkDependencies = new Map(); + compilation.dependencyFactories.set( + AMDRequireItemDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + AMDRequireItemDependency, + new AMDRequireItemDependency.Template() + ); - /** @type {Set} */ - const allCreatedChunkGroups = new Set(); + compilation.dependencyFactories.set( + AMDRequireArrayDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + AMDRequireArrayDependency, + new AMDRequireArrayDependency.Template() + ); - /** @type {Map} */ - const chunkGroupInfoMap = new Map(); + compilation.dependencyFactories.set( + AMDRequireContextDependency, + contextModuleFactory + ); + compilation.dependencyTemplates.set( + AMDRequireContextDependency, + new AMDRequireContextDependency.Template() + ); - /** @type {Set} */ - const blocksWithNestedBlocks = new Set(); + compilation.dependencyFactories.set( + AMDDefineDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + AMDDefineDependency, + new AMDDefineDependency.Template() + ); - // PART ONE + compilation.dependencyFactories.set( + UnsupportedDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + UnsupportedDependency, + new UnsupportedDependency.Template() + ); - visitModules( - compilation, - inputChunkGroups, - chunkGroupInfoMap, - chunkDependencies, - blocksWithNestedBlocks, - allCreatedChunkGroups - ); + compilation.dependencyFactories.set( + LocalModuleDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + LocalModuleDependency, + new LocalModuleDependency.Template() + ); - // PART TWO + const handler = (parser, parserOptions) => { + if (parserOptions.amd !== undefined && !parserOptions.amd) return; - connectChunkGroups( - blocksWithNestedBlocks, - chunkDependencies, - chunkGroupInfoMap - ); + const setExpressionToModule = (outerExpr, module) => { + parser.hooks.expression.for(outerExpr).tap("AMDPlugin", expr => { + const dep = new AMDRequireItemDependency(module, expr.range); + dep.userRequest = outerExpr; + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + return true; + }); + }; - // Cleaup work + new AMDRequireDependenciesBlockParserPlugin(options).apply(parser); + new AMDDefineDependencyParserPlugin(options).apply(parser); - cleanupUnconnectedGroups(compilation, allCreatedChunkGroups); -}; + setExpressionToModule("require.amd", "!!webpack amd options"); + setExpressionToModule("define.amd", "!!webpack amd options"); + setExpressionToModule("define", "!!webpack amd define"); -module.exports = buildChunkGraph; + parser.hooks.expression + .for("__webpack_amd_options__") + .tap("AMDPlugin", () => + parser.state.current.addVariable( + "__webpack_amd_options__", + JSON.stringify(amdOptions) + ) + ); + parser.hooks.evaluateTypeof + .for("define.amd") + .tap( + "AMDPlugin", + ParserHelpers.evaluateToString(typeof amdOptions) + ); + parser.hooks.evaluateTypeof + .for("require.amd") + .tap( + "AMDPlugin", + ParserHelpers.evaluateToString(typeof amdOptions) + ); + parser.hooks.evaluateIdentifier + .for("define.amd") + .tap( + "AMDPlugin", + ParserHelpers.evaluateToIdentifier("define.amd", true) + ); + parser.hooks.evaluateIdentifier + .for("require.amd") + .tap( + "AMDPlugin", + ParserHelpers.evaluateToIdentifier("require.amd", true) + ); + parser.hooks.typeof + .for("define") + .tap( + "AMDPlugin", + ParserHelpers.toConstantDependency( + parser, + JSON.stringify("function") + ) + ); + parser.hooks.evaluateTypeof + .for("define") + .tap("AMDPlugin", ParserHelpers.evaluateToString("function")); + parser.hooks.canRename + .for("define") + .tap("AMDPlugin", ParserHelpers.approve); + parser.hooks.rename.for("define").tap("AMDPlugin", expr => { + const dep = new AMDRequireItemDependency( + "!!webpack amd define", + expr.range + ); + dep.userRequest = "define"; + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + return false; + }); + parser.hooks.typeof + .for("require") + .tap( + "AMDPlugin", + ParserHelpers.toConstantDependency( + parser, + JSON.stringify("function") + ) + ); + parser.hooks.evaluateTypeof + .for("require") + .tap("AMDPlugin", ParserHelpers.evaluateToString("function")); + }; + + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("AMDPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("AMDPlugin", handler); + } + ); + compiler.hooks.afterResolvers.tap("AMDPlugin", () => { + compiler.resolverFactory.hooks.resolver + .for("normal") + .tap("AMDPlugin", resolver => { + new AliasPlugin( + "described-resolve", + { + name: "amdefine", + alias: __webpack_require__.ab + "amd-define.js" + }, + "resolve" + ).apply(resolver); + new AliasPlugin( + "described-resolve", + { + name: "webpack amd options", + alias: __webpack_require__.ab + "amd-options.js" + }, + "resolve" + ).apply(resolver); + new AliasPlugin( + "described-resolve", + { + name: "webpack amd define", + alias: __webpack_require__.ab + "amd-define.js" + }, + "resolve" + ).apply(resolver); + }); + }); + } +} +module.exports = AMDPlugin; /***/ }), -/***/ 22562: -/***/ (function(module) { +/***/ 63960: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -78643,507 +76133,563 @@ module.exports = buildChunkGraph; Author Tobias Koppers @sokra */ +const Dependency = __webpack_require__(57282); -/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ +class AMDRequireArrayDependency extends Dependency { + constructor(depsArray, range) { + super(); + this.depsArray = depsArray; + this.range = range; + } -// TODO webpack 5 remove string type from a and b -/** - * Compare two locations - * @param {string|DependencyLocation} a A location node - * @param {string|DependencyLocation} b A location node - * @returns {-1|0|1} sorting comparator value - */ -module.exports = (a, b) => { - if (typeof a === "string") { - if (typeof b === "string") { - if (a < b) return -1; - if (a > b) return 1; - return 0; - } else if (typeof b === "object") { - return 1; - } else { - return 0; + get type() { + return "amd require array"; + } +} + +AMDRequireArrayDependency.Template = class AMDRequireArrayDependencyTemplate { + apply(dep, source, runtime) { + const content = this.getContent(dep, runtime); + source.replace(dep.range[0], dep.range[1] - 1, content); + } + + getContent(dep, runtime) { + const requires = dep.depsArray.map(dependency => { + return this.contentForDependency(dependency, runtime); + }); + return `[${requires.join(", ")}]`; + } + + contentForDependency(dep, runtime) { + if (typeof dep === "string") { + return dep; } - } else if (typeof a === "object") { - if (typeof b === "string") { - return -1; - } else if (typeof b === "object") { - if ("start" in a && "start" in b) { - const ap = a.start; - const bp = b.start; - if (ap.line < bp.line) return -1; - if (ap.line > bp.line) return 1; - if (ap.column < bp.column) return -1; - if (ap.column > bp.column) return 1; - } - if ("name" in a && "name" in b) { - if (a.name < b.name) return -1; - if (a.name > b.name) return 1; - } - if ("index" in a && "index" in b) { - if (a.index < b.index) return -1; - if (a.index > b.index) return 1; - } - return 0; + + if (dep.localModule) { + return dep.localModule.variableName(); } else { - return 0; + return runtime.moduleExports({ + module: dep.module, + request: dep.request + }); } } }; +module.exports = AMDRequireArrayDependency; + /***/ }), -/***/ 72890: +/***/ 99890: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const mkdirp = __webpack_require__(50998); -const { Tracer } = __webpack_require__(92430); -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(49049); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -/** @typedef {import("../../declarations/plugins/debug/ProfilingPlugin").ProfilingPluginOptions} ProfilingPluginOptions */ -let inspector = undefined; +const ContextDependency = __webpack_require__(11583); +class AMDRequireContextDependency extends ContextDependency { + constructor(options, range, valueRange) { + super(options); + this.range = range; + this.valueRange = valueRange; + } -try { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - inspector = __webpack_require__(57012); -} catch (e) { - console.log("Unable to CPU profile in < node 8.0"); + get type() { + return "amd require context"; + } } +AMDRequireContextDependency.Template = __webpack_require__(54380); +module.exports = AMDRequireContextDependency; -class Profiler { - constructor(inspector) { - this.session = undefined; - this.inspector = inspector; - } - hasSession() { - return this.session !== undefined; - } +/***/ }), - startProfiling() { - if (this.inspector === undefined) { - return Promise.resolve(); - } +/***/ 32894: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - try { - this.session = new inspector.Session(); - this.session.connect(); - } catch (_) { - this.session = undefined; - return Promise.resolve(); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - return Promise.all([ - this.sendCommand("Profiler.setSamplingInterval", { - interval: 100 - }), - this.sendCommand("Profiler.enable"), - this.sendCommand("Profiler.start") - ]); - } +const AsyncDependenciesBlock = __webpack_require__(22814); +const AMDRequireDependency = __webpack_require__(73985); - sendCommand(method, params) { - if (this.hasSession()) { - return new Promise((res, rej) => { - return this.session.post(method, params, (err, params) => { - if (err !== null) { - rej(err); - } else { - res(params); - } - }); - }); +module.exports = class AMDRequireDependenciesBlock extends AsyncDependenciesBlock { + constructor( + expr, + arrayRange, + functionRange, + errorCallbackRange, + module, + loc, + request + ) { + super(null, module, loc, request); + this.expr = expr; + this.outerRange = expr.range; + this.arrayRange = arrayRange; + this.functionBindThis = false; + this.functionRange = functionRange; + this.errorCallbackBindThis = false; + this.errorCallbackRange = errorCallbackRange; + this.bindThis = true; + if (arrayRange && functionRange && errorCallbackRange) { + this.range = [arrayRange[0], errorCallbackRange[1]]; + } else if (arrayRange && functionRange) { + this.range = [arrayRange[0], functionRange[1]]; + } else if (arrayRange) { + this.range = arrayRange; + } else if (functionRange) { + this.range = functionRange; } else { - return Promise.resolve(); + this.range = expr.range; } + const dep = this.newRequireDependency(); + dep.loc = loc; + this.addDependency(dep); } - destroy() { - if (this.hasSession()) { - this.session.disconnect(); - } - - return Promise.resolve(); + newRequireDependency() { + return new AMDRequireDependency(this); } +}; - stopProfiling() { - return this.sendCommand("Profiler.stop"); - } -} -/** - * an object that wraps Tracer and Profiler with a counter - * @typedef {Object} Trace - * @property {Tracer} trace instance of Tracer - * @property {number} counter Counter - * @property {Profiler} profiler instance of Profiler - * @property {Function} end the end function - */ +/***/ }), -/** - * @param {string} outputPath The location where to write the log. - * @returns {Trace} The trace object - */ -const createTrace = outputPath => { - const trace = new Tracer({ - noStream: true - }); - const profiler = new Profiler(inspector); - if (/\/|\\/.test(outputPath)) { - const dirPath = path.dirname(outputPath); - mkdirp.sync(dirPath); - } - const fsStream = fs.createWriteStream(outputPath); +/***/ 9994: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - let counter = 0; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - trace.pipe(fsStream); - // These are critical events that need to be inserted so that tools like - // chrome dev tools can load the profile. - trace.instantEvent({ - name: "TracingStartedInPage", - id: ++counter, - cat: ["disabled-by-default-devtools.timeline"], - args: { - data: { - sessionId: "-1", - page: "0xfff", - frames: [ - { - frame: "0xfff", - url: "webpack", - name: "" + +const AMDRequireItemDependency = __webpack_require__(34345); +const AMDRequireArrayDependency = __webpack_require__(63960); +const AMDRequireContextDependency = __webpack_require__(99890); +const AMDRequireDependenciesBlock = __webpack_require__(32894); +const UnsupportedDependency = __webpack_require__(15826); +const LocalModuleDependency = __webpack_require__(56570); +const ContextDependencyHelpers = __webpack_require__(5594); +const LocalModulesHelpers = __webpack_require__(39658); +const ConstDependency = __webpack_require__(71101); +const getFunctionExpression = __webpack_require__(64197); +const UnsupportedFeatureWarning = __webpack_require__(99953); + +class AMDRequireDependenciesBlockParserPlugin { + constructor(options) { + this.options = options; + } + + processFunctionArgument(parser, expression) { + let bindThis = true; + const fnData = getFunctionExpression(expression); + if (fnData) { + parser.inScope( + fnData.fn.params.filter(i => { + return !["require", "module", "exports"].includes(i.name); + }), + () => { + if (fnData.fn.body.type === "BlockStatement") { + parser.walkStatement(fnData.fn.body); + } else { + parser.walkExpression(fnData.fn.body); } - ] + } + ); + parser.walkExpressions(fnData.expressions); + if (fnData.needThis === false) { + bindThis = false; } + } else { + parser.walkExpression(expression); } - }); + return bindThis; + } - trace.instantEvent({ - name: "TracingStartedInBrowser", - id: ++counter, - cat: ["disabled-by-default-devtools.timeline"], - args: { - data: { - sessionId: "-1" + apply(parser) { + parser.hooks.call + .for("require") + .tap( + "AMDRequireDependenciesBlockParserPlugin", + this.processCallRequire.bind(this, parser) + ); + } + + processArray(parser, expr, param) { + if (param.isArray()) { + for (const p of param.items) { + const result = this.processItem(parser, expr, p); + if (result === undefined) { + this.processContext(parser, expr, p); + } + } + return true; + } else if (param.isConstArray()) { + const deps = []; + for (const request of param.array) { + let dep, localModule; + if (request === "require") { + dep = "__webpack_require__"; + } else if (["exports", "module"].includes(request)) { + dep = request; + } else if ( + (localModule = LocalModulesHelpers.getLocalModule( + parser.state, + request + )) + ) { + dep = new LocalModuleDependency(localModule, undefined, false); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + } else { + dep = this.newRequireItemDependency(request); + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + } + deps.push(dep); } + const dep = this.newRequireArrayDependency(deps, param.range); + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; } - }); - - return { - trace, - counter, - profiler, - end: callback => { - // Wait until the write stream finishes. - fsStream.on("finish", () => { - callback(); - }); - // Tear down the readable trace stream. - trace.push(null); + } + processItem(parser, expr, param) { + if (param.isConditional()) { + for (const p of param.options) { + const result = this.processItem(parser, expr, p); + if (result === undefined) { + this.processContext(parser, expr, p); + } + } + return true; + } else if (param.isString()) { + let dep, localModule; + if (param.string === "require") { + dep = new ConstDependency("__webpack_require__", param.string); + } else if (param.string === "module") { + dep = new ConstDependency( + parser.state.module.buildInfo.moduleArgument, + param.range + ); + } else if (param.string === "exports") { + dep = new ConstDependency( + parser.state.module.buildInfo.exportsArgument, + param.range + ); + } else if ( + (localModule = LocalModulesHelpers.getLocalModule( + parser.state, + param.string + )) + ) { + dep = new LocalModuleDependency(localModule, param.range, false); + } else { + dep = this.newRequireItemDependency(param.string, param.range); + } + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; } - }; -}; + } + processContext(parser, expr, param) { + const dep = ContextDependencyHelpers.create( + AMDRequireContextDependency, + param.range, + param, + expr, + this.options, + {}, + parser + ); + if (!dep) return; + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; + } -const pluginName = "ProfilingPlugin"; + processArrayForRequestString(param) { + if (param.isArray()) { + const result = param.items.map(item => + this.processItemForRequestString(item) + ); + if (result.every(Boolean)) return result.join(" "); + } else if (param.isConstArray()) { + return param.array.join(" "); + } + } -class ProfilingPlugin { - /** - * @param {ProfilingPluginOptions=} opts options object - */ - constructor(opts) { - validateOptions(schema, opts || {}, "Profiling plugin"); - opts = opts || {}; - this.outputPath = opts.outputPath || "events.json"; + processItemForRequestString(param) { + if (param.isConditional()) { + const result = param.options.map(item => + this.processItemForRequestString(item) + ); + if (result.every(Boolean)) return result.join("|"); + } else if (param.isString()) { + return param.string; + } } - apply(compiler) { - const tracer = createTrace(this.outputPath); - tracer.profiler.startProfiling(); + processCallRequire(parser, expr) { + let param; + let dep; + let result; - // Compiler Hooks - Object.keys(compiler.hooks).forEach(hookName => { - compiler.hooks[hookName].intercept( - makeInterceptorFor("Compiler", tracer)(hookName) - ); - }); + const old = parser.state.current; - Object.keys(compiler.resolverFactory.hooks).forEach(hookName => { - compiler.resolverFactory.hooks[hookName].intercept( - makeInterceptorFor("Resolver", tracer)(hookName) + if (expr.arguments.length >= 1) { + param = parser.evaluateExpression(expr.arguments[0]); + dep = this.newRequireDependenciesBlock( + expr, + param.range, + expr.arguments.length > 1 ? expr.arguments[1].range : null, + expr.arguments.length > 2 ? expr.arguments[2].range : null, + parser.state.module, + expr.loc, + this.processArrayForRequestString(param) ); - }); + parser.state.current = dep; + } - compiler.hooks.compilation.tap( - pluginName, - (compilation, { normalModuleFactory, contextModuleFactory }) => { - interceptAllHooksFor(compilation, tracer, "Compilation"); - interceptAllHooksFor( - normalModuleFactory, - tracer, - "Normal Module Factory" - ); - interceptAllHooksFor( - contextModuleFactory, - tracer, - "Context Module Factory" + if (expr.arguments.length === 1) { + parser.inScope([], () => { + result = this.processArray(parser, expr, param); + }); + parser.state.current = old; + if (!result) return; + parser.state.current.addBlock(dep); + return true; + } + + if (expr.arguments.length === 2 || expr.arguments.length === 3) { + try { + parser.inScope([], () => { + result = this.processArray(parser, expr, param); + }); + if (!result) { + dep = new UnsupportedDependency("unsupported", expr.range); + old.addDependency(dep); + if (parser.state.module) { + parser.state.module.errors.push( + new UnsupportedFeatureWarning( + parser.state.module, + "Cannot statically analyse 'require(…, …)' in line " + + expr.loc.start.line, + expr.loc + ) + ); + } + dep = null; + return true; + } + dep.functionBindThis = this.processFunctionArgument( + parser, + expr.arguments[1] ); - interceptAllParserHooks(normalModuleFactory, tracer); - interceptTemplateInstancesFrom(compilation, tracer); + if (expr.arguments.length === 3) { + dep.errorCallbackBindThis = this.processFunctionArgument( + parser, + expr.arguments[2] + ); + } + } finally { + parser.state.current = old; + if (dep) parser.state.current.addBlock(dep); } + return true; + } + } + + newRequireDependenciesBlock( + expr, + arrayRange, + functionRange, + errorCallbackRange, + module, + loc, + request + ) { + return new AMDRequireDependenciesBlock( + expr, + arrayRange, + functionRange, + errorCallbackRange, + module, + loc, + request ); + } + newRequireItemDependency(request, range) { + return new AMDRequireItemDependency(request, range); + } + newRequireArrayDependency(depsArray, range) { + return new AMDRequireArrayDependency(depsArray, range); + } +} +module.exports = AMDRequireDependenciesBlockParserPlugin; - // We need to write out the CPU profile when we are all done. - compiler.hooks.done.tapAsync( - { - name: pluginName, - stage: Infinity - }, - (stats, callback) => { - tracer.profiler.stopProfiling().then(parsedResults => { - if (parsedResults === undefined) { - tracer.profiler.destroy(); - tracer.trace.flush(); - tracer.end(callback); - return; - } - const cpuStartTime = parsedResults.profile.startTime; - const cpuEndTime = parsedResults.profile.endTime; +/***/ }), - tracer.trace.completeEvent({ - name: "TaskQueueManager::ProcessTaskFromWorkQueue", - id: ++tracer.counter, - cat: ["toplevel"], - ts: cpuStartTime, - args: { - src_file: "../../ipc/ipc_moji_bootstrap.cc", - src_func: "Accept" - } - }); +/***/ 73985: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - tracer.trace.completeEvent({ - name: "EvaluateScript", - id: ++tracer.counter, - cat: ["devtools.timeline"], - ts: cpuStartTime, - dur: cpuEndTime - cpuStartTime, - args: { - data: { - url: "webpack", - lineNumber: 1, - columnNumber: 1, - frame: "0xFFF" - } - } - }); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - tracer.trace.instantEvent({ - name: "CpuProfile", - id: ++tracer.counter, - cat: ["disabled-by-default-devtools.timeline"], - ts: cpuEndTime, - args: { - data: { - cpuProfile: parsedResults.profile - } - } - }); +const NullDependency = __webpack_require__(5088); - tracer.profiler.destroy(); - tracer.trace.flush(); - tracer.end(callback); - }); - } - ); +class AMDRequireDependency extends NullDependency { + constructor(block) { + super(); + this.block = block; } } -const interceptTemplateInstancesFrom = (compilation, tracer) => { - const { - mainTemplate, - chunkTemplate, - hotUpdateChunkTemplate, - moduleTemplates - } = compilation; - - const { javascript, webassembly } = moduleTemplates; +AMDRequireDependency.Template = class AMDRequireDependencyTemplate { + apply(dep, source, runtime) { + const depBlock = dep.block; + const promise = runtime.blockPromise({ + block: depBlock, + message: "AMD require" + }); - [ - { - instance: mainTemplate, - name: "MainTemplate" - }, - { - instance: chunkTemplate, - name: "ChunkTemplate" - }, - { - instance: hotUpdateChunkTemplate, - name: "HotUpdateChunkTemplate" - }, - { - instance: javascript, - name: "JavaScriptModuleTemplate" - }, - { - instance: webassembly, - name: "WebAssemblyModuleTemplate" - } - ].forEach(templateObject => { - Object.keys(templateObject.instance.hooks).forEach(hookName => { - templateObject.instance.hooks[hookName].intercept( - makeInterceptorFor(templateObject.name, tracer)(hookName) + // has array range but no function range + if (depBlock.arrayRange && !depBlock.functionRange) { + const startBlock = `${promise}.then(function() {`; + const endBlock = `;}).catch(${runtime.onError()})`; + source.replace( + depBlock.outerRange[0], + depBlock.arrayRange[0] - 1, + startBlock ); - }); - }); -}; - -const interceptAllHooksFor = (instance, tracer, logLabel) => { - if (Reflect.has(instance, "hooks")) { - Object.keys(instance.hooks).forEach(hookName => { - instance.hooks[hookName].intercept( - makeInterceptorFor(logLabel, tracer)(hookName) + source.replace( + depBlock.arrayRange[1], + depBlock.outerRange[1] - 1, + endBlock ); - }); - } -}; - -const interceptAllParserHooks = (moduleFactory, tracer) => { - const moduleTypes = [ - "javascript/auto", - "javascript/dynamic", - "javascript/esm", - "json", - "webassembly/experimental" - ]; - - moduleTypes.forEach(moduleType => { - moduleFactory.hooks.parser - .for(moduleType) - .tap("ProfilingPlugin", (parser, parserOpts) => { - interceptAllHooksFor(parser, tracer, "Parser"); - }); - }); -}; - -const makeInterceptorFor = (instance, tracer) => hookName => ({ - register: ({ name, type, context, fn }) => { - const newFn = makeNewProfiledTapFn(hookName, tracer, { - name, - type, - fn - }); - return { - name, - type, - context, - fn: newFn - }; - } -}); + return; + } -// TODO improve typing -/** @typedef {(...args: TODO[]) => void | Promise} PluginFunction */ + // has function range but no array range + if (depBlock.functionRange && !depBlock.arrayRange) { + const startBlock = `${promise}.then((`; + const endBlock = `).bind(exports, __webpack_require__, exports, module)).catch(${runtime.onError()})`; + source.replace( + depBlock.outerRange[0], + depBlock.functionRange[0] - 1, + startBlock + ); + source.replace( + depBlock.functionRange[1], + depBlock.outerRange[1] - 1, + endBlock + ); + return; + } -/** - * @param {string} hookName Name of the hook to profile. - * @param {Trace} tracer The trace object. - * @param {object} options Options for the profiled fn. - * @param {string} options.name Plugin name - * @param {string} options.type Plugin type (sync | async | promise) - * @param {PluginFunction} options.fn Plugin function - * @returns {PluginFunction} Chainable hooked function. - */ -const makeNewProfiledTapFn = (hookName, tracer, { name, type, fn }) => { - const defaultCategory = ["blink.user_timing"]; + // has array range, function range, and errorCallbackRange + if ( + depBlock.arrayRange && + depBlock.functionRange && + depBlock.errorCallbackRange + ) { + const startBlock = `${promise}.then(function() { `; + const errorRangeBlock = `}${ + depBlock.functionBindThis ? ".bind(this)" : "" + }).catch(`; + const endBlock = `${ + depBlock.errorCallbackBindThis ? ".bind(this)" : "" + })`; - switch (type) { - case "promise": - return (...args) => { - const id = ++tracer.counter; - tracer.trace.begin({ - name, - id, - cat: defaultCategory - }); - const promise = /** @type {Promise<*>} */ (fn(...args)); - return promise.then(r => { - tracer.trace.end({ - name, - id, - cat: defaultCategory - }); - return r; - }); - }; - case "async": - return (...args) => { - const id = ++tracer.counter; - tracer.trace.begin({ - name, - id, - cat: defaultCategory - }); - const callback = args.pop(); - fn(...args, (...r) => { - tracer.trace.end({ - name, - id, - cat: defaultCategory - }); - callback(...r); - }); - }; - case "sync": - return (...args) => { - const id = ++tracer.counter; - // Do not instrument ourself due to the CPU - // profile needing to be the last event in the trace. - if (name === pluginName) { - return fn(...args); - } + source.replace( + depBlock.outerRange[0], + depBlock.arrayRange[0] - 1, + startBlock + ); + source.insert( + depBlock.arrayRange[0] + 0.9, + "var __WEBPACK_AMD_REQUIRE_ARRAY__ = " + ); + source.replace( + depBlock.arrayRange[1], + depBlock.functionRange[0] - 1, + "; (" + ); + source.insert( + depBlock.functionRange[1], + ").apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);" + ); + source.replace( + depBlock.functionRange[1], + depBlock.errorCallbackRange[0] - 1, + errorRangeBlock + ); + source.replace( + depBlock.errorCallbackRange[1], + depBlock.outerRange[1] - 1, + endBlock + ); + return; + } - tracer.trace.begin({ - name, - id, - cat: defaultCategory - }); - let r; - try { - r = fn(...args); - } catch (error) { - tracer.trace.end({ - name, - id, - cat: defaultCategory - }); - throw error; - } - tracer.trace.end({ - name, - id, - cat: defaultCategory - }); - return r; - }; - default: - break; + // has array range, function range, but no errorCallbackRange + if (depBlock.arrayRange && depBlock.functionRange) { + const startBlock = `${promise}.then(function() { `; + const endBlock = `}${ + depBlock.functionBindThis ? ".bind(this)" : "" + }).catch(${runtime.onError()})`; + source.replace( + depBlock.outerRange[0], + depBlock.arrayRange[0] - 1, + startBlock + ); + source.insert( + depBlock.arrayRange[0] + 0.9, + "var __WEBPACK_AMD_REQUIRE_ARRAY__ = " + ); + source.replace( + depBlock.arrayRange[1], + depBlock.functionRange[0] - 1, + "; (" + ); + source.insert( + depBlock.functionRange[1], + ").apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);" + ); + source.replace( + depBlock.functionRange[1], + depBlock.outerRange[1] - 1, + endBlock + ); + } } }; -module.exports = ProfilingPlugin; -module.exports.Profiler = Profiler; +module.exports = AMDRequireDependency; /***/ }), -/***/ 67045: +/***/ 34345: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -79152,143 +76698,28 @@ module.exports.Profiler = Profiler; Author Tobias Koppers @sokra */ -const NullDependency = __webpack_require__(5088); +const ModuleDependency = __webpack_require__(90865); +const ModuleDependencyTemplateAsRequireId = __webpack_require__(60441); -class AMDDefineDependency extends NullDependency { - constructor(range, arrayRange, functionRange, objectRange, namedModule) { - super(); +class AMDRequireItemDependency extends ModuleDependency { + constructor(request, range) { + super(request); this.range = range; - this.arrayRange = arrayRange; - this.functionRange = functionRange; - this.objectRange = objectRange; - this.namedModule = namedModule; - this.localModule = null; } get type() { - return "amd define"; + return "amd require"; } } -AMDDefineDependency.Template = class AMDDefineDependencyTemplate { - get definitions() { - return { - f: [ - "var __WEBPACK_AMD_DEFINE_RESULT__;", - `!(__WEBPACK_AMD_DEFINE_RESULT__ = (#).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))` - ], - o: ["", "!(module.exports = #)"], - of: [ - "var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;", - `!(__WEBPACK_AMD_DEFINE_FACTORY__ = (#), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : - __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))` - ], - af: [ - "var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;", - `!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_RESULT__ = (#).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))` - ], - ao: ["", "!(#, module.exports = #)"], - aof: [ - "var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;", - `!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_FACTORY__ = (#), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))` - ], - lf: [ - "var XXX, XXXmodule;", - "!(XXXmodule = { id: YYY, exports: {}, loaded: false }, XXX = #.call(XXXmodule.exports, __webpack_require__, XXXmodule.exports, XXXmodule), XXXmodule.loaded = true, XXX === undefined && (XXX = XXXmodule.exports))" - ], - lo: ["var XXX;", "!(XXX = #)"], - lof: [ - "var XXX, XXXfactory, XXXmodule;", - "!(XXXfactory = (#), (XXXmodule = { id: YYY, exports: {}, loaded: false }), XXX = (typeof XXXfactory === 'function' ? (XXXfactory.call(XXXmodule.exports, __webpack_require__, XXXmodule.exports, XXXmodule)) : XXXfactory), (XXXmodule.loaded = true), XXX === undefined && (XXX = XXXmodule.exports))" - ], - laf: [ - "var __WEBPACK_AMD_DEFINE_ARRAY__, XXX;", - "!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, XXX = ((#).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)))" - ], - lao: ["var XXX;", "!(#, XXX = #)"], - laof: [ - "var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_FACTORY__, XXX;", - `!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_FACTORY__ = (#), - XXX = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__))` - ] - }; - } - - apply(dependency, source) { - const branch = this.branch(dependency); - const defAndText = this.definitions[branch]; - const definitions = defAndText[0]; - const text = defAndText[1]; - this.replace(dependency, source, definitions, text); - } - - localModuleVar(dependency) { - return ( - dependency.localModule && - dependency.localModule.used && - dependency.localModule.variableName() - ); - } - - branch(dependency) { - const localModuleVar = this.localModuleVar(dependency) ? "l" : ""; - const arrayRange = dependency.arrayRange ? "a" : ""; - const objectRange = dependency.objectRange ? "o" : ""; - const functionRange = dependency.functionRange ? "f" : ""; - return localModuleVar + arrayRange + objectRange + functionRange; - } - - replace(dependency, source, definition, text) { - const localModuleVar = this.localModuleVar(dependency); - if (localModuleVar) { - text = text.replace(/XXX/g, localModuleVar.replace(/\$/g, "$$$$")); - definition = definition.replace( - /XXX/g, - localModuleVar.replace(/\$/g, "$$$$") - ); - } - - if (dependency.namedModule) { - text = text.replace(/YYY/g, JSON.stringify(dependency.namedModule)); - } - - const texts = text.split("#"); - - if (definition) source.insert(0, definition); - - let current = dependency.range[0]; - if (dependency.arrayRange) { - source.replace(current, dependency.arrayRange[0] - 1, texts.shift()); - current = dependency.arrayRange[1]; - } - - if (dependency.objectRange) { - source.replace(current, dependency.objectRange[0] - 1, texts.shift()); - current = dependency.objectRange[1]; - } else if (dependency.functionRange) { - source.replace(current, dependency.functionRange[0] - 1, texts.shift()); - current = dependency.functionRange[1]; - } - source.replace(current, dependency.range[1] - 1, texts.shift()); - if (texts.length > 0) throw new Error("Implementation error"); - } -}; +AMDRequireItemDependency.Template = ModuleDependencyTemplateAsRequireId; -module.exports = AMDDefineDependency; +module.exports = AMDRequireItemDependency; /***/ }), -/***/ 27057: +/***/ 85358: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -79297,581 +76728,164 @@ module.exports = AMDDefineDependency; Author Tobias Koppers @sokra */ - -const AMDRequireItemDependency = __webpack_require__(34345); -const AMDRequireContextDependency = __webpack_require__(99890); const ConstDependency = __webpack_require__(71101); -const AMDDefineDependency = __webpack_require__(67045); -const AMDRequireArrayDependency = __webpack_require__(63960); -const LocalModuleDependency = __webpack_require__(56570); -const ContextDependencyHelpers = __webpack_require__(5594); -const LocalModulesHelpers = __webpack_require__(39658); +const CommonJsRequireDependency = __webpack_require__(37504); +const CommonJsRequireContextDependency = __webpack_require__(26791); +const RequireResolveDependency = __webpack_require__(43519); +const RequireResolveContextDependency = __webpack_require__(83309); +const RequireResolveHeaderDependency = __webpack_require__(69647); +const RequireHeaderDependency = __webpack_require__(22928); -const isBoundFunctionExpression = expr => { - if (expr.type !== "CallExpression") return false; - if (expr.callee.type !== "MemberExpression") return false; - if (expr.callee.computed) return false; - if (expr.callee.object.type !== "FunctionExpression") return false; - if (expr.callee.property.type !== "Identifier") return false; - if (expr.callee.property.name !== "bind") return false; - return true; -}; +const NullFactory = __webpack_require__(40438); -const isUnboundFunctionExpression = expr => { - if (expr.type === "FunctionExpression") return true; - if (expr.type === "ArrowFunctionExpression") return true; - return false; -}; +const RequireResolveDependencyParserPlugin = __webpack_require__(68349); +const CommonJsRequireDependencyParserPlugin = __webpack_require__(37278); -const isCallable = expr => { - if (isUnboundFunctionExpression(expr)) return true; - if (isBoundFunctionExpression(expr)) return true; - return false; -}; +const ParserHelpers = __webpack_require__(23999); -class AMDDefineDependencyParserPlugin { +class CommonJsPlugin { constructor(options) { this.options = options; } - apply(parser) { - parser.hooks.call - .for("define") - .tap( - "AMDDefineDependencyParserPlugin", - this.processCallDefine.bind(this, parser) - ); - } + apply(compiler) { + const options = this.options; + compiler.hooks.compilation.tap( + "CommonJsPlugin", + (compilation, { contextModuleFactory, normalModuleFactory }) => { + compilation.dependencyFactories.set( + CommonJsRequireDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + CommonJsRequireDependency, + new CommonJsRequireDependency.Template() + ); - processArray(parser, expr, param, identifiers, namedModule) { - if (param.isArray()) { - param.items.forEach((param, idx) => { - if ( - param.isString() && - ["require", "module", "exports"].includes(param.string) - ) - identifiers[idx] = param.string; - const result = this.processItem(parser, expr, param, namedModule); - if (result === undefined) { - this.processContext(parser, expr, param); - } - }); - return true; - } else if (param.isConstArray()) { - const deps = []; - param.array.forEach((request, idx) => { - let dep; - let localModule; - if (request === "require") { - identifiers[idx] = request; - dep = "__webpack_require__"; - } else if (["exports", "module"].includes(request)) { - identifiers[idx] = request; - dep = request; - } else if ( - (localModule = LocalModulesHelpers.getLocalModule( - parser.state, - request - )) - ) { - dep = new LocalModuleDependency(localModule, undefined, false); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - } else { - dep = this.newRequireItemDependency(request); - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - } - deps.push(dep); - }); - const dep = this.newRequireArrayDependency(deps, param.range); - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - } - } - processItem(parser, expr, param, namedModule) { - if (param.isConditional()) { - param.options.forEach(param => { - const result = this.processItem(parser, expr, param); - if (result === undefined) { - this.processContext(parser, expr, param); - } - }); - return true; - } else if (param.isString()) { - let dep, localModule; - if (param.string === "require") { - dep = new ConstDependency("__webpack_require__", param.range); - } else if (["require", "exports", "module"].includes(param.string)) { - dep = new ConstDependency(param.string, param.range); - } else if ( - (localModule = LocalModulesHelpers.getLocalModule( - parser.state, - param.string, - namedModule - )) - ) { - dep = new LocalModuleDependency(localModule, param.range, false); - } else { - dep = this.newRequireItemDependency(param.string, param.range); - } - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - } - } - processContext(parser, expr, param) { - const dep = ContextDependencyHelpers.create( - AMDRequireContextDependency, - param.range, - param, - expr, - this.options, - {}, - parser - ); - if (!dep) return; - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - } - - processCallDefine(parser, expr) { - let array, fn, obj, namedModule; - switch (expr.arguments.length) { - case 1: - if (isCallable(expr.arguments[0])) { - // define(f() {…}) - fn = expr.arguments[0]; - } else if (expr.arguments[0].type === "ObjectExpression") { - // define({…}) - obj = expr.arguments[0]; - } else { - // define(expr) - // unclear if function or object - obj = fn = expr.arguments[0]; - } - break; - case 2: - if (expr.arguments[0].type === "Literal") { - namedModule = expr.arguments[0].value; - // define("…", …) - if (isCallable(expr.arguments[1])) { - // define("…", f() {…}) - fn = expr.arguments[1]; - } else if (expr.arguments[1].type === "ObjectExpression") { - // define("…", {…}) - obj = expr.arguments[1]; - } else { - // define("…", expr) - // unclear if function or object - obj = fn = expr.arguments[1]; - } - } else { - array = expr.arguments[0]; - if (isCallable(expr.arguments[1])) { - // define([…], f() {}) - fn = expr.arguments[1]; - } else if (expr.arguments[1].type === "ObjectExpression") { - // define([…], {…}) - obj = expr.arguments[1]; - } else { - // define([…], expr) - // unclear if function or object - obj = fn = expr.arguments[1]; - } - } - break; - case 3: - // define("…", […], f() {…}) - namedModule = expr.arguments[0].value; - array = expr.arguments[1]; - if (isCallable(expr.arguments[2])) { - // define("…", […], f() {}) - fn = expr.arguments[2]; - } else if (expr.arguments[2].type === "ObjectExpression") { - // define("…", […], {…}) - obj = expr.arguments[2]; - } else { - // define("…", […], expr) - // unclear if function or object - obj = fn = expr.arguments[2]; - } - break; - default: - return; - } - let fnParams = null; - let fnParamsOffset = 0; - if (fn) { - if (isUnboundFunctionExpression(fn)) { - fnParams = fn.params; - } else if (isBoundFunctionExpression(fn)) { - fnParams = fn.callee.object.params; - fnParamsOffset = fn.arguments.length - 1; - if (fnParamsOffset < 0) { - fnParamsOffset = 0; - } - } - } - let fnRenames = parser.scope.renames.createChild(); - if (array) { - const identifiers = {}; - const param = parser.evaluateExpression(array); - const result = this.processArray( - parser, - expr, - param, - identifiers, - namedModule - ); - if (!result) return; - if (fnParams) { - fnParams = fnParams.slice(fnParamsOffset).filter((param, idx) => { - if (identifiers[idx]) { - fnRenames.set(param.name, identifiers[idx]); - return false; - } - return true; - }); - } - } else { - const identifiers = ["require", "exports", "module"]; - if (fnParams) { - fnParams = fnParams.slice(fnParamsOffset).filter((param, idx) => { - if (identifiers[idx]) { - fnRenames.set(param.name, identifiers[idx]); - return false; - } - return true; - }); - } - } - let inTry; - if (fn && isUnboundFunctionExpression(fn)) { - inTry = parser.scope.inTry; - parser.inScope(fnParams, () => { - parser.scope.renames = fnRenames; - parser.scope.inTry = inTry; - if (fn.body.type === "BlockStatement") { - parser.walkStatement(fn.body); - } else { - parser.walkExpression(fn.body); - } - }); - } else if (fn && isBoundFunctionExpression(fn)) { - inTry = parser.scope.inTry; - parser.inScope( - fn.callee.object.params.filter( - i => !["require", "module", "exports"].includes(i.name) - ), - () => { - parser.scope.renames = fnRenames; - parser.scope.inTry = inTry; - if (fn.callee.object.body.type === "BlockStatement") { - parser.walkStatement(fn.callee.object.body); - } else { - parser.walkExpression(fn.callee.object.body); - } - } - ); - if (fn.arguments) { - parser.walkExpressions(fn.arguments); - } - } else if (fn || obj) { - parser.walkExpression(fn || obj); - } - - const dep = this.newDefineDependency( - expr.range, - array ? array.range : null, - fn ? fn.range : null, - obj ? obj.range : null, - namedModule ? namedModule : null - ); - dep.loc = expr.loc; - if (namedModule) { - dep.localModule = LocalModulesHelpers.addLocalModule( - parser.state, - namedModule - ); - } - parser.state.current.addDependency(dep); - return true; - } - - newDefineDependency( - range, - arrayRange, - functionRange, - objectRange, - namedModule - ) { - return new AMDDefineDependency( - range, - arrayRange, - functionRange, - objectRange, - namedModule - ); - } - newRequireArrayDependency(depsArray, range) { - return new AMDRequireArrayDependency(depsArray, range); - } - newRequireItemDependency(request, range) { - return new AMDRequireItemDependency(request, range); - } -} -module.exports = AMDDefineDependencyParserPlugin; - - -/***/ }), - -/***/ 85812: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const path = __webpack_require__(85622); -const AMDRequireDependency = __webpack_require__(73985); -const AMDRequireItemDependency = __webpack_require__(34345); -const AMDRequireArrayDependency = __webpack_require__(63960); -const AMDRequireContextDependency = __webpack_require__(99890); -const AMDDefineDependency = __webpack_require__(67045); -const UnsupportedDependency = __webpack_require__(15826); -const LocalModuleDependency = __webpack_require__(56570); - -const NullFactory = __webpack_require__(40438); - -const AMDRequireDependenciesBlockParserPlugin = __webpack_require__(9994); -const AMDDefineDependencyParserPlugin = __webpack_require__(27057); - -const AliasPlugin = __webpack_require__(15005); - -const ParserHelpers = __webpack_require__(23999); - -class AMDPlugin { - constructor(options, amdOptions) { - this.amdOptions = amdOptions; - this.options = options; - } - - apply(compiler) { - const options = this.options; - const amdOptions = this.amdOptions; - compiler.hooks.compilation.tap( - "AMDPlugin", - (compilation, { contextModuleFactory, normalModuleFactory }) => { compilation.dependencyFactories.set( - AMDRequireDependency, - new NullFactory() + CommonJsRequireContextDependency, + contextModuleFactory ); compilation.dependencyTemplates.set( - AMDRequireDependency, - new AMDRequireDependency.Template() + CommonJsRequireContextDependency, + new CommonJsRequireContextDependency.Template() ); compilation.dependencyFactories.set( - AMDRequireItemDependency, + RequireResolveDependency, normalModuleFactory ); compilation.dependencyTemplates.set( - AMDRequireItemDependency, - new AMDRequireItemDependency.Template() - ); - - compilation.dependencyFactories.set( - AMDRequireArrayDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - AMDRequireArrayDependency, - new AMDRequireArrayDependency.Template() + RequireResolveDependency, + new RequireResolveDependency.Template() ); compilation.dependencyFactories.set( - AMDRequireContextDependency, + RequireResolveContextDependency, contextModuleFactory ); compilation.dependencyTemplates.set( - AMDRequireContextDependency, - new AMDRequireContextDependency.Template() - ); - - compilation.dependencyFactories.set( - AMDDefineDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - AMDDefineDependency, - new AMDDefineDependency.Template() + RequireResolveContextDependency, + new RequireResolveContextDependency.Template() ); compilation.dependencyFactories.set( - UnsupportedDependency, + RequireResolveHeaderDependency, new NullFactory() ); compilation.dependencyTemplates.set( - UnsupportedDependency, - new UnsupportedDependency.Template() + RequireResolveHeaderDependency, + new RequireResolveHeaderDependency.Template() ); compilation.dependencyFactories.set( - LocalModuleDependency, + RequireHeaderDependency, new NullFactory() ); compilation.dependencyTemplates.set( - LocalModuleDependency, - new LocalModuleDependency.Template() + RequireHeaderDependency, + new RequireHeaderDependency.Template() ); const handler = (parser, parserOptions) => { - if (parserOptions.amd !== undefined && !parserOptions.amd) return; - - const setExpressionToModule = (outerExpr, module) => { - parser.hooks.expression.for(outerExpr).tap("AMDPlugin", expr => { - const dep = new AMDRequireItemDependency(module, expr.range); - dep.userRequest = outerExpr; - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - return true; - }); - }; - - new AMDRequireDependenciesBlockParserPlugin(options).apply(parser); - new AMDDefineDependencyParserPlugin(options).apply(parser); + if (parserOptions.commonjs !== undefined && !parserOptions.commonjs) + return; - setExpressionToModule("require.amd", "!!webpack amd options"); - setExpressionToModule("define.amd", "!!webpack amd options"); - setExpressionToModule("define", "!!webpack amd define"); + const requireExpressions = [ + "require", + "require.resolve", + "require.resolveWeak" + ]; + for (let expression of requireExpressions) { + parser.hooks.typeof + .for(expression) + .tap( + "CommonJsPlugin", + ParserHelpers.toConstantDependency( + parser, + JSON.stringify("function") + ) + ); + parser.hooks.evaluateTypeof + .for(expression) + .tap( + "CommonJsPlugin", + ParserHelpers.evaluateToString("function") + ); + parser.hooks.evaluateIdentifier + .for(expression) + .tap( + "CommonJsPlugin", + ParserHelpers.evaluateToIdentifier(expression, true) + ); + } - parser.hooks.expression - .for("__webpack_amd_options__") - .tap("AMDPlugin", () => - parser.state.current.addVariable( - "__webpack_amd_options__", - JSON.stringify(amdOptions) - ) - ); - parser.hooks.evaluateTypeof - .for("define.amd") - .tap( - "AMDPlugin", - ParserHelpers.evaluateToString(typeof amdOptions) - ); - parser.hooks.evaluateTypeof - .for("require.amd") - .tap( - "AMDPlugin", - ParserHelpers.evaluateToString(typeof amdOptions) - ); - parser.hooks.evaluateIdentifier - .for("define.amd") - .tap( - "AMDPlugin", - ParserHelpers.evaluateToIdentifier("define.amd", true) - ); - parser.hooks.evaluateIdentifier - .for("require.amd") - .tap( - "AMDPlugin", - ParserHelpers.evaluateToIdentifier("require.amd", true) - ); - parser.hooks.typeof - .for("define") - .tap( - "AMDPlugin", - ParserHelpers.toConstantDependency( - parser, - JSON.stringify("function") - ) - ); parser.hooks.evaluateTypeof - .for("define") - .tap("AMDPlugin", ParserHelpers.evaluateToString("function")); + .for("module") + .tap("CommonJsPlugin", ParserHelpers.evaluateToString("object")); + parser.hooks.assign.for("require").tap("CommonJsPlugin", expr => { + // to not leak to global "require", we need to define a local require here. + const dep = new ConstDependency("var require;", 0); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + parser.scope.definitions.add("require"); + return true; + }); parser.hooks.canRename - .for("define") - .tap("AMDPlugin", ParserHelpers.approve); - parser.hooks.rename.for("define").tap("AMDPlugin", expr => { - const dep = new AMDRequireItemDependency( - "!!webpack amd define", - expr.range - ); - dep.userRequest = "define"; + .for("require") + .tap("CommonJsPlugin", () => true); + parser.hooks.rename.for("require").tap("CommonJsPlugin", expr => { + // define the require variable. It's still undefined, but not "not defined". + const dep = new ConstDependency("var require;", 0); dep.loc = expr.loc; parser.state.current.addDependency(dep); return false; }); - parser.hooks.typeof - .for("require") - .tap( - "AMDPlugin", - ParserHelpers.toConstantDependency( - parser, - JSON.stringify("function") - ) - ); + parser.hooks.typeof.for("module").tap("CommonJsPlugin", () => true); parser.hooks.evaluateTypeof - .for("require") - .tap("AMDPlugin", ParserHelpers.evaluateToString("function")); + .for("exports") + .tap("CommonJsPlugin", ParserHelpers.evaluateToString("object")); + + new CommonJsRequireDependencyParserPlugin(options).apply(parser); + new RequireResolveDependencyParserPlugin(options).apply(parser); }; normalModuleFactory.hooks.parser .for("javascript/auto") - .tap("AMDPlugin", handler); + .tap("CommonJsPlugin", handler); normalModuleFactory.hooks.parser .for("javascript/dynamic") - .tap("AMDPlugin", handler); + .tap("CommonJsPlugin", handler); } ); - compiler.hooks.afterResolvers.tap("AMDPlugin", () => { - compiler.resolverFactory.hooks.resolver - .for("normal") - .tap("AMDPlugin", resolver => { - new AliasPlugin( - "described-resolve", - { - name: "amdefine", - alias: __webpack_require__.ab + "amd-define.js" - }, - "resolve" - ).apply(resolver); - new AliasPlugin( - "described-resolve", - { - name: "webpack amd options", - alias: __webpack_require__.ab + "amd-options.js" - }, - "resolve" - ).apply(resolver); - new AliasPlugin( - "described-resolve", - { - name: "webpack amd define", - alias: __webpack_require__.ab + "amd-define.js" - }, - "resolve" - ).apply(resolver); - }); - }); } } -module.exports = AMDPlugin; +module.exports = CommonJsPlugin; /***/ }), -/***/ 63960: +/***/ 26791: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -79880,55 +76894,29 @@ module.exports = AMDPlugin; Author Tobias Koppers @sokra */ -const Dependency = __webpack_require__(57282); +const ContextDependency = __webpack_require__(11583); +const ContextDependencyTemplateAsRequireCall = __webpack_require__(54380); -class AMDRequireArrayDependency extends Dependency { - constructor(depsArray, range) { - super(); - this.depsArray = depsArray; +class CommonJsRequireContextDependency extends ContextDependency { + constructor(options, range, valueRange) { + super(options); this.range = range; + this.valueRange = valueRange; } get type() { - return "amd require array"; + return "cjs require context"; } } -AMDRequireArrayDependency.Template = class AMDRequireArrayDependencyTemplate { - apply(dep, source, runtime) { - const content = this.getContent(dep, runtime); - source.replace(dep.range[0], dep.range[1] - 1, content); - } +CommonJsRequireContextDependency.Template = ContextDependencyTemplateAsRequireCall; - getContent(dep, runtime) { - const requires = dep.depsArray.map(dependency => { - return this.contentForDependency(dependency, runtime); - }); - return `[${requires.join(", ")}]`; - } - - contentForDependency(dep, runtime) { - if (typeof dep === "string") { - return dep; - } - - if (dep.localModule) { - return dep.localModule.variableName(); - } else { - return runtime.moduleExports({ - module: dep.module, - request: dep.request - }); - } - } -}; - -module.exports = AMDRequireArrayDependency; +module.exports = CommonJsRequireContextDependency; /***/ }), -/***/ 99890: +/***/ 37504: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -79937,81 +76925,28 @@ module.exports = AMDRequireArrayDependency; Author Tobias Koppers @sokra */ +const ModuleDependency = __webpack_require__(90865); +const ModuleDependencyTemplateAsId = __webpack_require__(63708); -const ContextDependency = __webpack_require__(11583); -class AMDRequireContextDependency extends ContextDependency { - constructor(options, range, valueRange) { - super(options); +class CommonJsRequireDependency extends ModuleDependency { + constructor(request, range) { + super(request); this.range = range; - this.valueRange = valueRange; } get type() { - return "amd require context"; + return "cjs require"; } } -AMDRequireContextDependency.Template = __webpack_require__(54380); -module.exports = AMDRequireContextDependency; - - -/***/ }), - -/***/ 32894: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -const AsyncDependenciesBlock = __webpack_require__(22814); -const AMDRequireDependency = __webpack_require__(73985); - -module.exports = class AMDRequireDependenciesBlock extends AsyncDependenciesBlock { - constructor( - expr, - arrayRange, - functionRange, - errorCallbackRange, - module, - loc, - request - ) { - super(null, module, loc, request); - this.expr = expr; - this.outerRange = expr.range; - this.arrayRange = arrayRange; - this.functionBindThis = false; - this.functionRange = functionRange; - this.errorCallbackBindThis = false; - this.errorCallbackRange = errorCallbackRange; - this.bindThis = true; - if (arrayRange && functionRange && errorCallbackRange) { - this.range = [arrayRange[0], errorCallbackRange[1]]; - } else if (arrayRange && functionRange) { - this.range = [arrayRange[0], functionRange[1]]; - } else if (arrayRange) { - this.range = arrayRange; - } else if (functionRange) { - this.range = functionRange; - } else { - this.range = expr.range; - } - const dep = this.newRequireDependency(); - dep.loc = loc; - this.addDependency(dep); - } +CommonJsRequireDependency.Template = ModuleDependencyTemplateAsId; - newRequireDependency() { - return new AMDRequireDependency(this); - } -}; +module.exports = CommonJsRequireDependency; /***/ }), -/***/ 9994: +/***/ 37278: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80021,279 +76956,184 @@ module.exports = class AMDRequireDependenciesBlock extends AsyncDependenciesBloc */ -const AMDRequireItemDependency = __webpack_require__(34345); -const AMDRequireArrayDependency = __webpack_require__(63960); -const AMDRequireContextDependency = __webpack_require__(99890); -const AMDRequireDependenciesBlock = __webpack_require__(32894); -const UnsupportedDependency = __webpack_require__(15826); +const CommonJsRequireDependency = __webpack_require__(37504); +const CommonJsRequireContextDependency = __webpack_require__(26791); +const RequireHeaderDependency = __webpack_require__(22928); const LocalModuleDependency = __webpack_require__(56570); const ContextDependencyHelpers = __webpack_require__(5594); const LocalModulesHelpers = __webpack_require__(39658); -const ConstDependency = __webpack_require__(71101); -const getFunctionExpression = __webpack_require__(64197); -const UnsupportedFeatureWarning = __webpack_require__(99953); +const ParserHelpers = __webpack_require__(23999); -class AMDRequireDependenciesBlockParserPlugin { +class CommonJsRequireDependencyParserPlugin { constructor(options) { this.options = options; } - processFunctionArgument(parser, expression) { - let bindThis = true; - const fnData = getFunctionExpression(expression); - if (fnData) { - parser.inScope( - fnData.fn.params.filter(i => { - return !["require", "module", "exports"].includes(i.name); - }), - () => { - if (fnData.fn.body.type === "BlockStatement") { - parser.walkStatement(fnData.fn.body); - } else { - parser.walkExpression(fnData.fn.body); - } - } - ); - parser.walkExpressions(fnData.expressions); - if (fnData.needThis === false) { - bindThis = false; - } - } else { - parser.walkExpression(expression); - } - return bindThis; - } - apply(parser) { - parser.hooks.call - .for("require") - .tap( - "AMDRequireDependenciesBlockParserPlugin", - this.processCallRequire.bind(this, parser) - ); - } + const options = this.options; - processArray(parser, expr, param) { - if (param.isArray()) { - for (const p of param.items) { - const result = this.processItem(parser, expr, p); - if (result === undefined) { - this.processContext(parser, expr, p); - } - } - return true; - } else if (param.isConstArray()) { - const deps = []; - for (const request of param.array) { - let dep, localModule; - if (request === "require") { - dep = "__webpack_require__"; - } else if (["exports", "module"].includes(request)) { - dep = request; - } else if ( - (localModule = LocalModulesHelpers.getLocalModule( - parser.state, - request - )) - ) { - dep = new LocalModuleDependency(localModule, undefined, false); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - } else { - dep = this.newRequireItemDependency(request); - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - } - deps.push(dep); + const processItem = (expr, param) => { + if (param.isString()) { + const dep = new CommonJsRequireDependency(param.string, param.range); + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; } - const dep = this.newRequireArrayDependency(deps, param.range); + }; + const processContext = (expr, param) => { + const dep = ContextDependencyHelpers.create( + CommonJsRequireContextDependency, + expr.range, + param, + expr, + options, + {}, + parser + ); + if (!dep) return; dep.loc = expr.loc; dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; - } - } - processItem(parser, expr, param) { - if (param.isConditional()) { - for (const p of param.options) { - const result = this.processItem(parser, expr, p); - if (result === undefined) { - this.processContext(parser, expr, p); + }; + + parser.hooks.expression + .for("require.cache") + .tap( + "CommonJsRequireDependencyParserPlugin", + ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + "__webpack_require__.c" + ) + ); + parser.hooks.expression + .for("require") + .tap("CommonJsRequireDependencyParserPlugin", expr => { + const dep = new CommonJsRequireContextDependency( + { + request: options.unknownContextRequest, + recursive: options.unknownContextRecursive, + regExp: options.unknownContextRegExp, + mode: "sync" + }, + expr.range + ); + dep.critical = + options.unknownContextCritical && + "require function is used in a way in which dependencies cannot be statically extracted"; + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; + }); + + const createHandler = callNew => expr => { + if (expr.arguments.length !== 1) return; + let localModule; + const param = parser.evaluateExpression(expr.arguments[0]); + if (param.isConditional()) { + let isExpression = false; + const prevLength = parser.state.current.dependencies.length; + const dep = new RequireHeaderDependency(expr.callee.range); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + for (const p of param.options) { + const result = processItem(expr, p); + if (result === undefined) { + isExpression = true; + } + } + if (isExpression) { + parser.state.current.dependencies.length = prevLength; + } else { + return true; } } - return true; - } else if (param.isString()) { - let dep, localModule; - if (param.string === "require") { - dep = new ConstDependency("__webpack_require__", param.string); - } else if (param.string === "module") { - dep = new ConstDependency( - parser.state.module.buildInfo.moduleArgument, - param.range - ); - } else if (param.string === "exports") { - dep = new ConstDependency( - parser.state.module.buildInfo.exportsArgument, - param.range - ); - } else if ( + if ( + param.isString() && (localModule = LocalModulesHelpers.getLocalModule( parser.state, param.string )) ) { - dep = new LocalModuleDependency(localModule, param.range, false); + const dep = new LocalModuleDependency(localModule, expr.range, callNew); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + return true; } else { - dep = this.newRequireItemDependency(param.string, param.range); + const result = processItem(expr, param); + if (result === undefined) { + processContext(expr, param); + } else { + const dep = new RequireHeaderDependency(expr.callee.range); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + } + return true; } - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - } - } - processContext(parser, expr, param) { - const dep = ContextDependencyHelpers.create( - AMDRequireContextDependency, - param.range, - param, - expr, - this.options, - {}, - parser - ); - if (!dep) return; - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - } - - processArrayForRequestString(param) { - if (param.isArray()) { - const result = param.items.map(item => - this.processItemForRequestString(item) - ); - if (result.every(Boolean)) return result.join(" "); - } else if (param.isConstArray()) { - return param.array.join(" "); - } + }; + parser.hooks.call + .for("require") + .tap("CommonJsRequireDependencyParserPlugin", createHandler(false)); + parser.hooks.new + .for("require") + .tap("CommonJsRequireDependencyParserPlugin", createHandler(true)); + parser.hooks.call + .for("module.require") + .tap("CommonJsRequireDependencyParserPlugin", createHandler(false)); + parser.hooks.new + .for("module.require") + .tap("CommonJsRequireDependencyParserPlugin", createHandler(true)); } +} +module.exports = CommonJsRequireDependencyParserPlugin; - processItemForRequestString(param) { - if (param.isConditional()) { - const result = param.options.map(item => - this.processItemForRequestString(item) - ); - if (result.every(Boolean)) return result.join("|"); - } else if (param.isString()) { - return param.string; - } - } - processCallRequire(parser, expr) { - let param; - let dep; - let result; +/***/ }), - const old = parser.state.current; +/***/ 71101: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (expr.arguments.length >= 1) { - param = parser.evaluateExpression(expr.arguments[0]); - dep = this.newRequireDependenciesBlock( - expr, - param.range, - expr.arguments.length > 1 ? expr.arguments[1].range : null, - expr.arguments.length > 2 ? expr.arguments[2].range : null, - parser.state.module, - expr.loc, - this.processArrayForRequestString(param) - ); - parser.state.current = dep; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (expr.arguments.length === 1) { - parser.inScope([], () => { - result = this.processArray(parser, expr, param); - }); - parser.state.current = old; - if (!result) return; - parser.state.current.addBlock(dep); - return true; - } +const NullDependency = __webpack_require__(5088); - if (expr.arguments.length === 2 || expr.arguments.length === 3) { - try { - parser.inScope([], () => { - result = this.processArray(parser, expr, param); - }); - if (!result) { - dep = new UnsupportedDependency("unsupported", expr.range); - old.addDependency(dep); - if (parser.state.module) { - parser.state.module.errors.push( - new UnsupportedFeatureWarning( - parser.state.module, - "Cannot statically analyse 'require(…, …)' in line " + - expr.loc.start.line, - expr.loc - ) - ); - } - dep = null; - return true; - } - dep.functionBindThis = this.processFunctionArgument( - parser, - expr.arguments[1] - ); - if (expr.arguments.length === 3) { - dep.errorCallbackBindThis = this.processFunctionArgument( - parser, - expr.arguments[2] - ); - } - } finally { - parser.state.current = old; - if (dep) parser.state.current.addBlock(dep); - } - return true; - } +class ConstDependency extends NullDependency { + constructor(expression, range, requireWebpackRequire) { + super(); + this.expression = expression; + this.range = range; + this.requireWebpackRequire = requireWebpackRequire; } - newRequireDependenciesBlock( - expr, - arrayRange, - functionRange, - errorCallbackRange, - module, - loc, - request - ) { - return new AMDRequireDependenciesBlock( - expr, - arrayRange, - functionRange, - errorCallbackRange, - module, - loc, - request - ); - } - newRequireItemDependency(request, range) { - return new AMDRequireItemDependency(request, range); - } - newRequireArrayDependency(depsArray, range) { - return new AMDRequireArrayDependency(depsArray, range); + updateHash(hash) { + hash.update(this.range + ""); + hash.update(this.expression + ""); } } -module.exports = AMDRequireDependenciesBlockParserPlugin; + +ConstDependency.Template = class ConstDependencyTemplate { + apply(dep, source) { + if (typeof dep.range === "number") { + source.insert(dep.range, dep.expression); + return; + } + + source.replace(dep.range[0], dep.range[1] - 1, dep.expression); + } +}; + +module.exports = ConstDependency; /***/ }), -/***/ 73985: +/***/ 11583: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80302,141 +77142,412 @@ module.exports = AMDRequireDependenciesBlockParserPlugin; Author Tobias Koppers @sokra */ -const NullDependency = __webpack_require__(5088); +const Dependency = __webpack_require__(57282); +const CriticalDependencyWarning = __webpack_require__(54983); -class AMDRequireDependency extends NullDependency { - constructor(block) { +const regExpToString = r => (r ? r + "" : ""); + +class ContextDependency extends Dependency { + // options: { request, recursive, regExp, include, exclude, mode, chunkName, groupOptions } + constructor(options) { super(); - this.block = block; + this.options = options; + this.userRequest = this.options.request; + /** @type {false | string} */ + this.critical = false; + this.hadGlobalOrStickyRegExp = false; + if (this.options.regExp.global || this.options.regExp.sticky) { + this.options.regExp = null; + this.hadGlobalOrStickyRegExp = true; + } } -} -AMDRequireDependency.Template = class AMDRequireDependencyTemplate { - apply(dep, source, runtime) { - const depBlock = dep.block; - const promise = runtime.blockPromise({ - block: depBlock, - message: "AMD require" - }); + getResourceIdentifier() { + return ( + `context${this.options.request} ${this.options.recursive} ` + + `${regExpToString(this.options.regExp)} ${regExpToString( + this.options.include + )} ${regExpToString(this.options.exclude)} ` + + `${this.options.mode} ${this.options.chunkName} ` + + `${JSON.stringify(this.options.groupOptions)}` + ); + } - // has array range but no function range - if (depBlock.arrayRange && !depBlock.functionRange) { - const startBlock = `${promise}.then(function() {`; - const endBlock = `;}).catch(${runtime.onError()})`; - source.replace( - depBlock.outerRange[0], - depBlock.arrayRange[0] - 1, - startBlock - ); - source.replace( - depBlock.arrayRange[1], - depBlock.outerRange[1] - 1, - endBlock - ); - return; + getWarnings() { + let warnings = super.getWarnings() || []; + if (this.critical) { + warnings.push(new CriticalDependencyWarning(this.critical)); } - - // has function range but no array range - if (depBlock.functionRange && !depBlock.arrayRange) { - const startBlock = `${promise}.then((`; - const endBlock = `).bind(exports, __webpack_require__, exports, module)).catch(${runtime.onError()})`; - source.replace( - depBlock.outerRange[0], - depBlock.functionRange[0] - 1, - startBlock - ); - source.replace( - depBlock.functionRange[1], - depBlock.outerRange[1] - 1, - endBlock + if (this.hadGlobalOrStickyRegExp) { + warnings.push( + new CriticalDependencyWarning( + "Contexts can't use RegExps with the 'g' or 'y' flags." + ) ); - return; } + return warnings; + } +} - // has array range, function range, and errorCallbackRange - if ( - depBlock.arrayRange && - depBlock.functionRange && - depBlock.errorCallbackRange - ) { - const startBlock = `${promise}.then(function() { `; - const errorRangeBlock = `}${ - depBlock.functionBindThis ? ".bind(this)" : "" - }).catch(`; - const endBlock = `${ - depBlock.errorCallbackBindThis ? ".bind(this)" : "" - })`; +// TODO remove in webpack 5 +Object.defineProperty(ContextDependency.prototype, "async", { + configurable: false, + get() { + throw new Error( + "ContextDependency.async was removed. Use ContextDependency.options.mode instead." + ); + }, + set() { + throw new Error( + "ContextDependency.async was removed. Pass options.mode to constructor instead" + ); + } +}); - source.replace( - depBlock.outerRange[0], - depBlock.arrayRange[0] - 1, - startBlock - ); - source.insert( - depBlock.arrayRange[0] + 0.9, - "var __WEBPACK_AMD_REQUIRE_ARRAY__ = " - ); - source.replace( - depBlock.arrayRange[1], - depBlock.functionRange[0] - 1, - "; (" - ); - source.insert( - depBlock.functionRange[1], - ").apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);" - ); - source.replace( - depBlock.functionRange[1], - depBlock.errorCallbackRange[0] - 1, - errorRangeBlock - ); - source.replace( - depBlock.errorCallbackRange[1], - depBlock.outerRange[1] - 1, - endBlock - ); - return; +module.exports = ContextDependency; + + +/***/ }), + +/***/ 5594: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const ContextDependencyHelpers = exports; + +/** + * Escapes regular expression metacharacters + * @param {string} str String to quote + * @returns {string} Escaped string + */ +const quotemeta = str => { + return str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); +}; + +const splitContextFromPrefix = prefix => { + const idx = prefix.lastIndexOf("/"); + let context = "."; + if (idx >= 0) { + context = prefix.substr(0, idx); + prefix = `.${prefix.substr(idx)}`; + } + return { + context, + prefix + }; +}; + +const splitQueryFromPostfix = postfix => { + const idx = postfix.indexOf("?"); + let query = ""; + if (idx >= 0) { + query = postfix.substr(idx); + postfix = postfix.substr(0, idx); + } + return { + postfix, + query + }; +}; + +ContextDependencyHelpers.create = ( + Dep, + range, + param, + expr, + options, + contextOptions, + // when parser is not passed in, expressions won't be walked + parser = null +) => { + if (param.isTemplateString()) { + let prefixRaw = param.quasis[0].string; + let postfixRaw = + param.quasis.length > 1 + ? param.quasis[param.quasis.length - 1].string + : ""; + + const valueRange = param.range; + const { context, prefix } = splitContextFromPrefix(prefixRaw); + const { postfix, query } = splitQueryFromPostfix(postfixRaw); + + // When there are more than two quasis, the generated RegExp can be more precise + // We join the quasis with the expression regexp + const innerQuasis = param.quasis.slice(1, param.quasis.length - 1); + const innerRegExp = + options.wrappedContextRegExp.source + + innerQuasis + .map(q => quotemeta(q.string) + options.wrappedContextRegExp.source) + .join(""); + + // Example: `./context/pre${e}inner${e}inner2${e}post?query` + // context: "./context" + // prefix: "./pre" + // innerQuasis: [BEE("inner"), BEE("inner2")] + // (BEE = BasicEvaluatedExpression) + // postfix: "post" + // query: "?query" + // regExp: /^\.\/pre.*inner.*inner2.*post$/ + const regExp = new RegExp( + `^${quotemeta(prefix)}${innerRegExp}${quotemeta(postfix)}$` + ); + const dep = new Dep( + Object.assign( + { + request: context + query, + recursive: options.wrappedContextRecursive, + regExp, + mode: "sync" + }, + contextOptions + ), + range, + valueRange + ); + dep.loc = expr.loc; + const replaces = []; + + param.parts.forEach((part, i) => { + if (i % 2 === 0) { + // Quasis or merged quasi + let range = part.range; + let value = part.string; + if (param.templateStringKind === "cooked") { + value = JSON.stringify(value); + value = value.slice(1, value.length - 1); + } + if (i === 0) { + // prefix + value = prefix; + range = [param.range[0], part.range[1]]; + value = + (param.templateStringKind === "cooked" ? "`" : "String.raw`") + + value; + } else if (i === param.parts.length - 1) { + // postfix + value = postfix; + range = [part.range[0], param.range[1]]; + value = value + "`"; + } else if ( + part.expression && + part.expression.type === "TemplateElement" && + part.expression.value.raw === value + ) { + // Shortcut when it's a single quasi and doesn't need to be replaced + return; + } + replaces.push({ + range, + value + }); + } else { + // Expression + if (parser) { + parser.walkExpression(part.expression); + } + } + }); + + dep.replaces = replaces; + dep.critical = + options.wrappedContextCritical && + "a part of the request of a dependency is an expression"; + return dep; + } else if ( + param.isWrapped() && + ((param.prefix && param.prefix.isString()) || + (param.postfix && param.postfix.isString())) + ) { + let prefixRaw = + param.prefix && param.prefix.isString() ? param.prefix.string : ""; + let postfixRaw = + param.postfix && param.postfix.isString() ? param.postfix.string : ""; + const prefixRange = + param.prefix && param.prefix.isString() ? param.prefix.range : null; + const postfixRange = + param.postfix && param.postfix.isString() ? param.postfix.range : null; + const valueRange = param.range; + const { context, prefix } = splitContextFromPrefix(prefixRaw); + const { postfix, query } = splitQueryFromPostfix(postfixRaw); + const regExp = new RegExp( + `^${quotemeta(prefix)}${options.wrappedContextRegExp.source}${quotemeta( + postfix + )}$` + ); + const dep = new Dep( + Object.assign( + { + request: context + query, + recursive: options.wrappedContextRecursive, + regExp, + mode: "sync" + }, + contextOptions + ), + range, + valueRange + ); + dep.loc = expr.loc; + const replaces = []; + if (prefixRange) { + replaces.push({ + range: prefixRange, + value: JSON.stringify(prefix) + }); + } + if (postfixRange) { + replaces.push({ + range: postfixRange, + value: JSON.stringify(postfix) + }); } + dep.replaces = replaces; + dep.critical = + options.wrappedContextCritical && + "a part of the request of a dependency is an expression"; - // has array range, function range, but no errorCallbackRange - if (depBlock.arrayRange && depBlock.functionRange) { - const startBlock = `${promise}.then(function() { `; - const endBlock = `}${ - depBlock.functionBindThis ? ".bind(this)" : "" - }).catch(${runtime.onError()})`; - source.replace( - depBlock.outerRange[0], - depBlock.arrayRange[0] - 1, - startBlock - ); - source.insert( - depBlock.arrayRange[0] + 0.9, - "var __WEBPACK_AMD_REQUIRE_ARRAY__ = " - ); - source.replace( - depBlock.arrayRange[1], - depBlock.functionRange[0] - 1, - "; (" - ); - source.insert( - depBlock.functionRange[1], - ").apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);" - ); - source.replace( - depBlock.functionRange[1], - depBlock.outerRange[1] - 1, - endBlock - ); + if (parser && param.wrappedInnerExpressions) { + for (const part of param.wrappedInnerExpressions) { + if (part.expression) parser.walkExpression(part.expression); + } + } + + return dep; + } else { + const dep = new Dep( + Object.assign( + { + request: options.exprContextRequest, + recursive: options.exprContextRecursive, + regExp: options.exprContextRegExp, + mode: "sync" + }, + contextOptions + ), + range, + param.range + ); + dep.loc = expr.loc; + dep.critical = + options.exprContextCritical && + "the request of a dependency is an expression"; + + if (parser) { + parser.walkExpression(param.expression); } + + return dep; } }; -module.exports = AMDRequireDependency; + +/***/ }), + +/***/ 6174: +/***/ (function(module) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +class ContextDependencyTemplateAsId { + apply(dep, source, runtime) { + const moduleExports = runtime.moduleExports({ + module: dep.module, + request: dep.request + }); + + if (dep.module) { + if (dep.valueRange) { + if (Array.isArray(dep.replaces)) { + for (let i = 0; i < dep.replaces.length; i++) { + const rep = dep.replaces[i]; + source.replace(rep.range[0], rep.range[1] - 1, rep.value); + } + } + source.replace(dep.valueRange[1], dep.range[1] - 1, ")"); + // TODO webpack 5 remove `prepend` it's no longer used + source.replace( + dep.range[0], + dep.valueRange[0] - 1, + `${moduleExports}.resolve(${ + typeof dep.prepend === "string" ? JSON.stringify(dep.prepend) : "" + }` + ); + } else { + source.replace( + dep.range[0], + dep.range[1] - 1, + `${moduleExports}.resolve` + ); + } + } else { + source.replace(dep.range[0], dep.range[1] - 1, moduleExports); + } + } +} +module.exports = ContextDependencyTemplateAsId; /***/ }), -/***/ 34345: +/***/ 54380: +/***/ (function(module) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +class ContextDependencyTemplateAsRequireCall { + apply(dep, source, runtime) { + const moduleExports = runtime.moduleExports({ + module: dep.module, + request: dep.request + }); + + if (dep.module) { + if (dep.valueRange) { + if (Array.isArray(dep.replaces)) { + for (let i = 0; i < dep.replaces.length; i++) { + const rep = dep.replaces[i]; + source.replace(rep.range[0], rep.range[1] - 1, rep.value); + } + } + source.replace(dep.valueRange[1], dep.range[1] - 1, ")"); + // TODO webpack 5 remove `prepend` it's no longer used + source.replace( + dep.range[0], + dep.valueRange[0] - 1, + `${moduleExports}(${ + typeof dep.prepend === "string" ? JSON.stringify(dep.prepend) : "" + }` + ); + } else { + source.replace(dep.range[0], dep.range[1] - 1, moduleExports); + } + } else { + source.replace(dep.range[0], dep.range[1] - 1, moduleExports); + } + } +} +module.exports = ContextDependencyTemplateAsRequireCall; + + +/***/ }), + +/***/ 89079: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80446,27 +77557,26 @@ module.exports = AMDRequireDependency; */ const ModuleDependency = __webpack_require__(90865); -const ModuleDependencyTemplateAsRequireId = __webpack_require__(60441); -class AMDRequireItemDependency extends ModuleDependency { - constructor(request, range) { +class ContextElementDependency extends ModuleDependency { + constructor(request, userRequest) { super(request); - this.range = range; + if (userRequest) { + this.userRequest = userRequest; + } } get type() { - return "amd require"; + return "context element"; } } -AMDRequireItemDependency.Template = ModuleDependencyTemplateAsRequireId; - -module.exports = AMDRequireItemDependency; +module.exports = ContextElementDependency; /***/ }), -/***/ 85358: +/***/ 54983: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80475,164 +77585,67 @@ module.exports = AMDRequireItemDependency; Author Tobias Koppers @sokra */ -const ConstDependency = __webpack_require__(71101); -const CommonJsRequireDependency = __webpack_require__(37504); -const CommonJsRequireContextDependency = __webpack_require__(26791); -const RequireResolveDependency = __webpack_require__(43519); -const RequireResolveContextDependency = __webpack_require__(83309); -const RequireResolveHeaderDependency = __webpack_require__(69647); -const RequireHeaderDependency = __webpack_require__(22928); -const NullFactory = __webpack_require__(40438); +const WebpackError = __webpack_require__(97391); -const RequireResolveDependencyParserPlugin = __webpack_require__(68349); -const CommonJsRequireDependencyParserPlugin = __webpack_require__(37278); +class CriticalDependencyWarning extends WebpackError { + constructor(message) { + super(); -const ParserHelpers = __webpack_require__(23999); + this.name = "CriticalDependencyWarning"; + this.message = "Critical dependency: " + message; -class CommonJsPlugin { - constructor(options) { - this.options = options; + Error.captureStackTrace(this, this.constructor); } +} - apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap( - "CommonJsPlugin", - (compilation, { contextModuleFactory, normalModuleFactory }) => { - compilation.dependencyFactories.set( - CommonJsRequireDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - CommonJsRequireDependency, - new CommonJsRequireDependency.Template() - ); +module.exports = CriticalDependencyWarning; - compilation.dependencyFactories.set( - CommonJsRequireContextDependency, - contextModuleFactory - ); - compilation.dependencyTemplates.set( - CommonJsRequireContextDependency, - new CommonJsRequireContextDependency.Template() - ); - compilation.dependencyFactories.set( - RequireResolveDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - RequireResolveDependency, - new RequireResolveDependency.Template() - ); +/***/ }), - compilation.dependencyFactories.set( - RequireResolveContextDependency, - contextModuleFactory - ); - compilation.dependencyTemplates.set( - RequireResolveContextDependency, - new RequireResolveContextDependency.Template() - ); +/***/ 53104: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - compilation.dependencyFactories.set( - RequireResolveHeaderDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - RequireResolveHeaderDependency, - new RequireResolveHeaderDependency.Template() - ); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - compilation.dependencyFactories.set( - RequireHeaderDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - RequireHeaderDependency, - new RequireHeaderDependency.Template() - ); - const handler = (parser, parserOptions) => { - if (parserOptions.commonjs !== undefined && !parserOptions.commonjs) - return; +const DependencyReference = __webpack_require__(71722); +const NullDependency = __webpack_require__(5088); - const requireExpressions = [ - "require", - "require.resolve", - "require.resolveWeak" - ]; - for (let expression of requireExpressions) { - parser.hooks.typeof - .for(expression) - .tap( - "CommonJsPlugin", - ParserHelpers.toConstantDependency( - parser, - JSON.stringify("function") - ) - ); - parser.hooks.evaluateTypeof - .for(expression) - .tap( - "CommonJsPlugin", - ParserHelpers.evaluateToString("function") - ); - parser.hooks.evaluateIdentifier - .for(expression) - .tap( - "CommonJsPlugin", - ParserHelpers.evaluateToIdentifier(expression, true) - ); - } +class DelegatedExportsDependency extends NullDependency { + constructor(originModule, exports) { + super(); + this.originModule = originModule; + this.exports = exports; + } - parser.hooks.evaluateTypeof - .for("module") - .tap("CommonJsPlugin", ParserHelpers.evaluateToString("object")); - parser.hooks.assign.for("require").tap("CommonJsPlugin", expr => { - // to not leak to global "require", we need to define a local require here. - const dep = new ConstDependency("var require;", 0); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - parser.scope.definitions.add("require"); - return true; - }); - parser.hooks.canRename - .for("require") - .tap("CommonJsPlugin", () => true); - parser.hooks.rename.for("require").tap("CommonJsPlugin", expr => { - // define the require variable. It's still undefined, but not "not defined". - const dep = new ConstDependency("var require;", 0); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - return false; - }); - parser.hooks.typeof.for("module").tap("CommonJsPlugin", () => true); - parser.hooks.evaluateTypeof - .for("exports") - .tap("CommonJsPlugin", ParserHelpers.evaluateToString("object")); + get type() { + return "delegated exports"; + } - new CommonJsRequireDependencyParserPlugin(options).apply(parser); - new RequireResolveDependencyParserPlugin(options).apply(parser); - }; + getReference() { + return new DependencyReference(this.originModule, true, false); + } - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("CommonJsPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("CommonJsPlugin", handler); - } - ); + getExports() { + return { + exports: this.exports, + dependencies: undefined + }; } } -module.exports = CommonJsPlugin; + +module.exports = DelegatedExportsDependency; /***/ }), -/***/ 26791: +/***/ 25930: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80641,59 +77654,96 @@ module.exports = CommonJsPlugin; Author Tobias Koppers @sokra */ -const ContextDependency = __webpack_require__(11583); -const ContextDependencyTemplateAsRequireCall = __webpack_require__(54380); +const ModuleDependency = __webpack_require__(90865); -class CommonJsRequireContextDependency extends ContextDependency { - constructor(options, range, valueRange) { - super(options); - this.range = range; - this.valueRange = valueRange; +class DelegatedSourceDependency extends ModuleDependency { + constructor(request) { + super(request); } get type() { - return "cjs require context"; + return "delegated source"; } } -CommonJsRequireContextDependency.Template = ContextDependencyTemplateAsRequireCall; - -module.exports = CommonJsRequireContextDependency; +module.exports = DelegatedSourceDependency; /***/ }), -/***/ 37504: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 71722: +/***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra + Author Florent Cailhol @ooflorent */ -const ModuleDependency = __webpack_require__(90865); -const ModuleDependencyTemplateAsId = __webpack_require__(63708); -class CommonJsRequireDependency extends ModuleDependency { - constructor(request, range) { - super(request); - this.range = range; +/** @typedef {import("../Module")} Module */ + +class DependencyReference { + // TODO webpack 5: module must be dynamic, you must pass a function returning a module + // This is needed to remove the hack in ConcatenatedModule + // The problem is that the `module` in Dependency could be replaced i. e. because of Scope Hoisting + /** + * + * @param {Module} module the referenced module + * @param {string[] | boolean} importedNames imported named from the module + * @param {boolean=} weak if this is a weak reference + * @param {number} order the order information or NaN if don't care + */ + constructor(module, importedNames, weak = false, order = NaN) { + // TODO webpack 5: make it a getter + this.module = module; + // true: full object + // false: only sideeffects/no export + // array of strings: the exports with this names + this.importedNames = importedNames; + this.weak = !!weak; + this.order = order; } - get type() { - return "cjs require"; + /** + * @param {DependencyReference[]} array an array (will be modified) + * @returns {DependencyReference[]} the array again + */ + static sort(array) { + /** @type {WeakMap} */ + const originalOrder = new WeakMap(); + let i = 0; + for (const ref of array) { + originalOrder.set(ref, i++); + } + return array.sort((a, b) => { + const aOrder = a.order; + const bOrder = b.order; + if (isNaN(aOrder)) { + if (!isNaN(bOrder)) { + return 1; + } + } else { + if (isNaN(bOrder)) { + return -1; + } + if (aOrder !== bOrder) { + return aOrder - bOrder; + } + } + const aOrg = originalOrder.get(a); + const bOrg = originalOrder.get(b); + return aOrg - bOrg; + }); } } -CommonJsRequireDependency.Template = ModuleDependencyTemplateAsId; - -module.exports = CommonJsRequireDependency; +module.exports = DependencyReference; /***/ }), -/***/ 37278: +/***/ 66279: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80702,144 +77752,26 @@ module.exports = CommonJsRequireDependency; Author Tobias Koppers @sokra */ +const Dependency = __webpack_require__(57282); -const CommonJsRequireDependency = __webpack_require__(37504); -const CommonJsRequireContextDependency = __webpack_require__(26791); -const RequireHeaderDependency = __webpack_require__(22928); -const LocalModuleDependency = __webpack_require__(56570); -const ContextDependencyHelpers = __webpack_require__(5594); -const LocalModulesHelpers = __webpack_require__(39658); -const ParserHelpers = __webpack_require__(23999); - -class CommonJsRequireDependencyParserPlugin { - constructor(options) { - this.options = options; +class DllEntryDependency extends Dependency { + constructor(dependencies, name) { + super(); + this.dependencies = dependencies; + this.name = name; } - apply(parser) { - const options = this.options; - - const processItem = (expr, param) => { - if (param.isString()) { - const dep = new CommonJsRequireDependency(param.string, param.range); - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - } - }; - const processContext = (expr, param) => { - const dep = ContextDependencyHelpers.create( - CommonJsRequireContextDependency, - expr.range, - param, - expr, - options, - {}, - parser - ); - if (!dep) return; - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - }; - - parser.hooks.expression - .for("require.cache") - .tap( - "CommonJsRequireDependencyParserPlugin", - ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - "__webpack_require__.c" - ) - ); - parser.hooks.expression - .for("require") - .tap("CommonJsRequireDependencyParserPlugin", expr => { - const dep = new CommonJsRequireContextDependency( - { - request: options.unknownContextRequest, - recursive: options.unknownContextRecursive, - regExp: options.unknownContextRegExp, - mode: "sync" - }, - expr.range - ); - dep.critical = - options.unknownContextCritical && - "require function is used in a way in which dependencies cannot be statically extracted"; - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - }); - - const createHandler = callNew => expr => { - if (expr.arguments.length !== 1) return; - let localModule; - const param = parser.evaluateExpression(expr.arguments[0]); - if (param.isConditional()) { - let isExpression = false; - const prevLength = parser.state.current.dependencies.length; - const dep = new RequireHeaderDependency(expr.callee.range); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - for (const p of param.options) { - const result = processItem(expr, p); - if (result === undefined) { - isExpression = true; - } - } - if (isExpression) { - parser.state.current.dependencies.length = prevLength; - } else { - return true; - } - } - if ( - param.isString() && - (localModule = LocalModulesHelpers.getLocalModule( - parser.state, - param.string - )) - ) { - const dep = new LocalModuleDependency(localModule, expr.range, callNew); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - return true; - } else { - const result = processItem(expr, param); - if (result === undefined) { - processContext(expr, param); - } else { - const dep = new RequireHeaderDependency(expr.callee.range); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - } - return true; - } - }; - parser.hooks.call - .for("require") - .tap("CommonJsRequireDependencyParserPlugin", createHandler(false)); - parser.hooks.new - .for("require") - .tap("CommonJsRequireDependencyParserPlugin", createHandler(true)); - parser.hooks.call - .for("module.require") - .tap("CommonJsRequireDependencyParserPlugin", createHandler(false)); - parser.hooks.new - .for("module.require") - .tap("CommonJsRequireDependencyParserPlugin", createHandler(true)); + get type() { + return "dll entry"; } } -module.exports = CommonJsRequireDependencyParserPlugin; + +module.exports = DllEntryDependency; /***/ }), -/***/ 71101: +/***/ 75159: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80848,39 +77780,54 @@ module.exports = CommonJsRequireDependencyParserPlugin; Author Tobias Koppers @sokra */ + const NullDependency = __webpack_require__(5088); +const HarmonyImportDependency = __webpack_require__(81599); -class ConstDependency extends NullDependency { - constructor(expression, range, requireWebpackRequire) { +class HarmonyAcceptDependency extends NullDependency { + constructor(range, dependencies, hasCallback) { super(); - this.expression = expression; this.range = range; - this.requireWebpackRequire = requireWebpackRequire; + this.dependencies = dependencies; + this.hasCallback = hasCallback; } - updateHash(hash) { - hash.update(this.range + ""); - hash.update(this.expression + ""); + get type() { + return "accepted harmony modules"; } } -ConstDependency.Template = class ConstDependencyTemplate { - apply(dep, source) { - if (typeof dep.range === "number") { - source.insert(dep.range, dep.expression); +HarmonyAcceptDependency.Template = class HarmonyAcceptDependencyTemplate { + apply(dep, source, runtime) { + const content = dep.dependencies + .filter(dependency => + HarmonyImportDependency.Template.isImportEmitted(dependency, source) + ) + .map(dependency => dependency.getImportStatement(true, runtime)) + .join(""); + + if (dep.hasCallback) { + source.insert( + dep.range[0], + `function(__WEBPACK_OUTDATED_DEPENDENCIES__) { ${content}(` + ); + source.insert( + dep.range[1], + ")(__WEBPACK_OUTDATED_DEPENDENCIES__); }.bind(this)" + ); return; } - source.replace(dep.range[0], dep.range[1] - 1, dep.expression); + source.insert(dep.range[1] - 0.5, `, function() { ${content} }`); } }; -module.exports = ConstDependency; +module.exports = HarmonyAcceptDependency; /***/ }), -/***/ 11583: +/***/ 66136: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80889,75 +77836,69 @@ module.exports = ConstDependency; Author Tobias Koppers @sokra */ -const Dependency = __webpack_require__(57282); -const CriticalDependencyWarning = __webpack_require__(54983); +const HarmonyImportDependency = __webpack_require__(81599); -const regExpToString = r => (r ? r + "" : ""); +class HarmonyAcceptImportDependency extends HarmonyImportDependency { + constructor(request, originModule, parserScope) { + super(request, originModule, NaN, parserScope); + this.weak = true; + } -class ContextDependency extends Dependency { - // options: { request, recursive, regExp, include, exclude, mode, chunkName, groupOptions } - constructor(options) { - super(); - this.options = options; - this.userRequest = this.options.request; - /** @type {false | string} */ - this.critical = false; - this.hadGlobalOrStickyRegExp = false; - if (this.options.regExp.global || this.options.regExp.sticky) { - this.options.regExp = null; - this.hadGlobalOrStickyRegExp = true; - } + get type() { + return "harmony accept"; } +} - getResourceIdentifier() { - return ( - `context${this.options.request} ${this.options.recursive} ` + - `${regExpToString(this.options.regExp)} ${regExpToString( - this.options.include - )} ${regExpToString(this.options.exclude)} ` + - `${this.options.mode} ${this.options.chunkName} ` + - `${JSON.stringify(this.options.groupOptions)}` - ); +HarmonyAcceptImportDependency.Template = class HarmonyAcceptImportDependencyTemplate extends HarmonyImportDependency.Template { + apply(dep, source, runtime) {} +}; + +module.exports = HarmonyAcceptImportDependency; + + +/***/ }), + +/***/ 1533: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +const NullDependency = __webpack_require__(5088); + +class HarmonyCompatibilityDependency extends NullDependency { + constructor(originModule) { + super(); + this.originModule = originModule; } - getWarnings() { - let warnings = super.getWarnings() || []; - if (this.critical) { - warnings.push(new CriticalDependencyWarning(this.critical)); - } - if (this.hadGlobalOrStickyRegExp) { - warnings.push( - new CriticalDependencyWarning( - "Contexts can't use RegExps with the 'g' or 'y' flags." - ) - ); - } - return warnings; + get type() { + return "harmony export header"; } } -// TODO remove in webpack 5 -Object.defineProperty(ContextDependency.prototype, "async", { - configurable: false, - get() { - throw new Error( - "ContextDependency.async was removed. Use ContextDependency.options.mode instead." - ); - }, - set() { - throw new Error( - "ContextDependency.async was removed. Pass options.mode to constructor instead" - ); +HarmonyCompatibilityDependency.Template = class HarmonyExportDependencyTemplate { + apply(dep, source, runtime) { + const usedExports = dep.originModule.usedExports; + if (usedExports !== false && !Array.isArray(usedExports)) { + const content = runtime.defineEsModuleFlagStatement({ + exportsArgument: dep.originModule.exportsArgument + }); + source.insert(-10, content); + } } -}); +}; -module.exports = ContextDependency; +module.exports = HarmonyCompatibilityDependency; /***/ }), -/***/ 5594: -/***/ (function(__unused_webpack_module, exports) { +/***/ 59310: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -80966,238 +77907,102 @@ module.exports = ContextDependency; */ -const ContextDependencyHelpers = exports; +const HarmonyCompatibilityDependency = __webpack_require__(1533); +const HarmonyInitDependency = __webpack_require__(27204); -/** - * Escapes regular expression metacharacters - * @param {string} str String to quote - * @returns {string} Escaped string - */ -const quotemeta = str => { - return str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); -}; - -const splitContextFromPrefix = prefix => { - const idx = prefix.lastIndexOf("/"); - let context = "."; - if (idx >= 0) { - context = prefix.substr(0, idx); - prefix = `.${prefix.substr(idx)}`; - } - return { - context, - prefix - }; -}; - -const splitQueryFromPostfix = postfix => { - const idx = postfix.indexOf("?"); - let query = ""; - if (idx >= 0) { - query = postfix.substr(idx); - postfix = postfix.substr(0, idx); - } - return { - postfix, - query - }; -}; - -ContextDependencyHelpers.create = ( - Dep, - range, - param, - expr, - options, - contextOptions, - // when parser is not passed in, expressions won't be walked - parser = null -) => { - if (param.isTemplateString()) { - let prefixRaw = param.quasis[0].string; - let postfixRaw = - param.quasis.length > 1 - ? param.quasis[param.quasis.length - 1].string - : ""; - - const valueRange = param.range; - const { context, prefix } = splitContextFromPrefix(prefixRaw); - const { postfix, query } = splitQueryFromPostfix(postfixRaw); - - // When there are more than two quasis, the generated RegExp can be more precise - // We join the quasis with the expression regexp - const innerQuasis = param.quasis.slice(1, param.quasis.length - 1); - const innerRegExp = - options.wrappedContextRegExp.source + - innerQuasis - .map(q => quotemeta(q.string) + options.wrappedContextRegExp.source) - .join(""); - - // Example: `./context/pre${e}inner${e}inner2${e}post?query` - // context: "./context" - // prefix: "./pre" - // innerQuasis: [BEE("inner"), BEE("inner2")] - // (BEE = BasicEvaluatedExpression) - // postfix: "post" - // query: "?query" - // regExp: /^\.\/pre.*inner.*inner2.*post$/ - const regExp = new RegExp( - `^${quotemeta(prefix)}${innerRegExp}${quotemeta(postfix)}$` - ); - const dep = new Dep( - Object.assign( - { - request: context + query, - recursive: options.wrappedContextRecursive, - regExp, - mode: "sync" - }, - contextOptions - ), - range, - valueRange - ); - dep.loc = expr.loc; - const replaces = []; - - param.parts.forEach((part, i) => { - if (i % 2 === 0) { - // Quasis or merged quasi - let range = part.range; - let value = part.string; - if (param.templateStringKind === "cooked") { - value = JSON.stringify(value); - value = value.slice(1, value.length - 1); - } - if (i === 0) { - // prefix - value = prefix; - range = [param.range[0], part.range[1]]; - value = - (param.templateStringKind === "cooked" ? "`" : "String.raw`") + - value; - } else if (i === param.parts.length - 1) { - // postfix - value = postfix; - range = [part.range[0], param.range[1]]; - value = value + "`"; - } else if ( - part.expression && - part.expression.type === "TemplateElement" && - part.expression.value.raw === value - ) { - // Shortcut when it's a single quasi and doesn't need to be replaced - return; - } - replaces.push({ - range, - value - }); - } else { - // Expression - if (parser) { - parser.walkExpression(part.expression); +module.exports = class HarmonyDetectionParserPlugin { + apply(parser) { + parser.hooks.program.tap("HarmonyDetectionParserPlugin", ast => { + const isStrictHarmony = parser.state.module.type === "javascript/esm"; + const isHarmony = + isStrictHarmony || + ast.body.some( + statement => + statement.type === "ImportDeclaration" || + statement.type === "ExportDefaultDeclaration" || + statement.type === "ExportNamedDeclaration" || + statement.type === "ExportAllDeclaration" + ); + if (isHarmony) { + const module = parser.state.module; + const compatDep = new HarmonyCompatibilityDependency(module); + compatDep.loc = { + start: { + line: -1, + column: 0 + }, + end: { + line: -1, + column: 0 + }, + index: -3 + }; + module.addDependency(compatDep); + const initDep = new HarmonyInitDependency(module); + initDep.loc = { + start: { + line: -1, + column: 0 + }, + end: { + line: -1, + column: 0 + }, + index: -2 + }; + module.addDependency(initDep); + parser.state.harmonyParserScope = parser.state.harmonyParserScope || {}; + parser.scope.isStrict = true; + module.buildMeta.exportsType = "namespace"; + module.buildInfo.strict = true; + module.buildInfo.exportsArgument = "__webpack_exports__"; + if (isStrictHarmony) { + module.buildMeta.strictHarmonyModule = true; + module.buildInfo.moduleArgument = "__webpack_module__"; } } }); - dep.replaces = replaces; - dep.critical = - options.wrappedContextCritical && - "a part of the request of a dependency is an expression"; - return dep; - } else if ( - param.isWrapped() && - ((param.prefix && param.prefix.isString()) || - (param.postfix && param.postfix.isString())) - ) { - let prefixRaw = - param.prefix && param.prefix.isString() ? param.prefix.string : ""; - let postfixRaw = - param.postfix && param.postfix.isString() ? param.postfix.string : ""; - const prefixRange = - param.prefix && param.prefix.isString() ? param.prefix.range : null; - const postfixRange = - param.postfix && param.postfix.isString() ? param.postfix.range : null; - const valueRange = param.range; - const { context, prefix } = splitContextFromPrefix(prefixRaw); - const { postfix, query } = splitQueryFromPostfix(postfixRaw); - const regExp = new RegExp( - `^${quotemeta(prefix)}${options.wrappedContextRegExp.source}${quotemeta( - postfix - )}$` - ); - const dep = new Dep( - Object.assign( - { - request: context + query, - recursive: options.wrappedContextRecursive, - regExp, - mode: "sync" - }, - contextOptions - ), - range, - valueRange - ); - dep.loc = expr.loc; - const replaces = []; - if (prefixRange) { - replaces.push({ - range: prefixRange, - value: JSON.stringify(prefix) - }); - } - if (postfixRange) { - replaces.push({ - range: postfixRange, - value: JSON.stringify(postfix) - }); - } - dep.replaces = replaces; - dep.critical = - options.wrappedContextCritical && - "a part of the request of a dependency is an expression"; - - if (parser && param.wrappedInnerExpressions) { - for (const part of param.wrappedInnerExpressions) { - if (part.expression) parser.walkExpression(part.expression); + const skipInHarmony = () => { + const module = parser.state.module; + if (module && module.buildMeta && module.buildMeta.exportsType) { + return true; } - } + }; - return dep; - } else { - const dep = new Dep( - Object.assign( - { - request: options.exprContextRequest, - recursive: options.exprContextRecursive, - regExp: options.exprContextRegExp, - mode: "sync" - }, - contextOptions - ), - range, - param.range - ); - dep.loc = expr.loc; - dep.critical = - options.exprContextCritical && - "the request of a dependency is an expression"; + const nullInHarmony = () => { + const module = parser.state.module; + if (module && module.buildMeta && module.buildMeta.exportsType) { + return null; + } + }; - if (parser) { - parser.walkExpression(param.expression); + const nonHarmonyIdentifiers = ["define", "exports"]; + for (const identifer of nonHarmonyIdentifiers) { + parser.hooks.evaluateTypeof + .for(identifer) + .tap("HarmonyDetectionParserPlugin", nullInHarmony); + parser.hooks.typeof + .for(identifer) + .tap("HarmonyDetectionParserPlugin", skipInHarmony); + parser.hooks.evaluate + .for(identifer) + .tap("HarmonyDetectionParserPlugin", nullInHarmony); + parser.hooks.expression + .for(identifer) + .tap("HarmonyDetectionParserPlugin", skipInHarmony); + parser.hooks.call + .for(identifer) + .tap("HarmonyDetectionParserPlugin", skipInHarmony); } - - return dep; } }; /***/ }), -/***/ 6174: -/***/ (function(module) { +/***/ 49180: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -81206,49 +78011,160 @@ ContextDependencyHelpers.create = ( */ -class ContextDependencyTemplateAsId { - apply(dep, source, runtime) { - const moduleExports = runtime.moduleExports({ - module: dep.module, - request: dep.request - }); +const HarmonyExportExpressionDependency = __webpack_require__(84245); +const HarmonyImportSideEffectDependency = __webpack_require__(79171); +const HarmonyExportHeaderDependency = __webpack_require__(21320); +const HarmonyExportSpecifierDependency = __webpack_require__(34834); +const HarmonyExportImportedSpecifierDependency = __webpack_require__(22864); +const ConstDependency = __webpack_require__(71101); - if (dep.module) { - if (dep.valueRange) { - if (Array.isArray(dep.replaces)) { - for (let i = 0; i < dep.replaces.length; i++) { - const rep = dep.replaces[i]; - source.replace(rep.range[0], rep.range[1] - 1, rep.value); - } - } - source.replace(dep.valueRange[1], dep.range[1] - 1, ")"); - // TODO webpack 5 remove `prepend` it's no longer used - source.replace( - dep.range[0], - dep.valueRange[0] - 1, - `${moduleExports}.resolve(${ - typeof dep.prepend === "string" ? JSON.stringify(dep.prepend) : "" - }` +module.exports = class HarmonyExportDependencyParserPlugin { + constructor(moduleOptions) { + this.strictExportPresence = moduleOptions.strictExportPresence; + } + + apply(parser) { + parser.hooks.export.tap( + "HarmonyExportDependencyParserPlugin", + statement => { + const dep = new HarmonyExportHeaderDependency( + statement.declaration && statement.declaration.range, + statement.range ); - } else { - source.replace( - dep.range[0], - dep.range[1] - 1, - `${moduleExports}.resolve` + dep.loc = Object.create(statement.loc); + dep.loc.index = -1; + parser.state.current.addDependency(dep); + return true; + } + ); + parser.hooks.exportImport.tap( + "HarmonyExportDependencyParserPlugin", + (statement, source) => { + parser.state.lastHarmonyImportOrder = + (parser.state.lastHarmonyImportOrder || 0) + 1; + const clearDep = new ConstDependency("", statement.range); + clearDep.loc = Object.create(statement.loc); + clearDep.loc.index = -1; + parser.state.current.addDependency(clearDep); + const sideEffectDep = new HarmonyImportSideEffectDependency( + source, + parser.state.module, + parser.state.lastHarmonyImportOrder, + parser.state.harmonyParserScope ); + sideEffectDep.loc = Object.create(statement.loc); + sideEffectDep.loc.index = -1; + parser.state.current.addDependency(sideEffectDep); + return true; } - } else { - source.replace(dep.range[0], dep.range[1] - 1, moduleExports); - } + ); + parser.hooks.exportExpression.tap( + "HarmonyExportDependencyParserPlugin", + (statement, expr) => { + const comments = parser.getComments([ + statement.range[0], + expr.range[0] + ]); + const dep = new HarmonyExportExpressionDependency( + parser.state.module, + expr.range, + statement.range, + comments + .map(c => { + switch (c.type) { + case "Block": + return `/*${c.value}*/`; + case "Line": + return `//${c.value}\n`; + } + return ""; + }) + .join("") + ); + dep.loc = Object.create(statement.loc); + dep.loc.index = -1; + parser.state.current.addDependency(dep); + return true; + } + ); + parser.hooks.exportDeclaration.tap( + "HarmonyExportDependencyParserPlugin", + statement => {} + ); + parser.hooks.exportSpecifier.tap( + "HarmonyExportDependencyParserPlugin", + (statement, id, name, idx) => { + const rename = parser.scope.renames.get(id); + let dep; + const harmonyNamedExports = (parser.state.harmonyNamedExports = + parser.state.harmonyNamedExports || new Set()); + harmonyNamedExports.add(name); + if (rename === "imported var") { + const settings = parser.state.harmonySpecifier.get(id); + dep = new HarmonyExportImportedSpecifierDependency( + settings.source, + parser.state.module, + settings.sourceOrder, + parser.state.harmonyParserScope, + settings.id, + name, + harmonyNamedExports, + null, + this.strictExportPresence + ); + } else { + dep = new HarmonyExportSpecifierDependency( + parser.state.module, + id, + name + ); + } + dep.loc = Object.create(statement.loc); + dep.loc.index = idx; + parser.state.current.addDependency(dep); + return true; + } + ); + parser.hooks.exportImportSpecifier.tap( + "HarmonyExportDependencyParserPlugin", + (statement, source, id, name, idx) => { + const harmonyNamedExports = (parser.state.harmonyNamedExports = + parser.state.harmonyNamedExports || new Set()); + let harmonyStarExports = null; + if (name) { + harmonyNamedExports.add(name); + } else { + harmonyStarExports = parser.state.harmonyStarExports = + parser.state.harmonyStarExports || []; + } + const dep = new HarmonyExportImportedSpecifierDependency( + source, + parser.state.module, + parser.state.lastHarmonyImportOrder, + parser.state.harmonyParserScope, + id, + name, + harmonyNamedExports, + harmonyStarExports && harmonyStarExports.slice(), + this.strictExportPresence + ); + if (harmonyStarExports) { + harmonyStarExports.push(dep); + } + dep.loc = Object.create(statement.loc); + dep.loc.index = idx; + parser.state.current.addDependency(dep); + return true; + } + ); } -} -module.exports = ContextDependencyTemplateAsId; +}; /***/ }), -/***/ 54380: -/***/ (function(module) { +/***/ 84245: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -81256,102 +78172,64 @@ module.exports = ContextDependencyTemplateAsId; Author Tobias Koppers @sokra */ +const NullDependency = __webpack_require__(5088); -class ContextDependencyTemplateAsRequireCall { - apply(dep, source, runtime) { - const moduleExports = runtime.moduleExports({ - module: dep.module, - request: dep.request - }); - - if (dep.module) { - if (dep.valueRange) { - if (Array.isArray(dep.replaces)) { - for (let i = 0; i < dep.replaces.length; i++) { - const rep = dep.replaces[i]; - source.replace(rep.range[0], rep.range[1] - 1, rep.value); - } - } - source.replace(dep.valueRange[1], dep.range[1] - 1, ")"); - // TODO webpack 5 remove `prepend` it's no longer used - source.replace( - dep.range[0], - dep.valueRange[0] - 1, - `${moduleExports}(${ - typeof dep.prepend === "string" ? JSON.stringify(dep.prepend) : "" - }` - ); - } else { - source.replace(dep.range[0], dep.range[1] - 1, moduleExports); - } - } else { - source.replace(dep.range[0], dep.range[1] - 1, moduleExports); - } +class HarmonyExportExpressionDependency extends NullDependency { + constructor(originModule, range, rangeStatement, prefix) { + super(); + this.originModule = originModule; + this.range = range; + this.rangeStatement = rangeStatement; + this.prefix = prefix; } -} -module.exports = ContextDependencyTemplateAsRequireCall; - - -/***/ }), - -/***/ 89079: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -const ModuleDependency = __webpack_require__(90865); -class ContextElementDependency extends ModuleDependency { - constructor(request, userRequest) { - super(request); - if (userRequest) { - this.userRequest = userRequest; - } + get type() { + return "harmony export expression"; } - get type() { - return "context element"; + getExports() { + return { + exports: ["default"], + dependencies: undefined + }; } } -module.exports = ContextElementDependency; - - -/***/ }), - -/***/ 54983: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const WebpackError = __webpack_require__(97391); +HarmonyExportExpressionDependency.Template = class HarmonyExportDependencyTemplate { + apply(dep, source) { + const used = dep.originModule.isUsed("default"); + const content = this.getContent(dep.originModule, used); -class CriticalDependencyWarning extends WebpackError { - constructor(message) { - super(); + if (dep.range) { + source.replace( + dep.rangeStatement[0], + dep.range[0] - 1, + content + "(" + dep.prefix + ); + source.replace(dep.range[1], dep.rangeStatement[1] - 1, ");"); + return; + } - this.name = "CriticalDependencyWarning"; - this.message = "Critical dependency: " + message; + source.replace(dep.rangeStatement[0], dep.rangeStatement[1] - 1, content); + } - Error.captureStackTrace(this, this.constructor); + getContent(module, used) { + const exportsName = module.exportsArgument; + if (used) { + return `/* harmony default export */ ${exportsName}[${JSON.stringify( + used + )}] = `; + } + return "/* unused harmony default export */ var _unused_webpack_default_export = "; } -} +}; -module.exports = CriticalDependencyWarning; +module.exports = HarmonyExportExpressionDependency; /***/ }), -/***/ 53104: +/***/ 21320: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81360,39 +78238,36 @@ module.exports = CriticalDependencyWarning; Author Tobias Koppers @sokra */ - -const DependencyReference = __webpack_require__(71722); const NullDependency = __webpack_require__(5088); -class DelegatedExportsDependency extends NullDependency { - constructor(originModule, exports) { +class HarmonyExportHeaderDependency extends NullDependency { + constructor(range, rangeStatement) { super(); - this.originModule = originModule; - this.exports = exports; + this.range = range; + this.rangeStatement = rangeStatement; } get type() { - return "delegated exports"; - } - - getReference() { - return new DependencyReference(this.originModule, true, false); + return "harmony export header"; } +} - getExports() { - return { - exports: this.exports, - dependencies: undefined - }; +HarmonyExportHeaderDependency.Template = class HarmonyExportDependencyTemplate { + apply(dep, source) { + const content = ""; + const replaceUntil = dep.range + ? dep.range[0] - 1 + : dep.rangeStatement[1] - 1; + source.replace(dep.rangeStatement[0], replaceUntil, content); } -} +}; -module.exports = DelegatedExportsDependency; +module.exports = HarmonyExportHeaderDependency; /***/ }), -/***/ 25930: +/***/ 22864: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81401,354 +78276,665 @@ module.exports = DelegatedExportsDependency; Author Tobias Koppers @sokra */ -const ModuleDependency = __webpack_require__(90865); - -class DelegatedSourceDependency extends ModuleDependency { - constructor(request) { - super(request); - } - - get type() { - return "delegated source"; - } -} - -module.exports = DelegatedSourceDependency; - - -/***/ }), - -/***/ 71722: -/***/ (function(module) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Florent Cailhol @ooflorent -*/ +const DependencyReference = __webpack_require__(71722); +const HarmonyImportDependency = __webpack_require__(81599); +const Template = __webpack_require__(96066); +const HarmonyLinkingError = __webpack_require__(30327); /** @typedef {import("../Module")} Module */ -class DependencyReference { - // TODO webpack 5: module must be dynamic, you must pass a function returning a module - // This is needed to remove the hack in ConcatenatedModule - // The problem is that the `module` in Dependency could be replaced i. e. because of Scope Hoisting - /** - * - * @param {Module} module the referenced module - * @param {string[] | boolean} importedNames imported named from the module - * @param {boolean=} weak if this is a weak reference - * @param {number} order the order information or NaN if don't care - */ - constructor(module, importedNames, weak = false, order = NaN) { - // TODO webpack 5: make it a getter - this.module = module; - // true: full object - // false: only sideeffects/no export - // array of strings: the exports with this names - this.importedNames = importedNames; - this.weak = !!weak; - this.order = order; - } +/** @typedef {"missing"|"unused"|"empty-star"|"reexport-non-harmony-default"|"reexport-named-default"|"reexport-namespace-object"|"reexport-non-harmony-default-strict"|"reexport-fake-namespace-object"|"rexport-non-harmony-undefined"|"safe-reexport"|"checked-reexport"|"dynamic-reexport"} ExportModeType */ +/** @type {Map} */ +const EMPTY_MAP = new Map(); + +class ExportMode { /** - * @param {DependencyReference[]} array an array (will be modified) - * @returns {DependencyReference[]} the array again + * @param {ExportModeType} type type of the mode */ - static sort(array) { - /** @type {WeakMap} */ - const originalOrder = new WeakMap(); - let i = 0; - for (const ref of array) { - originalOrder.set(ref, i++); - } - return array.sort((a, b) => { - const aOrder = a.order; - const bOrder = b.order; - if (isNaN(aOrder)) { - if (!isNaN(bOrder)) { - return 1; - } - } else { - if (isNaN(bOrder)) { - return -1; - } - if (aOrder !== bOrder) { - return aOrder - bOrder; - } - } - const aOrg = originalOrder.get(a); - const bOrg = originalOrder.get(b); - return aOrg - bOrg; - }); + constructor(type) { + /** @type {ExportModeType} */ + this.type = type; + /** @type {string|null} */ + this.name = null; + /** @type {Map} */ + this.map = EMPTY_MAP; + /** @type {Set|null} */ + this.ignored = null; + /** @type {Module|null} */ + this.module = null; + /** @type {string|null} */ + this.userRequest = null; } } -module.exports = DependencyReference; - - -/***/ }), - -/***/ 66279: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -const Dependency = __webpack_require__(57282); +const EMPTY_STAR_MODE = new ExportMode("empty-star"); -class DllEntryDependency extends Dependency { - constructor(dependencies, name) { - super(); - this.dependencies = dependencies; +class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { + constructor( + request, + originModule, + sourceOrder, + parserScope, + id, + name, + activeExports, + otherStarExports, + strictExportPresence + ) { + super(request, originModule, sourceOrder, parserScope); + this.id = id; + this.redirectedId = undefined; this.name = name; + this.activeExports = activeExports; + this.otherStarExports = otherStarExports; + this.strictExportPresence = strictExportPresence; } get type() { - return "dll entry"; + return "harmony export imported specifier"; } -} -module.exports = DllEntryDependency; + get _id() { + return this.redirectedId || this.id; + } + getMode(ignoreUnused) { + const name = this.name; + const id = this._id; + const used = this.originModule.isUsed(name); + const importedModule = this._module; -/***/ }), + if (!importedModule) { + const mode = new ExportMode("missing"); + mode.userRequest = this.userRequest; + return mode; + } -/***/ 75159: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if ( + !ignoreUnused && + (name ? !used : this.originModule.usedExports === false) + ) { + const mode = new ExportMode("unused"); + mode.name = name || "*"; + return mode; + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + const strictHarmonyModule = this.originModule.buildMeta.strictHarmonyModule; + if (name && id === "default" && importedModule.buildMeta) { + if (!importedModule.buildMeta.exportsType) { + const mode = new ExportMode( + strictHarmonyModule + ? "reexport-non-harmony-default-strict" + : "reexport-non-harmony-default" + ); + mode.name = name; + mode.module = importedModule; + return mode; + } else if (importedModule.buildMeta.exportsType === "named") { + const mode = new ExportMode("reexport-named-default"); + mode.name = name; + mode.module = importedModule; + return mode; + } + } + const isNotAHarmonyModule = + importedModule.buildMeta && !importedModule.buildMeta.exportsType; + if (name) { + let mode; + if (id) { + // export { name as name } + if (isNotAHarmonyModule && strictHarmonyModule) { + mode = new ExportMode("rexport-non-harmony-undefined"); + mode.name = name; + } else { + mode = new ExportMode("safe-reexport"); + mode.map = new Map([[name, id]]); + } + } else { + // export { * as name } + if (isNotAHarmonyModule && strictHarmonyModule) { + mode = new ExportMode("reexport-fake-namespace-object"); + mode.name = name; + } else { + mode = new ExportMode("reexport-namespace-object"); + mode.name = name; + } + } + mode.module = importedModule; + return mode; + } -const NullDependency = __webpack_require__(5088); -const HarmonyImportDependency = __webpack_require__(81599); + const hasUsedExports = Array.isArray(this.originModule.usedExports); + const hasProvidedExports = Array.isArray( + importedModule.buildMeta.providedExports + ); + const activeFromOtherStarExports = this._discoverActiveExportsFromOtherStartExports(); -class HarmonyAcceptDependency extends NullDependency { - constructor(range, dependencies, hasCallback) { - super(); - this.range = range; - this.dependencies = dependencies; - this.hasCallback = hasCallback; - } + // export * + if (hasUsedExports) { + // reexport * with known used exports + if (hasProvidedExports) { + const map = new Map( + this.originModule.usedExports + .filter(id => { + if (id === "default") return false; + if (this.activeExports.has(id)) return false; + if (activeFromOtherStarExports.has(id)) return false; + if (!importedModule.buildMeta.providedExports.includes(id)) + return false; + return true; + }) + .map(item => [item, item]) + ); - get type() { - return "accepted harmony modules"; - } -} + if (map.size === 0) { + return EMPTY_STAR_MODE; + } -HarmonyAcceptDependency.Template = class HarmonyAcceptDependencyTemplate { - apply(dep, source, runtime) { - const content = dep.dependencies - .filter(dependency => - HarmonyImportDependency.Template.isImportEmitted(dependency, source) - ) - .map(dependency => dependency.getImportStatement(true, runtime)) - .join(""); + const mode = new ExportMode("safe-reexport"); + mode.module = importedModule; + mode.map = map; + return mode; + } - if (dep.hasCallback) { - source.insert( - dep.range[0], - `function(__WEBPACK_OUTDATED_DEPENDENCIES__) { ${content}(` - ); - source.insert( - dep.range[1], - ")(__WEBPACK_OUTDATED_DEPENDENCIES__); }.bind(this)" - ); - return; - } + const map = new Map( + this.originModule.usedExports + .filter(id => { + if (id === "default") return false; + if (this.activeExports.has(id)) return false; + if (activeFromOtherStarExports.has(id)) return false; - source.insert(dep.range[1] - 0.5, `, function() { ${content} }`); - } -}; + return true; + }) + .map(item => [item, item]) + ); -module.exports = HarmonyAcceptDependency; + if (map.size === 0) { + return EMPTY_STAR_MODE; + } + const mode = new ExportMode("checked-reexport"); + mode.module = importedModule; + mode.map = map; + return mode; + } -/***/ }), + if (hasProvidedExports) { + const map = new Map( + importedModule.buildMeta.providedExports + .filter(id => { + if (id === "default") return false; + if (this.activeExports.has(id)) return false; + if (activeFromOtherStarExports.has(id)) return false; -/***/ 66136: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + return true; + }) + .map(item => [item, item]) + ); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + if (map.size === 0) { + return EMPTY_STAR_MODE; + } -const HarmonyImportDependency = __webpack_require__(81599); + const mode = new ExportMode("safe-reexport"); + mode.module = importedModule; + mode.map = map; + return mode; + } -class HarmonyAcceptImportDependency extends HarmonyImportDependency { - constructor(request, originModule, parserScope) { - super(request, originModule, NaN, parserScope); - this.weak = true; + const mode = new ExportMode("dynamic-reexport"); + mode.module = importedModule; + mode.ignored = new Set([ + "default", + ...this.activeExports, + ...activeFromOtherStarExports + ]); + return mode; } - get type() { - return "harmony accept"; - } -} + getReference() { + const mode = this.getMode(false); -HarmonyAcceptImportDependency.Template = class HarmonyAcceptImportDependencyTemplate extends HarmonyImportDependency.Template { - apply(dep, source, runtime) {} -}; + switch (mode.type) { + case "missing": + case "unused": + case "empty-star": + return null; -module.exports = HarmonyAcceptImportDependency; + case "reexport-non-harmony-default": + case "reexport-named-default": + return new DependencyReference( + mode.module, + ["default"], + false, + this.sourceOrder + ); + case "reexport-namespace-object": + case "reexport-non-harmony-default-strict": + case "reexport-fake-namespace-object": + case "rexport-non-harmony-undefined": + return new DependencyReference( + mode.module, + true, + false, + this.sourceOrder + ); -/***/ }), + case "safe-reexport": + case "checked-reexport": + return new DependencyReference( + mode.module, + Array.from(mode.map.values()), + false, + this.sourceOrder + ); -/***/ 1533: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + case "dynamic-reexport": + return new DependencyReference( + mode.module, + true, + false, + this.sourceOrder + ); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + default: + throw new Error(`Unknown mode ${mode.type}`); + } + } -const NullDependency = __webpack_require__(5088); + _discoverActiveExportsFromOtherStartExports() { + if (!this.otherStarExports) return new Set(); + const result = new Set(); + // try to learn impossible exports from other star exports with provided exports + for (const otherStarExport of this.otherStarExports) { + const otherImportedModule = otherStarExport._module; + if ( + otherImportedModule && + Array.isArray(otherImportedModule.buildMeta.providedExports) + ) { + for (const exportName of otherImportedModule.buildMeta + .providedExports) { + result.add(exportName); + } + } + } + return result; + } -class HarmonyCompatibilityDependency extends NullDependency { - constructor(originModule) { - super(); - this.originModule = originModule; + getExports() { + if (this.name) { + return { + exports: [this.name], + dependencies: undefined + }; + } + + const importedModule = this._module; + + if (!importedModule) { + // no imported module available + return { + exports: null, + dependencies: undefined + }; + } + + if (Array.isArray(importedModule.buildMeta.providedExports)) { + const activeFromOtherStarExports = this._discoverActiveExportsFromOtherStartExports(); + return { + exports: importedModule.buildMeta.providedExports.filter( + id => + id !== "default" && + !activeFromOtherStarExports.has(id) && + !this.activeExports.has(id) + ), + dependencies: [importedModule] + }; + } + + if (importedModule.buildMeta.providedExports) { + return { + exports: true, + dependencies: undefined + }; + } + + return { + exports: null, + dependencies: [importedModule] + }; } - get type() { - return "harmony export header"; + getWarnings() { + if ( + this.strictExportPresence || + this.originModule.buildMeta.strictHarmonyModule + ) { + return []; + } + return this._getErrors(); + } + + getErrors() { + if ( + this.strictExportPresence || + this.originModule.buildMeta.strictHarmonyModule + ) { + return this._getErrors(); + } + return []; + } + + _getErrors() { + const importedModule = this._module; + if (!importedModule) { + return; + } + + if (!importedModule.buildMeta || !importedModule.buildMeta.exportsType) { + // It's not an harmony module + if ( + this.originModule.buildMeta.strictHarmonyModule && + this._id && + this._id !== "default" + ) { + // In strict harmony modules we only support the default export + return [ + new HarmonyLinkingError( + `Can't reexport the named export '${this._id}' from non EcmaScript module (only default export is available)` + ) + ]; + } + return; + } + + if (!this._id) { + return; + } + + if (importedModule.isProvided(this._id) !== false) { + // It's provided or we are not sure + return; + } + + // We are sure that it's not provided + const idIsNotNameMessage = + this._id !== this.name ? ` (reexported as '${this.name}')` : ""; + const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`; + return [new HarmonyLinkingError(errorMessage)]; + } + + updateHash(hash) { + super.updateHash(hash); + const hashValue = this.getHashValue(this._module); + hash.update(hashValue); + } + + getHashValue(importedModule) { + if (!importedModule) { + return ""; + } + + const stringifiedUsedExport = JSON.stringify(importedModule.usedExports); + const stringifiedProvidedExport = JSON.stringify( + importedModule.buildMeta.providedExports + ); + return ( + importedModule.used + stringifiedUsedExport + stringifiedProvidedExport + ); + } + + disconnect() { + super.disconnect(); + this.redirectedId = undefined; } } -HarmonyCompatibilityDependency.Template = class HarmonyExportDependencyTemplate { - apply(dep, source, runtime) { - const usedExports = dep.originModule.usedExports; - if (usedExports !== false && !Array.isArray(usedExports)) { - const content = runtime.defineEsModuleFlagStatement({ - exportsArgument: dep.originModule.exportsArgument - }); - source.insert(-10, content); +module.exports = HarmonyExportImportedSpecifierDependency; + +HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedSpecifierDependencyTemplate extends HarmonyImportDependency.Template { + harmonyInit(dep, source, runtime, dependencyTemplates) { + super.harmonyInit(dep, source, runtime, dependencyTemplates); + const content = this.getContent(dep); + source.insert(-1, content); + } + + getHarmonyInitOrder(dep) { + if (dep.name) { + const used = dep.originModule.isUsed(dep.name); + if (!used) return NaN; + } else { + const importedModule = dep._module; + + const activeFromOtherStarExports = dep._discoverActiveExportsFromOtherStartExports(); + + if (Array.isArray(dep.originModule.usedExports)) { + // we know which exports are used + + const unused = dep.originModule.usedExports.every(id => { + if (id === "default") return true; + if (dep.activeExports.has(id)) return true; + if (importedModule.isProvided(id) === false) return true; + if (activeFromOtherStarExports.has(id)) return true; + return false; + }); + if (unused) return NaN; + } else if ( + dep.originModule.usedExports && + importedModule && + Array.isArray(importedModule.buildMeta.providedExports) + ) { + // not sure which exports are used, but we know which are provided + + const unused = importedModule.buildMeta.providedExports.every(id => { + if (id === "default") return true; + if (dep.activeExports.has(id)) return true; + if (activeFromOtherStarExports.has(id)) return true; + return false; + }); + if (unused) return NaN; + } } + return super.getHarmonyInitOrder(dep); } -}; -module.exports = HarmonyCompatibilityDependency; + getContent(dep) { + const mode = dep.getMode(false); + const module = dep.originModule; + const importedModule = dep._module; + const importVar = dep.getImportVar(); + switch (mode.type) { + case "missing": + return `throw new Error(${JSON.stringify( + `Cannot find module '${mode.userRequest}'` + )});\n`; -/***/ }), + case "unused": + return `${Template.toNormalComment( + `unused harmony reexport ${mode.name}` + )}\n`; -/***/ 59310: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + case "reexport-non-harmony-default": + return ( + "/* harmony reexport (default from non-harmony) */ " + + this.getReexportStatement( + module, + module.isUsed(mode.name), + importVar, + null + ) + ); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + case "reexport-named-default": + return ( + "/* harmony reexport (default from named exports) */ " + + this.getReexportStatement( + module, + module.isUsed(mode.name), + importVar, + "" + ) + ); + case "reexport-fake-namespace-object": + return ( + "/* harmony reexport (fake namespace object from non-harmony) */ " + + this.getReexportFakeNamespaceObjectStatement( + module, + module.isUsed(mode.name), + importVar + ) + ); -const HarmonyCompatibilityDependency = __webpack_require__(1533); -const HarmonyInitDependency = __webpack_require__(27204); + case "rexport-non-harmony-undefined": + return ( + "/* harmony reexport (non default export from non-harmony) */ " + + this.getReexportStatement( + module, + module.isUsed(mode.name), + "undefined", + "" + ) + ); -module.exports = class HarmonyDetectionParserPlugin { - apply(parser) { - parser.hooks.program.tap("HarmonyDetectionParserPlugin", ast => { - const isStrictHarmony = parser.state.module.type === "javascript/esm"; - const isHarmony = - isStrictHarmony || - ast.body.some( - statement => - statement.type === "ImportDeclaration" || - statement.type === "ExportDefaultDeclaration" || - statement.type === "ExportNamedDeclaration" || - statement.type === "ExportAllDeclaration" + case "reexport-non-harmony-default-strict": + return ( + "/* harmony reexport (default from non-harmony) */ " + + this.getReexportStatement( + module, + module.isUsed(mode.name), + importVar, + "" + ) ); - if (isHarmony) { - const module = parser.state.module; - const compatDep = new HarmonyCompatibilityDependency(module); - compatDep.loc = { - start: { - line: -1, - column: 0 - }, - end: { - line: -1, - column: 0 - }, - index: -3 - }; - module.addDependency(compatDep); - const initDep = new HarmonyInitDependency(module); - initDep.loc = { - start: { - line: -1, - column: 0 - }, - end: { - line: -1, - column: 0 - }, - index: -2 - }; - module.addDependency(initDep); - parser.state.harmonyParserScope = parser.state.harmonyParserScope || {}; - parser.scope.isStrict = true; - module.buildMeta.exportsType = "namespace"; - module.buildInfo.strict = true; - module.buildInfo.exportsArgument = "__webpack_exports__"; - if (isStrictHarmony) { - module.buildMeta.strictHarmonyModule = true; - module.buildInfo.moduleArgument = "__webpack_module__"; + + case "reexport-namespace-object": + return ( + "/* harmony reexport (module object) */ " + + this.getReexportStatement( + module, + module.isUsed(mode.name), + importVar, + "" + ) + ); + + case "empty-star": + return "/* empty/unused harmony star reexport */"; + + case "safe-reexport": + return Array.from(mode.map.entries()) + .map(item => { + return ( + "/* harmony reexport (safe) */ " + + this.getReexportStatement( + module, + module.isUsed(item[0]), + importVar, + importedModule.isUsed(item[1]) + ) + + "\n" + ); + }) + .join(""); + + case "checked-reexport": + return Array.from(mode.map.entries()) + .map(item => { + return ( + "/* harmony reexport (checked) */ " + + this.getConditionalReexportStatement( + module, + item[0], + importVar, + item[1] + ) + + "\n" + ); + }) + .join(""); + + case "dynamic-reexport": { + const ignoredExports = mode.ignored; + let content = + "/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in " + + importVar + + ") "; + + // Filter out exports which are defined by other exports + // and filter out default export because it cannot be reexported with * + if (ignoredExports.size > 0) { + content += + "if(" + + JSON.stringify(Array.from(ignoredExports)) + + ".indexOf(__WEBPACK_IMPORT_KEY__) < 0) "; + } else { + content += "if(__WEBPACK_IMPORT_KEY__ !== 'default') "; } + const exportsName = dep.originModule.exportsArgument; + return ( + content + + `(function(key) { __webpack_require__.d(${exportsName}, key, function() { return ${importVar}[key]; }) }(__WEBPACK_IMPORT_KEY__));\n` + ); } - }); - const skipInHarmony = () => { - const module = parser.state.module; - if (module && module.buildMeta && module.buildMeta.exportsType) { - return true; - } - }; + default: + throw new Error(`Unknown mode ${mode.type}`); + } + } - const nullInHarmony = () => { - const module = parser.state.module; - if (module && module.buildMeta && module.buildMeta.exportsType) { - return null; - } - }; + getReexportStatement(module, key, name, valueKey) { + const exportsName = module.exportsArgument; + const returnValue = this.getReturnValue(name, valueKey); + return `__webpack_require__.d(${exportsName}, ${JSON.stringify( + key + )}, function() { return ${returnValue}; });\n`; + } - const nonHarmonyIdentifiers = ["define", "exports"]; - for (const identifer of nonHarmonyIdentifiers) { - parser.hooks.evaluateTypeof - .for(identifer) - .tap("HarmonyDetectionParserPlugin", nullInHarmony); - parser.hooks.typeof - .for(identifer) - .tap("HarmonyDetectionParserPlugin", skipInHarmony); - parser.hooks.evaluate - .for(identifer) - .tap("HarmonyDetectionParserPlugin", nullInHarmony); - parser.hooks.expression - .for(identifer) - .tap("HarmonyDetectionParserPlugin", skipInHarmony); - parser.hooks.call - .for(identifer) - .tap("HarmonyDetectionParserPlugin", skipInHarmony); + getReexportFakeNamespaceObjectStatement(module, key, name) { + const exportsName = module.exportsArgument; + return `__webpack_require__.d(${exportsName}, ${JSON.stringify( + key + )}, function() { return __webpack_require__.t(${name}); });\n`; + } + + getConditionalReexportStatement(module, key, name, valueKey) { + if (valueKey === false) { + return "/* unused export */\n"; + } + const exportsName = module.exportsArgument; + const returnValue = this.getReturnValue(name, valueKey); + return `if(__webpack_require__.o(${name}, ${JSON.stringify( + valueKey + )})) __webpack_require__.d(${exportsName}, ${JSON.stringify( + key + )}, function() { return ${returnValue}; });\n`; + } + + getReturnValue(name, valueKey) { + if (valueKey === null) { + return `${name}_default.a`; } + if (valueKey === "") { + return name; + } + if (valueKey === false) { + return "/* unused export */ undefined"; + } + + return `${name}[${JSON.stringify(valueKey)}]`; } }; /***/ }), -/***/ 49180: +/***/ 34834: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81757,160 +78943,60 @@ module.exports = class HarmonyDetectionParserPlugin { Author Tobias Koppers @sokra */ +const NullDependency = __webpack_require__(5088); -const HarmonyExportExpressionDependency = __webpack_require__(84245); -const HarmonyImportSideEffectDependency = __webpack_require__(79171); -const HarmonyExportHeaderDependency = __webpack_require__(21320); -const HarmonyExportSpecifierDependency = __webpack_require__(34834); -const HarmonyExportImportedSpecifierDependency = __webpack_require__(22864); -const ConstDependency = __webpack_require__(71101); +class HarmonyExportSpecifierDependency extends NullDependency { + constructor(originModule, id, name) { + super(); + this.originModule = originModule; + this.id = id; + this.name = name; + } -module.exports = class HarmonyExportDependencyParserPlugin { - constructor(moduleOptions) { - this.strictExportPresence = moduleOptions.strictExportPresence; + get type() { + return "harmony export specifier"; } - apply(parser) { - parser.hooks.export.tap( - "HarmonyExportDependencyParserPlugin", - statement => { - const dep = new HarmonyExportHeaderDependency( - statement.declaration && statement.declaration.range, - statement.range - ); - dep.loc = Object.create(statement.loc); - dep.loc.index = -1; - parser.state.current.addDependency(dep); - return true; - } - ); - parser.hooks.exportImport.tap( - "HarmonyExportDependencyParserPlugin", - (statement, source) => { - parser.state.lastHarmonyImportOrder = - (parser.state.lastHarmonyImportOrder || 0) + 1; - const clearDep = new ConstDependency("", statement.range); - clearDep.loc = Object.create(statement.loc); - clearDep.loc.index = -1; - parser.state.current.addDependency(clearDep); - const sideEffectDep = new HarmonyImportSideEffectDependency( - source, - parser.state.module, - parser.state.lastHarmonyImportOrder, - parser.state.harmonyParserScope - ); - sideEffectDep.loc = Object.create(statement.loc); - sideEffectDep.loc.index = -1; - parser.state.current.addDependency(sideEffectDep); - return true; - } - ); - parser.hooks.exportExpression.tap( - "HarmonyExportDependencyParserPlugin", - (statement, expr) => { - const comments = parser.getComments([ - statement.range[0], - expr.range[0] - ]); - const dep = new HarmonyExportExpressionDependency( - parser.state.module, - expr.range, - statement.range, - comments - .map(c => { - switch (c.type) { - case "Block": - return `/*${c.value}*/`; - case "Line": - return `//${c.value}\n`; - } - return ""; - }) - .join("") - ); - dep.loc = Object.create(statement.loc); - dep.loc.index = -1; - parser.state.current.addDependency(dep); - return true; - } - ); - parser.hooks.exportDeclaration.tap( - "HarmonyExportDependencyParserPlugin", - statement => {} - ); - parser.hooks.exportSpecifier.tap( - "HarmonyExportDependencyParserPlugin", - (statement, id, name, idx) => { - const rename = parser.scope.renames.get(id); - let dep; - const harmonyNamedExports = (parser.state.harmonyNamedExports = - parser.state.harmonyNamedExports || new Set()); - harmonyNamedExports.add(name); - if (rename === "imported var") { - const settings = parser.state.harmonySpecifier.get(id); - dep = new HarmonyExportImportedSpecifierDependency( - settings.source, - parser.state.module, - settings.sourceOrder, - parser.state.harmonyParserScope, - settings.id, - name, - harmonyNamedExports, - null, - this.strictExportPresence - ); - } else { - dep = new HarmonyExportSpecifierDependency( - parser.state.module, - id, - name - ); - } - dep.loc = Object.create(statement.loc); - dep.loc.index = idx; - parser.state.current.addDependency(dep); - return true; - } - ); - parser.hooks.exportImportSpecifier.tap( - "HarmonyExportDependencyParserPlugin", - (statement, source, id, name, idx) => { - const harmonyNamedExports = (parser.state.harmonyNamedExports = - parser.state.harmonyNamedExports || new Set()); - let harmonyStarExports = null; - if (name) { - harmonyNamedExports.add(name); - } else { - harmonyStarExports = parser.state.harmonyStarExports = - parser.state.harmonyStarExports || []; - } - const dep = new HarmonyExportImportedSpecifierDependency( - source, - parser.state.module, - parser.state.lastHarmonyImportOrder, - parser.state.harmonyParserScope, - id, - name, - harmonyNamedExports, - harmonyStarExports && harmonyStarExports.slice(), - this.strictExportPresence - ); - if (harmonyStarExports) { - harmonyStarExports.push(dep); - } - dep.loc = Object.create(statement.loc); - dep.loc.index = idx; - parser.state.current.addDependency(dep); - return true; - } - ); + getExports() { + return { + exports: [this.name], + dependencies: undefined + }; + } +} + +HarmonyExportSpecifierDependency.Template = class HarmonyExportSpecifierDependencyTemplate { + apply(dep, source) {} + + getHarmonyInitOrder(dep) { + return 0; + } + + harmonyInit(dep, source, runtime) { + const content = this.getContent(dep); + source.insert(-1, content); + } + + getContent(dep) { + const used = dep.originModule.isUsed(dep.name); + if (!used) { + return `/* unused harmony export ${dep.name || "namespace"} */\n`; + } + + const exportsName = dep.originModule.exportsArgument; + + return `/* harmony export (binding) */ __webpack_require__.d(${exportsName}, ${JSON.stringify( + used + )}, function() { return ${dep.id}; });\n`; } }; +module.exports = HarmonyExportSpecifierDependency; + /***/ }), -/***/ 84245: +/***/ 81599: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81919,64 +79005,115 @@ module.exports = class HarmonyExportDependencyParserPlugin { Author Tobias Koppers @sokra */ -const NullDependency = __webpack_require__(5088); -class HarmonyExportExpressionDependency extends NullDependency { - constructor(originModule, range, rangeStatement, prefix) { - super(); +const DependencyReference = __webpack_require__(71722); +const ModuleDependency = __webpack_require__(90865); +const Template = __webpack_require__(96066); + +class HarmonyImportDependency extends ModuleDependency { + constructor(request, originModule, sourceOrder, parserScope) { + super(request); + this.redirectedModule = undefined; this.originModule = originModule; - this.range = range; - this.rangeStatement = rangeStatement; - this.prefix = prefix; + this.sourceOrder = sourceOrder; + this.parserScope = parserScope; } - get type() { - return "harmony export expression"; + get _module() { + return this.redirectedModule || this.module; } - getExports() { - return { - exports: ["default"], - dependencies: undefined - }; + getReference() { + if (!this._module) return null; + return new DependencyReference( + this._module, + false, + this.weak, + this.sourceOrder + ); + } + + getImportVar() { + let importVarMap = this.parserScope.importVarMap; + if (!importVarMap) this.parserScope.importVarMap = importVarMap = new Map(); + let importVar = importVarMap.get(this._module); + if (importVar) return importVar; + importVar = `${Template.toIdentifier( + `${this.userRequest}` + )}__WEBPACK_IMPORTED_MODULE_${importVarMap.size}__`; + importVarMap.set(this._module, importVar); + return importVar; + } + + getImportStatement(update, runtime) { + return runtime.importStatement({ + update, + module: this._module, + importVar: this.getImportVar(), + request: this.request, + originModule: this.originModule + }); + } + + updateHash(hash) { + super.updateHash(hash); + const importedModule = this._module; + hash.update( + (importedModule && + (!importedModule.buildMeta || importedModule.buildMeta.exportsType)) + + "" + ); + hash.update((importedModule && importedModule.id) + ""); + } + + disconnect() { + super.disconnect(); + this.redirectedModule = undefined; } } -HarmonyExportExpressionDependency.Template = class HarmonyExportDependencyTemplate { - apply(dep, source) { - const used = dep.originModule.isUsed("default"); - const content = this.getContent(dep.originModule, used); +module.exports = HarmonyImportDependency; - if (dep.range) { - source.replace( - dep.rangeStatement[0], - dep.range[0] - 1, - content + "(" + dep.prefix - ); - source.replace(dep.range[1], dep.rangeStatement[1] - 1, ");"); - return; - } +const importEmittedMap = new WeakMap(); - source.replace(dep.rangeStatement[0], dep.rangeStatement[1] - 1, content); +HarmonyImportDependency.Template = class HarmonyImportDependencyTemplate { + apply(dep, source, runtime) { + // no-op } - getContent(module, used) { - const exportsName = module.exportsArgument; - if (used) { - return `/* harmony default export */ ${exportsName}[${JSON.stringify( - used - )}] = `; + getHarmonyInitOrder(dep) { + return dep.sourceOrder; + } + + static isImportEmitted(dep, source) { + let sourceInfo = importEmittedMap.get(source); + if (!sourceInfo) return false; + const key = dep._module || dep.request; + return key && sourceInfo.emittedImports.get(key); + } + + harmonyInit(dep, source, runtime, dependencyTemplates) { + let sourceInfo = importEmittedMap.get(source); + if (!sourceInfo) { + importEmittedMap.set( + source, + (sourceInfo = { + emittedImports: new Map() + }) + ); } - return "/* unused harmony default export */ var _unused_webpack_default_export = "; + const key = dep._module || dep.request; + if (key && sourceInfo.emittedImports.get(key)) return; + sourceInfo.emittedImports.set(key, true); + const content = dep.getImportStatement(false, runtime); + source.insert(-1, content); } }; -module.exports = HarmonyExportExpressionDependency; - /***/ }), -/***/ 21320: +/***/ 99433: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81985,36 +79122,228 @@ module.exports = HarmonyExportExpressionDependency; Author Tobias Koppers @sokra */ -const NullDependency = __webpack_require__(5088); -class HarmonyExportHeaderDependency extends NullDependency { - constructor(range, rangeStatement) { - super(); - this.range = range; - this.rangeStatement = rangeStatement; - } +const { SyncBailHook } = __webpack_require__(92402); +const HarmonyImportSideEffectDependency = __webpack_require__(79171); +const HarmonyImportSpecifierDependency = __webpack_require__(95966); +const HarmonyAcceptImportDependency = __webpack_require__(66136); +const HarmonyAcceptDependency = __webpack_require__(75159); +const ConstDependency = __webpack_require__(71101); - get type() { - return "harmony export header"; +module.exports = class HarmonyImportDependencyParserPlugin { + constructor(moduleOptions) { + this.strictExportPresence = moduleOptions.strictExportPresence; + this.strictThisContextOnImports = moduleOptions.strictThisContextOnImports; } -} -HarmonyExportHeaderDependency.Template = class HarmonyExportDependencyTemplate { - apply(dep, source) { - const content = ""; - const replaceUntil = dep.range - ? dep.range[0] - 1 - : dep.rangeStatement[1] - 1; - source.replace(dep.rangeStatement[0], replaceUntil, content); + apply(parser) { + parser.hooks.import.tap( + "HarmonyImportDependencyParserPlugin", + (statement, source) => { + parser.state.lastHarmonyImportOrder = + (parser.state.lastHarmonyImportOrder || 0) + 1; + const clearDep = new ConstDependency("", statement.range); + clearDep.loc = statement.loc; + parser.state.module.addDependency(clearDep); + const sideEffectDep = new HarmonyImportSideEffectDependency( + source, + parser.state.module, + parser.state.lastHarmonyImportOrder, + parser.state.harmonyParserScope + ); + sideEffectDep.loc = statement.loc; + parser.state.module.addDependency(sideEffectDep); + return true; + } + ); + parser.hooks.importSpecifier.tap( + "HarmonyImportDependencyParserPlugin", + (statement, source, id, name) => { + parser.scope.definitions.delete(name); + parser.scope.renames.set(name, "imported var"); + if (!parser.state.harmonySpecifier) { + parser.state.harmonySpecifier = new Map(); + } + parser.state.harmonySpecifier.set(name, { + source, + id, + sourceOrder: parser.state.lastHarmonyImportOrder + }); + return true; + } + ); + parser.hooks.expression + .for("imported var") + .tap("HarmonyImportDependencyParserPlugin", expr => { + const name = expr.name; + const settings = parser.state.harmonySpecifier.get(name); + const dep = new HarmonyImportSpecifierDependency( + settings.source, + parser.state.module, + settings.sourceOrder, + parser.state.harmonyParserScope, + settings.id, + name, + expr.range, + this.strictExportPresence + ); + dep.shorthand = parser.scope.inShorthand; + dep.directImport = true; + dep.loc = expr.loc; + parser.state.module.addDependency(dep); + return true; + }); + parser.hooks.expressionAnyMember + .for("imported var") + .tap("HarmonyImportDependencyParserPlugin", expr => { + const name = expr.object.name; + const settings = parser.state.harmonySpecifier.get(name); + if (settings.id !== null) return false; + const dep = new HarmonyImportSpecifierDependency( + settings.source, + parser.state.module, + settings.sourceOrder, + parser.state.harmonyParserScope, + expr.property.name || expr.property.value, + name, + expr.range, + this.strictExportPresence + ); + dep.shorthand = parser.scope.inShorthand; + dep.directImport = false; + dep.loc = expr.loc; + parser.state.module.addDependency(dep); + return true; + }); + if (this.strictThisContextOnImports) { + // only in case when we strictly follow the spec we need a special case here + parser.hooks.callAnyMember + .for("imported var") + .tap("HarmonyImportDependencyParserPlugin", expr => { + if (expr.callee.type !== "MemberExpression") return; + if (expr.callee.object.type !== "Identifier") return; + const name = expr.callee.object.name; + const settings = parser.state.harmonySpecifier.get(name); + if (settings.id !== null) return false; + const dep = new HarmonyImportSpecifierDependency( + settings.source, + parser.state.module, + settings.sourceOrder, + parser.state.harmonyParserScope, + expr.callee.property.name || expr.callee.property.value, + name, + expr.callee.range, + this.strictExportPresence + ); + dep.shorthand = parser.scope.inShorthand; + dep.directImport = false; + dep.namespaceObjectAsContext = true; + dep.loc = expr.callee.loc; + parser.state.module.addDependency(dep); + if (expr.arguments) parser.walkExpressions(expr.arguments); + return true; + }); + } + parser.hooks.call + .for("imported var") + .tap("HarmonyImportDependencyParserPlugin", expr => { + const args = expr.arguments; + const fullExpr = expr; + expr = expr.callee; + if (expr.type !== "Identifier") return; + const name = expr.name; + const settings = parser.state.harmonySpecifier.get(name); + const dep = new HarmonyImportSpecifierDependency( + settings.source, + parser.state.module, + settings.sourceOrder, + parser.state.harmonyParserScope, + settings.id, + name, + expr.range, + this.strictExportPresence + ); + dep.directImport = true; + dep.callArgs = args; + dep.call = fullExpr; + dep.loc = expr.loc; + parser.state.module.addDependency(dep); + if (args) parser.walkExpressions(args); + return true; + }); + // TODO webpack 5: refactor this, no custom hooks + if (!parser.hooks.hotAcceptCallback) { + parser.hooks.hotAcceptCallback = new SyncBailHook([ + "expression", + "requests" + ]); + } + if (!parser.hooks.hotAcceptWithoutCallback) { + parser.hooks.hotAcceptWithoutCallback = new SyncBailHook([ + "expression", + "requests" + ]); + } + parser.hooks.hotAcceptCallback.tap( + "HarmonyImportDependencyParserPlugin", + (expr, requests) => { + const harmonyParserScope = parser.state.harmonyParserScope; + if (!harmonyParserScope) { + // This is not a harmony module, skip it + return; + } + const dependencies = requests.map(request => { + const dep = new HarmonyAcceptImportDependency( + request, + parser.state.module, + harmonyParserScope + ); + dep.loc = expr.loc; + parser.state.module.addDependency(dep); + return dep; + }); + if (dependencies.length > 0) { + const dep = new HarmonyAcceptDependency( + expr.range, + dependencies, + true + ); + dep.loc = expr.loc; + parser.state.module.addDependency(dep); + } + } + ); + parser.hooks.hotAcceptWithoutCallback.tap( + "HarmonyImportDependencyParserPlugin", + (expr, requests) => { + const dependencies = requests.map(request => { + const dep = new HarmonyAcceptImportDependency( + request, + parser.state.module, + parser.state.harmonyParserScope + ); + dep.loc = expr.loc; + parser.state.module.addDependency(dep); + return dep; + }); + if (dependencies.length > 0) { + const dep = new HarmonyAcceptDependency( + expr.range, + dependencies, + false + ); + dep.loc = expr.loc; + parser.state.module.addDependency(dep); + } + } + ); } }; -module.exports = HarmonyExportHeaderDependency; - /***/ }), -/***/ 22864: +/***/ 79171: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82023,42 +79352,51 @@ module.exports = HarmonyExportHeaderDependency; Author Tobias Koppers @sokra */ - -const DependencyReference = __webpack_require__(71722); const HarmonyImportDependency = __webpack_require__(81599); -const Template = __webpack_require__(96066); -const HarmonyLinkingError = __webpack_require__(30327); - -/** @typedef {import("../Module")} Module */ -/** @typedef {"missing"|"unused"|"empty-star"|"reexport-non-harmony-default"|"reexport-named-default"|"reexport-namespace-object"|"reexport-non-harmony-default-strict"|"reexport-fake-namespace-object"|"rexport-non-harmony-undefined"|"safe-reexport"|"checked-reexport"|"dynamic-reexport"} ExportModeType */ +class HarmonyImportSideEffectDependency extends HarmonyImportDependency { + constructor(request, originModule, sourceOrder, parserScope) { + super(request, originModule, sourceOrder, parserScope); + } -/** @type {Map} */ -const EMPTY_MAP = new Map(); + getReference() { + if (this._module && this._module.factoryMeta.sideEffectFree) return null; -class ExportMode { - /** - * @param {ExportModeType} type type of the mode - */ - constructor(type) { - /** @type {ExportModeType} */ - this.type = type; - /** @type {string|null} */ - this.name = null; - /** @type {Map} */ - this.map = EMPTY_MAP; - /** @type {Set|null} */ - this.ignored = null; - /** @type {Module|null} */ - this.module = null; - /** @type {string|null} */ - this.userRequest = null; + return super.getReference(); + } + + get type() { + return "harmony side effect evaluation"; } } -const EMPTY_STAR_MODE = new ExportMode("empty-star"); +HarmonyImportSideEffectDependency.Template = class HarmonyImportSideEffectDependencyTemplate extends HarmonyImportDependency.Template { + getHarmonyInitOrder(dep) { + if (dep._module && dep._module.factoryMeta.sideEffectFree) return NaN; + return super.getHarmonyInitOrder(dep); + } +}; -class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { +module.exports = HarmonyImportSideEffectDependency; + + +/***/ }), + +/***/ 95966: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const DependencyReference = __webpack_require__(71722); +const HarmonyImportDependency = __webpack_require__(81599); +const HarmonyLinkingError = __webpack_require__(30327); + +class HarmonyImportSpecifierDependency extends HarmonyImportDependency { constructor( request, originModule, @@ -82066,294 +79404,38 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { parserScope, id, name, - activeExports, - otherStarExports, + range, strictExportPresence ) { super(request, originModule, sourceOrder, parserScope); - this.id = id; + this.id = id === null ? null : `${id}`; this.redirectedId = undefined; this.name = name; - this.activeExports = activeExports; - this.otherStarExports = otherStarExports; + this.range = range; this.strictExportPresence = strictExportPresence; + this.namespaceObjectAsContext = false; + this.callArgs = undefined; + this.call = undefined; + this.directImport = undefined; + this.shorthand = undefined; } get type() { - return "harmony export imported specifier"; + return "harmony import specifier"; } get _id() { return this.redirectedId || this.id; } - getMode(ignoreUnused) { - const name = this.name; - const id = this._id; - const used = this.originModule.isUsed(name); - const importedModule = this._module; - - if (!importedModule) { - const mode = new ExportMode("missing"); - mode.userRequest = this.userRequest; - return mode; - } - - if ( - !ignoreUnused && - (name ? !used : this.originModule.usedExports === false) - ) { - const mode = new ExportMode("unused"); - mode.name = name || "*"; - return mode; - } - - const strictHarmonyModule = this.originModule.buildMeta.strictHarmonyModule; - if (name && id === "default" && importedModule.buildMeta) { - if (!importedModule.buildMeta.exportsType) { - const mode = new ExportMode( - strictHarmonyModule - ? "reexport-non-harmony-default-strict" - : "reexport-non-harmony-default" - ); - mode.name = name; - mode.module = importedModule; - return mode; - } else if (importedModule.buildMeta.exportsType === "named") { - const mode = new ExportMode("reexport-named-default"); - mode.name = name; - mode.module = importedModule; - return mode; - } - } - - const isNotAHarmonyModule = - importedModule.buildMeta && !importedModule.buildMeta.exportsType; - if (name) { - let mode; - if (id) { - // export { name as name } - if (isNotAHarmonyModule && strictHarmonyModule) { - mode = new ExportMode("rexport-non-harmony-undefined"); - mode.name = name; - } else { - mode = new ExportMode("safe-reexport"); - mode.map = new Map([[name, id]]); - } - } else { - // export { * as name } - if (isNotAHarmonyModule && strictHarmonyModule) { - mode = new ExportMode("reexport-fake-namespace-object"); - mode.name = name; - } else { - mode = new ExportMode("reexport-namespace-object"); - mode.name = name; - } - } - mode.module = importedModule; - return mode; - } - - const hasUsedExports = Array.isArray(this.originModule.usedExports); - const hasProvidedExports = Array.isArray( - importedModule.buildMeta.providedExports - ); - const activeFromOtherStarExports = this._discoverActiveExportsFromOtherStartExports(); - - // export * - if (hasUsedExports) { - // reexport * with known used exports - if (hasProvidedExports) { - const map = new Map( - this.originModule.usedExports - .filter(id => { - if (id === "default") return false; - if (this.activeExports.has(id)) return false; - if (activeFromOtherStarExports.has(id)) return false; - if (!importedModule.buildMeta.providedExports.includes(id)) - return false; - return true; - }) - .map(item => [item, item]) - ); - - if (map.size === 0) { - return EMPTY_STAR_MODE; - } - - const mode = new ExportMode("safe-reexport"); - mode.module = importedModule; - mode.map = map; - return mode; - } - - const map = new Map( - this.originModule.usedExports - .filter(id => { - if (id === "default") return false; - if (this.activeExports.has(id)) return false; - if (activeFromOtherStarExports.has(id)) return false; - - return true; - }) - .map(item => [item, item]) - ); - - if (map.size === 0) { - return EMPTY_STAR_MODE; - } - - const mode = new ExportMode("checked-reexport"); - mode.module = importedModule; - mode.map = map; - return mode; - } - - if (hasProvidedExports) { - const map = new Map( - importedModule.buildMeta.providedExports - .filter(id => { - if (id === "default") return false; - if (this.activeExports.has(id)) return false; - if (activeFromOtherStarExports.has(id)) return false; - - return true; - }) - .map(item => [item, item]) - ); - - if (map.size === 0) { - return EMPTY_STAR_MODE; - } - - const mode = new ExportMode("safe-reexport"); - mode.module = importedModule; - mode.map = map; - return mode; - } - - const mode = new ExportMode("dynamic-reexport"); - mode.module = importedModule; - mode.ignored = new Set([ - "default", - ...this.activeExports, - ...activeFromOtherStarExports - ]); - return mode; - } - getReference() { - const mode = this.getMode(false); - - switch (mode.type) { - case "missing": - case "unused": - case "empty-star": - return null; - - case "reexport-non-harmony-default": - case "reexport-named-default": - return new DependencyReference( - mode.module, - ["default"], - false, - this.sourceOrder - ); - - case "reexport-namespace-object": - case "reexport-non-harmony-default-strict": - case "reexport-fake-namespace-object": - case "rexport-non-harmony-undefined": - return new DependencyReference( - mode.module, - true, - false, - this.sourceOrder - ); - - case "safe-reexport": - case "checked-reexport": - return new DependencyReference( - mode.module, - Array.from(mode.map.values()), - false, - this.sourceOrder - ); - - case "dynamic-reexport": - return new DependencyReference( - mode.module, - true, - false, - this.sourceOrder - ); - - default: - throw new Error(`Unknown mode ${mode.type}`); - } - } - - _discoverActiveExportsFromOtherStartExports() { - if (!this.otherStarExports) return new Set(); - const result = new Set(); - // try to learn impossible exports from other star exports with provided exports - for (const otherStarExport of this.otherStarExports) { - const otherImportedModule = otherStarExport._module; - if ( - otherImportedModule && - Array.isArray(otherImportedModule.buildMeta.providedExports) - ) { - for (const exportName of otherImportedModule.buildMeta - .providedExports) { - result.add(exportName); - } - } - } - return result; - } - - getExports() { - if (this.name) { - return { - exports: [this.name], - dependencies: undefined - }; - } - - const importedModule = this._module; - - if (!importedModule) { - // no imported module available - return { - exports: null, - dependencies: undefined - }; - } - - if (Array.isArray(importedModule.buildMeta.providedExports)) { - const activeFromOtherStarExports = this._discoverActiveExportsFromOtherStartExports(); - return { - exports: importedModule.buildMeta.providedExports.filter( - id => - id !== "default" && - !activeFromOtherStarExports.has(id) && - !this.activeExports.has(id) - ), - dependencies: [importedModule] - }; - } - - if (importedModule.buildMeta.providedExports) { - return { - exports: true, - dependencies: undefined - }; - } - - return { - exports: null, - dependencies: [importedModule] - }; + if (!this._module) return null; + return new DependencyReference( + this._module, + this._id && !this.namespaceObjectAsContext ? [this._id] : true, + false, + this.sourceOrder + ); } getWarnings() { @@ -82392,7 +79474,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { // In strict harmony modules we only support the default export return [ new HarmonyLinkingError( - `Can't reexport the named export '${this._id}' from non EcmaScript module (only default export is available)` + `Can't import the named export '${this._id}' from non EcmaScript module (only default export is available)` ) ]; } @@ -82410,28 +79492,31 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { // We are sure that it's not provided const idIsNotNameMessage = - this._id !== this.name ? ` (reexported as '${this.name}')` : ""; + this._id !== this.name ? ` (imported as '${this.name}')` : ""; const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`; return [new HarmonyLinkingError(errorMessage)]; } - updateHash(hash) { - super.updateHash(hash); - const hashValue = this.getHashValue(this._module); - hash.update(hashValue); + // implement this method to allow the occurrence order plugin to count correctly + getNumberOfIdOccurrences() { + return 0; } - getHashValue(importedModule) { - if (!importedModule) { - return ""; - } - - const stringifiedUsedExport = JSON.stringify(importedModule.usedExports); - const stringifiedProvidedExport = JSON.stringify( - importedModule.buildMeta.providedExports + updateHash(hash) { + super.updateHash(hash); + const importedModule = this._module; + hash.update((importedModule && this._id) + ""); + hash.update( + (importedModule && this._id && importedModule.isUsed(this._id)) + "" ); - return ( - importedModule.used + stringifiedUsedExport + stringifiedProvidedExport + hash.update( + (importedModule && + (!importedModule.buildMeta || importedModule.buildMeta.exportsType)) + + "" + ); + hash.update( + (importedModule && + importedModule.used + JSON.stringify(importedModule.usedExports)) + "" ); } @@ -82441,247 +79526,287 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { } } -module.exports = HarmonyExportImportedSpecifierDependency; +HarmonyImportSpecifierDependency.Template = class HarmonyImportSpecifierDependencyTemplate extends HarmonyImportDependency.Template { + apply(dep, source, runtime) { + super.apply(dep, source, runtime); + const content = this.getContent(dep, runtime); + source.replace(dep.range[0], dep.range[1] - 1, content); + } -HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedSpecifierDependencyTemplate extends HarmonyImportDependency.Template { - harmonyInit(dep, source, runtime, dependencyTemplates) { - super.harmonyInit(dep, source, runtime, dependencyTemplates); - const content = this.getContent(dep); - source.insert(-1, content); + getContent(dep, runtime) { + const exportExpr = runtime.exportFromImport({ + module: dep._module, + request: dep.request, + exportName: dep._id, + originModule: dep.originModule, + asiSafe: dep.shorthand, + isCall: dep.call, + callContext: !dep.directImport, + importVar: dep.getImportVar() + }); + return dep.shorthand ? `${dep.name}: ${exportExpr}` : exportExpr; } +}; - getHarmonyInitOrder(dep) { - if (dep.name) { - const used = dep.originModule.isUsed(dep.name); - if (!used) return NaN; - } else { - const importedModule = dep._module; +module.exports = HarmonyImportSpecifierDependency; - const activeFromOtherStarExports = dep._discoverActiveExportsFromOtherStartExports(); - if (Array.isArray(dep.originModule.usedExports)) { - // we know which exports are used +/***/ }), - const unused = dep.originModule.usedExports.every(id => { - if (id === "default") return true; - if (dep.activeExports.has(id)) return true; - if (importedModule.isProvided(id) === false) return true; - if (activeFromOtherStarExports.has(id)) return true; - return false; - }); - if (unused) return NaN; - } else if ( - dep.originModule.usedExports && - importedModule && - Array.isArray(importedModule.buildMeta.providedExports) - ) { - // not sure which exports are used, but we know which are provided +/***/ 27204: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - const unused = importedModule.buildMeta.providedExports.every(id => { - if (id === "default") return true; - if (dep.activeExports.has(id)) return true; - if (activeFromOtherStarExports.has(id)) return true; - return false; - }); - if (unused) return NaN; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const NullDependency = __webpack_require__(5088); + +class HarmonyInitDependency extends NullDependency { + constructor(originModule) { + super(); + this.originModule = originModule; + } + + get type() { + return "harmony init"; + } +} + +module.exports = HarmonyInitDependency; + +HarmonyInitDependency.Template = class HarmonyInitDependencyTemplate { + apply(dep, source, runtime, dependencyTemplates) { + const module = dep.originModule; + const list = []; + for (const dependency of module.dependencies) { + const template = dependencyTemplates.get(dependency.constructor); + if ( + template && + typeof template.harmonyInit === "function" && + typeof template.getHarmonyInitOrder === "function" + ) { + const order = template.getHarmonyInitOrder(dependency); + if (!isNaN(order)) { + list.push({ + order, + listOrder: list.length, + dependency, + template + }); + } } } - return super.getHarmonyInitOrder(dep); + + list.sort((a, b) => { + const x = a.order - b.order; + if (x) return x; + return a.listOrder - b.listOrder; + }); + + for (const item of list) { + item.template.harmonyInit( + item.dependency, + source, + runtime, + dependencyTemplates + ); + } } +}; - getContent(dep) { - const mode = dep.getMode(false); - const module = dep.originModule; - const importedModule = dep._module; - const importVar = dep.getImportVar(); - switch (mode.type) { - case "missing": - return `throw new Error(${JSON.stringify( - `Cannot find module '${mode.userRequest}'` - )});\n`; +/***/ }), - case "unused": - return `${Template.toNormalComment( - `unused harmony reexport ${mode.name}` - )}\n`; +/***/ 66792: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - case "reexport-non-harmony-default": - return ( - "/* harmony reexport (default from non-harmony) */ " + - this.getReexportStatement( - module, - module.isUsed(mode.name), - importVar, - null - ) - ); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - case "reexport-named-default": - return ( - "/* harmony reexport (default from named exports) */ " + - this.getReexportStatement( - module, - module.isUsed(mode.name), - importVar, - "" - ) +const HarmonyCompatibilityDependency = __webpack_require__(1533); +const HarmonyInitDependency = __webpack_require__(27204); +const HarmonyImportSpecifierDependency = __webpack_require__(95966); +const HarmonyImportSideEffectDependency = __webpack_require__(79171); +const HarmonyExportHeaderDependency = __webpack_require__(21320); +const HarmonyExportExpressionDependency = __webpack_require__(84245); +const HarmonyExportSpecifierDependency = __webpack_require__(34834); +const HarmonyExportImportedSpecifierDependency = __webpack_require__(22864); +const HarmonyAcceptDependency = __webpack_require__(75159); +const HarmonyAcceptImportDependency = __webpack_require__(66136); + +const NullFactory = __webpack_require__(40438); + +const HarmonyDetectionParserPlugin = __webpack_require__(59310); +const HarmonyImportDependencyParserPlugin = __webpack_require__(99433); +const HarmonyExportDependencyParserPlugin = __webpack_require__(49180); +const HarmonyTopLevelThisParserPlugin = __webpack_require__(58215); + +class HarmonyModulesPlugin { + constructor(options) { + this.options = options; + } + + apply(compiler) { + compiler.hooks.compilation.tap( + "HarmonyModulesPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set( + HarmonyCompatibilityDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + HarmonyCompatibilityDependency, + new HarmonyCompatibilityDependency.Template() ); - case "reexport-fake-namespace-object": - return ( - "/* harmony reexport (fake namespace object from non-harmony) */ " + - this.getReexportFakeNamespaceObjectStatement( - module, - module.isUsed(mode.name), - importVar - ) + compilation.dependencyFactories.set( + HarmonyInitDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + HarmonyInitDependency, + new HarmonyInitDependency.Template() ); - case "rexport-non-harmony-undefined": - return ( - "/* harmony reexport (non default export from non-harmony) */ " + - this.getReexportStatement( - module, - module.isUsed(mode.name), - "undefined", - "" - ) + compilation.dependencyFactories.set( + HarmonyImportSideEffectDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + HarmonyImportSideEffectDependency, + new HarmonyImportSideEffectDependency.Template() ); - case "reexport-non-harmony-default-strict": - return ( - "/* harmony reexport (default from non-harmony) */ " + - this.getReexportStatement( - module, - module.isUsed(mode.name), - importVar, - "" - ) + compilation.dependencyFactories.set( + HarmonyImportSpecifierDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + HarmonyImportSpecifierDependency, + new HarmonyImportSpecifierDependency.Template() ); - case "reexport-namespace-object": - return ( - "/* harmony reexport (module object) */ " + - this.getReexportStatement( - module, - module.isUsed(mode.name), - importVar, - "" - ) + compilation.dependencyFactories.set( + HarmonyExportHeaderDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + HarmonyExportHeaderDependency, + new HarmonyExportHeaderDependency.Template() ); - case "empty-star": - return "/* empty/unused harmony star reexport */"; + compilation.dependencyFactories.set( + HarmonyExportExpressionDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + HarmonyExportExpressionDependency, + new HarmonyExportExpressionDependency.Template() + ); - case "safe-reexport": - return Array.from(mode.map.entries()) - .map(item => { - return ( - "/* harmony reexport (safe) */ " + - this.getReexportStatement( - module, - module.isUsed(item[0]), - importVar, - importedModule.isUsed(item[1]) - ) + - "\n" - ); - }) - .join(""); + compilation.dependencyFactories.set( + HarmonyExportSpecifierDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + HarmonyExportSpecifierDependency, + new HarmonyExportSpecifierDependency.Template() + ); - case "checked-reexport": - return Array.from(mode.map.entries()) - .map(item => { - return ( - "/* harmony reexport (checked) */ " + - this.getConditionalReexportStatement( - module, - item[0], - importVar, - item[1] - ) + - "\n" - ); - }) - .join(""); + compilation.dependencyFactories.set( + HarmonyExportImportedSpecifierDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + HarmonyExportImportedSpecifierDependency, + new HarmonyExportImportedSpecifierDependency.Template() + ); - case "dynamic-reexport": { - const ignoredExports = mode.ignored; - let content = - "/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in " + - importVar + - ") "; + compilation.dependencyFactories.set( + HarmonyAcceptDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + HarmonyAcceptDependency, + new HarmonyAcceptDependency.Template() + ); - // Filter out exports which are defined by other exports - // and filter out default export because it cannot be reexported with * - if (ignoredExports.size > 0) { - content += - "if(" + - JSON.stringify(Array.from(ignoredExports)) + - ".indexOf(__WEBPACK_IMPORT_KEY__) < 0) "; - } else { - content += "if(__WEBPACK_IMPORT_KEY__ !== 'default') "; - } - const exportsName = dep.originModule.exportsArgument; - return ( - content + - `(function(key) { __webpack_require__.d(${exportsName}, key, function() { return ${importVar}[key]; }) }(__WEBPACK_IMPORT_KEY__));\n` + compilation.dependencyFactories.set( + HarmonyAcceptImportDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + HarmonyAcceptImportDependency, + new HarmonyAcceptImportDependency.Template() ); - } - default: - throw new Error(`Unknown mode ${mode.type}`); - } - } + const handler = (parser, parserOptions) => { + if (parserOptions.harmony !== undefined && !parserOptions.harmony) + return; - getReexportStatement(module, key, name, valueKey) { - const exportsName = module.exportsArgument; - const returnValue = this.getReturnValue(name, valueKey); - return `__webpack_require__.d(${exportsName}, ${JSON.stringify( - key - )}, function() { return ${returnValue}; });\n`; - } + new HarmonyDetectionParserPlugin().apply(parser); + new HarmonyImportDependencyParserPlugin(this.options).apply(parser); + new HarmonyExportDependencyParserPlugin(this.options).apply(parser); + new HarmonyTopLevelThisParserPlugin().apply(parser); + }; - getReexportFakeNamespaceObjectStatement(module, key, name) { - const exportsName = module.exportsArgument; - return `__webpack_require__.d(${exportsName}, ${JSON.stringify( - key - )}, function() { return __webpack_require__.t(${name}); });\n`; + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("HarmonyModulesPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/esm") + .tap("HarmonyModulesPlugin", handler); + } + ); } +} +module.exports = HarmonyModulesPlugin; - getConditionalReexportStatement(module, key, name, valueKey) { - if (valueKey === false) { - return "/* unused export */\n"; - } - const exportsName = module.exportsArgument; - const returnValue = this.getReturnValue(name, valueKey); - return `if(__webpack_require__.o(${name}, ${JSON.stringify( - valueKey - )})) __webpack_require__.d(${exportsName}, ${JSON.stringify( - key - )}, function() { return ${returnValue}; });\n`; - } - getReturnValue(name, valueKey) { - if (valueKey === null) { - return `${name}_default.a`; - } - if (valueKey === "") { - return name; - } - if (valueKey === false) { - return "/* unused export */ undefined"; - } +/***/ }), - return `${name}[${JSON.stringify(valueKey)}]`; +/***/ 58215: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Florent Cailhol @ooflorent +*/ + + +const ConstDependency = __webpack_require__(71101); + +class HarmonyTopLevelThisParserPlugin { + apply(parser) { + parser.hooks.expression + .for("this") + .tap("HarmonyTopLevelThisParserPlugin", node => { + if (!parser.scope.topLevelScope) return; + const module = parser.state.module; + const isHarmony = !!(module.buildMeta && module.buildMeta.exportsType); + if (isHarmony) { + const dep = new ConstDependency("undefined", node.range, false); + dep.loc = node.loc; + parser.state.current.addDependency(dep); + } + }); } -}; +} + +module.exports = HarmonyTopLevelThisParserPlugin; /***/ }), -/***/ 34834: +/***/ 20417: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82690,60 +79815,55 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS Author Tobias Koppers @sokra */ -const NullDependency = __webpack_require__(5088); +const ContextDependency = __webpack_require__(11583); +const ContextDependencyTemplateAsRequireCall = __webpack_require__(54380); -class HarmonyExportSpecifierDependency extends NullDependency { - constructor(originModule, id, name) { - super(); - this.originModule = originModule; - this.id = id; - this.name = name; +class ImportContextDependency extends ContextDependency { + constructor(options, range, valueRange) { + super(options); + this.range = range; + this.valueRange = valueRange; } get type() { - return "harmony export specifier"; - } - - getExports() { - return { - exports: [this.name], - dependencies: undefined - }; + return `import() context ${this.options.mode}`; } } -HarmonyExportSpecifierDependency.Template = class HarmonyExportSpecifierDependencyTemplate { - apply(dep, source) {} +ImportContextDependency.Template = ContextDependencyTemplateAsRequireCall; - getHarmonyInitOrder(dep) { - return 0; - } +module.exports = ImportContextDependency; - harmonyInit(dep, source, runtime) { - const content = this.getContent(dep); - source.insert(-1, content); - } - getContent(dep) { - const used = dep.originModule.isUsed(dep.name); - if (!used) { - return `/* unused harmony export ${dep.name || "namespace"} */\n`; - } +/***/ }), - const exportsName = dep.originModule.exportsArgument; +/***/ 38875: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - return `/* harmony export (binding) */ __webpack_require__.d(${exportsName}, ${JSON.stringify( - used - )}, function() { return ${dep.id}; });\n`; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +const AsyncDependenciesBlock = __webpack_require__(22814); +const ImportDependency = __webpack_require__(50883); + +module.exports = class ImportDependenciesBlock extends AsyncDependenciesBlock { + // TODO webpack 5 reorganize arguments + constructor(request, range, groupOptions, module, loc, originModule) { + super(groupOptions, module, loc, request); + this.range = range; + const dep = new ImportDependency(request, originModule, this); + dep.loc = loc; + this.addDependency(dep); } }; -module.exports = HarmonyExportSpecifierDependency; - /***/ }), -/***/ 81599: +/***/ 50883: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82752,115 +79872,80 @@ module.exports = HarmonyExportSpecifierDependency; Author Tobias Koppers @sokra */ - -const DependencyReference = __webpack_require__(71722); const ModuleDependency = __webpack_require__(90865); -const Template = __webpack_require__(96066); -class HarmonyImportDependency extends ModuleDependency { - constructor(request, originModule, sourceOrder, parserScope) { +class ImportDependency extends ModuleDependency { + constructor(request, originModule, block) { super(request); - this.redirectedModule = undefined; this.originModule = originModule; - this.sourceOrder = sourceOrder; - this.parserScope = parserScope; + this.block = block; } - get _module() { - return this.redirectedModule || this.module; + get type() { + return "import()"; } +} - getReference() { - if (!this._module) return null; - return new DependencyReference( - this._module, - false, - this.weak, - this.sourceOrder - ); - } +ImportDependency.Template = class ImportDependencyTemplate { + apply(dep, source, runtime) { + const content = runtime.moduleNamespacePromise({ + block: dep.block, + module: dep.module, + request: dep.request, + strict: dep.originModule.buildMeta.strictHarmonyModule, + message: "import()" + }); - getImportVar() { - let importVarMap = this.parserScope.importVarMap; - if (!importVarMap) this.parserScope.importVarMap = importVarMap = new Map(); - let importVar = importVarMap.get(this._module); - if (importVar) return importVar; - importVar = `${Template.toIdentifier( - `${this.userRequest}` - )}__WEBPACK_IMPORTED_MODULE_${importVarMap.size}__`; - importVarMap.set(this._module, importVar); - return importVar; + source.replace(dep.block.range[0], dep.block.range[1] - 1, content); } +}; - getImportStatement(update, runtime) { - return runtime.importStatement({ - update, - module: this._module, - importVar: this.getImportVar(), - request: this.request, - originModule: this.originModule - }); - } +module.exports = ImportDependency; - updateHash(hash) { - super.updateHash(hash); - const importedModule = this._module; - hash.update( - (importedModule && - (!importedModule.buildMeta || importedModule.buildMeta.exportsType)) + - "" - ); - hash.update((importedModule && importedModule.id) + ""); - } - disconnect() { - super.disconnect(); - this.redirectedModule = undefined; - } -} +/***/ }), -module.exports = HarmonyImportDependency; +/***/ 25552: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -const importEmittedMap = new WeakMap(); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -HarmonyImportDependency.Template = class HarmonyImportDependencyTemplate { - apply(dep, source, runtime) { - // no-op - } +const ModuleDependency = __webpack_require__(90865); - getHarmonyInitOrder(dep) { - return dep.sourceOrder; +class ImportEagerDependency extends ModuleDependency { + constructor(request, originModule, range) { + super(request); + this.originModule = originModule; + this.range = range; } - static isImportEmitted(dep, source) { - let sourceInfo = importEmittedMap.get(source); - if (!sourceInfo) return false; - const key = dep._module || dep.request; - return key && sourceInfo.emittedImports.get(key); + get type() { + return "import() eager"; } +} - harmonyInit(dep, source, runtime, dependencyTemplates) { - let sourceInfo = importEmittedMap.get(source); - if (!sourceInfo) { - importEmittedMap.set( - source, - (sourceInfo = { - emittedImports: new Map() - }) - ); - } - const key = dep._module || dep.request; - if (key && sourceInfo.emittedImports.get(key)) return; - sourceInfo.emittedImports.set(key, true); - const content = dep.getImportStatement(false, runtime); - source.insert(-1, content); +ImportEagerDependency.Template = class ImportEagerDependencyTemplate { + apply(dep, source, runtime) { + const content = runtime.moduleNamespacePromise({ + module: dep.module, + request: dep.request, + strict: dep.originModule.buildMeta.strictHarmonyModule, + message: "import() eager" + }); + source.replace(dep.range[0], dep.range[1] - 1, content); } }; +module.exports = ImportEagerDependency; + /***/ }), -/***/ 99433: +/***/ 93382: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82870,227 +79955,253 @@ HarmonyImportDependency.Template = class HarmonyImportDependencyTemplate { */ -const { SyncBailHook } = __webpack_require__(92402); -const HarmonyImportSideEffectDependency = __webpack_require__(79171); -const HarmonyImportSpecifierDependency = __webpack_require__(95966); -const HarmonyAcceptImportDependency = __webpack_require__(66136); -const HarmonyAcceptDependency = __webpack_require__(75159); -const ConstDependency = __webpack_require__(71101); +const ImportContextDependency = __webpack_require__(20417); +const ImportWeakDependency = __webpack_require__(86817); +const ImportDependenciesBlock = __webpack_require__(38875); +const ImportEagerDependency = __webpack_require__(25552); +const ContextDependencyHelpers = __webpack_require__(5594); +const UnsupportedFeatureWarning = __webpack_require__(99953); +const CommentCompilationWarning = __webpack_require__(51760); -module.exports = class HarmonyImportDependencyParserPlugin { - constructor(moduleOptions) { - this.strictExportPresence = moduleOptions.strictExportPresence; - this.strictThisContextOnImports = moduleOptions.strictThisContextOnImports; +class ImportParserPlugin { + constructor(options) { + this.options = options; } apply(parser) { - parser.hooks.import.tap( - "HarmonyImportDependencyParserPlugin", - (statement, source) => { - parser.state.lastHarmonyImportOrder = - (parser.state.lastHarmonyImportOrder || 0) + 1; - const clearDep = new ConstDependency("", statement.range); - clearDep.loc = statement.loc; - parser.state.module.addDependency(clearDep); - const sideEffectDep = new HarmonyImportSideEffectDependency( - source, - parser.state.module, - parser.state.lastHarmonyImportOrder, - parser.state.harmonyParserScope + parser.hooks.importCall.tap("ImportParserPlugin", expr => { + if (expr.arguments.length !== 1) { + throw new Error( + "Incorrect number of arguments provided to 'import(module: string) -> Promise'." ); - sideEffectDep.loc = statement.loc; - parser.state.module.addDependency(sideEffectDep); - return true; } - ); - parser.hooks.importSpecifier.tap( - "HarmonyImportDependencyParserPlugin", - (statement, source, id, name) => { - parser.scope.definitions.delete(name); - parser.scope.renames.set(name, "imported var"); - if (!parser.state.harmonySpecifier) { - parser.state.harmonySpecifier = new Map(); + + const param = parser.evaluateExpression(expr.arguments[0]); + + let chunkName = null; + let mode = "lazy"; + let include = null; + let exclude = null; + const groupOptions = {}; + + const { + options: importOptions, + errors: commentErrors + } = parser.parseCommentOptions(expr.range); + + if (commentErrors) { + for (const e of commentErrors) { + const { comment } = e; + parser.state.module.warnings.push( + new CommentCompilationWarning( + `Compilation error while processing magic comment(-s): /*${comment.value}*/: ${e.message}`, + parser.state.module, + comment.loc + ) + ); } - parser.state.harmonySpecifier.set(name, { - source, - id, - sourceOrder: parser.state.lastHarmonyImportOrder - }); - return true; } - ); - parser.hooks.expression - .for("imported var") - .tap("HarmonyImportDependencyParserPlugin", expr => { - const name = expr.name; - const settings = parser.state.harmonySpecifier.get(name); - const dep = new HarmonyImportSpecifierDependency( - settings.source, - parser.state.module, - settings.sourceOrder, - parser.state.harmonyParserScope, - settings.id, - name, - expr.range, - this.strictExportPresence - ); - dep.shorthand = parser.scope.inShorthand; - dep.directImport = true; - dep.loc = expr.loc; - parser.state.module.addDependency(dep); - return true; - }); - parser.hooks.expressionAnyMember - .for("imported var") - .tap("HarmonyImportDependencyParserPlugin", expr => { - const name = expr.object.name; - const settings = parser.state.harmonySpecifier.get(name); - if (settings.id !== null) return false; - const dep = new HarmonyImportSpecifierDependency( - settings.source, - parser.state.module, - settings.sourceOrder, - parser.state.harmonyParserScope, - expr.property.name || expr.property.value, - name, - expr.range, - this.strictExportPresence - ); - dep.shorthand = parser.scope.inShorthand; - dep.directImport = false; - dep.loc = expr.loc; - parser.state.module.addDependency(dep); - return true; - }); - if (this.strictThisContextOnImports) { - // only in case when we strictly follow the spec we need a special case here - parser.hooks.callAnyMember - .for("imported var") - .tap("HarmonyImportDependencyParserPlugin", expr => { - if (expr.callee.type !== "MemberExpression") return; - if (expr.callee.object.type !== "Identifier") return; - const name = expr.callee.object.name; - const settings = parser.state.harmonySpecifier.get(name); - if (settings.id !== null) return false; - const dep = new HarmonyImportSpecifierDependency( - settings.source, - parser.state.module, - settings.sourceOrder, - parser.state.harmonyParserScope, - expr.callee.property.name || expr.callee.property.value, - name, - expr.callee.range, - this.strictExportPresence + + if (importOptions) { + if (importOptions.webpackIgnore !== undefined) { + if (typeof importOptions.webpackIgnore !== "boolean") { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`, + expr.loc + ) + ); + } else { + // Do not instrument `import()` if `webpackIgnore` is `true` + if (importOptions.webpackIgnore) { + return false; + } + } + } + if (importOptions.webpackChunkName !== undefined) { + if (typeof importOptions.webpackChunkName !== "string") { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`, + expr.loc + ) + ); + } else { + chunkName = importOptions.webpackChunkName; + } + } + if (importOptions.webpackMode !== undefined) { + if (typeof importOptions.webpackMode !== "string") { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackMode\` expected a string, but received: ${importOptions.webpackMode}.`, + expr.loc + ) + ); + } else { + mode = importOptions.webpackMode; + } + } + if (importOptions.webpackPrefetch !== undefined) { + if (importOptions.webpackPrefetch === true) { + groupOptions.prefetchOrder = 0; + } else if (typeof importOptions.webpackPrefetch === "number") { + groupOptions.prefetchOrder = importOptions.webpackPrefetch; + } else { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`, + expr.loc + ) + ); + } + } + if (importOptions.webpackPreload !== undefined) { + if (importOptions.webpackPreload === true) { + groupOptions.preloadOrder = 0; + } else if (typeof importOptions.webpackPreload === "number") { + groupOptions.preloadOrder = importOptions.webpackPreload; + } else { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`, + expr.loc + ) + ); + } + } + if (importOptions.webpackInclude !== undefined) { + if ( + !importOptions.webpackInclude || + importOptions.webpackInclude.constructor.name !== "RegExp" + ) { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackInclude\` expected a regular expression, but received: ${importOptions.webpackInclude}.`, + expr.loc + ) + ); + } else { + include = new RegExp(importOptions.webpackInclude); + } + } + if (importOptions.webpackExclude !== undefined) { + if ( + !importOptions.webpackExclude || + importOptions.webpackExclude.constructor.name !== "RegExp" + ) { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackExclude\` expected a regular expression, but received: ${importOptions.webpackExclude}.`, + expr.loc + ) + ); + } else { + exclude = new RegExp(importOptions.webpackExclude); + } + } + } + + if (param.isString()) { + if (mode !== "lazy" && mode !== "eager" && mode !== "weak") { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackMode\` expected 'lazy', 'eager' or 'weak', but received: ${mode}.`, + expr.loc + ) ); - dep.shorthand = parser.scope.inShorthand; - dep.directImport = false; - dep.namespaceObjectAsContext = true; - dep.loc = expr.callee.loc; - parser.state.module.addDependency(dep); - if (expr.arguments) parser.walkExpressions(expr.arguments); - return true; - }); - } - parser.hooks.call - .for("imported var") - .tap("HarmonyImportDependencyParserPlugin", expr => { - const args = expr.arguments; - const fullExpr = expr; - expr = expr.callee; - if (expr.type !== "Identifier") return; - const name = expr.name; - const settings = parser.state.harmonySpecifier.get(name); - const dep = new HarmonyImportSpecifierDependency( - settings.source, - parser.state.module, - settings.sourceOrder, - parser.state.harmonyParserScope, - settings.id, - name, - expr.range, - this.strictExportPresence - ); - dep.directImport = true; - dep.callArgs = args; - dep.call = fullExpr; - dep.loc = expr.loc; - parser.state.module.addDependency(dep); - if (args) parser.walkExpressions(args); - return true; - }); - // TODO webpack 5: refactor this, no custom hooks - if (!parser.hooks.hotAcceptCallback) { - parser.hooks.hotAcceptCallback = new SyncBailHook([ - "expression", - "requests" - ]); - } - if (!parser.hooks.hotAcceptWithoutCallback) { - parser.hooks.hotAcceptWithoutCallback = new SyncBailHook([ - "expression", - "requests" - ]); - } - parser.hooks.hotAcceptCallback.tap( - "HarmonyImportDependencyParserPlugin", - (expr, requests) => { - const harmonyParserScope = parser.state.harmonyParserScope; - if (!harmonyParserScope) { - // This is not a harmony module, skip it - return; } - const dependencies = requests.map(request => { - const dep = new HarmonyAcceptImportDependency( - request, + + if (mode === "eager") { + const dep = new ImportEagerDependency( + param.string, parser.state.module, - harmonyParserScope - ); - dep.loc = expr.loc; - parser.state.module.addDependency(dep); - return dep; - }); - if (dependencies.length > 0) { - const dep = new HarmonyAcceptDependency( - expr.range, - dependencies, - true + expr.range ); - dep.loc = expr.loc; - parser.state.module.addDependency(dep); - } - } - ); - parser.hooks.hotAcceptWithoutCallback.tap( - "HarmonyImportDependencyParserPlugin", - (expr, requests) => { - const dependencies = requests.map(request => { - const dep = new HarmonyAcceptImportDependency( - request, + parser.state.current.addDependency(dep); + } else if (mode === "weak") { + const dep = new ImportWeakDependency( + param.string, parser.state.module, - parser.state.harmonyParserScope + expr.range ); - dep.loc = expr.loc; - parser.state.module.addDependency(dep); - return dep; - }); - if (dependencies.length > 0) { - const dep = new HarmonyAcceptDependency( + parser.state.current.addDependency(dep); + } else { + const depBlock = new ImportDependenciesBlock( + param.string, expr.range, - dependencies, - false + Object.assign(groupOptions, { + name: chunkName + }), + parser.state.module, + expr.loc, + parser.state.module ); - dep.loc = expr.loc; - parser.state.module.addDependency(dep); + parser.state.current.addBlock(depBlock); + } + return true; + } else { + if ( + mode !== "lazy" && + mode !== "lazy-once" && + mode !== "eager" && + mode !== "weak" + ) { + parser.state.module.warnings.push( + new UnsupportedFeatureWarning( + parser.state.module, + `\`webpackMode\` expected 'lazy', 'lazy-once', 'eager' or 'weak', but received: ${mode}.`, + expr.loc + ) + ); + mode = "lazy"; + } + + if (mode === "weak") { + mode = "async-weak"; } + const dep = ContextDependencyHelpers.create( + ImportContextDependency, + expr.range, + param, + expr, + this.options, + { + chunkName, + groupOptions, + include, + exclude, + mode, + namespaceObject: parser.state.module.buildMeta.strictHarmonyModule + ? "strict" + : true + }, + parser + ); + if (!dep) return; + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; } - ); + }); } -}; +} + +module.exports = ImportParserPlugin; /***/ }), -/***/ 79171: +/***/ 58839: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -83099,37 +80210,85 @@ module.exports = class HarmonyImportDependencyParserPlugin { Author Tobias Koppers @sokra */ -const HarmonyImportDependency = __webpack_require__(81599); -class HarmonyImportSideEffectDependency extends HarmonyImportDependency { - constructor(request, originModule, sourceOrder, parserScope) { - super(request, originModule, sourceOrder, parserScope); +const ImportDependency = __webpack_require__(50883); +const ImportEagerDependency = __webpack_require__(25552); +const ImportWeakDependency = __webpack_require__(86817); +const ImportContextDependency = __webpack_require__(20417); +const ImportParserPlugin = __webpack_require__(93382); + +class ImportPlugin { + constructor(options) { + this.options = options; } - getReference() { - if (this._module && this._module.factoryMeta.sideEffectFree) return null; + apply(compiler) { + const options = this.options; + compiler.hooks.compilation.tap( + "ImportPlugin", + (compilation, { contextModuleFactory, normalModuleFactory }) => { + compilation.dependencyFactories.set( + ImportDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + ImportDependency, + new ImportDependency.Template() + ); - return super.getReference(); - } + compilation.dependencyFactories.set( + ImportEagerDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + ImportEagerDependency, + new ImportEagerDependency.Template() + ); - get type() { - return "harmony side effect evaluation"; - } -} + compilation.dependencyFactories.set( + ImportWeakDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + ImportWeakDependency, + new ImportWeakDependency.Template() + ); -HarmonyImportSideEffectDependency.Template = class HarmonyImportSideEffectDependencyTemplate extends HarmonyImportDependency.Template { - getHarmonyInitOrder(dep) { - if (dep._module && dep._module.factoryMeta.sideEffectFree) return NaN; - return super.getHarmonyInitOrder(dep); - } -}; + compilation.dependencyFactories.set( + ImportContextDependency, + contextModuleFactory + ); + compilation.dependencyTemplates.set( + ImportContextDependency, + new ImportContextDependency.Template() + ); -module.exports = HarmonyImportSideEffectDependency; + const handler = (parser, parserOptions) => { + if (parserOptions.import !== undefined && !parserOptions.import) + return; + + new ImportParserPlugin(options).apply(parser); + }; + + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("ImportPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("ImportPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/esm") + .tap("ImportPlugin", handler); + } + ); + } +} +module.exports = ImportPlugin; /***/ }), -/***/ 95966: +/***/ 86817: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -83138,169 +80297,74 @@ module.exports = HarmonyImportSideEffectDependency; Author Tobias Koppers @sokra */ +const ModuleDependency = __webpack_require__(90865); -const DependencyReference = __webpack_require__(71722); -const HarmonyImportDependency = __webpack_require__(81599); -const HarmonyLinkingError = __webpack_require__(30327); - -class HarmonyImportSpecifierDependency extends HarmonyImportDependency { - constructor( - request, - originModule, - sourceOrder, - parserScope, - id, - name, - range, - strictExportPresence - ) { - super(request, originModule, sourceOrder, parserScope); - this.id = id === null ? null : `${id}`; - this.redirectedId = undefined; - this.name = name; - this.range = range; - this.strictExportPresence = strictExportPresence; - this.namespaceObjectAsContext = false; - this.callArgs = undefined; - this.call = undefined; - this.directImport = undefined; - this.shorthand = undefined; - } +class ImportWeakDependency extends ModuleDependency { + constructor(request, originModule, range) { + super(request); + this.originModule = originModule; + this.range = range; + this.weak = true; + } get type() { - return "harmony import specifier"; - } - - get _id() { - return this.redirectedId || this.id; - } - - getReference() { - if (!this._module) return null; - return new DependencyReference( - this._module, - this._id && !this.namespaceObjectAsContext ? [this._id] : true, - false, - this.sourceOrder - ); + return "import() weak"; } +} - getWarnings() { - if ( - this.strictExportPresence || - this.originModule.buildMeta.strictHarmonyModule - ) { - return []; - } - return this._getErrors(); +ImportWeakDependency.Template = class ImportDependencyTemplate { + apply(dep, source, runtime) { + const content = runtime.moduleNamespacePromise({ + module: dep.module, + request: dep.request, + strict: dep.originModule.buildMeta.strictHarmonyModule, + message: "import() weak", + weak: true + }); + source.replace(dep.range[0], dep.range[1] - 1, content); } +}; - getErrors() { - if ( - this.strictExportPresence || - this.originModule.buildMeta.strictHarmonyModule - ) { - return this._getErrors(); - } - return []; - } +module.exports = ImportWeakDependency; - _getErrors() { - const importedModule = this._module; - if (!importedModule) { - return; - } - if (!importedModule.buildMeta || !importedModule.buildMeta.exportsType) { - // It's not an harmony module - if ( - this.originModule.buildMeta.strictHarmonyModule && - this._id && - this._id !== "default" - ) { - // In strict harmony modules we only support the default export - return [ - new HarmonyLinkingError( - `Can't import the named export '${this._id}' from non EcmaScript module (only default export is available)` - ) - ]; - } - return; - } +/***/ }), - if (!this._id) { - return; - } +/***/ 54396: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (importedModule.isProvided(this._id) !== false) { - // It's provided or we are not sure - return; - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // We are sure that it's not provided - const idIsNotNameMessage = - this._id !== this.name ? ` (imported as '${this.name}')` : ""; - const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`; - return [new HarmonyLinkingError(errorMessage)]; - } +const NullDependency = __webpack_require__(5088); - // implement this method to allow the occurrence order plugin to count correctly - getNumberOfIdOccurrences() { - return 0; +class JsonExportsDependency extends NullDependency { + constructor(exports) { + super(); + this.exports = exports; } - updateHash(hash) { - super.updateHash(hash); - const importedModule = this._module; - hash.update((importedModule && this._id) + ""); - hash.update( - (importedModule && this._id && importedModule.isUsed(this._id)) + "" - ); - hash.update( - (importedModule && - (!importedModule.buildMeta || importedModule.buildMeta.exportsType)) + - "" - ); - hash.update( - (importedModule && - importedModule.used + JSON.stringify(importedModule.usedExports)) + "" - ); + get type() { + return "json exports"; } - disconnect() { - super.disconnect(); - this.redirectedId = undefined; + getExports() { + return { + exports: this.exports, + dependencies: undefined + }; } } -HarmonyImportSpecifierDependency.Template = class HarmonyImportSpecifierDependencyTemplate extends HarmonyImportDependency.Template { - apply(dep, source, runtime) { - super.apply(dep, source, runtime); - const content = this.getContent(dep, runtime); - source.replace(dep.range[0], dep.range[1] - 1, content); - } - - getContent(dep, runtime) { - const exportExpr = runtime.exportFromImport({ - module: dep._module, - request: dep.request, - exportName: dep._id, - originModule: dep.originModule, - asiSafe: dep.shorthand, - isCall: dep.call, - callContext: !dep.directImport, - importVar: dep.getImportVar() - }); - return dep.shorthand ? `${dep.name}: ${exportExpr}` : exportExpr; - } -}; - -module.exports = HarmonyImportSpecifierDependency; +module.exports = JsonExportsDependency; /***/ }), -/***/ 27204: +/***/ 1129: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -83309,66 +80373,27 @@ module.exports = HarmonyImportSpecifierDependency; Author Tobias Koppers @sokra */ +const ModuleDependency = __webpack_require__(90865); -const NullDependency = __webpack_require__(5088); - -class HarmonyInitDependency extends NullDependency { - constructor(originModule) { - super(); - this.originModule = originModule; +class LoaderDependency extends ModuleDependency { + /** + * @param {string} request request string + */ + constructor(request) { + super(request); } get type() { - return "harmony init"; + return "loader"; } } -module.exports = HarmonyInitDependency; - -HarmonyInitDependency.Template = class HarmonyInitDependencyTemplate { - apply(dep, source, runtime, dependencyTemplates) { - const module = dep.originModule; - const list = []; - for (const dependency of module.dependencies) { - const template = dependencyTemplates.get(dependency.constructor); - if ( - template && - typeof template.harmonyInit === "function" && - typeof template.getHarmonyInitOrder === "function" - ) { - const order = template.getHarmonyInitOrder(dependency); - if (!isNaN(order)) { - list.push({ - order, - listOrder: list.length, - dependency, - template - }); - } - } - } - - list.sort((a, b) => { - const x = a.order - b.order; - if (x) return x; - return a.listOrder - b.listOrder; - }); - - for (const item of list) { - item.template.harmonyInit( - item.dependency, - source, - runtime, - dependencyTemplates - ); - } - } -}; +module.exports = LoaderDependency; /***/ }), -/***/ 66792: +/***/ 31559: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -83377,184 +80402,189 @@ HarmonyInitDependency.Template = class HarmonyInitDependencyTemplate { Author Tobias Koppers @sokra */ -const HarmonyCompatibilityDependency = __webpack_require__(1533); -const HarmonyInitDependency = __webpack_require__(27204); -const HarmonyImportSpecifierDependency = __webpack_require__(95966); -const HarmonyImportSideEffectDependency = __webpack_require__(79171); -const HarmonyExportHeaderDependency = __webpack_require__(21320); -const HarmonyExportExpressionDependency = __webpack_require__(84245); -const HarmonyExportSpecifierDependency = __webpack_require__(34834); -const HarmonyExportImportedSpecifierDependency = __webpack_require__(22864); -const HarmonyAcceptDependency = __webpack_require__(75159); -const HarmonyAcceptImportDependency = __webpack_require__(66136); -const NullFactory = __webpack_require__(40438); +const LoaderDependency = __webpack_require__(1129); +const NormalModule = __webpack_require__(25963); -const HarmonyDetectionParserPlugin = __webpack_require__(59310); -const HarmonyImportDependencyParserPlugin = __webpack_require__(99433); -const HarmonyExportDependencyParserPlugin = __webpack_require__(49180); -const HarmonyTopLevelThisParserPlugin = __webpack_require__(58215); +/** @typedef {import("../Module")} Module */ -class HarmonyModulesPlugin { - constructor(options) { - this.options = options; - } +/** + * @callback LoadModuleCallback + * @param {Error=} err error object + * @param {string=} source source code + * @param {object=} map source map + * @param {Module=} module loaded module if successful + */ +class LoaderPlugin { apply(compiler) { compiler.hooks.compilation.tap( - "HarmonyModulesPlugin", + "LoaderPlugin", (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( - HarmonyCompatibilityDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - HarmonyCompatibilityDependency, - new HarmonyCompatibilityDependency.Template() - ); - - compilation.dependencyFactories.set( - HarmonyInitDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - HarmonyInitDependency, - new HarmonyInitDependency.Template() - ); - - compilation.dependencyFactories.set( - HarmonyImportSideEffectDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - HarmonyImportSideEffectDependency, - new HarmonyImportSideEffectDependency.Template() - ); - - compilation.dependencyFactories.set( - HarmonyImportSpecifierDependency, + LoaderDependency, normalModuleFactory ); - compilation.dependencyTemplates.set( - HarmonyImportSpecifierDependency, - new HarmonyImportSpecifierDependency.Template() - ); + } + ); - compilation.dependencyFactories.set( - HarmonyExportHeaderDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - HarmonyExportHeaderDependency, - new HarmonyExportHeaderDependency.Template() - ); + compiler.hooks.compilation.tap("LoaderPlugin", compilation => { + compilation.hooks.normalModuleLoader.tap( + "LoaderPlugin", + (loaderContext, module) => { + /** + * @param {string} request the request string to load the module from + * @param {LoadModuleCallback} callback callback returning the loaded module or error + * @returns {void} + */ + loaderContext.loadModule = (request, callback) => { + const dep = new LoaderDependency(request); + dep.loc = { + name: request + }; + const factory = compilation.dependencyFactories.get( + dep.constructor + ); + if (factory === undefined) { + return callback( + new Error( + `No module factory available for dependency type: ${dep.constructor.name}` + ) + ); + } + compilation.semaphore.release(); + compilation.addModuleDependencies( + module, + [ + { + factory, + dependencies: [dep] + } + ], + true, + "lm", + true, + err => { + compilation.semaphore.acquire(() => { + if (err) { + return callback(err); + } + if (!dep.module) { + return callback(new Error("Cannot load the module")); + } + // TODO consider removing this in webpack 5 + if (dep.module instanceof NormalModule && dep.module.error) { + return callback(dep.module.error); + } + if (!dep.module._source) { + throw new Error( + "The module created for a LoaderDependency must have a property _source" + ); + } + let source, map; + const moduleSource = dep.module._source; + if (moduleSource.sourceAndMap) { + const sourceAndMap = moduleSource.sourceAndMap(); + map = sourceAndMap.map; + source = sourceAndMap.source; + } else { + map = moduleSource.map(); + source = moduleSource.source(); + } + if (dep.module.buildInfo.fileDependencies) { + for (const d of dep.module.buildInfo.fileDependencies) { + loaderContext.addDependency(d); + } + } + if (dep.module.buildInfo.contextDependencies) { + for (const d of dep.module.buildInfo.contextDependencies) { + loaderContext.addContextDependency(d); + } + } + return callback(null, source, map, dep.module); + }); + } + ); + }; + } + ); + }); + } +} +module.exports = LoaderPlugin; - compilation.dependencyFactories.set( - HarmonyExportExpressionDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - HarmonyExportExpressionDependency, - new HarmonyExportExpressionDependency.Template() - ); - compilation.dependencyFactories.set( - HarmonyExportSpecifierDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - HarmonyExportSpecifierDependency, - new HarmonyExportSpecifierDependency.Template() - ); +/***/ }), - compilation.dependencyFactories.set( - HarmonyExportImportedSpecifierDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - HarmonyExportImportedSpecifierDependency, - new HarmonyExportImportedSpecifierDependency.Template() - ); +/***/ 17356: +/***/ (function(module) { - compilation.dependencyFactories.set( - HarmonyAcceptDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - HarmonyAcceptDependency, - new HarmonyAcceptDependency.Template() - ); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - compilation.dependencyFactories.set( - HarmonyAcceptImportDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - HarmonyAcceptImportDependency, - new HarmonyAcceptImportDependency.Template() - ); - const handler = (parser, parserOptions) => { - if (parserOptions.harmony !== undefined && !parserOptions.harmony) - return; +class LocalModule { + constructor(module, name, idx) { + this.module = module; + this.name = name; + this.idx = idx; + this.used = false; + } - new HarmonyDetectionParserPlugin().apply(parser); - new HarmonyImportDependencyParserPlugin(this.options).apply(parser); - new HarmonyExportDependencyParserPlugin(this.options).apply(parser); - new HarmonyTopLevelThisParserPlugin().apply(parser); - }; + flagUsed() { + this.used = true; + } - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("HarmonyModulesPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("HarmonyModulesPlugin", handler); - } - ); + variableName() { + return "__WEBPACK_LOCAL_MODULE_" + this.idx + "__"; } } -module.exports = HarmonyModulesPlugin; +module.exports = LocalModule; /***/ }), -/***/ 58215: +/***/ 56570: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Florent Cailhol @ooflorent + Author Tobias Koppers @sokra */ +const NullDependency = __webpack_require__(5088); -const ConstDependency = __webpack_require__(71101); - -class HarmonyTopLevelThisParserPlugin { - apply(parser) { - parser.hooks.expression - .for("this") - .tap("HarmonyTopLevelThisParserPlugin", node => { - if (!parser.scope.topLevelScope) return; - const module = parser.state.module; - const isHarmony = !!(module.buildMeta && module.buildMeta.exportsType); - if (isHarmony) { - const dep = new ConstDependency("undefined", node.range, false); - dep.loc = node.loc; - parser.state.current.addDependency(dep); - } - }); +class LocalModuleDependency extends NullDependency { + constructor(localModule, range, callNew) { + super(); + localModule.flagUsed(); + this.localModule = localModule; + this.range = range; + this.callNew = callNew; } } -module.exports = HarmonyTopLevelThisParserPlugin; +LocalModuleDependency.Template = class LocalModuleDependencyTemplate { + apply(dep, source) { + if (!dep.range) return; + const moduleInstance = dep.callNew + ? `new (function () { return ${dep.localModule.variableName()}; })()` + : dep.localModule.variableName(); + source.replace(dep.range[0], dep.range[1] - 1, moduleInstance); + } +}; + +module.exports = LocalModuleDependency; /***/ }), -/***/ 20417: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 39658: +/***/ (function(module, exports, __webpack_require__) { "use strict"; /* @@ -83562,29 +80592,58 @@ module.exports = HarmonyTopLevelThisParserPlugin; Author Tobias Koppers @sokra */ -const ContextDependency = __webpack_require__(11583); -const ContextDependencyTemplateAsRequireCall = __webpack_require__(54380); -class ImportContextDependency extends ContextDependency { - constructor(options, range, valueRange) { - super(options); - this.range = range; - this.valueRange = valueRange; +const LocalModule = __webpack_require__(17356); +const LocalModulesHelpers = exports; + +const lookup = (parent, mod) => { + if (mod.charAt(0) !== ".") return mod; + + var path = parent.split("/"); + var segs = mod.split("/"); + path.pop(); + + for (let i = 0; i < segs.length; i++) { + const seg = segs[i]; + if (seg === "..") { + path.pop(); + } else if (seg !== ".") { + path.push(seg); + } } - get type() { - return `import() context ${this.options.mode}`; + return path.join("/"); +}; + +LocalModulesHelpers.addLocalModule = (state, name) => { + if (!state.localModules) { + state.localModules = []; } -} + const m = new LocalModule(state.module, name, state.localModules.length); + state.localModules.push(m); + return m; +}; -ImportContextDependency.Template = ContextDependencyTemplateAsRequireCall; +LocalModulesHelpers.getLocalModule = (state, name, namedModule) => { + if (!state.localModules) return null; + if (namedModule) { + // resolve dependency name relative to the defining named module + name = lookup(namedModule, name); + } + for (let i = 0; i < state.localModules.length; i++) { + if (state.localModules[i].name === name) { + return state.localModules[i]; + } + } + return null; +}; -module.exports = ImportContextDependency; +module.exports = LocalModulesHelpers; /***/ }), -/***/ 38875: +/***/ 90865: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -83593,25 +80652,30 @@ module.exports = ImportContextDependency; Author Tobias Koppers @sokra */ -const AsyncDependenciesBlock = __webpack_require__(22814); -const ImportDependency = __webpack_require__(50883); +const Dependency = __webpack_require__(57282); -module.exports = class ImportDependenciesBlock extends AsyncDependenciesBlock { - // TODO webpack 5 reorganize arguments - constructor(request, range, groupOptions, module, loc, originModule) { - super(groupOptions, module, loc, request); - this.range = range; - const dep = new ImportDependency(request, originModule, this); - dep.loc = loc; - this.addDependency(dep); +class ModuleDependency extends Dependency { + /** + * @param {string} request request path which needs resolving + */ + constructor(request) { + super(); + this.request = request; + this.userRequest = request; } -}; + + getResourceIdentifier() { + return `module${this.request}`; + } +} + +module.exports = ModuleDependency; /***/ }), -/***/ 50883: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 63708: +/***/ (function(module) { "use strict"; /* @@ -83619,40 +80683,48 @@ module.exports = class ImportDependenciesBlock extends AsyncDependenciesBlock { Author Tobias Koppers @sokra */ -const ModuleDependency = __webpack_require__(90865); - -class ImportDependency extends ModuleDependency { - constructor(request, originModule, block) { - super(request); - this.originModule = originModule; - this.block = block; - } - get type() { - return "import()"; +class ModuleDependencyTemplateAsId { + apply(dep, source, runtime) { + if (!dep.range) return; + const content = runtime.moduleId({ + module: dep.module, + request: dep.request + }); + source.replace(dep.range[0], dep.range[1] - 1, content); } } +module.exports = ModuleDependencyTemplateAsId; -ImportDependency.Template = class ImportDependencyTemplate { + +/***/ }), + +/***/ 60441: +/***/ (function(module) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +class ModuleDependencyTemplateAsRequireId { apply(dep, source, runtime) { - const content = runtime.moduleNamespacePromise({ - block: dep.block, + if (!dep.range) return; + const content = runtime.moduleExports({ module: dep.module, - request: dep.request, - strict: dep.originModule.buildMeta.strictHarmonyModule, - message: "import()" + request: dep.request }); - - source.replace(dep.block.range[0], dep.block.range[1] - 1, content); + source.replace(dep.range[0], dep.range[1] - 1, content); } -}; - -module.exports = ImportDependency; +} +module.exports = ModuleDependencyTemplateAsRequireId; /***/ }), -/***/ 25552: +/***/ 29018: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -83662,37 +80734,28 @@ module.exports = ImportDependency; */ const ModuleDependency = __webpack_require__(90865); +const ModuleDependencyTemplateAsId = __webpack_require__(63708); -class ImportEagerDependency extends ModuleDependency { - constructor(request, originModule, range) { +class ModuleHotAcceptDependency extends ModuleDependency { + constructor(request, range) { super(request); - this.originModule = originModule; this.range = range; + this.weak = true; } get type() { - return "import() eager"; + return "module.hot.accept"; } } -ImportEagerDependency.Template = class ImportEagerDependencyTemplate { - apply(dep, source, runtime) { - const content = runtime.moduleNamespacePromise({ - module: dep.module, - request: dep.request, - strict: dep.originModule.buildMeta.strictHarmonyModule, - message: "import() eager" - }); - source.replace(dep.range[0], dep.range[1] - 1, content); - } -}; +ModuleHotAcceptDependency.Template = ModuleDependencyTemplateAsId; -module.exports = ImportEagerDependency; +module.exports = ModuleHotAcceptDependency; /***/ }), -/***/ 93382: +/***/ 60482: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -83701,254 +80764,62 @@ module.exports = ImportEagerDependency; Author Tobias Koppers @sokra */ +const ModuleDependency = __webpack_require__(90865); +const ModuleDependencyTemplateAsId = __webpack_require__(63708); -const ImportContextDependency = __webpack_require__(20417); -const ImportWeakDependency = __webpack_require__(86817); -const ImportDependenciesBlock = __webpack_require__(38875); -const ImportEagerDependency = __webpack_require__(25552); -const ContextDependencyHelpers = __webpack_require__(5594); -const UnsupportedFeatureWarning = __webpack_require__(99953); -const CommentCompilationWarning = __webpack_require__(51760); +class ModuleHotDeclineDependency extends ModuleDependency { + constructor(request, range) { + super(request); + this.range = range; + this.weak = true; + } -class ImportParserPlugin { - constructor(options) { - this.options = options; + get type() { + return "module.hot.decline"; } +} - apply(parser) { - parser.hooks.importCall.tap("ImportParserPlugin", expr => { - if (expr.arguments.length !== 1) { - throw new Error( - "Incorrect number of arguments provided to 'import(module: string) -> Promise'." - ); - } +ModuleHotDeclineDependency.Template = ModuleDependencyTemplateAsId; - const param = parser.evaluateExpression(expr.arguments[0]); +module.exports = ModuleHotDeclineDependency; - let chunkName = null; - let mode = "lazy"; - let include = null; - let exclude = null; - const groupOptions = {}; - const { - options: importOptions, - errors: commentErrors - } = parser.parseCommentOptions(expr.range); +/***/ }), - if (commentErrors) { - for (const e of commentErrors) { - const { comment } = e; - parser.state.module.warnings.push( - new CommentCompilationWarning( - `Compilation error while processing magic comment(-s): /*${comment.value}*/: ${e.message}`, - parser.state.module, - comment.loc - ) - ); - } - } +/***/ 7791: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (importOptions) { - if (importOptions.webpackIgnore !== undefined) { - if (typeof importOptions.webpackIgnore !== "boolean") { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`, - expr.loc - ) - ); - } else { - // Do not instrument `import()` if `webpackIgnore` is `true` - if (importOptions.webpackIgnore) { - return false; - } - } - } - if (importOptions.webpackChunkName !== undefined) { - if (typeof importOptions.webpackChunkName !== "string") { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`, - expr.loc - ) - ); - } else { - chunkName = importOptions.webpackChunkName; - } - } - if (importOptions.webpackMode !== undefined) { - if (typeof importOptions.webpackMode !== "string") { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackMode\` expected a string, but received: ${importOptions.webpackMode}.`, - expr.loc - ) - ); - } else { - mode = importOptions.webpackMode; - } - } - if (importOptions.webpackPrefetch !== undefined) { - if (importOptions.webpackPrefetch === true) { - groupOptions.prefetchOrder = 0; - } else if (typeof importOptions.webpackPrefetch === "number") { - groupOptions.prefetchOrder = importOptions.webpackPrefetch; - } else { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`, - expr.loc - ) - ); - } - } - if (importOptions.webpackPreload !== undefined) { - if (importOptions.webpackPreload === true) { - groupOptions.preloadOrder = 0; - } else if (typeof importOptions.webpackPreload === "number") { - groupOptions.preloadOrder = importOptions.webpackPreload; - } else { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`, - expr.loc - ) - ); - } - } - if (importOptions.webpackInclude !== undefined) { - if ( - !importOptions.webpackInclude || - importOptions.webpackInclude.constructor.name !== "RegExp" - ) { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackInclude\` expected a regular expression, but received: ${importOptions.webpackInclude}.`, - expr.loc - ) - ); - } else { - include = new RegExp(importOptions.webpackInclude); - } - } - if (importOptions.webpackExclude !== undefined) { - if ( - !importOptions.webpackExclude || - importOptions.webpackExclude.constructor.name !== "RegExp" - ) { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackExclude\` expected a regular expression, but received: ${importOptions.webpackExclude}.`, - expr.loc - ) - ); - } else { - exclude = new RegExp(importOptions.webpackExclude); - } - } - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (param.isString()) { - if (mode !== "lazy" && mode !== "eager" && mode !== "weak") { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackMode\` expected 'lazy', 'eager' or 'weak', but received: ${mode}.`, - expr.loc - ) - ); - } +/** @typedef {import("./SingleEntryDependency")} SingleEntryDependency */ +const Dependency = __webpack_require__(57282); - if (mode === "eager") { - const dep = new ImportEagerDependency( - param.string, - parser.state.module, - expr.range - ); - parser.state.current.addDependency(dep); - } else if (mode === "weak") { - const dep = new ImportWeakDependency( - param.string, - parser.state.module, - expr.range - ); - parser.state.current.addDependency(dep); - } else { - const depBlock = new ImportDependenciesBlock( - param.string, - expr.range, - Object.assign(groupOptions, { - name: chunkName - }), - parser.state.module, - expr.loc, - parser.state.module - ); - parser.state.current.addBlock(depBlock); - } - return true; - } else { - if ( - mode !== "lazy" && - mode !== "lazy-once" && - mode !== "eager" && - mode !== "weak" - ) { - parser.state.module.warnings.push( - new UnsupportedFeatureWarning( - parser.state.module, - `\`webpackMode\` expected 'lazy', 'lazy-once', 'eager' or 'weak', but received: ${mode}.`, - expr.loc - ) - ); - mode = "lazy"; - } +class MultiEntryDependency extends Dependency { + /** + * @param {SingleEntryDependency[]} dependencies an array of SingleEntryDependencies + * @param {string} name entry name + */ + constructor(dependencies, name) { + super(); + this.dependencies = dependencies; + this.name = name; + } - if (mode === "weak") { - mode = "async-weak"; - } - const dep = ContextDependencyHelpers.create( - ImportContextDependency, - expr.range, - param, - expr, - this.options, - { - chunkName, - groupOptions, - include, - exclude, - mode, - namespaceObject: parser.state.module.buildMeta.strictHarmonyModule - ? "strict" - : true - }, - parser - ); - if (!dep) return; - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - } - }); + get type() { + return "multi entry"; } } -module.exports = ImportParserPlugin; +module.exports = MultiEntryDependency; /***/ }), -/***/ 58839: +/***/ 5088: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -83957,85 +80828,26 @@ module.exports = ImportParserPlugin; Author Tobias Koppers @sokra */ +const Dependency = __webpack_require__(57282); -const ImportDependency = __webpack_require__(50883); -const ImportEagerDependency = __webpack_require__(25552); -const ImportWeakDependency = __webpack_require__(86817); -const ImportContextDependency = __webpack_require__(20417); -const ImportParserPlugin = __webpack_require__(93382); - -class ImportPlugin { - constructor(options) { - this.options = options; +class NullDependency extends Dependency { + get type() { + return "null"; } - apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap( - "ImportPlugin", - (compilation, { contextModuleFactory, normalModuleFactory }) => { - compilation.dependencyFactories.set( - ImportDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - ImportDependency, - new ImportDependency.Template() - ); - - compilation.dependencyFactories.set( - ImportEagerDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - ImportEagerDependency, - new ImportEagerDependency.Template() - ); - - compilation.dependencyFactories.set( - ImportWeakDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - ImportWeakDependency, - new ImportWeakDependency.Template() - ); - - compilation.dependencyFactories.set( - ImportContextDependency, - contextModuleFactory - ); - compilation.dependencyTemplates.set( - ImportContextDependency, - new ImportContextDependency.Template() - ); - - const handler = (parser, parserOptions) => { - if (parserOptions.import !== undefined && !parserOptions.import) - return; + updateHash() {} +} - new ImportParserPlugin(options).apply(parser); - }; +NullDependency.Template = class NullDependencyTemplate { + apply() {} +}; - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ImportPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ImportPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ImportPlugin", handler); - } - ); - } -} -module.exports = ImportPlugin; +module.exports = NullDependency; /***/ }), -/***/ 86817: +/***/ 14237: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84046,38 +80858,22 @@ module.exports = ImportPlugin; const ModuleDependency = __webpack_require__(90865); -class ImportWeakDependency extends ModuleDependency { - constructor(request, originModule, range) { +class PrefetchDependency extends ModuleDependency { + constructor(request) { super(request); - this.originModule = originModule; - this.range = range; - this.weak = true; } get type() { - return "import() weak"; + return "prefetch"; } } -ImportWeakDependency.Template = class ImportDependencyTemplate { - apply(dep, source, runtime) { - const content = runtime.moduleNamespacePromise({ - module: dep.module, - request: dep.request, - strict: dep.originModule.buildMeta.strictHarmonyModule, - message: "import() weak", - weak: true - }); - source.replace(dep.range[0], dep.range[1] - 1, content); - } -}; - -module.exports = ImportWeakDependency; +module.exports = PrefetchDependency; /***/ }), -/***/ 54396: +/***/ 79142: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84086,32 +80882,28 @@ module.exports = ImportWeakDependency; Author Tobias Koppers @sokra */ -const NullDependency = __webpack_require__(5088); +const ContextDependency = __webpack_require__(11583); +const ModuleDependencyTemplateAsRequireId = __webpack_require__(60441); -class JsonExportsDependency extends NullDependency { - constructor(exports) { - super(); - this.exports = exports; +class RequireContextDependency extends ContextDependency { + constructor(options, range) { + super(options); + this.range = range; } get type() { - return "json exports"; - } - - getExports() { - return { - exports: this.exports, - dependencies: undefined - }; + return "require.context"; } } -module.exports = JsonExportsDependency; +RequireContextDependency.Template = ModuleDependencyTemplateAsRequireId; + +module.exports = RequireContextDependency; /***/ }), -/***/ 1129: +/***/ 10566: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84120,27 +80912,62 @@ module.exports = JsonExportsDependency; Author Tobias Koppers @sokra */ -const ModuleDependency = __webpack_require__(90865); -class LoaderDependency extends ModuleDependency { - /** - * @param {string} request request string - */ - constructor(request) { - super(request); - } +const RequireContextDependency = __webpack_require__(79142); - get type() { - return "loader"; +module.exports = class RequireContextDependencyParserPlugin { + apply(parser) { + parser.hooks.call + .for("require.context") + .tap("RequireContextDependencyParserPlugin", expr => { + let regExp = /^\.\/.*$/; + let recursive = true; + let mode = "sync"; + switch (expr.arguments.length) { + case 4: { + const modeExpr = parser.evaluateExpression(expr.arguments[3]); + if (!modeExpr.isString()) return; + mode = modeExpr.string; + } + // falls through + case 3: { + const regExpExpr = parser.evaluateExpression(expr.arguments[2]); + if (!regExpExpr.isRegExp()) return; + regExp = regExpExpr.regExp; + } + // falls through + case 2: { + const recursiveExpr = parser.evaluateExpression(expr.arguments[1]); + if (!recursiveExpr.isBoolean()) return; + recursive = recursiveExpr.bool; + } + // falls through + case 1: { + const requestExpr = parser.evaluateExpression(expr.arguments[0]); + if (!requestExpr.isString()) return; + const dep = new RequireContextDependency( + { + request: requestExpr.string, + recursive, + regExp, + mode + }, + expr.range + ); + dep.loc = expr.loc; + dep.optional = parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; + } + } + }); } -} - -module.exports = LoaderDependency; +}; /***/ }), -/***/ 31559: +/***/ 89042: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84150,121 +80977,149 @@ module.exports = LoaderDependency; */ -const LoaderDependency = __webpack_require__(1129); -const NormalModule = __webpack_require__(25963); +const RequireContextDependency = __webpack_require__(79142); +const ContextElementDependency = __webpack_require__(89079); -/** @typedef {import("../Module")} Module */ +const RequireContextDependencyParserPlugin = __webpack_require__(10566); -/** - * @callback LoadModuleCallback - * @param {Error=} err error object - * @param {string=} source source code - * @param {object=} map source map - * @param {Module=} module loaded module if successful - */ +class RequireContextPlugin { + constructor(modulesDirectories, extensions, mainFiles) { + if (!Array.isArray(modulesDirectories)) { + throw new Error("modulesDirectories must be an array"); + } + if (!Array.isArray(extensions)) { + throw new Error("extensions must be an array"); + } + this.modulesDirectories = modulesDirectories; + this.extensions = extensions; + this.mainFiles = mainFiles; + } -class LoaderPlugin { apply(compiler) { compiler.hooks.compilation.tap( - "LoaderPlugin", - (compilation, { normalModuleFactory }) => { + "RequireContextPlugin", + (compilation, { contextModuleFactory, normalModuleFactory }) => { compilation.dependencyFactories.set( - LoaderDependency, + RequireContextDependency, + contextModuleFactory + ); + compilation.dependencyTemplates.set( + RequireContextDependency, + new RequireContextDependency.Template() + ); + + compilation.dependencyFactories.set( + ContextElementDependency, normalModuleFactory ); - } - ); - compiler.hooks.compilation.tap("LoaderPlugin", compilation => { - compilation.hooks.normalModuleLoader.tap( - "LoaderPlugin", - (loaderContext, module) => { - /** - * @param {string} request the request string to load the module from - * @param {LoadModuleCallback} callback callback returning the loaded module or error - * @returns {void} - */ - loaderContext.loadModule = (request, callback) => { - const dep = new LoaderDependency(request); - dep.loc = { - name: request - }; - const factory = compilation.dependencyFactories.get( - dep.constructor - ); - if (factory === undefined) { - return callback( - new Error( - `No module factory available for dependency type: ${dep.constructor.name}` - ) - ); - } - compilation.semaphore.release(); - compilation.addModuleDependencies( - module, - [ - { - factory, - dependencies: [dep] - } - ], - true, - "lm", - true, - err => { - compilation.semaphore.acquire(() => { - if (err) { - return callback(err); - } - if (!dep.module) { - return callback(new Error("Cannot load the module")); - } - // TODO consider removing this in webpack 5 - if (dep.module instanceof NormalModule && dep.module.error) { - return callback(dep.module.error); - } - if (!dep.module._source) { - throw new Error( - "The module created for a LoaderDependency must have a property _source" + const handler = (parser, parserOptions) => { + if ( + parserOptions.requireContext !== undefined && + !parserOptions.requireContext + ) + return; + + new RequireContextDependencyParserPlugin().apply(parser); + }; + + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("RequireContextPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("RequireContextPlugin", handler); + + contextModuleFactory.hooks.alternatives.tap( + "RequireContextPlugin", + items => { + if (items.length === 0) return items; + return items + .map(obj => { + return this.extensions + .filter(ext => { + const l = obj.request.length; + return ( + l > ext.length && + obj.request.substr(l - ext.length, l) === ext ); - } - let source, map; - const moduleSource = dep.module._source; - if (moduleSource.sourceAndMap) { - const sourceAndMap = moduleSource.sourceAndMap(); - map = sourceAndMap.map; - source = sourceAndMap.source; - } else { - map = moduleSource.map(); - source = moduleSource.source(); - } - if (dep.module.buildInfo.fileDependencies) { - for (const d of dep.module.buildInfo.fileDependencies) { - loaderContext.addDependency(d); - } - } - if (dep.module.buildInfo.contextDependencies) { - for (const d of dep.module.buildInfo.contextDependencies) { - loaderContext.addContextDependency(d); - } - } - return callback(null, source, map, dep.module); - }); + }) + .map(ext => { + const l = obj.request.length; + return { + context: obj.context, + request: obj.request.substr(0, l - ext.length) + }; + }) + .concat(obj); + }) + .reduce((a, b) => a.concat(b), []); + } + ); + + contextModuleFactory.hooks.alternatives.tap( + "RequireContextPlugin", + items => { + if (items.length === 0) return items; + return items + .map(obj => { + return this.mainFiles + .filter(mainFile => { + const l = obj.request.length; + return ( + l > mainFile.length + 1 && + obj.request.substr(l - mainFile.length - 1, l) === + "/" + mainFile + ); + }) + .map(mainFile => { + const l = obj.request.length; + return [ + { + context: obj.context, + request: obj.request.substr(0, l - mainFile.length) + }, + { + context: obj.context, + request: obj.request.substr(0, l - mainFile.length - 1) + } + ]; + }) + .reduce((a, b) => a.concat(b), []) + .concat(obj); + }) + .reduce((a, b) => a.concat(b), []); + } + ); + + contextModuleFactory.hooks.alternatives.tap( + "RequireContextPlugin", + items => { + if (items.length === 0) return items; + return items.map(obj => { + for (let i = 0; i < this.modulesDirectories.length; i++) { + const dir = this.modulesDirectories[i]; + const idx = obj.request.indexOf("./" + dir + "/"); + if (idx === 0) { + obj.request = obj.request.slice(dir.length + 3); + break; + } } - ); - }; - } - ); - }); + return obj; + }); + } + ); + } + ); } } -module.exports = LoaderPlugin; +module.exports = RequireContextPlugin; /***/ }), -/***/ 17356: -/***/ (function(module) { +/***/ 49105: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -84272,29 +81127,39 @@ module.exports = LoaderPlugin; Author Tobias Koppers @sokra */ +const AsyncDependenciesBlock = __webpack_require__(22814); +const RequireEnsureDependency = __webpack_require__(75830); -class LocalModule { - constructor(module, name, idx) { - this.module = module; - this.name = name; - this.idx = idx; - this.used = false; - } - - flagUsed() { - this.used = true; - } - - variableName() { - return "__WEBPACK_LOCAL_MODULE_" + this.idx + "__"; +module.exports = class RequireEnsureDependenciesBlock extends AsyncDependenciesBlock { + constructor( + expr, + successExpression, + errorExpression, + chunkName, + chunkNameRange, + module, + loc + ) { + super(chunkName, module, loc, null); + this.expr = expr; + const successBodyRange = + successExpression && + successExpression.body && + successExpression.body.range; + if (successBodyRange) { + this.range = [successBodyRange[0] + 1, successBodyRange[1] - 1]; + } + this.chunkNameRange = chunkNameRange; + const dep = new RequireEnsureDependency(this); + dep.loc = loc; + this.addDependency(dep); } -} -module.exports = LocalModule; +}; /***/ }), -/***/ 56570: +/***/ 24620: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84303,35 +81168,123 @@ module.exports = LocalModule; Author Tobias Koppers @sokra */ -const NullDependency = __webpack_require__(5088); -class LocalModuleDependency extends NullDependency { - constructor(localModule, range, callNew) { - super(); - localModule.flagUsed(); - this.localModule = localModule; - this.range = range; - this.callNew = callNew; - } -} +const RequireEnsureDependenciesBlock = __webpack_require__(49105); +const RequireEnsureItemDependency = __webpack_require__(5511); +const getFunctionExpression = __webpack_require__(64197); -LocalModuleDependency.Template = class LocalModuleDependencyTemplate { - apply(dep, source) { - if (!dep.range) return; - const moduleInstance = dep.callNew - ? `new (function () { return ${dep.localModule.variableName()}; })()` - : dep.localModule.variableName(); - source.replace(dep.range[0], dep.range[1] - 1, moduleInstance); +module.exports = class RequireEnsureDependenciesBlockParserPlugin { + apply(parser) { + parser.hooks.call + .for("require.ensure") + .tap("RequireEnsureDependenciesBlockParserPlugin", expr => { + let chunkName = null; + let chunkNameRange = null; + let errorExpressionArg = null; + let errorExpression = null; + switch (expr.arguments.length) { + case 4: { + const chunkNameExpr = parser.evaluateExpression(expr.arguments[3]); + if (!chunkNameExpr.isString()) return; + chunkNameRange = chunkNameExpr.range; + chunkName = chunkNameExpr.string; + } + // falls through + case 3: { + errorExpressionArg = expr.arguments[2]; + errorExpression = getFunctionExpression(errorExpressionArg); + + if (!errorExpression && !chunkName) { + const chunkNameExpr = parser.evaluateExpression( + expr.arguments[2] + ); + if (!chunkNameExpr.isString()) return; + chunkNameRange = chunkNameExpr.range; + chunkName = chunkNameExpr.string; + } + } + // falls through + case 2: { + const dependenciesExpr = parser.evaluateExpression( + expr.arguments[0] + ); + const dependenciesItems = dependenciesExpr.isArray() + ? dependenciesExpr.items + : [dependenciesExpr]; + const successExpressionArg = expr.arguments[1]; + const successExpression = getFunctionExpression( + successExpressionArg + ); + + if (successExpression) { + parser.walkExpressions(successExpression.expressions); + } + if (errorExpression) { + parser.walkExpressions(errorExpression.expressions); + } + + const dep = new RequireEnsureDependenciesBlock( + expr, + successExpression ? successExpression.fn : successExpressionArg, + errorExpression ? errorExpression.fn : errorExpressionArg, + chunkName, + chunkNameRange, + parser.state.module, + expr.loc + ); + const old = parser.state.current; + parser.state.current = dep; + try { + let failed = false; + parser.inScope([], () => { + for (const ee of dependenciesItems) { + if (ee.isString()) { + const edep = new RequireEnsureItemDependency(ee.string); + edep.loc = dep.loc; + dep.addDependency(edep); + } else { + failed = true; + } + } + }); + if (failed) { + return; + } + if (successExpression) { + if (successExpression.fn.body.type === "BlockStatement") { + parser.walkStatement(successExpression.fn.body); + } else { + parser.walkExpression(successExpression.fn.body); + } + } + old.addBlock(dep); + } finally { + parser.state.current = old; + } + if (!successExpression) { + parser.walkExpression(successExpressionArg); + } + if (errorExpression) { + if (errorExpression.fn.body.type === "BlockStatement") { + parser.walkStatement(errorExpression.fn.body); + } else { + parser.walkExpression(errorExpression.fn.body); + } + } else if (errorExpressionArg) { + parser.walkExpression(errorExpressionArg); + } + return true; + } + } + }); } }; -module.exports = LocalModuleDependency; - /***/ }), -/***/ 39658: -/***/ (function(module, exports, __webpack_require__) { +/***/ 75830: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -84339,58 +81292,64 @@ module.exports = LocalModuleDependency; Author Tobias Koppers @sokra */ +const NullDependency = __webpack_require__(5088); -const LocalModule = __webpack_require__(17356); -const LocalModulesHelpers = exports; - -const lookup = (parent, mod) => { - if (mod.charAt(0) !== ".") return mod; - - var path = parent.split("/"); - var segs = mod.split("/"); - path.pop(); - - for (let i = 0; i < segs.length; i++) { - const seg = segs[i]; - if (seg === "..") { - path.pop(); - } else if (seg !== ".") { - path.push(seg); - } +class RequireEnsureDependency extends NullDependency { + constructor(block) { + super(); + this.block = block; } - return path.join("/"); -}; - -LocalModulesHelpers.addLocalModule = (state, name) => { - if (!state.localModules) { - state.localModules = []; + get type() { + return "require.ensure"; } - const m = new LocalModule(state.module, name, state.localModules.length); - state.localModules.push(m); - return m; -}; +} -LocalModulesHelpers.getLocalModule = (state, name, namedModule) => { - if (!state.localModules) return null; - if (namedModule) { - // resolve dependency name relative to the defining named module - name = lookup(namedModule, name); - } - for (let i = 0; i < state.localModules.length; i++) { - if (state.localModules[i].name === name) { - return state.localModules[i]; +RequireEnsureDependency.Template = class RequireEnsureDependencyTemplate { + apply(dep, source, runtime) { + const depBlock = dep.block; + const promise = runtime.blockPromise({ + block: depBlock, + message: "require.ensure" + }); + const errorCallbackExists = + depBlock.expr.arguments.length === 4 || + (!depBlock.chunkName && depBlock.expr.arguments.length === 3); + const startBlock = `${promise}.then((`; + const middleBlock = ").bind(null, __webpack_require__)).catch("; + const endBlock = `).bind(null, __webpack_require__)).catch(${runtime.onError()})`; + source.replace( + depBlock.expr.range[0], + depBlock.expr.arguments[1].range[0] - 1, + startBlock + ); + if (errorCallbackExists) { + source.replace( + depBlock.expr.arguments[1].range[1], + depBlock.expr.arguments[2].range[0] - 1, + middleBlock + ); + source.replace( + depBlock.expr.arguments[2].range[1], + depBlock.expr.range[1] - 1, + ")" + ); + } else { + source.replace( + depBlock.expr.arguments[1].range[1], + depBlock.expr.range[1] - 1, + endBlock + ); } } - return null; }; -module.exports = LocalModulesHelpers; +module.exports = RequireEnsureDependency; /***/ }), -/***/ 90865: +/***/ 5511: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84399,30 +81358,28 @@ module.exports = LocalModulesHelpers; Author Tobias Koppers @sokra */ -const Dependency = __webpack_require__(57282); +const ModuleDependency = __webpack_require__(90865); +const NullDependency = __webpack_require__(5088); -class ModuleDependency extends Dependency { - /** - * @param {string} request request path which needs resolving - */ +class RequireEnsureItemDependency extends ModuleDependency { constructor(request) { - super(); - this.request = request; - this.userRequest = request; + super(request); } - getResourceIdentifier() { - return `module${this.request}`; + get type() { + return "require.ensure item"; } } -module.exports = ModuleDependency; +RequireEnsureItemDependency.Template = NullDependency.Template; + +module.exports = RequireEnsureItemDependency; /***/ }), -/***/ 63708: -/***/ (function(module) { +/***/ 98655: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -84431,47 +81388,79 @@ module.exports = ModuleDependency; */ -class ModuleDependencyTemplateAsId { - apply(dep, source, runtime) { - if (!dep.range) return; - const content = runtime.moduleId({ - module: dep.module, - request: dep.request - }); - source.replace(dep.range[0], dep.range[1] - 1, content); - } -} -module.exports = ModuleDependencyTemplateAsId; +const RequireEnsureItemDependency = __webpack_require__(5511); +const RequireEnsureDependency = __webpack_require__(75830); +const NullFactory = __webpack_require__(40438); -/***/ }), +const RequireEnsureDependenciesBlockParserPlugin = __webpack_require__(24620); -/***/ 60441: -/***/ (function(module) { +const ParserHelpers = __webpack_require__(23999); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +class RequireEnsurePlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "RequireEnsurePlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set( + RequireEnsureItemDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + RequireEnsureItemDependency, + new RequireEnsureItemDependency.Template() + ); + compilation.dependencyFactories.set( + RequireEnsureDependency, + new NullFactory() + ); + compilation.dependencyTemplates.set( + RequireEnsureDependency, + new RequireEnsureDependency.Template() + ); -class ModuleDependencyTemplateAsRequireId { - apply(dep, source, runtime) { - if (!dep.range) return; - const content = runtime.moduleExports({ - module: dep.module, - request: dep.request - }); - source.replace(dep.range[0], dep.range[1] - 1, content); + const handler = (parser, parserOptions) => { + if ( + parserOptions.requireEnsure !== undefined && + !parserOptions.requireEnsure + ) + return; + + new RequireEnsureDependenciesBlockParserPlugin().apply(parser); + parser.hooks.evaluateTypeof + .for("require.ensure") + .tap( + "RequireEnsurePlugin", + ParserHelpers.evaluateToString("function") + ); + parser.hooks.typeof + .for("require.ensure") + .tap( + "RequireEnsurePlugin", + ParserHelpers.toConstantDependency( + parser, + JSON.stringify("function") + ) + ); + }; + + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("RequireEnsurePlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("RequireEnsurePlugin", handler); + } + ); } } -module.exports = ModuleDependencyTemplateAsRequireId; +module.exports = RequireEnsurePlugin; /***/ }), -/***/ 29018: +/***/ 22928: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84480,29 +81469,32 @@ module.exports = ModuleDependencyTemplateAsRequireId; Author Tobias Koppers @sokra */ -const ModuleDependency = __webpack_require__(90865); -const ModuleDependencyTemplateAsId = __webpack_require__(63708); +const NullDependency = __webpack_require__(5088); -class ModuleHotAcceptDependency extends ModuleDependency { - constructor(request, range) { - super(request); +class RequireHeaderDependency extends NullDependency { + constructor(range) { + super(); + if (!Array.isArray(range)) throw new Error("range must be valid"); this.range = range; - this.weak = true; } +} - get type() { - return "module.hot.accept"; +RequireHeaderDependency.Template = class RequireHeaderDependencyTemplate { + apply(dep, source) { + source.replace(dep.range[0], dep.range[1] - 1, "__webpack_require__"); } -} -ModuleHotAcceptDependency.Template = ModuleDependencyTemplateAsId; + applyAsTemplateArgument(name, dep, source) { + source.replace(dep.range[0], dep.range[1] - 1, "require"); + } +}; -module.exports = ModuleHotAcceptDependency; +module.exports = RequireHeaderDependency; /***/ }), -/***/ 60482: +/***/ 58045: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84511,29 +81503,45 @@ module.exports = ModuleHotAcceptDependency; Author Tobias Koppers @sokra */ + +const DependencyReference = __webpack_require__(71722); const ModuleDependency = __webpack_require__(90865); -const ModuleDependencyTemplateAsId = __webpack_require__(63708); +const Template = __webpack_require__(96066); -class ModuleHotDeclineDependency extends ModuleDependency { +class RequireIncludeDependency extends ModuleDependency { constructor(request, range) { super(request); this.range = range; - this.weak = true; + } + + getReference() { + if (!this.module) return null; + // This doesn't use any export + return new DependencyReference(this.module, [], false); } get type() { - return "module.hot.decline"; + return "require.include"; } } -ModuleHotDeclineDependency.Template = ModuleDependencyTemplateAsId; +RequireIncludeDependency.Template = class RequireIncludeDependencyTemplate { + apply(dep, source, runtime) { + const comment = runtime.outputOptions.pathinfo + ? Template.toComment( + `require.include ${runtime.requestShortener.shorten(dep.request)}` + ) + : ""; + source.replace(dep.range[0], dep.range[1] - 1, `undefined${comment}`); + } +}; -module.exports = ModuleHotDeclineDependency; +module.exports = RequireIncludeDependency; /***/ }), -/***/ 7791: +/***/ 36330: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84542,31 +81550,29 @@ module.exports = ModuleHotDeclineDependency; Author Tobias Koppers @sokra */ -/** @typedef {import("./SingleEntryDependency")} SingleEntryDependency */ -const Dependency = __webpack_require__(57282); -class MultiEntryDependency extends Dependency { - /** - * @param {SingleEntryDependency[]} dependencies an array of SingleEntryDependencies - * @param {string} name entry name - */ - constructor(dependencies, name) { - super(); - this.dependencies = dependencies; - this.name = name; - } +const RequireIncludeDependency = __webpack_require__(58045); - get type() { - return "multi entry"; +module.exports = class RequireIncludeDependencyParserPlugin { + apply(parser) { + parser.hooks.call + .for("require.include") + .tap("RequireIncludeDependencyParserPlugin", expr => { + if (expr.arguments.length !== 1) return; + const param = parser.evaluateExpression(expr.arguments[0]); + if (!param.isString()) return; + const dep = new RequireIncludeDependency(param.string, expr.range); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + return true; + }); } -} - -module.exports = MultiEntryDependency; +}; /***/ }), -/***/ 5088: +/***/ 16522: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84575,26 +81581,67 @@ module.exports = MultiEntryDependency; Author Tobias Koppers @sokra */ -const Dependency = __webpack_require__(57282); -class NullDependency extends Dependency { - get type() { - return "null"; - } +const RequireIncludeDependency = __webpack_require__(58045); +const RequireIncludeDependencyParserPlugin = __webpack_require__(36330); - updateHash() {} -} +const ParserHelpers = __webpack_require__(23999); -NullDependency.Template = class NullDependencyTemplate { - apply() {} -}; +class RequireIncludePlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "RequireIncludePlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set( + RequireIncludeDependency, + normalModuleFactory + ); + compilation.dependencyTemplates.set( + RequireIncludeDependency, + new RequireIncludeDependency.Template() + ); -module.exports = NullDependency; + const handler = (parser, parserOptions) => { + if ( + parserOptions.requireInclude !== undefined && + !parserOptions.requireInclude + ) + return; + + new RequireIncludeDependencyParserPlugin().apply(parser); + parser.hooks.evaluateTypeof + .for("require.include") + .tap( + "RequireIncludePlugin", + ParserHelpers.evaluateToString("function") + ); + parser.hooks.typeof + .for("require.include") + .tap( + "RequireIncludePlugin", + ParserHelpers.toConstantDependency( + parser, + JSON.stringify("function") + ) + ); + }; + + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("RequireIncludePlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("RequireIncludePlugin", handler); + } + ); + } +} +module.exports = RequireIncludePlugin; /***/ }), -/***/ 14237: +/***/ 83309: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84603,24 +81650,29 @@ module.exports = NullDependency; Author Tobias Koppers @sokra */ -const ModuleDependency = __webpack_require__(90865); +const ContextDependency = __webpack_require__(11583); +const ContextDependencyTemplateAsId = __webpack_require__(6174); -class PrefetchDependency extends ModuleDependency { - constructor(request) { - super(request); +class RequireResolveContextDependency extends ContextDependency { + constructor(options, range, valueRange) { + super(options); + this.range = range; + this.valueRange = valueRange; } get type() { - return "prefetch"; + return "amd require context"; } } -module.exports = PrefetchDependency; +RequireResolveContextDependency.Template = ContextDependencyTemplateAsId; + +module.exports = RequireResolveContextDependency; /***/ }), -/***/ 79142: +/***/ 43519: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84629,28 +81681,28 @@ module.exports = PrefetchDependency; Author Tobias Koppers @sokra */ -const ContextDependency = __webpack_require__(11583); -const ModuleDependencyTemplateAsRequireId = __webpack_require__(60441); +const ModuleDependency = __webpack_require__(90865); +const ModuleDependencyAsId = __webpack_require__(63708); -class RequireContextDependency extends ContextDependency { - constructor(options, range) { - super(options); +class RequireResolveDependency extends ModuleDependency { + constructor(request, range) { + super(request); this.range = range; } get type() { - return "require.context"; + return "require.resolve"; } } -RequireContextDependency.Template = ModuleDependencyTemplateAsRequireId; +RequireResolveDependency.Template = ModuleDependencyAsId; -module.exports = RequireContextDependency; +module.exports = RequireResolveDependency; /***/ }), -/***/ 10566: +/***/ 68349: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84660,61 +81712,91 @@ module.exports = RequireContextDependency; */ -const RequireContextDependency = __webpack_require__(79142); +const RequireResolveDependency = __webpack_require__(43519); +const RequireResolveContextDependency = __webpack_require__(83309); +const RequireResolveHeaderDependency = __webpack_require__(69647); +const ContextDependencyHelpers = __webpack_require__(5594); + +class RequireResolveDependencyParserPlugin { + constructor(options) { + this.options = options; + } -module.exports = class RequireContextDependencyParserPlugin { apply(parser) { - parser.hooks.call - .for("require.context") - .tap("RequireContextDependencyParserPlugin", expr => { - let regExp = /^\.\/.*$/; - let recursive = true; - let mode = "sync"; - switch (expr.arguments.length) { - case 4: { - const modeExpr = parser.evaluateExpression(expr.arguments[3]); - if (!modeExpr.isString()) return; - mode = modeExpr.string; - } - // falls through - case 3: { - const regExpExpr = parser.evaluateExpression(expr.arguments[2]); - if (!regExpExpr.isRegExp()) return; - regExp = regExpExpr.regExp; - } - // falls through - case 2: { - const recursiveExpr = parser.evaluateExpression(expr.arguments[1]); - if (!recursiveExpr.isBoolean()) return; - recursive = recursiveExpr.bool; - } - // falls through - case 1: { - const requestExpr = parser.evaluateExpression(expr.arguments[0]); - if (!requestExpr.isString()) return; - const dep = new RequireContextDependency( - { - request: requestExpr.string, - recursive, - regExp, - mode - }, - expr.range - ); - dep.loc = expr.loc; - dep.optional = parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; + const options = this.options; + + const process = (expr, weak) => { + if (expr.arguments.length !== 1) return; + const param = parser.evaluateExpression(expr.arguments[0]); + if (param.isConditional()) { + for (const option of param.options) { + const result = processItem(expr, option, weak); + if (result === undefined) { + processContext(expr, option, weak); } } + const dep = new RequireResolveHeaderDependency(expr.callee.range); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + return true; + } else { + const result = processItem(expr, param, weak); + if (result === undefined) { + processContext(expr, param, weak); + } + const dep = new RequireResolveHeaderDependency(expr.callee.range); + dep.loc = expr.loc; + parser.state.current.addDependency(dep); + return true; + } + }; + const processItem = (expr, param, weak) => { + if (param.isString()) { + const dep = new RequireResolveDependency(param.string, param.range); + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + dep.weak = weak; + parser.state.current.addDependency(dep); + return true; + } + }; + const processContext = (expr, param, weak) => { + const dep = ContextDependencyHelpers.create( + RequireResolveContextDependency, + param.range, + param, + expr, + options, + { + mode: weak ? "weak" : "sync" + }, + parser + ); + if (!dep) return; + dep.loc = expr.loc; + dep.optional = !!parser.scope.inTry; + parser.state.current.addDependency(dep); + return true; + }; + + parser.hooks.call + .for("require.resolve") + .tap("RequireResolveDependencyParserPlugin", expr => { + return process(expr, false); + }); + parser.hooks.call + .for("require.resolveWeak") + .tap("RequireResolveDependencyParserPlugin", expr => { + return process(expr, true); }); } -}; +} +module.exports = RequireResolveDependencyParserPlugin; /***/ }), -/***/ 89042: +/***/ 69647: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84723,149 +81805,32 @@ module.exports = class RequireContextDependencyParserPlugin { Author Tobias Koppers @sokra */ +const NullDependency = __webpack_require__(5088); -const RequireContextDependency = __webpack_require__(79142); -const ContextElementDependency = __webpack_require__(89079); - -const RequireContextDependencyParserPlugin = __webpack_require__(10566); - -class RequireContextPlugin { - constructor(modulesDirectories, extensions, mainFiles) { - if (!Array.isArray(modulesDirectories)) { - throw new Error("modulesDirectories must be an array"); - } - if (!Array.isArray(extensions)) { - throw new Error("extensions must be an array"); - } - this.modulesDirectories = modulesDirectories; - this.extensions = extensions; - this.mainFiles = mainFiles; +class RequireResolveHeaderDependency extends NullDependency { + constructor(range) { + super(); + if (!Array.isArray(range)) throw new Error("range must be valid"); + this.range = range; } +} - apply(compiler) { - compiler.hooks.compilation.tap( - "RequireContextPlugin", - (compilation, { contextModuleFactory, normalModuleFactory }) => { - compilation.dependencyFactories.set( - RequireContextDependency, - contextModuleFactory - ); - compilation.dependencyTemplates.set( - RequireContextDependency, - new RequireContextDependency.Template() - ); - - compilation.dependencyFactories.set( - ContextElementDependency, - normalModuleFactory - ); - - const handler = (parser, parserOptions) => { - if ( - parserOptions.requireContext !== undefined && - !parserOptions.requireContext - ) - return; - - new RequireContextDependencyParserPlugin().apply(parser); - }; - - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("RequireContextPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("RequireContextPlugin", handler); - - contextModuleFactory.hooks.alternatives.tap( - "RequireContextPlugin", - items => { - if (items.length === 0) return items; - return items - .map(obj => { - return this.extensions - .filter(ext => { - const l = obj.request.length; - return ( - l > ext.length && - obj.request.substr(l - ext.length, l) === ext - ); - }) - .map(ext => { - const l = obj.request.length; - return { - context: obj.context, - request: obj.request.substr(0, l - ext.length) - }; - }) - .concat(obj); - }) - .reduce((a, b) => a.concat(b), []); - } - ); - - contextModuleFactory.hooks.alternatives.tap( - "RequireContextPlugin", - items => { - if (items.length === 0) return items; - return items - .map(obj => { - return this.mainFiles - .filter(mainFile => { - const l = obj.request.length; - return ( - l > mainFile.length + 1 && - obj.request.substr(l - mainFile.length - 1, l) === - "/" + mainFile - ); - }) - .map(mainFile => { - const l = obj.request.length; - return [ - { - context: obj.context, - request: obj.request.substr(0, l - mainFile.length) - }, - { - context: obj.context, - request: obj.request.substr(0, l - mainFile.length - 1) - } - ]; - }) - .reduce((a, b) => a.concat(b), []) - .concat(obj); - }) - .reduce((a, b) => a.concat(b), []); - } - ); +RequireResolveHeaderDependency.Template = class RequireResolveHeaderDependencyTemplate { + apply(dep, source) { + source.replace(dep.range[0], dep.range[1] - 1, "/*require.resolve*/"); + } - contextModuleFactory.hooks.alternatives.tap( - "RequireContextPlugin", - items => { - if (items.length === 0) return items; - return items.map(obj => { - for (let i = 0; i < this.modulesDirectories.length; i++) { - const dir = this.modulesDirectories[i]; - const idx = obj.request.indexOf("./" + dir + "/"); - if (idx === 0) { - obj.request = obj.request.slice(dir.length + 3); - break; - } - } - return obj; - }); - } - ); - } - ); + applyAsTemplateArgument(name, dep, source) { + source.replace(dep.range[0], dep.range[1] - 1, "/*require.resolve*/"); } -} -module.exports = RequireContextPlugin; +}; + +module.exports = RequireResolveHeaderDependency; /***/ }), -/***/ 49105: +/***/ 84828: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84874,39 +81839,27 @@ module.exports = RequireContextPlugin; Author Tobias Koppers @sokra */ -const AsyncDependenciesBlock = __webpack_require__(22814); -const RequireEnsureDependency = __webpack_require__(75830); +const ModuleDependency = __webpack_require__(90865); -module.exports = class RequireEnsureDependenciesBlock extends AsyncDependenciesBlock { - constructor( - expr, - successExpression, - errorExpression, - chunkName, - chunkNameRange, - module, - loc - ) { - super(chunkName, module, loc, null); - this.expr = expr; - const successBodyRange = - successExpression && - successExpression.body && - successExpression.body.range; - if (successBodyRange) { - this.range = [successBodyRange[0] + 1, successBodyRange[1] - 1]; - } - this.chunkNameRange = chunkNameRange; - const dep = new RequireEnsureDependency(this); - dep.loc = loc; - this.addDependency(dep); +class SingleEntryDependency extends ModuleDependency { + /** + * @param {string} request request path for entry + */ + constructor(request) { + super(request); } -}; + + get type() { + return "single entry"; + } +} + +module.exports = SingleEntryDependency; /***/ }), -/***/ 24620: +/***/ 68166: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84916,121 +81869,127 @@ module.exports = class RequireEnsureDependenciesBlock extends AsyncDependenciesB */ -const RequireEnsureDependenciesBlock = __webpack_require__(49105); -const RequireEnsureItemDependency = __webpack_require__(5511); -const getFunctionExpression = __webpack_require__(64197); +const ParserHelpers = __webpack_require__(23999); +const WebpackError = __webpack_require__(97391); -module.exports = class RequireEnsureDependenciesBlockParserPlugin { - apply(parser) { - parser.hooks.call - .for("require.ensure") - .tap("RequireEnsureDependenciesBlockParserPlugin", expr => { - let chunkName = null; - let chunkNameRange = null; - let errorExpressionArg = null; - let errorExpression = null; - switch (expr.arguments.length) { - case 4: { - const chunkNameExpr = parser.evaluateExpression(expr.arguments[3]); - if (!chunkNameExpr.isString()) return; - chunkNameRange = chunkNameExpr.range; - chunkName = chunkNameExpr.string; - } - // falls through - case 3: { - errorExpressionArg = expr.arguments[2]; - errorExpression = getFunctionExpression(errorExpressionArg); +class SystemPlugin { + constructor(options) { + this.options = options; + } - if (!errorExpression && !chunkName) { - const chunkNameExpr = parser.evaluateExpression( - expr.arguments[2] + apply(compiler) { + compiler.hooks.compilation.tap( + "SystemPlugin", + (compilation, { normalModuleFactory }) => { + const handler = (parser, parserOptions) => { + if (parserOptions.system !== undefined && !parserOptions.system) + return; + + const shouldWarn = parserOptions.system === undefined; + + const setNotSupported = name => { + parser.hooks.evaluateTypeof + .for(name) + .tap("SystemPlugin", ParserHelpers.evaluateToString("undefined")); + parser.hooks.expression + .for(name) + .tap( + "SystemPlugin", + ParserHelpers.expressionIsUnsupported( + parser, + name + " is not supported by webpack." + ) ); - if (!chunkNameExpr.isString()) return; - chunkNameRange = chunkNameExpr.range; - chunkName = chunkNameExpr.string; - } - } - // falls through - case 2: { - const dependenciesExpr = parser.evaluateExpression( - expr.arguments[0] + }; + + parser.hooks.typeof + .for("System.import") + .tap( + "SystemPlugin", + ParserHelpers.toConstantDependency( + parser, + JSON.stringify("function") + ) ); - const dependenciesItems = dependenciesExpr.isArray() - ? dependenciesExpr.items - : [dependenciesExpr]; - const successExpressionArg = expr.arguments[1]; - const successExpression = getFunctionExpression( - successExpressionArg + parser.hooks.evaluateTypeof + .for("System.import") + .tap("SystemPlugin", ParserHelpers.evaluateToString("function")); + parser.hooks.typeof + .for("System") + .tap( + "SystemPlugin", + ParserHelpers.toConstantDependency( + parser, + JSON.stringify("object") + ) ); + parser.hooks.evaluateTypeof + .for("System") + .tap("SystemPlugin", ParserHelpers.evaluateToString("object")); - if (successExpression) { - parser.walkExpressions(successExpression.expressions); - } - if (errorExpression) { - parser.walkExpressions(errorExpression.expressions); - } + setNotSupported("System.set"); + setNotSupported("System.get"); + setNotSupported("System.register"); - const dep = new RequireEnsureDependenciesBlock( - expr, - successExpression ? successExpression.fn : successExpressionArg, - errorExpression ? errorExpression.fn : errorExpressionArg, - chunkName, - chunkNameRange, - parser.state.module, - expr.loc + parser.hooks.expression.for("System").tap("SystemPlugin", () => { + const systemPolyfillRequire = ParserHelpers.requireFileAsExpression( + parser.state.module.context, + __webpack_require__.ab + "system.js" ); - const old = parser.state.current; - parser.state.current = dep; - try { - let failed = false; - parser.inScope([], () => { - for (const ee of dependenciesItems) { - if (ee.isString()) { - const edep = new RequireEnsureItemDependency(ee.string); - edep.loc = dep.loc; - dep.addDependency(edep); - } else { - failed = true; - } - } - }); - if (failed) { - return; - } - if (successExpression) { - if (successExpression.fn.body.type === "BlockStatement") { - parser.walkStatement(successExpression.fn.body); - } else { - parser.walkExpression(successExpression.fn.body); - } - } - old.addBlock(dep); - } finally { - parser.state.current = old; - } - if (!successExpression) { - parser.walkExpression(successExpressionArg); - } - if (errorExpression) { - if (errorExpression.fn.body.type === "BlockStatement") { - parser.walkStatement(errorExpression.fn.body); - } else { - parser.walkExpression(errorExpression.fn.body); - } - } else if (errorExpressionArg) { - parser.walkExpression(errorExpressionArg); + return ParserHelpers.addParsedVariableToModule( + parser, + "System", + systemPolyfillRequire + ); + }); + + parser.hooks.call.for("System.import").tap("SystemPlugin", expr => { + if (shouldWarn) { + parser.state.module.warnings.push( + new SystemImportDeprecationWarning( + parser.state.module, + expr.loc + ) + ); } - return true; - } - } - }); + + return parser.hooks.importCall.call(expr); + }); + }; + + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("SystemPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("SystemPlugin", handler); + } + ); } -}; +} + +class SystemImportDeprecationWarning extends WebpackError { + constructor(module, loc) { + super( + "System.import() is deprecated and will be removed soon. Use import() instead.\n" + + "For more info visit https://webpack.js.org/guides/code-splitting/" + ); + + this.name = "SystemImportDeprecationWarning"; + + this.module = module; + this.loc = loc; + + Error.captureStackTrace(this, this.constructor); + } +} + +module.exports = SystemPlugin; /***/ }), -/***/ 75830: +/***/ 15826: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85040,63 +81999,32 @@ module.exports = class RequireEnsureDependenciesBlockParserPlugin { */ const NullDependency = __webpack_require__(5088); +const webpackMissingModule = __webpack_require__(75386).module; -class RequireEnsureDependency extends NullDependency { - constructor(block) { +class UnsupportedDependency extends NullDependency { + constructor(request, range) { super(); - this.block = block; - } - - get type() { - return "require.ensure"; + this.request = request; + this.range = range; } } -RequireEnsureDependency.Template = class RequireEnsureDependencyTemplate { +UnsupportedDependency.Template = class UnsupportedDependencyTemplate { apply(dep, source, runtime) { - const depBlock = dep.block; - const promise = runtime.blockPromise({ - block: depBlock, - message: "require.ensure" - }); - const errorCallbackExists = - depBlock.expr.arguments.length === 4 || - (!depBlock.chunkName && depBlock.expr.arguments.length === 3); - const startBlock = `${promise}.then((`; - const middleBlock = ").bind(null, __webpack_require__)).catch("; - const endBlock = `).bind(null, __webpack_require__)).catch(${runtime.onError()})`; source.replace( - depBlock.expr.range[0], - depBlock.expr.arguments[1].range[0] - 1, - startBlock + dep.range[0], + dep.range[1], + webpackMissingModule(dep.request) ); - if (errorCallbackExists) { - source.replace( - depBlock.expr.arguments[1].range[1], - depBlock.expr.arguments[2].range[0] - 1, - middleBlock - ); - source.replace( - depBlock.expr.arguments[2].range[1], - depBlock.expr.range[1] - 1, - ")" - ); - } else { - source.replace( - depBlock.expr.arguments[1].range[1], - depBlock.expr.range[1] - 1, - endBlock - ); - } } }; -module.exports = RequireEnsureDependency; +module.exports = UnsupportedDependency; /***/ }), -/***/ 5511: +/***/ 18925: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85105,27 +82033,37 @@ module.exports = RequireEnsureDependency; Author Tobias Koppers @sokra */ + +const DependencyReference = __webpack_require__(71722); const ModuleDependency = __webpack_require__(90865); -const NullDependency = __webpack_require__(5088); -class RequireEnsureItemDependency extends ModuleDependency { - constructor(request) { +class WebAssemblyExportImportedDependency extends ModuleDependency { + constructor(exportName, request, name, valueType) { super(request); + /** @type {string} */ + this.exportName = exportName; + /** @type {string} */ + this.name = name; + /** @type {string} */ + this.valueType = valueType; + } + + getReference() { + if (!this.module) return null; + return new DependencyReference(this.module, [this.name], false); } get type() { - return "require.ensure item"; + return "wasm export import"; } } -RequireEnsureItemDependency.Template = NullDependency.Template; - -module.exports = RequireEnsureItemDependency; +module.exports = WebAssemblyExportImportedDependency; /***/ }), -/***/ 98655: +/***/ 52959: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85135,80 +82073,60 @@ module.exports = RequireEnsureItemDependency; */ -const RequireEnsureItemDependency = __webpack_require__(5511); -const RequireEnsureDependency = __webpack_require__(75830); +const DependencyReference = __webpack_require__(71722); +const ModuleDependency = __webpack_require__(90865); +const UnsupportedWebAssemblyFeatureError = __webpack_require__(43101); -const NullFactory = __webpack_require__(40438); +/** @typedef {import("@webassemblyjs/ast").ModuleImportDescription} ModuleImportDescription */ -const RequireEnsureDependenciesBlockParserPlugin = __webpack_require__(24620); +class WebAssemblyImportDependency extends ModuleDependency { + /** + * @param {string} request the request + * @param {string} name the imported name + * @param {ModuleImportDescription} description the WASM ast node + * @param {false | string} onlyDirectImport if only direct imports are allowed + */ + constructor(request, name, description, onlyDirectImport) { + super(request); + /** @type {string} */ + this.name = name; + /** @type {ModuleImportDescription} */ + this.description = description; + /** @type {false | string} */ + this.onlyDirectImport = onlyDirectImport; + } -const ParserHelpers = __webpack_require__(23999); + getReference() { + if (!this.module) return null; + return new DependencyReference(this.module, [this.name], false); + } -class RequireEnsurePlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "RequireEnsurePlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set( - RequireEnsureItemDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - RequireEnsureItemDependency, - new RequireEnsureItemDependency.Template() - ); - - compilation.dependencyFactories.set( - RequireEnsureDependency, - new NullFactory() - ); - compilation.dependencyTemplates.set( - RequireEnsureDependency, - new RequireEnsureDependency.Template() - ); - - const handler = (parser, parserOptions) => { - if ( - parserOptions.requireEnsure !== undefined && - !parserOptions.requireEnsure - ) - return; - - new RequireEnsureDependenciesBlockParserPlugin().apply(parser); - parser.hooks.evaluateTypeof - .for("require.ensure") - .tap( - "RequireEnsurePlugin", - ParserHelpers.evaluateToString("function") - ); - parser.hooks.typeof - .for("require.ensure") - .tap( - "RequireEnsurePlugin", - ParserHelpers.toConstantDependency( - parser, - JSON.stringify("function") - ) - ); - }; + getErrors() { + if ( + this.onlyDirectImport && + this.module && + !this.module.type.startsWith("webassembly") + ) { + return [ + new UnsupportedWebAssemblyFeatureError( + `Import "${this.name}" from "${this.request}" with ${this.onlyDirectImport} can only be used for direct wasm to wasm dependencies` + ) + ]; + } + } - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("RequireEnsurePlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("RequireEnsurePlugin", handler); - } - ); + get type() { + return "wasm import"; } } -module.exports = RequireEnsurePlugin; + +module.exports = WebAssemblyImportDependency; /***/ }), -/***/ 22928: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 75386: +/***/ (function(__unused_webpack_module, exports) { "use strict"; /* @@ -85216,80 +82134,86 @@ module.exports = RequireEnsurePlugin; Author Tobias Koppers @sokra */ -const NullDependency = __webpack_require__(5088); - -class RequireHeaderDependency extends NullDependency { - constructor(range) { - super(); - if (!Array.isArray(range)) throw new Error("range must be valid"); - this.range = range; - } -} +const toErrorCode = err => + `var e = new Error(${JSON.stringify(err)}); e.code = 'MODULE_NOT_FOUND';`; -RequireHeaderDependency.Template = class RequireHeaderDependencyTemplate { - apply(dep, source) { - source.replace(dep.range[0], dep.range[1] - 1, "__webpack_require__"); - } +exports.module = request => + `!(function webpackMissingModule() { ${exports.moduleCode(request)} }())`; - applyAsTemplateArgument(name, dep, source) { - source.replace(dep.range[0], dep.range[1] - 1, "require"); - } +exports.promise = request => { + const errorCode = toErrorCode(`Cannot find module '${request}'`); + return `Promise.reject(function webpackMissingModule() { ${errorCode} return e; }())`; }; -module.exports = RequireHeaderDependency; +exports.moduleCode = request => { + const errorCode = toErrorCode(`Cannot find module '${request}'`); + return `${errorCode} throw e;`; +}; /***/ }), -/***/ 58045: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 64197: +/***/ (function(module) { -"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ - - -const DependencyReference = __webpack_require__(71722); -const ModuleDependency = __webpack_require__(90865); -const Template = __webpack_require__(96066); - -class RequireIncludeDependency extends ModuleDependency { - constructor(request, range) { - super(request); - this.range = range; - } - - getReference() { - if (!this.module) return null; - // This doesn't use any export - return new DependencyReference(this.module, [], false); +module.exports = expr => { + // + if ( + expr.type === "FunctionExpression" || + expr.type === "ArrowFunctionExpression" + ) { + return { + fn: expr, + expressions: [], + needThis: false + }; } - get type() { - return "require.include"; + // .bind() + if ( + expr.type === "CallExpression" && + expr.callee.type === "MemberExpression" && + expr.callee.object.type === "FunctionExpression" && + expr.callee.property.type === "Identifier" && + expr.callee.property.name === "bind" && + expr.arguments.length === 1 + ) { + return { + fn: expr.callee.object, + expressions: [expr.arguments[0]], + needThis: undefined + }; } -} - -RequireIncludeDependency.Template = class RequireIncludeDependencyTemplate { - apply(dep, source, runtime) { - const comment = runtime.outputOptions.pathinfo - ? Template.toComment( - `require.include ${runtime.requestShortener.shorten(dep.request)}` - ) - : ""; - source.replace(dep.range[0], dep.range[1] - 1, `undefined${comment}`); + // (function(_this) {return })(this) (Coffeescript) + if ( + expr.type === "CallExpression" && + expr.callee.type === "FunctionExpression" && + expr.callee.body.type === "BlockStatement" && + expr.arguments.length === 1 && + expr.arguments[0].type === "ThisExpression" && + expr.callee.body.body && + expr.callee.body.body.length === 1 && + expr.callee.body.body[0].type === "ReturnStatement" && + expr.callee.body.body[0].argument && + expr.callee.body.body[0].argument.type === "FunctionExpression" + ) { + return { + fn: expr.callee.body.body[0].argument, + expressions: [], + needThis: true + }; } }; -module.exports = RequireIncludeDependency; - /***/ }), -/***/ 36330: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 49: +/***/ (function(module) { "use strict"; /* @@ -85298,158 +82222,216 @@ module.exports = RequireIncludeDependency; */ -const RequireIncludeDependency = __webpack_require__(58045); -module.exports = class RequireIncludeDependencyParserPlugin { - apply(parser) { - parser.hooks.call - .for("require.include") - .tap("RequireIncludeDependencyParserPlugin", expr => { - if (expr.arguments.length !== 1) return; - const param = parser.evaluateExpression(expr.arguments[0]); - if (!param.isString()) return; - const dep = new RequireIncludeDependency(param.string, expr.range); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - return true; - }); +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("./Dependency").SourcePosition} SourcePosition */ + +// TODO webpack 5: pos must be SourcePosition +/** + * @param {SourcePosition|DependencyLocation|string} pos position + * @returns {string} formatted position + */ +const formatPosition = pos => { + if (pos === null) return ""; + // TODO webpack 5: Simplify this + if (typeof pos === "string") return pos; + if (typeof pos === "number") return `${pos}`; + if (typeof pos === "object") { + if ("line" in pos && "column" in pos) { + return `${pos.line}:${pos.column}`; + } else if ("line" in pos) { + return `${pos.line}:?`; + } else if ("index" in pos) { + // TODO webpack 5 remove this case + return `+${pos.index}`; + } else { + return ""; + } + } + return ""; +}; + +// TODO webpack 5: loc must be DependencyLocation +/** + * @param {DependencyLocation|SourcePosition|string} loc location + * @returns {string} formatted location + */ +const formatLocation = loc => { + if (loc === null) return ""; + // TODO webpack 5: Simplify this + if (typeof loc === "string") return loc; + if (typeof loc === "number") return `${loc}`; + if (typeof loc === "object") { + if ("start" in loc && loc.start && "end" in loc && loc.end) { + if ( + typeof loc.start === "object" && + typeof loc.start.line === "number" && + typeof loc.end === "object" && + typeof loc.end.line === "number" && + typeof loc.end.column === "number" && + loc.start.line === loc.end.line + ) { + return `${formatPosition(loc.start)}-${loc.end.column}`; + } else { + return `${formatPosition(loc.start)}-${formatPosition(loc.end)}`; + } + } + if ("start" in loc && loc.start) { + return formatPosition(loc.start); + } + if ("name" in loc && "index" in loc) { + return `${loc.name}[${loc.index}]`; + } + if ("name" in loc) { + return loc.name; + } + return formatPosition(loc); } + return ""; }; +module.exports = formatLocation; + /***/ }), -/***/ 16522: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 47194: +/***/ (function(__unused_webpack_module, exports) { "use strict"; /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ -const RequireIncludeDependency = __webpack_require__(58045); -const RequireIncludeDependencyParserPlugin = __webpack_require__(36330); -const ParserHelpers = __webpack_require__(23999); +const LogType = Object.freeze({ + error: /** @type {"error"} */ ("error"), // message, c style arguments + warn: /** @type {"warn"} */ ("warn"), // message, c style arguments + info: /** @type {"info"} */ ("info"), // message, c style arguments + log: /** @type {"log"} */ ("log"), // message, c style arguments + debug: /** @type {"debug"} */ ("debug"), // message, c style arguments -class RequireIncludePlugin { - apply(compiler) { - compiler.hooks.compilation.tap( - "RequireIncludePlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set( - RequireIncludeDependency, - normalModuleFactory - ); - compilation.dependencyTemplates.set( - RequireIncludeDependency, - new RequireIncludeDependency.Template() - ); + trace: /** @type {"trace"} */ ("trace"), // no arguments - const handler = (parser, parserOptions) => { - if ( - parserOptions.requireInclude !== undefined && - !parserOptions.requireInclude - ) - return; + group: /** @type {"group"} */ ("group"), // [label] + groupCollapsed: /** @type {"groupCollapsed"} */ ("groupCollapsed"), // [label] + groupEnd: /** @type {"groupEnd"} */ ("groupEnd"), // [label] - new RequireIncludeDependencyParserPlugin().apply(parser); - parser.hooks.evaluateTypeof - .for("require.include") - .tap( - "RequireIncludePlugin", - ParserHelpers.evaluateToString("function") - ); - parser.hooks.typeof - .for("require.include") - .tap( - "RequireIncludePlugin", - ParserHelpers.toConstantDependency( - parser, - JSON.stringify("function") - ) - ); - }; + profile: /** @type {"profile"} */ ("profile"), // [profileName] + profileEnd: /** @type {"profileEnd"} */ ("profileEnd"), // [profileName] - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("RequireIncludePlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("RequireIncludePlugin", handler); - } - ); + time: /** @type {"time"} */ ("time"), // name, time as [seconds, nanoseconds] + + clear: /** @type {"clear"} */ ("clear"), // no arguments + status: /** @type {"status"} */ ("status") // message, arguments +}); + +exports.LogType = LogType; + +/** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */ + +const LOG_SYMBOL = Symbol("webpack logger raw log method"); +const TIMERS_SYMBOL = Symbol("webpack logger times"); + +class WebpackLogger { + /** + * @param {function(LogTypeEnum, any[]=): void} log log function + */ + constructor(log) { + this[LOG_SYMBOL] = log; } -} -module.exports = RequireIncludePlugin; + error(...args) { + this[LOG_SYMBOL](LogType.error, args); + } -/***/ }), + warn(...args) { + this[LOG_SYMBOL](LogType.warn, args); + } -/***/ 83309: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + info(...args) { + this[LOG_SYMBOL](LogType.info, args); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + log(...args) { + this[LOG_SYMBOL](LogType.log, args); + } -const ContextDependency = __webpack_require__(11583); -const ContextDependencyTemplateAsId = __webpack_require__(6174); + debug(...args) { + this[LOG_SYMBOL](LogType.debug, args); + } -class RequireResolveContextDependency extends ContextDependency { - constructor(options, range, valueRange) { - super(options); - this.range = range; - this.valueRange = valueRange; + assert(assertion, ...args) { + if (!assertion) { + this[LOG_SYMBOL](LogType.error, args); + } } - get type() { - return "amd require context"; + trace() { + this[LOG_SYMBOL](LogType.trace, ["Trace"]); } -} -RequireResolveContextDependency.Template = ContextDependencyTemplateAsId; + clear() { + this[LOG_SYMBOL](LogType.clear); + } -module.exports = RequireResolveContextDependency; + status(...args) { + this[LOG_SYMBOL](LogType.status, args); + } + group(...args) { + this[LOG_SYMBOL](LogType.group, args); + } -/***/ }), + groupCollapsed(...args) { + this[LOG_SYMBOL](LogType.groupCollapsed, args); + } -/***/ 43519: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + groupEnd(...args) { + this[LOG_SYMBOL](LogType.groupEnd, args); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + profile(label) { + this[LOG_SYMBOL](LogType.profile, [label]); + } -const ModuleDependency = __webpack_require__(90865); -const ModuleDependencyAsId = __webpack_require__(63708); + profileEnd(label) { + this[LOG_SYMBOL](LogType.profileEnd, [label]); + } -class RequireResolveDependency extends ModuleDependency { - constructor(request, range) { - super(request); - this.range = range; + time(label) { + this[TIMERS_SYMBOL] = this[TIMERS_SYMBOL] || new Map(); + this[TIMERS_SYMBOL].set(label, process.hrtime()); } - get type() { - return "require.resolve"; + timeLog(label) { + const prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); + if (!prev) { + throw new Error(`No such label '${label}' for WebpackLogger.timeLog()`); + } + const time = process.hrtime(prev); + this[LOG_SYMBOL](LogType.time, [label, ...time]); } -} -RequireResolveDependency.Template = ModuleDependencyAsId; + timeEnd(label) { + const prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); + if (!prev) { + throw new Error(`No such label '${label}' for WebpackLogger.timeEnd()`); + } + const time = process.hrtime(prev); + this[TIMERS_SYMBOL].delete(label); + this[LOG_SYMBOL](LogType.time, [label, ...time]); + } +} -module.exports = RequireResolveDependency; +exports.Logger = WebpackLogger; /***/ }), -/***/ 68349: +/***/ 88838: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85459,125 +82441,299 @@ module.exports = RequireResolveDependency; */ -const RequireResolveDependency = __webpack_require__(43519); -const RequireResolveContextDependency = __webpack_require__(83309); -const RequireResolveHeaderDependency = __webpack_require__(69647); -const ContextDependencyHelpers = __webpack_require__(5594); -class RequireResolveDependencyParserPlugin { - constructor(options) { - this.options = options; - } +const { LogType } = __webpack_require__(47194); - apply(parser) { - const options = this.options; +/** @typedef {import("./Logger").LogTypeEnum} LogTypeEnum */ +/** @typedef {import("../../declarations/WebpackOptions").FilterTypes} FilterTypes */ +/** @typedef {import("../../declarations/WebpackOptions").FilterItemTypes} FilterItemTypes */ - const process = (expr, weak) => { - if (expr.arguments.length !== 1) return; - const param = parser.evaluateExpression(expr.arguments[0]); - if (param.isConditional()) { - for (const option of param.options) { - const result = processItem(expr, option, weak); - if (result === undefined) { - processContext(expr, option, weak); - } - } - const dep = new RequireResolveHeaderDependency(expr.callee.range); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - return true; - } else { - const result = processItem(expr, param, weak); - if (result === undefined) { - processContext(expr, param, weak); - } - const dep = new RequireResolveHeaderDependency(expr.callee.range); - dep.loc = expr.loc; - parser.state.current.addDependency(dep); - return true; - } - }; - const processItem = (expr, param, weak) => { - if (param.isString()) { - const dep = new RequireResolveDependency(param.string, param.range); - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - dep.weak = weak; - parser.state.current.addDependency(dep); - return true; - } - }; - const processContext = (expr, param, weak) => { - const dep = ContextDependencyHelpers.create( - RequireResolveContextDependency, - param.range, - param, - expr, - options, - { - mode: weak ? "weak" : "sync" - }, - parser - ); - if (!dep) return; - dep.loc = expr.loc; - dep.optional = !!parser.scope.inTry; - parser.state.current.addDependency(dep); - return true; - }; +/** @typedef {function(string): boolean} FilterFunction */ - parser.hooks.call - .for("require.resolve") - .tap("RequireResolveDependencyParserPlugin", expr => { - return process(expr, false); - }); - parser.hooks.call - .for("require.resolveWeak") - .tap("RequireResolveDependencyParserPlugin", expr => { - return process(expr, true); - }); +/** + * @typedef {Object} LoggerOptions + * @property {false|true|"none"|"error"|"warn"|"info"|"log"|"verbose"} level loglevel + * @property {FilterTypes|boolean} debug filter for debug logging + * @property {Console & { status?: Function, logTime?: Function }} console the console to log to + */ + +/** + * @param {FilterItemTypes} item an input item + * @returns {FilterFunction} filter funtion + */ +const filterToFunction = item => { + if (typeof item === "string") { + const regExp = new RegExp( + `[\\\\/]${item.replace( + // eslint-disable-next-line no-useless-escape + /[-[\]{}()*+?.\\^$|]/g, + "\\$&" + )}([\\\\/]|$|!|\\?)` + ); + return ident => regExp.test(ident); } -} -module.exports = RequireResolveDependencyParserPlugin; + if (item && typeof item === "object" && typeof item.test === "function") { + return ident => item.test(ident); + } + if (typeof item === "function") { + return item; + } + if (typeof item === "boolean") { + return () => item; + } +}; + +/** + * @enum {number} + */ +const LogLevel = { + none: 6, + false: 6, + error: 5, + warn: 4, + info: 3, + log: 2, + true: 2, + verbose: 1 +}; + +/** + * @param {LoggerOptions} options options object + * @returns {function(string, LogTypeEnum, any[]): void} logging function + */ +module.exports = ({ level = "info", debug = false, console }) => { + const debugFilters = + typeof debug === "boolean" + ? [() => debug] + : /** @type {FilterItemTypes[]} */ ([]) + .concat(debug) + .map(filterToFunction); + /** @type {number} */ + const loglevel = LogLevel[`${level}`] || 0; + + /** + * @param {string} name name of the logger + * @param {LogTypeEnum} type type of the log entry + * @param {any[]} args arguments of the log entry + * @returns {void} + */ + const logger = (name, type, args) => { + const labeledArgs = () => { + if (Array.isArray(args)) { + if (args.length > 0 && typeof args[0] === "string") { + return [`[${name}] ${args[0]}`, ...args.slice(1)]; + } else { + return [`[${name}]`, ...args]; + } + } else { + return []; + } + }; + const debug = debugFilters.some(f => f(name)); + switch (type) { + case LogType.debug: + if (!debug) return; + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.debug === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.debug(...labeledArgs()); + } else { + console.log(...labeledArgs()); + } + break; + case LogType.log: + if (!debug && loglevel > LogLevel.log) return; + console.log(...labeledArgs()); + break; + case LogType.info: + if (!debug && loglevel > LogLevel.info) return; + console.info(...labeledArgs()); + break; + case LogType.warn: + if (!debug && loglevel > LogLevel.warn) return; + console.warn(...labeledArgs()); + break; + case LogType.error: + if (!debug && loglevel > LogLevel.error) return; + console.error(...labeledArgs()); + break; + case LogType.trace: + if (!debug) return; + console.trace(); + break; + case LogType.groupCollapsed: + if (!debug && loglevel > LogLevel.log) return; + if (!debug && loglevel > LogLevel.verbose) { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.groupCollapsed === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.groupCollapsed(...labeledArgs()); + } else { + console.log(...labeledArgs()); + } + break; + } + // falls through + case LogType.group: + if (!debug && loglevel > LogLevel.log) return; + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.group === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.group(...labeledArgs()); + } else { + console.log(...labeledArgs()); + } + break; + case LogType.groupEnd: + if (!debug && loglevel > LogLevel.log) return; + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.groupEnd === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.groupEnd(); + } + break; + case LogType.time: { + if (!debug && loglevel > LogLevel.log) return; + const ms = args[1] * 1000 + args[2] / 1000000; + const msg = `[${name}] ${args[0]}: ${ms}ms`; + if (typeof console.logTime === "function") { + console.logTime(msg); + } else { + console.log(msg); + } + break; + } + case LogType.profile: + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.profile === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.profile(...labeledArgs()); + } + break; + case LogType.profileEnd: + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.profileEnd === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.profileEnd(...labeledArgs()); + } + break; + case LogType.clear: + if (!debug && loglevel > LogLevel.log) return; + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.clear === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.clear(); + } + break; + case LogType.status: + if (!debug && loglevel > LogLevel.info) return; + if (typeof console.status === "function") { + if (args.length === 0) { + console.status(); + } else { + console.status(...labeledArgs()); + } + } else { + if (args.length !== 0) { + console.info(...labeledArgs()); + } + } + break; + default: + throw new Error(`Unexpected LogType ${type}`); + } + }; + return logger; +}; /***/ }), -/***/ 69647: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 62299: +/***/ (function(module) { "use strict"; /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ -const NullDependency = __webpack_require__(5088); -class RequireResolveHeaderDependency extends NullDependency { - constructor(range) { - super(); - if (!Array.isArray(range)) throw new Error("range must be valid"); - this.range = range; + +/** + * @param {any[]} args items to be truncated + * @param {number} maxLength maximum length of args including spaces between + * @returns {string[]} truncated args + */ +const truncateArgs = (args, maxLength) => { + const lengths = args.map(a => `${a}`.length); + const availableLength = maxLength - lengths.length + 1; + + if (availableLength > 0 && args.length === 1) { + if (availableLength >= args[0].length) { + return args; + } else if (availableLength > 3) { + return ["..." + args[0].slice(-availableLength + 3)]; + } else { + return [args[0].slice(-availableLength)]; + } } -} -RequireResolveHeaderDependency.Template = class RequireResolveHeaderDependencyTemplate { - apply(dep, source) { - source.replace(dep.range[0], dep.range[1] - 1, "/*require.resolve*/"); + // Check if there is space for at least 4 chars per arg + if (availableLength < lengths.reduce((s, i) => s + Math.min(i, 6), 0)) { + // remove args + if (args.length > 1) + return truncateArgs(args.slice(0, args.length - 1), maxLength); + return []; } - applyAsTemplateArgument(name, dep, source) { - source.replace(dep.range[0], dep.range[1] - 1, "/*require.resolve*/"); + let currentLength = lengths.reduce((a, b) => a + b, 0); + + // Check if all fits into maxLength + if (currentLength <= availableLength) return args; + + // Try to remove chars from the longest items until it fits + while (currentLength > availableLength) { + const maxLength = Math.max(...lengths); + const shorterItems = lengths.filter(l => l !== maxLength); + const nextToMaxLength = + shorterItems.length > 0 ? Math.max(...shorterItems) : 0; + const maxReduce = maxLength - nextToMaxLength; + let maxItems = lengths.length - shorterItems.length; + let overrun = currentLength - availableLength; + for (let i = 0; i < lengths.length; i++) { + if (lengths[i] === maxLength) { + const reduce = Math.min(Math.floor(overrun / maxItems), maxReduce); + lengths[i] -= reduce; + currentLength -= reduce; + overrun -= reduce; + maxItems--; + } + } } + + // Return args reduced to length in lengths + return args.map((a, i) => { + const str = `${a}`; + const length = lengths[i]; + if (str.length === length) { + return str; + } else if (length > 5) { + return "..." + str.slice(-length + 3); + } else if (length > 0) { + return str.slice(-length); + } else { + return ""; + } + }); }; -module.exports = RequireResolveHeaderDependency; +module.exports = truncateArgs; /***/ }), -/***/ 84828: +/***/ 45249: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85586,27 +82742,37 @@ module.exports = RequireResolveHeaderDependency; Author Tobias Koppers @sokra */ -const ModuleDependency = __webpack_require__(90865); -class SingleEntryDependency extends ModuleDependency { - /** - * @param {string} request request path for entry - */ - constructor(request) { - super(request); - } - get type() { - return "single entry"; +const { ConcatSource } = __webpack_require__(53665); + +class NodeChunkTemplatePlugin { + apply(chunkTemplate) { + chunkTemplate.hooks.render.tap( + "NodeChunkTemplatePlugin", + (modules, chunk) => { + const source = new ConcatSource(); + source.add( + `exports.ids = ${JSON.stringify(chunk.ids)};\nexports.modules = ` + ); + source.add(modules); + source.add(";"); + return source; + } + ); + chunkTemplate.hooks.hash.tap("NodeChunkTemplatePlugin", hash => { + hash.update("node"); + hash.update("3"); + }); } } -module.exports = SingleEntryDependency; +module.exports = NodeChunkTemplatePlugin; /***/ }), -/***/ 68166: +/***/ 52520: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85616,201 +82782,189 @@ module.exports = SingleEntryDependency; */ -const ParserHelpers = __webpack_require__(23999); -const WebpackError = __webpack_require__(97391); +const NodeWatchFileSystem = __webpack_require__(71610); +const NodeOutputFileSystem = __webpack_require__(31836); +const NodeJsInputFileSystem = __webpack_require__(13445); +const CachedInputFileSystem = __webpack_require__(75544); +const createConsoleLogger = __webpack_require__(88838); +const nodeConsole = __webpack_require__(7886); -class SystemPlugin { +class NodeEnvironmentPlugin { constructor(options) { - this.options = options; + this.options = options || {}; } apply(compiler) { - compiler.hooks.compilation.tap( - "SystemPlugin", - (compilation, { normalModuleFactory }) => { - const handler = (parser, parserOptions) => { - if (parserOptions.system !== undefined && !parserOptions.system) - return; - - const shouldWarn = parserOptions.system === undefined; + compiler.infrastructureLogger = createConsoleLogger( + Object.assign( + { + level: "info", + debug: false, + console: nodeConsole + }, + this.options.infrastructureLogging + ) + ); + compiler.inputFileSystem = new CachedInputFileSystem( + new NodeJsInputFileSystem(), + 60000 + ); + const inputFileSystem = compiler.inputFileSystem; + compiler.outputFileSystem = new NodeOutputFileSystem(); + compiler.watchFileSystem = new NodeWatchFileSystem( + compiler.inputFileSystem + ); + compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", compiler => { + if (compiler.inputFileSystem === inputFileSystem) inputFileSystem.purge(); + }); + } +} +module.exports = NodeEnvironmentPlugin; - const setNotSupported = name => { - parser.hooks.evaluateTypeof - .for(name) - .tap("SystemPlugin", ParserHelpers.evaluateToString("undefined")); - parser.hooks.expression - .for(name) - .tap( - "SystemPlugin", - ParserHelpers.expressionIsUnsupported( - parser, - name + " is not supported by webpack." - ) - ); - }; - parser.hooks.typeof - .for("System.import") - .tap( - "SystemPlugin", - ParserHelpers.toConstantDependency( - parser, - JSON.stringify("function") - ) - ); - parser.hooks.evaluateTypeof - .for("System.import") - .tap("SystemPlugin", ParserHelpers.evaluateToString("function")); - parser.hooks.typeof - .for("System") - .tap( - "SystemPlugin", - ParserHelpers.toConstantDependency( - parser, - JSON.stringify("object") - ) - ); - parser.hooks.evaluateTypeof - .for("System") - .tap("SystemPlugin", ParserHelpers.evaluateToString("object")); +/***/ }), - setNotSupported("System.set"); - setNotSupported("System.get"); - setNotSupported("System.register"); +/***/ 95909: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - parser.hooks.expression.for("System").tap("SystemPlugin", () => { - const systemPolyfillRequire = ParserHelpers.requireFileAsExpression( - parser.state.module.context, - __webpack_require__.ab + "system.js" - ); - return ParserHelpers.addParsedVariableToModule( - parser, - "System", - systemPolyfillRequire - ); - }); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - parser.hooks.call.for("System.import").tap("SystemPlugin", expr => { - if (shouldWarn) { - parser.state.module.warnings.push( - new SystemImportDeprecationWarning( - parser.state.module, - expr.loc - ) - ); - } - return parser.hooks.importCall.call(expr); - }); - }; +const { ConcatSource } = __webpack_require__(53665); - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("SystemPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("SystemPlugin", handler); +class NodeHotUpdateChunkTemplatePlugin { + apply(hotUpdateChunkTemplate) { + hotUpdateChunkTemplate.hooks.render.tap( + "NodeHotUpdateChunkTemplatePlugin", + (modulesSource, modules, removedModules, hash, id) => { + const source = new ConcatSource(); + source.add( + "exports.id = " + JSON.stringify(id) + ";\nexports.modules = " + ); + source.add(modulesSource); + source.add(";"); + return source; } ); - } -} - -class SystemImportDeprecationWarning extends WebpackError { - constructor(module, loc) { - super( - "System.import() is deprecated and will be removed soon. Use import() instead.\n" + - "For more info visit https://webpack.js.org/guides/code-splitting/" + hotUpdateChunkTemplate.hooks.hash.tap( + "NodeHotUpdateChunkTemplatePlugin", + hash => { + hash.update("NodeHotUpdateChunkTemplatePlugin"); + hash.update("3"); + hash.update( + hotUpdateChunkTemplate.outputOptions.hotUpdateFunction + "" + ); + hash.update(hotUpdateChunkTemplate.outputOptions.library + ""); + } ); - - this.name = "SystemImportDeprecationWarning"; - - this.module = module; - this.loc = loc; - - Error.captureStackTrace(this, this.constructor); } } - -module.exports = SystemPlugin; +module.exports = NodeHotUpdateChunkTemplatePlugin; /***/ }), -/***/ 15826: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 33514: +/***/ (function(module) { -"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ +// eslint-disable-next-line no-unused-vars +var $hotChunkFilename$ = undefined; +var hotAddUpdateChunk = undefined; +var installedChunks = undefined; +var $hotMainFilename$ = undefined; -const NullDependency = __webpack_require__(5088); -const webpackMissingModule = __webpack_require__(75386).module; +module.exports = function() { + // eslint-disable-next-line no-unused-vars + function hotDownloadUpdateChunk(chunkId) { + var chunk = require("./" + $hotChunkFilename$); + hotAddUpdateChunk(chunk.id, chunk.modules); + } -class UnsupportedDependency extends NullDependency { - constructor(request, range) { - super(); - this.request = request; - this.range = range; + // eslint-disable-next-line no-unused-vars + function hotDownloadManifest() { + try { + var update = require("./" + $hotMainFilename$); + } catch (e) { + return Promise.resolve(); + } + return Promise.resolve(update); } -} -UnsupportedDependency.Template = class UnsupportedDependencyTemplate { - apply(dep, source, runtime) { - source.replace( - dep.range[0], - dep.range[1], - webpackMissingModule(dep.request) - ); + //eslint-disable-next-line no-unused-vars + function hotDisposeChunk(chunkId) { + delete installedChunks[chunkId]; } }; -module.exports = UnsupportedDependency; - /***/ }), -/***/ 18925: +/***/ 51433: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ +// eslint-disable-next-line no-unused-vars +var $hotChunkFilename$ = undefined; +var $require$ = undefined; +var hotAddUpdateChunk = undefined; +var $hotMainFilename$ = undefined; +var installedChunks = undefined; - -const DependencyReference = __webpack_require__(71722); -const ModuleDependency = __webpack_require__(90865); - -class WebAssemblyExportImportedDependency extends ModuleDependency { - constructor(exportName, request, name, valueType) { - super(request); - /** @type {string} */ - this.exportName = exportName; - /** @type {string} */ - this.name = name; - /** @type {string} */ - this.valueType = valueType; +module.exports = function() { + // eslint-disable-next-line no-unused-vars + function hotDownloadUpdateChunk(chunkId) { + var filename = __webpack_require__(85622).join(__dirname, $hotChunkFilename$); + __webpack_require__(35747).readFile(filename, "utf-8", function(err, content) { + if (err) { + if ($require$.onError) return $require$.oe(err); + throw err; + } + var chunk = {}; + __webpack_require__(92184).runInThisContext( + "(function(exports) {" + content + "\n})", + { filename: filename } + )(chunk); + hotAddUpdateChunk(chunk.id, chunk.modules); + }); } - getReference() { - if (!this.module) return null; - return new DependencyReference(this.module, [this.name], false); + // eslint-disable-next-line no-unused-vars + function hotDownloadManifest() { + var filename = __webpack_require__(85622).join(__dirname, $hotMainFilename$); + return new Promise(function(resolve, reject) { + __webpack_require__(35747).readFile(filename, "utf-8", function(err, content) { + if (err) return resolve(); + try { + var update = JSON.parse(content); + } catch (e) { + return reject(e); + } + resolve(update); + }); + }); } - get type() { - return "wasm export import"; + // eslint-disable-next-line no-unused-vars + function hotDisposeChunk(chunkId) { + delete installedChunks[chunkId]; } -} - -module.exports = WebAssemblyExportImportedDependency; +}; /***/ }), -/***/ 52959: +/***/ 78597: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85820,60 +82974,327 @@ module.exports = WebAssemblyExportImportedDependency; */ -const DependencyReference = __webpack_require__(71722); -const ModuleDependency = __webpack_require__(90865); -const UnsupportedWebAssemblyFeatureError = __webpack_require__(43101); - -/** @typedef {import("@webassemblyjs/ast").ModuleImportDescription} ModuleImportDescription */ - -class WebAssemblyImportDependency extends ModuleDependency { - /** - * @param {string} request the request - * @param {string} name the imported name - * @param {ModuleImportDescription} description the WASM ast node - * @param {false | string} onlyDirectImport if only direct imports are allowed - */ - constructor(request, name, description, onlyDirectImport) { - super(request); - /** @type {string} */ - this.name = name; - /** @type {ModuleImportDescription} */ - this.description = description; - /** @type {false | string} */ - this.onlyDirectImport = onlyDirectImport; - } +const Template = __webpack_require__(96066); - getReference() { - if (!this.module) return null; - return new DependencyReference(this.module, [this.name], false); +module.exports = class NodeMainTemplatePlugin { + constructor(asyncChunkLoading) { + this.asyncChunkLoading = asyncChunkLoading; } - getErrors() { - if ( - this.onlyDirectImport && - this.module && - !this.module.type.startsWith("webassembly") - ) { - return [ - new UnsupportedWebAssemblyFeatureError( - `Import "${this.name}" from "${this.request}" with ${this.onlyDirectImport} can only be used for direct wasm to wasm dependencies` + apply(mainTemplate) { + const needChunkOnDemandLoadingCode = chunk => { + for (const chunkGroup of chunk.groupsIterable) { + if (chunkGroup.getNumberOfChildren() > 0) return true; + } + return false; + }; + const asyncChunkLoading = this.asyncChunkLoading; + mainTemplate.hooks.localVars.tap( + "NodeMainTemplatePlugin", + (source, chunk) => { + if (needChunkOnDemandLoadingCode(chunk)) { + return Template.asString([ + source, + "", + "// object to store loaded chunks", + '// "0" means "already loaded"', + "var installedChunks = {", + Template.indent( + chunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(",\n") + ), + "};" + ]); + } + return source; + } + ); + mainTemplate.hooks.requireExtensions.tap( + "NodeMainTemplatePlugin", + (source, chunk) => { + if (needChunkOnDemandLoadingCode(chunk)) { + return Template.asString([ + source, + "", + "// uncaught error handler for webpack runtime", + `${mainTemplate.requireFn}.oe = function(err) {`, + Template.indent([ + "process.nextTick(function() {", + Template.indent( + "throw err; // catch this error by using import().catch()" + ), + "});" + ]), + "};" + ]); + } + return source; + } + ); + mainTemplate.hooks.requireEnsure.tap( + "NodeMainTemplatePlugin", + (source, chunk, hash) => { + const chunkFilename = mainTemplate.outputOptions.chunkFilename; + const chunkMaps = chunk.getChunkMaps(); + const insertMoreModules = [ + "var moreModules = chunk.modules, chunkIds = chunk.ids;", + "for(var moduleId in moreModules) {", + Template.indent( + mainTemplate.renderAddModule( + hash, + chunk, + "moduleId", + "moreModules[moduleId]" + ) + ), + "}" + ]; + if (asyncChunkLoading) { + return Template.asString([ + source, + "", + "// ReadFile + VM.run chunk loading for javascript", + "", + "var installedChunkData = installedChunks[chunkId];", + 'if(installedChunkData !== 0) { // 0 means "already installed".', + Template.indent([ + '// array of [resolve, reject, promise] means "currently loading"', + "if(installedChunkData) {", + Template.indent(["promises.push(installedChunkData[2]);"]), + "} else {", + Template.indent([ + "// load the chunk and return promise to it", + "var promise = new Promise(function(resolve, reject) {", + Template.indent([ + "installedChunkData = installedChunks[chunkId] = [resolve, reject];", + "var filename = require('path').join(__dirname, " + + mainTemplate.getAssetPath( + JSON.stringify(`/${chunkFilename}`), + { + hash: `" + ${mainTemplate.renderCurrentHashCode( + hash + )} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode( + hash, + length + )} + "`, + chunk: { + id: '" + chunkId + "', + hash: `" + ${JSON.stringify( + chunkMaps.hash + )}[chunkId] + "`, + hashWithLength: length => { + const shortChunkHashMap = {}; + for (const chunkId of Object.keys(chunkMaps.hash)) { + if (typeof chunkMaps.hash[chunkId] === "string") { + shortChunkHashMap[chunkId] = chunkMaps.hash[ + chunkId + ].substr(0, length); + } + } + return `" + ${JSON.stringify( + shortChunkHashMap + )}[chunkId] + "`; + }, + contentHash: { + javascript: `" + ${JSON.stringify( + chunkMaps.contentHash.javascript + )}[chunkId] + "` + }, + contentHashWithLength: { + javascript: length => { + const shortContentHashMap = {}; + const contentHash = + chunkMaps.contentHash.javascript; + for (const chunkId of Object.keys(contentHash)) { + if (typeof contentHash[chunkId] === "string") { + shortContentHashMap[chunkId] = contentHash[ + chunkId + ].substr(0, length); + } + } + return `" + ${JSON.stringify( + shortContentHashMap + )}[chunkId] + "`; + } + }, + name: `" + (${JSON.stringify( + chunkMaps.name + )}[chunkId]||chunkId) + "` + }, + contentHashType: "javascript" + } + ) + + ");", + "require('fs').readFile(filename, 'utf-8', function(err, content) {", + Template.indent( + [ + "if(err) return reject(err);", + "var chunk = {};", + "require('vm').runInThisContext('(function(exports, require, __dirname, __filename) {' + content + '\\n})', filename)" + + "(chunk, require, require('path').dirname(filename), filename);" + ] + .concat(insertMoreModules) + .concat([ + "var callbacks = [];", + "for(var i = 0; i < chunkIds.length; i++) {", + Template.indent([ + "if(installedChunks[chunkIds[i]])", + Template.indent([ + "callbacks = callbacks.concat(installedChunks[chunkIds[i]][0]);" + ]), + "installedChunks[chunkIds[i]] = 0;" + ]), + "}", + "for(i = 0; i < callbacks.length; i++)", + Template.indent("callbacks[i]();") + ]) + ), + "});" + ]), + "});", + "promises.push(installedChunkData[2] = promise);" + ]), + "}" + ]), + "}" + ]); + } else { + const request = mainTemplate.getAssetPath( + JSON.stringify(`./${chunkFilename}`), + { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, + chunk: { + id: '" + chunkId + "', + hash: `" + ${JSON.stringify(chunkMaps.hash)}[chunkId] + "`, + hashWithLength: length => { + const shortChunkHashMap = {}; + for (const chunkId of Object.keys(chunkMaps.hash)) { + if (typeof chunkMaps.hash[chunkId] === "string") { + shortChunkHashMap[chunkId] = chunkMaps.hash[ + chunkId + ].substr(0, length); + } + } + return `" + ${JSON.stringify( + shortChunkHashMap + )}[chunkId] + "`; + }, + contentHash: { + javascript: `" + ${JSON.stringify( + chunkMaps.contentHash.javascript + )}[chunkId] + "` + }, + contentHashWithLength: { + javascript: length => { + const shortContentHashMap = {}; + const contentHash = chunkMaps.contentHash.javascript; + for (const chunkId of Object.keys(contentHash)) { + if (typeof contentHash[chunkId] === "string") { + shortContentHashMap[chunkId] = contentHash[ + chunkId + ].substr(0, length); + } + } + return `" + ${JSON.stringify( + shortContentHashMap + )}[chunkId] + "`; + } + }, + name: `" + (${JSON.stringify( + chunkMaps.name + )}[chunkId]||chunkId) + "` + }, + contentHashType: "javascript" + } + ); + return Template.asString([ + source, + "", + "// require() chunk loading for javascript", + "", + '// "0" is the signal for "already loaded"', + "if(installedChunks[chunkId] !== 0) {", + Template.indent( + [`var chunk = require(${request});`] + .concat(insertMoreModules) + .concat([ + "for(var i = 0; i < chunkIds.length; i++)", + Template.indent("installedChunks[chunkIds[i]] = 0;") + ]) + ), + "}" + ]); + } + } + ); + mainTemplate.hooks.hotBootstrap.tap( + "NodeMainTemplatePlugin", + (source, chunk, hash) => { + const hotUpdateChunkFilename = + mainTemplate.outputOptions.hotUpdateChunkFilename; + const hotUpdateMainFilename = + mainTemplate.outputOptions.hotUpdateMainFilename; + const chunkMaps = chunk.getChunkMaps(); + const currentHotUpdateChunkFilename = mainTemplate.getAssetPath( + JSON.stringify(hotUpdateChunkFilename), + { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, + chunk: { + id: '" + chunkId + "', + hash: `" + ${JSON.stringify(chunkMaps.hash)}[chunkId] + "`, + hashWithLength: length => { + const shortChunkHashMap = {}; + for (const chunkId of Object.keys(chunkMaps.hash)) { + if (typeof chunkMaps.hash[chunkId] === "string") { + shortChunkHashMap[chunkId] = chunkMaps.hash[chunkId].substr( + 0, + length + ); + } + } + return `" + ${JSON.stringify(shortChunkHashMap)}[chunkId] + "`; + }, + name: `" + (${JSON.stringify( + chunkMaps.name + )}[chunkId]||chunkId) + "` + } + } + ); + const currentHotUpdateMainFilename = mainTemplate.getAssetPath( + JSON.stringify(hotUpdateMainFilename), + { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "` + } + ); + return Template.getFunctionContent( + asyncChunkLoading + ? __webpack_require__(51433) + : __webpack_require__(33514) ) - ]; - } - } - - get type() { - return "wasm import"; + .replace(/\$require\$/g, mainTemplate.requireFn) + .replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename) + .replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename); + } + ); + mainTemplate.hooks.hash.tap("NodeMainTemplatePlugin", hash => { + hash.update("node"); + hash.update("4"); + }); } -} - -module.exports = WebAssemblyImportDependency; +}; /***/ }), -/***/ 75386: -/***/ (function(__unused_webpack_module, exports) { +/***/ 31836: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -85881,86 +83302,178 @@ module.exports = WebAssemblyImportDependency; Author Tobias Koppers @sokra */ -const toErrorCode = err => - `var e = new Error(${JSON.stringify(err)}); e.code = 'MODULE_NOT_FOUND';`; -exports.module = request => - `!(function webpackMissingModule() { ${exports.moduleCode(request)} }())`; +const fs = __webpack_require__(35747); +const path = __webpack_require__(85622); +const mkdirp = __webpack_require__(50998); -exports.promise = request => { - const errorCode = toErrorCode(`Cannot find module '${request}'`); - return `Promise.reject(function webpackMissingModule() { ${errorCode} return e; }())`; -}; +class NodeOutputFileSystem { + constructor() { + this.mkdirp = mkdirp; + this.mkdir = fs.mkdir.bind(fs); + this.rmdir = fs.rmdir.bind(fs); + this.unlink = fs.unlink.bind(fs); + this.writeFile = fs.writeFile.bind(fs); + this.join = path.join.bind(path); + } +} -exports.moduleCode = request => { - const errorCode = toErrorCode(`Cannot find module '${request}'`); - return `${errorCode} throw e;`; -}; +module.exports = NodeOutputFileSystem; /***/ }), -/***/ 64197: -/***/ (function(module) { +/***/ 9128: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -module.exports = expr => { - // - if ( - expr.type === "FunctionExpression" || - expr.type === "ArrowFunctionExpression" - ) { - return { - fn: expr, - expressions: [], - needThis: false - }; + +const AliasPlugin = __webpack_require__(15005); +const ParserHelpers = __webpack_require__(23999); +const nodeLibsBrowser = __webpack_require__(27852); + +module.exports = class NodeSourcePlugin { + constructor(options) { + this.options = options; } + apply(compiler) { + const options = this.options; + if (options === false) { + // allow single kill switch to turn off this plugin + return; + } - // .bind() - if ( - expr.type === "CallExpression" && - expr.callee.type === "MemberExpression" && - expr.callee.object.type === "FunctionExpression" && - expr.callee.property.type === "Identifier" && - expr.callee.property.name === "bind" && - expr.arguments.length === 1 - ) { - return { - fn: expr.callee.object, - expressions: [expr.arguments[0]], - needThis: undefined + const getPathToModule = (module, type) => { + if (type === true || (type === undefined && nodeLibsBrowser[module])) { + if (!nodeLibsBrowser[module]) { + throw new Error( + `No browser version for node.js core module ${module} available` + ); + } + return nodeLibsBrowser[module]; + } else if (type === "mock") { + return require.resolve(`node-libs-browser/mock/${module}`); + } else if (type === "empty") { + return __webpack_require__.ab + "empty.js"; + } else { + return module; + } }; - } - // (function(_this) {return })(this) (Coffeescript) - if ( - expr.type === "CallExpression" && - expr.callee.type === "FunctionExpression" && - expr.callee.body.type === "BlockStatement" && - expr.arguments.length === 1 && - expr.arguments[0].type === "ThisExpression" && - expr.callee.body.body && - expr.callee.body.body.length === 1 && - expr.callee.body.body[0].type === "ReturnStatement" && - expr.callee.body.body[0].argument && - expr.callee.body.body[0].argument.type === "FunctionExpression" - ) { - return { - fn: expr.callee.body.body[0].argument, - expressions: [], - needThis: true + + const addExpression = (parser, name, module, type, suffix) => { + suffix = suffix || ""; + parser.hooks.expression.for(name).tap("NodeSourcePlugin", () => { + if ( + parser.state.module && + parser.state.module.resource === getPathToModule(module, type) + ) + return; + const mockModule = ParserHelpers.requireFileAsExpression( + parser.state.module.context, + getPathToModule(module, type) + ); + return ParserHelpers.addParsedVariableToModule( + parser, + name, + mockModule + suffix + ); + }); }; + + compiler.hooks.compilation.tap( + "NodeSourcePlugin", + (compilation, { normalModuleFactory }) => { + const handler = (parser, parserOptions) => { + if (parserOptions.node === false) return; + + let localOptions = options; + if (parserOptions.node) { + localOptions = Object.assign({}, localOptions, parserOptions.node); + } + if (localOptions.global) { + parser.hooks.expression + .for("global") + .tap("NodeSourcePlugin", () => { + const retrieveGlobalModule = ParserHelpers.requireFileAsExpression( + parser.state.module.context, + __webpack_require__.ab + "global.js" + ); + return ParserHelpers.addParsedVariableToModule( + parser, + "global", + retrieveGlobalModule + ); + }); + } + if (localOptions.process) { + const processType = localOptions.process; + addExpression(parser, "process", "process", processType); + } + if (localOptions.console) { + const consoleType = localOptions.console; + addExpression(parser, "console", "console", consoleType); + } + const bufferType = localOptions.Buffer; + if (bufferType) { + addExpression(parser, "Buffer", "buffer", bufferType, ".Buffer"); + } + if (localOptions.setImmediate) { + const setImmediateType = localOptions.setImmediate; + addExpression( + parser, + "setImmediate", + "timers", + setImmediateType, + ".setImmediate" + ); + addExpression( + parser, + "clearImmediate", + "timers", + setImmediateType, + ".clearImmediate" + ); + } + }; + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("NodeSourcePlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("NodeSourcePlugin", handler); + } + ); + compiler.hooks.afterResolvers.tap("NodeSourcePlugin", compiler => { + for (const lib of Object.keys(nodeLibsBrowser)) { + if (options[lib] !== false) { + compiler.resolverFactory.hooks.resolver + .for("normal") + .tap("NodeSourcePlugin", resolver => { + new AliasPlugin( + "described-resolve", + { + name: lib, + onlyModule: true, + alias: getPathToModule(lib, options[lib]) + }, + "resolve" + ).apply(resolver); + }); + } + } + }); } }; /***/ }), -/***/ 49: -/***/ (function(module) { +/***/ 59743: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -85969,216 +83482,249 @@ module.exports = expr => { */ +const ExternalsPlugin = __webpack_require__(75705); -/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ -/** @typedef {import("./Dependency").SourcePosition} SourcePosition */ - -// TODO webpack 5: pos must be SourcePosition -/** - * @param {SourcePosition|DependencyLocation|string} pos position - * @returns {string} formatted position - */ -const formatPosition = pos => { - if (pos === null) return ""; - // TODO webpack 5: Simplify this - if (typeof pos === "string") return pos; - if (typeof pos === "number") return `${pos}`; - if (typeof pos === "object") { - if ("line" in pos && "column" in pos) { - return `${pos.line}:${pos.column}`; - } else if ("line" in pos) { - return `${pos.line}:?`; - } else if ("index" in pos) { - // TODO webpack 5 remove this case - return `+${pos.index}`; - } else { - return ""; - } - } - return ""; -}; +const builtins = + // eslint-disable-next-line node/no-unsupported-features/node-builtins,node/no-deprecated-api + __webpack_require__(32282).builtinModules || Object.keys(process.binding("natives")); -// TODO webpack 5: loc must be DependencyLocation -/** - * @param {DependencyLocation|SourcePosition|string} loc location - * @returns {string} formatted location - */ -const formatLocation = loc => { - if (loc === null) return ""; - // TODO webpack 5: Simplify this - if (typeof loc === "string") return loc; - if (typeof loc === "number") return `${loc}`; - if (typeof loc === "object") { - if ("start" in loc && loc.start && "end" in loc && loc.end) { - if ( - typeof loc.start === "object" && - typeof loc.start.line === "number" && - typeof loc.end === "object" && - typeof loc.end.line === "number" && - typeof loc.end.column === "number" && - loc.start.line === loc.end.line - ) { - return `${formatPosition(loc.start)}-${loc.end.column}`; - } else { - return `${formatPosition(loc.start)}-${formatPosition(loc.end)}`; - } - } - if ("start" in loc && loc.start) { - return formatPosition(loc.start); - } - if ("name" in loc && "index" in loc) { - return `${loc.name}[${loc.index}]`; - } - if ("name" in loc) { - return loc.name; - } - return formatPosition(loc); +class NodeTargetPlugin { + apply(compiler) { + new ExternalsPlugin("commonjs", builtins).apply(compiler); } - return ""; -}; +} -module.exports = formatLocation; +module.exports = NodeTargetPlugin; /***/ }), -/***/ 47194: -/***/ (function(__unused_webpack_module, exports) { +/***/ 90010: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ - + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -const LogType = Object.freeze({ - error: /** @type {"error"} */ ("error"), // message, c style arguments - warn: /** @type {"warn"} */ ("warn"), // message, c style arguments - info: /** @type {"info"} */ ("info"), // message, c style arguments - log: /** @type {"log"} */ ("log"), // message, c style arguments - debug: /** @type {"debug"} */ ("debug"), // message, c style arguments - trace: /** @type {"trace"} */ ("trace"), // no arguments +const NodeMainTemplatePlugin = __webpack_require__(78597); +const NodeChunkTemplatePlugin = __webpack_require__(45249); +const NodeHotUpdateChunkTemplatePlugin = __webpack_require__(95909); - group: /** @type {"group"} */ ("group"), // [label] - groupCollapsed: /** @type {"groupCollapsed"} */ ("groupCollapsed"), // [label] - groupEnd: /** @type {"groupEnd"} */ ("groupEnd"), // [label] +class NodeTemplatePlugin { + constructor(options) { + options = options || {}; + this.asyncChunkLoading = options.asyncChunkLoading; + } - profile: /** @type {"profile"} */ ("profile"), // [profileName] - profileEnd: /** @type {"profileEnd"} */ ("profileEnd"), // [profileName] + apply(compiler) { + compiler.hooks.thisCompilation.tap("NodeTemplatePlugin", compilation => { + new NodeMainTemplatePlugin(this.asyncChunkLoading).apply( + compilation.mainTemplate + ); + new NodeChunkTemplatePlugin().apply(compilation.chunkTemplate); + new NodeHotUpdateChunkTemplatePlugin().apply( + compilation.hotUpdateChunkTemplate + ); + }); + } +} - time: /** @type {"time"} */ ("time"), // name, time as [seconds, nanoseconds] +module.exports = NodeTemplatePlugin; - clear: /** @type {"clear"} */ ("clear"), // no arguments - status: /** @type {"status"} */ ("status") // message, arguments -}); -exports.LogType = LogType; +/***/ }), -/** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */ +/***/ 71610: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -const LOG_SYMBOL = Symbol("webpack logger raw log method"); -const TIMERS_SYMBOL = Symbol("webpack logger times"); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ -class WebpackLogger { - /** - * @param {function(LogTypeEnum, any[]=): void} log log function - */ - constructor(log) { - this[LOG_SYMBOL] = log; - } - error(...args) { - this[LOG_SYMBOL](LogType.error, args); - } +const Watchpack = __webpack_require__(77056); +const objectToMap = __webpack_require__(1111); - warn(...args) { - this[LOG_SYMBOL](LogType.warn, args); +class NodeWatchFileSystem { + constructor(inputFileSystem) { + this.inputFileSystem = inputFileSystem; + this.watcherOptions = { + aggregateTimeout: 0 + }; + this.watcher = new Watchpack(this.watcherOptions); } - info(...args) { - this[LOG_SYMBOL](LogType.info, args); - } + watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) { + if (!Array.isArray(files)) { + throw new Error("Invalid arguments: 'files'"); + } + if (!Array.isArray(dirs)) { + throw new Error("Invalid arguments: 'dirs'"); + } + if (!Array.isArray(missing)) { + throw new Error("Invalid arguments: 'missing'"); + } + if (typeof callback !== "function") { + throw new Error("Invalid arguments: 'callback'"); + } + if (typeof startTime !== "number" && startTime) { + throw new Error("Invalid arguments: 'startTime'"); + } + if (typeof options !== "object") { + throw new Error("Invalid arguments: 'options'"); + } + if (typeof callbackUndelayed !== "function" && callbackUndelayed) { + throw new Error("Invalid arguments: 'callbackUndelayed'"); + } + const oldWatcher = this.watcher; + this.watcher = new Watchpack(options); - log(...args) { - this[LOG_SYMBOL](LogType.log, args); - } + if (callbackUndelayed) { + this.watcher.once("change", callbackUndelayed); + } + const cachedFiles = files; + const cachedDirs = dirs; + this.watcher.once("aggregated", (changes, removals) => { + changes = changes.concat(removals); + if (this.inputFileSystem && this.inputFileSystem.purge) { + this.inputFileSystem.purge(changes); + } + const times = objectToMap(this.watcher.getTimes()); + files = new Set(files); + dirs = new Set(dirs); + missing = new Set(missing); + removals = new Set(removals.filter(file => files.has(file))); + callback( + null, + changes.filter(file => files.has(file)).sort(), + changes.filter(file => dirs.has(file)).sort(), + changes.filter(file => missing.has(file)).sort(), + times, + times, + removals + ); + }); - debug(...args) { - this[LOG_SYMBOL](LogType.debug, args); - } + this.watcher.watch( + cachedFiles.concat(missing), + cachedDirs.concat(missing), + startTime + ); - assert(assertion, ...args) { - if (!assertion) { - this[LOG_SYMBOL](LogType.error, args); + if (oldWatcher) { + oldWatcher.close(); } + return { + close: () => { + if (this.watcher) { + this.watcher.close(); + this.watcher = null; + } + }, + pause: () => { + if (this.watcher) { + this.watcher.pause(); + } + }, + getFileTimestamps: () => { + if (this.watcher) { + return objectToMap(this.watcher.getTimes()); + } else { + return new Map(); + } + }, + getContextTimestamps: () => { + if (this.watcher) { + return objectToMap(this.watcher.getTimes()); + } else { + return new Map(); + } + } + }; } +} - trace() { - this[LOG_SYMBOL](LogType.trace, ["Trace"]); - } - - clear() { - this[LOG_SYMBOL](LogType.clear); - } +module.exports = NodeWatchFileSystem; - status(...args) { - this[LOG_SYMBOL](LogType.status, args); - } - group(...args) { - this[LOG_SYMBOL](LogType.group, args); - } +/***/ }), - groupCollapsed(...args) { - this[LOG_SYMBOL](LogType.groupCollapsed, args); - } +/***/ 73839: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - groupEnd(...args) { - this[LOG_SYMBOL](LogType.groupEnd, args); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - profile(label) { - this[LOG_SYMBOL](LogType.profile, [label]); - } - profileEnd(label) { - this[LOG_SYMBOL](LogType.profileEnd, [label]); - } +const Template = __webpack_require__(96066); +const WasmMainTemplatePlugin = __webpack_require__(65331); - time(label) { - this[TIMERS_SYMBOL] = this[TIMERS_SYMBOL] || new Map(); - this[TIMERS_SYMBOL].set(label, process.hrtime()); +class ReadFileCompileWasmTemplatePlugin { + constructor(options) { + this.options = options || {}; } - timeLog(label) { - const prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); - if (!prev) { - throw new Error(`No such label '${label}' for WebpackLogger.timeLog()`); - } - const time = process.hrtime(prev); - this[LOG_SYMBOL](LogType.time, [label, ...time]); - } + apply(compiler) { + compiler.hooks.thisCompilation.tap( + "ReadFileCompileWasmTemplatePlugin", + compilation => { + const generateLoadBinaryCode = path => + Template.asString([ + "new Promise(function (resolve, reject) {", + Template.indent([ + "var { readFile } = require('fs');", + "var { join } = require('path');", + "", + "try {", + Template.indent([ + `readFile(join(__dirname, ${path}), function(err, buffer){`, + Template.indent([ + "if (err) return reject(err);", + "", + "// Fake fetch response", + "resolve({", + Template.indent([ + "arrayBuffer() { return Promise.resolve(buffer); }" + ]), + "});" + ]), + "});" + ]), + "} catch (err) { reject(err); }" + ]), + "})" + ]); - timeEnd(label) { - const prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); - if (!prev) { - throw new Error(`No such label '${label}' for WebpackLogger.timeEnd()`); - } - const time = process.hrtime(prev); - this[TIMERS_SYMBOL].delete(label); - this[LOG_SYMBOL](LogType.time, [label, ...time]); + const plugin = new WasmMainTemplatePlugin( + Object.assign( + { + generateLoadBinaryCode, + supportsStreaming: false + }, + this.options + ) + ); + plugin.apply(compilation.mainTemplate); + } + ); } } -exports.Logger = WebpackLogger; +module.exports = ReadFileCompileWasmTemplatePlugin; /***/ }), -/***/ 88838: +/***/ 7886: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -86189,337 +83735,234 @@ exports.Logger = WebpackLogger; -const { LogType } = __webpack_require__(47194); +const truncateArgs = __webpack_require__(62299); +const util = __webpack_require__(31669); -/** @typedef {import("./Logger").LogTypeEnum} LogTypeEnum */ -/** @typedef {import("../../declarations/WebpackOptions").FilterTypes} FilterTypes */ -/** @typedef {import("../../declarations/WebpackOptions").FilterItemTypes} FilterItemTypes */ - -/** @typedef {function(string): boolean} FilterFunction */ +const tty = process.stderr.isTTY && process.env.TERM !== "dumb"; -/** - * @typedef {Object} LoggerOptions - * @property {false|true|"none"|"error"|"warn"|"info"|"log"|"verbose"} level loglevel - * @property {FilterTypes|boolean} debug filter for debug logging - * @property {Console & { status?: Function, logTime?: Function }} console the console to log to - */ +let currentStatusMessage = undefined; +let hasStatusMessage = false; +let currentIndent = ""; +let currentCollapsed = 0; -/** - * @param {FilterItemTypes} item an input item - * @returns {FilterFunction} filter funtion - */ -const filterToFunction = item => { - if (typeof item === "string") { - const regExp = new RegExp( - `[\\\\/]${item.replace( - // eslint-disable-next-line no-useless-escape - /[-[\]{}()*+?.\\^$|]/g, - "\\$&" - )}([\\\\/]|$|!|\\?)` +const indent = (str, prefix, colorPrefix, colorSuffix) => { + if (str === "") return str; + prefix = currentIndent + prefix; + if (tty) { + return ( + prefix + + colorPrefix + + str.replace(/\n/g, colorSuffix + "\n" + prefix + colorPrefix) + + colorSuffix ); - return ident => regExp.test(ident); - } - if (item && typeof item === "object" && typeof item.test === "function") { - return ident => item.test(ident); - } - if (typeof item === "function") { - return item; + } else { + return prefix + str.replace(/\n/g, "\n" + prefix); } - if (typeof item === "boolean") { - return () => item; +}; + +const clearStatusMessage = () => { + if (hasStatusMessage) { + process.stderr.write("\x1b[2K\r"); + hasStatusMessage = false; } }; -/** - * @enum {number} - */ -const LogLevel = { - none: 6, - false: 6, - error: 5, - warn: 4, - info: 3, - log: 2, - true: 2, - verbose: 1 +const writeStatusMessage = () => { + if (!currentStatusMessage) return; + const l = process.stderr.columns; + const args = l + ? truncateArgs(currentStatusMessage, l - 1) + : currentStatusMessage; + const str = args.join(" "); + const coloredStr = `\u001b[1m${str}\u001b[39m\u001b[22m`; + process.stderr.write(`\x1b[2K\r${coloredStr}`); + hasStatusMessage = true; }; -/** - * @param {LoggerOptions} options options object - * @returns {function(string, LogTypeEnum, any[]): void} logging function - */ -module.exports = ({ level = "info", debug = false, console }) => { - const debugFilters = - typeof debug === "boolean" - ? [() => debug] - : /** @type {FilterItemTypes[]} */ ([]) - .concat(debug) - .map(filterToFunction); - /** @type {number} */ - const loglevel = LogLevel[`${level}`] || 0; +const writeColored = (prefix, colorPrefix, colorSuffix) => { + return (...args) => { + if (currentCollapsed > 0) return; + clearStatusMessage(); + // @ts-ignore + const str = indent(util.format(...args), prefix, colorPrefix, colorSuffix); + process.stderr.write(str + "\n"); + writeStatusMessage(); + }; +}; - /** - * @param {string} name name of the logger - * @param {LogTypeEnum} type type of the log entry - * @param {any[]} args arguments of the log entry - * @returns {void} - */ - const logger = (name, type, args) => { - const labeledArgs = () => { - if (Array.isArray(args)) { - if (args.length > 0 && typeof args[0] === "string") { - return [`[${name}] ${args[0]}`, ...args.slice(1)]; - } else { - return [`[${name}]`, ...args]; - } - } else { - return []; - } - }; - const debug = debugFilters.some(f => f(name)); - switch (type) { - case LogType.debug: - if (!debug) return; - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.debug === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.debug(...labeledArgs()); - } else { - console.log(...labeledArgs()); - } - break; - case LogType.log: - if (!debug && loglevel > LogLevel.log) return; - console.log(...labeledArgs()); - break; - case LogType.info: - if (!debug && loglevel > LogLevel.info) return; - console.info(...labeledArgs()); - break; - case LogType.warn: - if (!debug && loglevel > LogLevel.warn) return; - console.warn(...labeledArgs()); - break; - case LogType.error: - if (!debug && loglevel > LogLevel.error) return; - console.error(...labeledArgs()); - break; - case LogType.trace: - if (!debug) return; - console.trace(); - break; - case LogType.groupCollapsed: - if (!debug && loglevel > LogLevel.log) return; - if (!debug && loglevel > LogLevel.verbose) { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.groupCollapsed === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.groupCollapsed(...labeledArgs()); - } else { - console.log(...labeledArgs()); - } - break; - } - // falls through - case LogType.group: - if (!debug && loglevel > LogLevel.log) return; - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.group === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.group(...labeledArgs()); - } else { - console.log(...labeledArgs()); - } - break; - case LogType.groupEnd: - if (!debug && loglevel > LogLevel.log) return; - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.groupEnd === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.groupEnd(); - } - break; - case LogType.time: { - if (!debug && loglevel > LogLevel.log) return; - const ms = args[1] * 1000 + args[2] / 1000000; - const msg = `[${name}] ${args[0]}: ${ms}ms`; - if (typeof console.logTime === "function") { - console.logTime(msg); - } else { - console.log(msg); - } - break; - } - case LogType.profile: - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.profile === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.profile(...labeledArgs()); - } - break; - case LogType.profileEnd: - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.profileEnd === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.profileEnd(...labeledArgs()); - } - break; - case LogType.clear: - if (!debug && loglevel > LogLevel.log) return; - // eslint-disable-next-line node/no-unsupported-features/node-builtins - if (typeof console.clear === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.clear(); - } - break; - case LogType.status: - if (!debug && loglevel > LogLevel.info) return; - if (typeof console.status === "function") { - if (args.length === 0) { - console.status(); - } else { - console.status(...labeledArgs()); - } +const writeGroupMessage = writeColored( + "<-> ", + "\u001b[1m\u001b[36m", + "\u001b[39m\u001b[22m" +); + +const writeGroupCollapsedMessage = writeColored( + "<+> ", + "\u001b[1m\u001b[36m", + "\u001b[39m\u001b[22m" +); + +module.exports = { + log: writeColored(" ", "\u001b[1m", "\u001b[22m"), + debug: writeColored(" ", "", ""), + trace: writeColored(" ", "", ""), + info: writeColored(" ", "\u001b[1m\u001b[32m", "\u001b[39m\u001b[22m"), + warn: writeColored(" ", "\u001b[1m\u001b[33m", "\u001b[39m\u001b[22m"), + error: writeColored(" ", "\u001b[1m\u001b[31m", "\u001b[39m\u001b[22m"), + logTime: writeColored(" ", "\u001b[1m\u001b[35m", "\u001b[39m\u001b[22m"), + group: (...args) => { + writeGroupMessage(...args); + if (currentCollapsed > 0) { + currentCollapsed++; + } else { + currentIndent += " "; + } + }, + groupCollapsed: (...args) => { + writeGroupCollapsedMessage(...args); + currentCollapsed++; + }, + groupEnd: () => { + if (currentCollapsed > 0) currentCollapsed--; + else if (currentIndent.length >= 2) + currentIndent = currentIndent.slice(0, currentIndent.length - 2); + }, + // eslint-disable-next-line node/no-unsupported-features/node-builtins + profile: console.profile && (name => console.profile(name)), + // eslint-disable-next-line node/no-unsupported-features/node-builtins + profileEnd: console.profileEnd && (name => console.profileEnd(name)), + clear: + tty && + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.clear && + (() => { + clearStatusMessage(); + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.clear(); + writeStatusMessage(); + }), + status: tty + ? (name, ...args) => { + args = args.filter(Boolean); + if (name === undefined && args.length === 0) { + clearStatusMessage(); + currentStatusMessage = undefined; + } else if ( + typeof name === "string" && + name.startsWith("[webpack.Progress] ") + ) { + currentStatusMessage = [name.slice(19), ...args]; + writeStatusMessage(); + } else if (name === "[webpack.Progress]") { + currentStatusMessage = [...args]; + writeStatusMessage(); } else { - if (args.length !== 0) { - console.info(...labeledArgs()); - } + currentStatusMessage = [name, ...args]; + writeStatusMessage(); } - break; - default: - throw new Error(`Unexpected LogType ${type}`); - } - }; - return logger; + } + : writeColored(" ", "", "") }; /***/ }), -/***/ 62299: +/***/ 88197: /***/ (function(module) { "use strict"; /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ - - - -/** - * @param {any[]} args items to be truncated - * @param {number} maxLength maximum length of args including spaces between - * @returns {string[]} truncated args - */ -const truncateArgs = (args, maxLength) => { - const lengths = args.map(a => `${a}`.length); - const availableLength = maxLength - lengths.length + 1; - - if (availableLength > 0 && args.length === 1) { - if (availableLength >= args[0].length) { - return args; - } else if (availableLength > 3) { - return ["..." + args[0].slice(-availableLength + 3)]; - } else { - return [args[0].slice(-availableLength)]; - } - } - - // Check if there is space for at least 4 chars per arg - if (availableLength < lengths.reduce((s, i) => s + Math.min(i, 6), 0)) { - // remove args - if (args.length > 1) - return truncateArgs(args.slice(0, args.length - 1), maxLength); - return []; - } - - let currentLength = lengths.reduce((a, b) => a + b, 0); + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // Check if all fits into maxLength - if (currentLength <= availableLength) return args; - // Try to remove chars from the longest items until it fits - while (currentLength > availableLength) { - const maxLength = Math.max(...lengths); - const shorterItems = lengths.filter(l => l !== maxLength); - const nextToMaxLength = - shorterItems.length > 0 ? Math.max(...shorterItems) : 0; - const maxReduce = maxLength - nextToMaxLength; - let maxItems = lengths.length - shorterItems.length; - let overrun = currentLength - availableLength; - for (let i = 0; i < lengths.length; i++) { - if (lengths[i] === maxLength) { - const reduce = Math.min(Math.floor(overrun / maxItems), maxReduce); - lengths[i] -= reduce; - currentLength -= reduce; - overrun -= reduce; - maxItems--; - } +class AggressiveMergingPlugin { + constructor(options) { + if ( + (options !== undefined && typeof options !== "object") || + Array.isArray(options) + ) { + throw new Error( + "Argument should be an options object. To use defaults, pass in nothing.\nFor more info on options, see https://webpack.js.org/plugins/" + ); } + this.options = options || {}; } - // Return args reduced to length in lengths - return args.map((a, i) => { - const str = `${a}`; - const length = lengths[i]; - if (str.length === length) { - return str; - } else if (length > 5) { - return "..." + str.slice(-length + 3); - } else if (length > 0) { - return str.slice(-length); - } else { - return ""; - } - }); -}; - -module.exports = truncateArgs; - - -/***/ }), + apply(compiler) { + const options = this.options; + const minSizeReduce = options.minSizeReduce || 1.5; -/***/ 45249: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + compiler.hooks.thisCompilation.tap( + "AggressiveMergingPlugin", + compilation => { + compilation.hooks.optimizeChunksAdvanced.tap( + "AggressiveMergingPlugin", + chunks => { + let combinations = []; + chunks.forEach((a, idx) => { + if (a.canBeInitial()) return; + for (let i = 0; i < idx; i++) { + const b = chunks[i]; + if (b.canBeInitial()) continue; + combinations.push({ + a, + b, + improvement: undefined + }); + } + }); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + for (const pair of combinations) { + const a = pair.b.size({ + chunkOverhead: 0 + }); + const b = pair.a.size({ + chunkOverhead: 0 + }); + const ab = pair.b.integratedSize(pair.a, { + chunkOverhead: 0 + }); + let newSize; + if (ab === false) { + pair.improvement = false; + return; + } else { + newSize = ab; + } + pair.improvement = (a + b) / newSize; + } + combinations = combinations.filter(pair => { + return pair.improvement !== false; + }); + combinations.sort((a, b) => { + return b.improvement - a.improvement; + }); + const pair = combinations[0]; -const { ConcatSource } = __webpack_require__(53665); + if (!pair) return; + if (pair.improvement < minSizeReduce) return; -class NodeChunkTemplatePlugin { - apply(chunkTemplate) { - chunkTemplate.hooks.render.tap( - "NodeChunkTemplatePlugin", - (modules, chunk) => { - const source = new ConcatSource(); - source.add( - `exports.ids = ${JSON.stringify(chunk.ids)};\nexports.modules = ` + if (pair.b.integrate(pair.a, "aggressive-merge")) { + chunks.splice(chunks.indexOf(pair.a), 1); + return true; + } + } ); - source.add(modules); - source.add(";"); - return source; } ); - chunkTemplate.hooks.hash.tap("NodeChunkTemplatePlugin", hash => { - hash.update("node"); - hash.update("3"); - }); } } -module.exports = NodeChunkTemplatePlugin; +module.exports = AggressiveMergingPlugin; /***/ }), -/***/ 52520: +/***/ 26688: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -86529,189 +83972,373 @@ module.exports = NodeChunkTemplatePlugin; */ -const NodeWatchFileSystem = __webpack_require__(71610); -const NodeOutputFileSystem = __webpack_require__(31836); -const NodeJsInputFileSystem = __webpack_require__(13445); -const CachedInputFileSystem = __webpack_require__(75544); -const createConsoleLogger = __webpack_require__(88838); -const nodeConsole = __webpack_require__(7886); +const identifierUtils = __webpack_require__(94658); +const { intersect } = __webpack_require__(54262); +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(71884); -class NodeEnvironmentPlugin { +/** @typedef {import("../../declarations/plugins/optimize/AggressiveSplittingPlugin").AggressiveSplittingPluginOptions} AggressiveSplittingPluginOptions */ + +const moveModuleBetween = (oldChunk, newChunk) => { + return module => { + oldChunk.moveModule(module, newChunk); + }; +}; + +const isNotAEntryModule = entryModule => { + return module => { + return entryModule !== module; + }; +}; + +class AggressiveSplittingPlugin { + /** + * @param {AggressiveSplittingPluginOptions=} options options object + */ constructor(options) { - this.options = options || {}; - } + if (!options) options = {}; - apply(compiler) { - compiler.infrastructureLogger = createConsoleLogger( - Object.assign( - { - level: "info", - debug: false, - console: nodeConsole - }, - this.options.infrastructureLogging - ) - ); - compiler.inputFileSystem = new CachedInputFileSystem( - new NodeJsInputFileSystem(), - 60000 - ); - const inputFileSystem = compiler.inputFileSystem; - compiler.outputFileSystem = new NodeOutputFileSystem(); - compiler.watchFileSystem = new NodeWatchFileSystem( - compiler.inputFileSystem - ); - compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", compiler => { - if (compiler.inputFileSystem === inputFileSystem) inputFileSystem.purge(); - }); + validateOptions(schema, options, "Aggressive Splitting Plugin"); + + this.options = options; + if (typeof this.options.minSize !== "number") { + this.options.minSize = 30 * 1024; + } + if (typeof this.options.maxSize !== "number") { + this.options.maxSize = 50 * 1024; + } + if (typeof this.options.chunkOverhead !== "number") { + this.options.chunkOverhead = 0; + } + if (typeof this.options.entryChunkMultiplicator !== "number") { + this.options.entryChunkMultiplicator = 1; + } } -} -module.exports = NodeEnvironmentPlugin; + apply(compiler) { + compiler.hooks.thisCompilation.tap( + "AggressiveSplittingPlugin", + compilation => { + let needAdditionalSeal = false; + let newSplits; + let fromAggressiveSplittingSet; + let chunkSplitDataMap; + compilation.hooks.optimize.tap("AggressiveSplittingPlugin", () => { + newSplits = []; + fromAggressiveSplittingSet = new Set(); + chunkSplitDataMap = new Map(); + }); + compilation.hooks.optimizeChunksAdvanced.tap( + "AggressiveSplittingPlugin", + chunks => { + // Precompute stuff + const nameToModuleMap = new Map(); + const moduleToNameMap = new Map(); + for (const m of compilation.modules) { + const name = identifierUtils.makePathsRelative( + compiler.context, + m.identifier(), + compilation.cache + ); + nameToModuleMap.set(name, m); + moduleToNameMap.set(m, name); + } + // Check used chunk ids + const usedIds = new Set(); + for (const chunk of chunks) { + usedIds.add(chunk.id); + } -/***/ }), + const recordedSplits = + (compilation.records && compilation.records.aggressiveSplits) || + []; + const usedSplits = newSplits + ? recordedSplits.concat(newSplits) + : recordedSplits; -/***/ 95909: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + const minSize = this.options.minSize; + const maxSize = this.options.maxSize; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + const applySplit = splitData => { + // Cannot split if id is already taken + if (splitData.id !== undefined && usedIds.has(splitData.id)) { + return false; + } + // Get module objects from names + const selectedModules = splitData.modules.map(name => + nameToModuleMap.get(name) + ); -const { ConcatSource } = __webpack_require__(53665); + // Does the modules exist at all? + if (!selectedModules.every(Boolean)) return false; -class NodeHotUpdateChunkTemplatePlugin { - apply(hotUpdateChunkTemplate) { - hotUpdateChunkTemplate.hooks.render.tap( - "NodeHotUpdateChunkTemplatePlugin", - (modulesSource, modules, removedModules, hash, id) => { - const source = new ConcatSource(); - source.add( - "exports.id = " + JSON.stringify(id) + ";\nexports.modules = " + // Check if size matches (faster than waiting for hash) + const size = selectedModules.reduce( + (sum, m) => sum + m.size(), + 0 + ); + if (size !== splitData.size) return false; + + // get chunks with all modules + const selectedChunks = intersect( + selectedModules.map(m => new Set(m.chunksIterable)) + ); + + // No relevant chunks found + if (selectedChunks.size === 0) return false; + + // The found chunk is already the split or similar + if ( + selectedChunks.size === 1 && + Array.from(selectedChunks)[0].getNumberOfModules() === + selectedModules.length + ) { + const chunk = Array.from(selectedChunks)[0]; + if (fromAggressiveSplittingSet.has(chunk)) return false; + fromAggressiveSplittingSet.add(chunk); + chunkSplitDataMap.set(chunk, splitData); + return true; + } + + // split the chunk into two parts + const newChunk = compilation.addChunk(); + newChunk.chunkReason = "aggressive splitted"; + for (const chunk of selectedChunks) { + selectedModules.forEach(moveModuleBetween(chunk, newChunk)); + chunk.split(newChunk); + chunk.name = null; + } + fromAggressiveSplittingSet.add(newChunk); + chunkSplitDataMap.set(newChunk, splitData); + + if (splitData.id !== null && splitData.id !== undefined) { + newChunk.id = splitData.id; + } + return true; + }; + + // try to restore to recorded splitting + let changed = false; + for (let j = 0; j < usedSplits.length; j++) { + const splitData = usedSplits[j]; + if (applySplit(splitData)) changed = true; + } + + // for any chunk which isn't splitted yet, split it and create a new entry + // start with the biggest chunk + const sortedChunks = chunks.slice().sort((a, b) => { + const diff1 = b.modulesSize() - a.modulesSize(); + if (diff1) return diff1; + const diff2 = a.getNumberOfModules() - b.getNumberOfModules(); + if (diff2) return diff2; + const modulesA = Array.from(a.modulesIterable); + const modulesB = Array.from(b.modulesIterable); + modulesA.sort(); + modulesB.sort(); + const aI = modulesA[Symbol.iterator](); + const bI = modulesB[Symbol.iterator](); + // eslint-disable-next-line no-constant-condition + while (true) { + const aItem = aI.next(); + const bItem = bI.next(); + if (aItem.done) return 0; + const aModuleIdentifier = aItem.value.identifier(); + const bModuleIdentifier = bItem.value.identifier(); + if (aModuleIdentifier > bModuleIdentifier) return -1; + if (aModuleIdentifier < bModuleIdentifier) return 1; + } + }); + for (const chunk of sortedChunks) { + if (fromAggressiveSplittingSet.has(chunk)) continue; + const size = chunk.modulesSize(); + if (size > maxSize && chunk.getNumberOfModules() > 1) { + const modules = chunk + .getModules() + .filter(isNotAEntryModule(chunk.entryModule)) + .sort((a, b) => { + a = a.identifier(); + b = b.identifier(); + if (a > b) return 1; + if (a < b) return -1; + return 0; + }); + const selectedModules = []; + let selectedModulesSize = 0; + for (let k = 0; k < modules.length; k++) { + const module = modules[k]; + const newSize = selectedModulesSize + module.size(); + if (newSize > maxSize && selectedModulesSize >= minSize) { + break; + } + selectedModulesSize = newSize; + selectedModules.push(module); + } + if (selectedModules.length === 0) continue; + const splitData = { + modules: selectedModules + .map(m => moduleToNameMap.get(m)) + .sort(), + size: selectedModulesSize + }; + + if (applySplit(splitData)) { + newSplits = (newSplits || []).concat(splitData); + changed = true; + } + } + } + if (changed) return true; + } ); - source.add(modulesSource); - source.add(";"); - return source; - } - ); - hotUpdateChunkTemplate.hooks.hash.tap( - "NodeHotUpdateChunkTemplatePlugin", - hash => { - hash.update("NodeHotUpdateChunkTemplatePlugin"); - hash.update("3"); - hash.update( - hotUpdateChunkTemplate.outputOptions.hotUpdateFunction + "" + compilation.hooks.recordHash.tap( + "AggressiveSplittingPlugin", + records => { + // 4. save made splittings to records + const allSplits = new Set(); + const invalidSplits = new Set(); + + // Check if some splittings are invalid + // We remove invalid splittings and try again + for (const chunk of compilation.chunks) { + const splitData = chunkSplitDataMap.get(chunk); + if (splitData !== undefined) { + if (splitData.hash && chunk.hash !== splitData.hash) { + // Split was successful, but hash doesn't equal + // We can throw away the split since it's useless now + invalidSplits.add(splitData); + } + } + } + + if (invalidSplits.size > 0) { + records.aggressiveSplits = records.aggressiveSplits.filter( + splitData => !invalidSplits.has(splitData) + ); + needAdditionalSeal = true; + } else { + // set hash and id values on all (new) splittings + for (const chunk of compilation.chunks) { + const splitData = chunkSplitDataMap.get(chunk); + if (splitData !== undefined) { + splitData.hash = chunk.hash; + splitData.id = chunk.id; + allSplits.add(splitData); + // set flag for stats + chunk.recorded = true; + } + } + + // Also add all unused historial splits (after the used ones) + // They can still be used in some future compilation + const recordedSplits = + compilation.records && compilation.records.aggressiveSplits; + if (recordedSplits) { + for (const splitData of recordedSplits) { + if (!invalidSplits.has(splitData)) allSplits.add(splitData); + } + } + + // record all splits + records.aggressiveSplits = Array.from(allSplits); + + needAdditionalSeal = false; + } + } + ); + compilation.hooks.needAdditionalSeal.tap( + "AggressiveSplittingPlugin", + () => { + if (needAdditionalSeal) { + needAdditionalSeal = false; + return true; + } + } ); - hash.update(hotUpdateChunkTemplate.outputOptions.library + ""); } ); } } -module.exports = NodeHotUpdateChunkTemplatePlugin; +module.exports = AggressiveSplittingPlugin; /***/ }), -/***/ 33514: +/***/ 30346: /***/ (function(module) { +"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -// eslint-disable-next-line no-unused-vars -var $hotChunkFilename$ = undefined; -var hotAddUpdateChunk = undefined; -var installedChunks = undefined; -var $hotMainFilename$ = undefined; - -module.exports = function() { - // eslint-disable-next-line no-unused-vars - function hotDownloadUpdateChunk(chunkId) { - var chunk = require("./" + $hotChunkFilename$); - hotAddUpdateChunk(chunk.id, chunk.modules); - } - // eslint-disable-next-line no-unused-vars - function hotDownloadManifest() { - try { - var update = require("./" + $hotMainFilename$); - } catch (e) { - return Promise.resolve(); - } - return Promise.resolve(update); - } - //eslint-disable-next-line no-unused-vars - function hotDisposeChunk(chunkId) { - delete installedChunks[chunkId]; - } +const sortByIndex = (a, b) => { + return a.index - b.index; }; +const sortByIndex2 = (a, b) => { + return a.index2 - b.index2; +}; -/***/ }), - -/***/ 51433: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +class ChunkModuleIdRangePlugin { + constructor(options) { + this.options = options; + } -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// eslint-disable-next-line no-unused-vars -var $hotChunkFilename$ = undefined; -var $require$ = undefined; -var hotAddUpdateChunk = undefined; -var $hotMainFilename$ = undefined; -var installedChunks = undefined; + apply(compiler) { + const options = this.options; + compiler.hooks.compilation.tap("ChunkModuleIdRangePlugin", compilation => { + compilation.hooks.moduleIds.tap("ChunkModuleIdRangePlugin", modules => { + const chunk = compilation.chunks.find( + chunk => chunk.name === options.name + ); + if (!chunk) { + throw new Error( + `ChunkModuleIdRangePlugin: Chunk with name '${options.name}"' was not found` + ); + } -module.exports = function() { - // eslint-disable-next-line no-unused-vars - function hotDownloadUpdateChunk(chunkId) { - var filename = __webpack_require__(85622).join(__dirname, $hotChunkFilename$); - __webpack_require__(35747).readFile(filename, "utf-8", function(err, content) { - if (err) { - if ($require$.onError) return $require$.oe(err); - throw err; - } - var chunk = {}; - __webpack_require__(92184).runInThisContext( - "(function(exports) {" + content + "\n})", - { filename: filename } - )(chunk); - hotAddUpdateChunk(chunk.id, chunk.modules); - }); - } + let chunkModules; + if (options.order) { + chunkModules = Array.from(chunk.modulesIterable); + switch (options.order) { + case "index": + chunkModules.sort(sortByIndex); + break; + case "index2": + chunkModules.sort(sortByIndex2); + break; + default: + throw new Error( + "ChunkModuleIdRangePlugin: unexpected value of order" + ); + } + } else { + chunkModules = modules.filter(m => { + return m.chunksIterable.has(chunk); + }); + } - // eslint-disable-next-line no-unused-vars - function hotDownloadManifest() { - var filename = __webpack_require__(85622).join(__dirname, $hotMainFilename$); - return new Promise(function(resolve, reject) { - __webpack_require__(35747).readFile(filename, "utf-8", function(err, content) { - if (err) return resolve(); - try { - var update = JSON.parse(content); - } catch (e) { - return reject(e); + let currentId = options.start || 0; + for (let i = 0; i < chunkModules.length; i++) { + const m = chunkModules[i]; + if (m.id === null) { + m.id = currentId++; + } + if (options.end && currentId > options.end) break; } - resolve(update); }); }); } - - // eslint-disable-next-line no-unused-vars - function hotDisposeChunk(chunkId) { - delete installedChunks[chunkId]; - } -}; +} +module.exports = ChunkModuleIdRangePlugin; /***/ }), -/***/ 78597: +/***/ 16953: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -86721,1297 +84348,1560 @@ module.exports = function() { */ +const Module = __webpack_require__(75993); const Template = __webpack_require__(96066); +const Parser = __webpack_require__(70558); +const eslintScope = __webpack_require__(41632); +const { ConcatSource, ReplaceSource } = __webpack_require__(53665); +const DependencyReference = __webpack_require__(71722); +const HarmonyImportDependency = __webpack_require__(81599); +const HarmonyImportSideEffectDependency = __webpack_require__(79171); +const HarmonyImportSpecifierDependency = __webpack_require__(95966); +const HarmonyExportSpecifierDependency = __webpack_require__(34834); +const HarmonyExportExpressionDependency = __webpack_require__(84245); +const HarmonyExportImportedSpecifierDependency = __webpack_require__(22864); +const HarmonyCompatibilityDependency = __webpack_require__(1533); +const createHash = __webpack_require__(15660); -module.exports = class NodeMainTemplatePlugin { - constructor(asyncChunkLoading) { - this.asyncChunkLoading = asyncChunkLoading; +/** @typedef {import("../Dependency")} Dependency */ +/** @typedef {import("../Compilation")} Compilation */ +/** @typedef {import("../util/createHash").Hash} Hash */ +/** @typedef {import("../RequestShortener")} RequestShortener */ + +const joinIterableWithComma = iterable => { + // This is more performant than Array.from().join(", ") + // as it doesn't create an array + let str = ""; + let first = true; + for (const item of iterable) { + if (first) { + first = false; + } else { + str += ", "; + } + str += item; } + return str; +}; - apply(mainTemplate) { - const needChunkOnDemandLoadingCode = chunk => { - for (const chunkGroup of chunk.groupsIterable) { - if (chunkGroup.getNumberOfChildren() > 0) return true; - } - return false; - }; - const asyncChunkLoading = this.asyncChunkLoading; - mainTemplate.hooks.localVars.tap( - "NodeMainTemplatePlugin", - (source, chunk) => { - if (needChunkOnDemandLoadingCode(chunk)) { - return Template.asString([ - source, - "", - "// object to store loaded chunks", - '// "0" means "already loaded"', - "var installedChunks = {", - Template.indent( - chunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(",\n") - ), - "};" - ]); - } - return source; - } - ); - mainTemplate.hooks.requireExtensions.tap( - "NodeMainTemplatePlugin", - (source, chunk) => { - if (needChunkOnDemandLoadingCode(chunk)) { - return Template.asString([ - source, - "", - "// uncaught error handler for webpack runtime", - `${mainTemplate.requireFn}.oe = function(err) {`, - Template.indent([ - "process.nextTick(function() {", - Template.indent( - "throw err; // catch this error by using import().catch()" - ), - "});" - ]), - "};" - ]); - } - return source; - } - ); - mainTemplate.hooks.requireEnsure.tap( - "NodeMainTemplatePlugin", - (source, chunk, hash) => { - const chunkFilename = mainTemplate.outputOptions.chunkFilename; - const chunkMaps = chunk.getChunkMaps(); - const insertMoreModules = [ - "var moreModules = chunk.modules, chunkIds = chunk.ids;", - "for(var moduleId in moreModules) {", - Template.indent( - mainTemplate.renderAddModule( - hash, - chunk, - "moduleId", - "moreModules[moduleId]" - ) - ), - "}" - ]; - if (asyncChunkLoading) { - return Template.asString([ - source, - "", - "// ReadFile + VM.run chunk loading for javascript", - "", - "var installedChunkData = installedChunks[chunkId];", - 'if(installedChunkData !== 0) { // 0 means "already installed".', - Template.indent([ - '// array of [resolve, reject, promise] means "currently loading"', - "if(installedChunkData) {", - Template.indent(["promises.push(installedChunkData[2]);"]), - "} else {", - Template.indent([ - "// load the chunk and return promise to it", - "var promise = new Promise(function(resolve, reject) {", - Template.indent([ - "installedChunkData = installedChunks[chunkId] = [resolve, reject];", - "var filename = require('path').join(__dirname, " + - mainTemplate.getAssetPath( - JSON.stringify(`/${chunkFilename}`), - { - hash: `" + ${mainTemplate.renderCurrentHashCode( - hash - )} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode( - hash, - length - )} + "`, - chunk: { - id: '" + chunkId + "', - hash: `" + ${JSON.stringify( - chunkMaps.hash - )}[chunkId] + "`, - hashWithLength: length => { - const shortChunkHashMap = {}; - for (const chunkId of Object.keys(chunkMaps.hash)) { - if (typeof chunkMaps.hash[chunkId] === "string") { - shortChunkHashMap[chunkId] = chunkMaps.hash[ - chunkId - ].substr(0, length); - } - } - return `" + ${JSON.stringify( - shortChunkHashMap - )}[chunkId] + "`; - }, - contentHash: { - javascript: `" + ${JSON.stringify( - chunkMaps.contentHash.javascript - )}[chunkId] + "` - }, - contentHashWithLength: { - javascript: length => { - const shortContentHashMap = {}; - const contentHash = - chunkMaps.contentHash.javascript; - for (const chunkId of Object.keys(contentHash)) { - if (typeof contentHash[chunkId] === "string") { - shortContentHashMap[chunkId] = contentHash[ - chunkId - ].substr(0, length); - } - } - return `" + ${JSON.stringify( - shortContentHashMap - )}[chunkId] + "`; - } - }, - name: `" + (${JSON.stringify( - chunkMaps.name - )}[chunkId]||chunkId) + "` - }, - contentHashType: "javascript" - } - ) + - ");", - "require('fs').readFile(filename, 'utf-8', function(err, content) {", - Template.indent( - [ - "if(err) return reject(err);", - "var chunk = {};", - "require('vm').runInThisContext('(function(exports, require, __dirname, __filename) {' + content + '\\n})', filename)" + - "(chunk, require, require('path').dirname(filename), filename);" - ] - .concat(insertMoreModules) - .concat([ - "var callbacks = [];", - "for(var i = 0; i < chunkIds.length; i++) {", - Template.indent([ - "if(installedChunks[chunkIds[i]])", - Template.indent([ - "callbacks = callbacks.concat(installedChunks[chunkIds[i]][0]);" - ]), - "installedChunks[chunkIds[i]] = 0;" - ]), - "}", - "for(i = 0; i < callbacks.length; i++)", - Template.indent("callbacks[i]();") - ]) - ), - "});" - ]), - "});", - "promises.push(installedChunkData[2] = promise);" - ]), - "}" - ]), - "}" - ]); +/** + * @typedef {Object} ConcatenationEntry + * @property {"concatenated" | "external"} type + * @property {Module} module + */ + +const ensureNsObjSource = ( + info, + moduleToInfoMap, + requestShortener, + strictHarmonyModule +) => { + if (!info.hasNamespaceObject) { + info.hasNamespaceObject = true; + const name = info.exportMap.get(true); + const nsObj = [`var ${name} = {};`, `__webpack_require__.r(${name});`]; + for (const exportName of info.module.buildMeta.providedExports) { + const finalName = getFinalName( + info, + exportName, + moduleToInfoMap, + requestShortener, + false, + strictHarmonyModule + ); + nsObj.push( + `__webpack_require__.d(${name}, ${JSON.stringify( + exportName + )}, function() { return ${finalName}; });` + ); + } + info.namespaceObjectSource = nsObj.join("\n") + "\n"; + } +}; + +const getExternalImport = ( + importedModule, + info, + exportName, + asCall, + strictHarmonyModule +) => { + const used = importedModule.isUsed(exportName); + if (!used) return "/* unused reexport */undefined"; + const comment = + used !== exportName ? ` ${Template.toNormalComment(exportName)}` : ""; + switch (importedModule.buildMeta.exportsType) { + case "named": + if (exportName === "default") { + return info.name; + } else if (exportName === true) { + info.interopNamespaceObjectUsed = true; + return info.interopNamespaceObjectName; + } else { + break; + } + case "namespace": + if (exportName === true) { + return info.name; + } else { + break; + } + default: + if (strictHarmonyModule) { + if (exportName === "default") { + return info.name; + } else if (exportName === true) { + info.interopNamespaceObjectUsed = true; + return info.interopNamespaceObjectName; } else { - const request = mainTemplate.getAssetPath( - JSON.stringify(`./${chunkFilename}`), - { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, - chunk: { - id: '" + chunkId + "', - hash: `" + ${JSON.stringify(chunkMaps.hash)}[chunkId] + "`, - hashWithLength: length => { - const shortChunkHashMap = {}; - for (const chunkId of Object.keys(chunkMaps.hash)) { - if (typeof chunkMaps.hash[chunkId] === "string") { - shortChunkHashMap[chunkId] = chunkMaps.hash[ - chunkId - ].substr(0, length); - } - } - return `" + ${JSON.stringify( - shortChunkHashMap - )}[chunkId] + "`; - }, - contentHash: { - javascript: `" + ${JSON.stringify( - chunkMaps.contentHash.javascript - )}[chunkId] + "` - }, - contentHashWithLength: { - javascript: length => { - const shortContentHashMap = {}; - const contentHash = chunkMaps.contentHash.javascript; - for (const chunkId of Object.keys(contentHash)) { - if (typeof contentHash[chunkId] === "string") { - shortContentHashMap[chunkId] = contentHash[ - chunkId - ].substr(0, length); - } - } - return `" + ${JSON.stringify( - shortContentHashMap - )}[chunkId] + "`; - } - }, - name: `" + (${JSON.stringify( - chunkMaps.name - )}[chunkId]||chunkId) + "` - }, - contentHashType: "javascript" - } + return "/* non-default import from non-esm module */undefined"; + } + } else { + if (exportName === "default") { + info.interopDefaultAccessUsed = true; + return asCall + ? `${info.interopDefaultAccessName}()` + : `${info.interopDefaultAccessName}.a`; + } else if (exportName === true) { + return info.name; + } else { + break; + } + } + } + const reference = `${info.name}[${JSON.stringify(used)}${comment}]`; + if (asCall) return `Object(${reference})`; + return reference; +}; + +const getFinalName = ( + info, + exportName, + moduleToInfoMap, + requestShortener, + asCall, + strictHarmonyModule, + alreadyVisited = new Set() +) => { + switch (info.type) { + case "concatenated": { + const directExport = info.exportMap.get(exportName); + if (directExport) { + if (exportName === true) { + ensureNsObjSource( + info, + moduleToInfoMap, + requestShortener, + strictHarmonyModule + ); + } else if (!info.module.isUsed(exportName)) { + return "/* unused export */ undefined"; + } + if (info.globalExports.has(directExport)) { + return directExport; + } + const name = info.internalNames.get(directExport); + if (!name) { + throw new Error( + `The export "${directExport}" in "${info.module.readableIdentifier( + requestShortener + )}" has no internal name` ); - return Template.asString([ - source, - "", - "// require() chunk loading for javascript", - "", - '// "0" is the signal for "already loaded"', - "if(installedChunks[chunkId] !== 0) {", - Template.indent( - [`var chunk = require(${request});`] - .concat(insertMoreModules) - .concat([ - "for(var i = 0; i < chunkIds.length; i++)", - Template.indent("installedChunks[chunkIds[i]] = 0;") - ]) - ), - "}" - ]); } + return name; } - ); - mainTemplate.hooks.hotBootstrap.tap( - "NodeMainTemplatePlugin", - (source, chunk, hash) => { - const hotUpdateChunkFilename = - mainTemplate.outputOptions.hotUpdateChunkFilename; - const hotUpdateMainFilename = - mainTemplate.outputOptions.hotUpdateMainFilename; - const chunkMaps = chunk.getChunkMaps(); - const currentHotUpdateChunkFilename = mainTemplate.getAssetPath( - JSON.stringify(hotUpdateChunkFilename), - { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, - chunk: { - id: '" + chunkId + "', - hash: `" + ${JSON.stringify(chunkMaps.hash)}[chunkId] + "`, - hashWithLength: length => { - const shortChunkHashMap = {}; - for (const chunkId of Object.keys(chunkMaps.hash)) { - if (typeof chunkMaps.hash[chunkId] === "string") { - shortChunkHashMap[chunkId] = chunkMaps.hash[chunkId].substr( - 0, - length - ); - } - } - return `" + ${JSON.stringify(shortChunkHashMap)}[chunkId] + "`; - }, - name: `" + (${JSON.stringify( - chunkMaps.name - )}[chunkId]||chunkId) + "` - } - } - ); - const currentHotUpdateMainFilename = mainTemplate.getAssetPath( - JSON.stringify(hotUpdateMainFilename), - { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "` - } - ); - return Template.getFunctionContent( - asyncChunkLoading - ? __webpack_require__(51433) - : __webpack_require__(33514) - ) - .replace(/\$require\$/g, mainTemplate.requireFn) - .replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename) - .replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename); + const reexport = info.reexportMap.get(exportName); + if (reexport) { + if (alreadyVisited.has(reexport)) { + throw new Error( + `Circular reexports ${Array.from( + alreadyVisited, + e => + `"${e.module.readableIdentifier(requestShortener)}".${ + e.exportName + }` + ).join( + " --> " + )} -(circular)-> "${reexport.module.readableIdentifier( + requestShortener + )}".${reexport.exportName}` + ); + } + alreadyVisited.add(reexport); + const refInfo = moduleToInfoMap.get(reexport.module); + if (refInfo) { + // module is in the concatenation + return getFinalName( + refInfo, + reexport.exportName, + moduleToInfoMap, + requestShortener, + asCall, + strictHarmonyModule, + alreadyVisited + ); + } } - ); - mainTemplate.hooks.hash.tap("NodeMainTemplatePlugin", hash => { - hash.update("node"); - hash.update("4"); - }); + const problem = + `Cannot get final name for export "${exportName}" in "${info.module.readableIdentifier( + requestShortener + )}"` + + ` (known exports: ${Array.from(info.exportMap.keys()) + .filter(name => name !== true) + .join(" ")}, ` + + `known reexports: ${Array.from(info.reexportMap.keys()).join(" ")})`; + return `${Template.toNormalComment(problem)} undefined`; + } + case "external": { + const importedModule = info.module; + return getExternalImport( + importedModule, + info, + exportName, + asCall, + strictHarmonyModule + ); + } } }; +const addScopeSymbols1 = (s, nameSet, scopeSet) => { + let scope = s; + while (scope) { + if (scopeSet.has(scope)) break; + scopeSet.add(scope); + for (const variable of scope.variables) { + nameSet.add(variable.name); + } + scope = scope.upper; + } +}; -/***/ }), +const addScopeSymbols2 = (s, nameSet, scopeSet1, scopeSet2) => { + let scope = s; + while (scope) { + if (scopeSet1.has(scope)) break; + if (scopeSet2.has(scope)) break; + scopeSet1.add(scope); + for (const variable of scope.variables) { + nameSet.add(variable.name); + } + scope = scope.upper; + } +}; -/***/ 31836: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +const getAllReferences = variable => { + let set = variable.references; + // Look for inner scope variables too (like in class Foo { t() { Foo } }) + const identifiers = new Set(variable.identifiers); + for (const scope of variable.scope.childScopes) { + for (const innerVar of scope.variables) { + if (innerVar.identifiers.some(id => identifiers.has(id))) { + set = set.concat(innerVar.references); + break; + } + } + } + return set; +}; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +const getPathInAst = (ast, node) => { + if (ast === node) { + return []; + } + const nr = node.range; -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const mkdirp = __webpack_require__(50998); + const enterNode = n => { + if (!n) return undefined; + const r = n.range; + if (r) { + if (r[0] <= nr[0] && r[1] >= nr[1]) { + const path = getPathInAst(n, node); + if (path) { + path.push(n); + return path; + } + } + } + return undefined; + }; -class NodeOutputFileSystem { - constructor() { - this.mkdirp = mkdirp; - this.mkdir = fs.mkdir.bind(fs); - this.rmdir = fs.rmdir.bind(fs); - this.unlink = fs.unlink.bind(fs); - this.writeFile = fs.writeFile.bind(fs); - this.join = path.join.bind(path); + var i; + if (Array.isArray(ast)) { + for (i = 0; i < ast.length; i++) { + const enterResult = enterNode(ast[i]); + if (enterResult !== undefined) return enterResult; + } + } else if (ast && typeof ast === "object") { + const keys = Object.keys(ast); + for (i = 0; i < keys.length; i++) { + const value = ast[keys[i]]; + if (Array.isArray(value)) { + const pathResult = getPathInAst(value, node); + if (pathResult !== undefined) return pathResult; + } else if (value && typeof value === "object") { + const enterResult = enterNode(value); + if (enterResult !== undefined) return enterResult; + } + } } -} +}; -module.exports = NodeOutputFileSystem; +const getHarmonyExportImportedSpecifierDependencyExports = dep => { + const importModule = dep._module; + if (!importModule) return []; + if (dep._id) { + // export { named } from "module" + return [ + { + name: dep.name, + id: dep._id, + module: importModule + } + ]; + } + if (dep.name) { + // export * as abc from "module" + return [ + { + name: dep.name, + id: true, + module: importModule + } + ]; + } + // export * from "module" + return importModule.buildMeta.providedExports + .filter(exp => exp !== "default" && !dep.activeExports.has(exp)) + .map(exp => { + return { + name: exp, + id: exp, + module: importModule + }; + }); +}; +class ConcatenatedModule extends Module { + constructor(rootModule, modules, concatenationList) { + super("javascript/esm", null); + super.setChunks(rootModule._chunks); -/***/ }), + // Info from Factory + this.rootModule = rootModule; + this.factoryMeta = rootModule.factoryMeta; -/***/ 9128: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Info from Compilation + this.index = rootModule.index; + this.index2 = rootModule.index2; + this.depth = rootModule.depth; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // Info from Optimization + this.used = rootModule.used; + this.usedExports = rootModule.usedExports; -const AliasPlugin = __webpack_require__(15005); -const ParserHelpers = __webpack_require__(23999); -const nodeLibsBrowser = __webpack_require__(27852); + // Info from Build + this.buildInfo = { + strict: true, + cacheable: modules.every(m => m.buildInfo.cacheable), + moduleArgument: rootModule.buildInfo.moduleArgument, + exportsArgument: rootModule.buildInfo.exportsArgument, + fileDependencies: new Set(), + contextDependencies: new Set(), + assets: undefined + }; + this.built = modules.some(m => m.built); + this.buildMeta = rootModule.buildMeta; -module.exports = class NodeSourcePlugin { - constructor(options) { - this.options = options; - } - apply(compiler) { - const options = this.options; - if (options === false) { - // allow single kill switch to turn off this plugin - return; - } + // Caching + this._numberOfConcatenatedModules = modules.length; - const getPathToModule = (module, type) => { - if (type === true || (type === undefined && nodeLibsBrowser[module])) { - if (!nodeLibsBrowser[module]) { - throw new Error( - `No browser version for node.js core module ${module} available` - ); - } - return nodeLibsBrowser[module]; - } else if (type === "mock") { - return require.resolve(`node-libs-browser/mock/${module}`); - } else if (type === "empty") { - return __webpack_require__.ab + "empty.js"; - } else { - return module; - } - }; + // Graph + const modulesSet = new Set(modules); + this.reasons = rootModule.reasons.filter( + reason => + !(reason.dependency instanceof HarmonyImportDependency) || + !modulesSet.has(reason.module) + ); - const addExpression = (parser, name, module, type, suffix) => { - suffix = suffix || ""; - parser.hooks.expression.for(name).tap("NodeSourcePlugin", () => { - if ( - parser.state.module && - parser.state.module.resource === getPathToModule(module, type) - ) - return; - const mockModule = ParserHelpers.requireFileAsExpression( - parser.state.module.context, - getPathToModule(module, type) - ); - return ParserHelpers.addParsedVariableToModule( - parser, - name, - mockModule + suffix - ); - }); - }; + this.dependencies = []; + this.blocks = []; - compiler.hooks.compilation.tap( - "NodeSourcePlugin", - (compilation, { normalModuleFactory }) => { - const handler = (parser, parserOptions) => { - if (parserOptions.node === false) return; + this.warnings = []; + this.errors = []; + this._orderedConcatenationList = + concatenationList || + ConcatenatedModule.createConcatenationList(rootModule, modulesSet, null); + for (const info of this._orderedConcatenationList) { + if (info.type === "concatenated") { + const m = info.module; - let localOptions = options; - if (parserOptions.node) { - localOptions = Object.assign({}, localOptions, parserOptions.node); - } - if (localOptions.global) { - parser.hooks.expression - .for("global") - .tap("NodeSourcePlugin", () => { - const retrieveGlobalModule = ParserHelpers.requireFileAsExpression( - parser.state.module.context, - __webpack_require__.ab + "global.js" - ); - return ParserHelpers.addParsedVariableToModule( - parser, - "global", - retrieveGlobalModule - ); - }); + // populate dependencies + for (const d of m.dependencies.filter( + dep => + !(dep instanceof HarmonyImportDependency) || + !modulesSet.has(dep._module) + )) { + this.dependencies.push(d); + } + // populate blocks + for (const d of m.blocks) { + this.blocks.push(d); + } + // populate file dependencies + if (m.buildInfo.fileDependencies) { + for (const file of m.buildInfo.fileDependencies) { + this.buildInfo.fileDependencies.add(file); } - if (localOptions.process) { - const processType = localOptions.process; - addExpression(parser, "process", "process", processType); + } + // populate context dependencies + if (m.buildInfo.contextDependencies) { + for (const context of m.buildInfo.contextDependencies) { + this.buildInfo.contextDependencies.add(context); } - if (localOptions.console) { - const consoleType = localOptions.console; - addExpression(parser, "console", "console", consoleType); + } + // populate warnings + for (const warning of m.warnings) { + this.warnings.push(warning); + } + // populate errors + for (const error of m.errors) { + this.errors.push(error); + } + + if (m.buildInfo.assets) { + if (this.buildInfo.assets === undefined) { + this.buildInfo.assets = Object.create(null); } - const bufferType = localOptions.Buffer; - if (bufferType) { - addExpression(parser, "Buffer", "buffer", bufferType, ".Buffer"); + Object.assign(this.buildInfo.assets, m.buildInfo.assets); + } + if (m.buildInfo.assetsInfo) { + if (this.buildInfo.assetsInfo === undefined) { + this.buildInfo.assetsInfo = new Map(); } - if (localOptions.setImmediate) { - const setImmediateType = localOptions.setImmediate; - addExpression( - parser, - "setImmediate", - "timers", - setImmediateType, - ".setImmediate" - ); - addExpression( - parser, - "clearImmediate", - "timers", - setImmediateType, - ".clearImmediate" - ); + for (const [key, value] of m.buildInfo.assetsInfo) { + this.buildInfo.assetsInfo.set(key, value); } - }; - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("NodeSourcePlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("NodeSourcePlugin", handler); - } - ); - compiler.hooks.afterResolvers.tap("NodeSourcePlugin", compiler => { - for (const lib of Object.keys(nodeLibsBrowser)) { - if (options[lib] !== false) { - compiler.resolverFactory.hooks.resolver - .for("normal") - .tap("NodeSourcePlugin", resolver => { - new AliasPlugin( - "described-resolve", - { - name: lib, - onlyModule: true, - alias: getPathToModule(lib, options[lib]) - }, - "resolve" - ).apply(resolver); - }); } } - }); + } + this._identifier = this._createIdentifier(); } -}; - - -/***/ }), -/***/ 59743: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const ExternalsPlugin = __webpack_require__(75705); + get modules() { + return this._orderedConcatenationList + .filter(info => info.type === "concatenated") + .map(info => info.module); + } -const builtins = - // eslint-disable-next-line node/no-unsupported-features/node-builtins,node/no-deprecated-api - __webpack_require__(32282).builtinModules || Object.keys(process.binding("natives")); + identifier() { + return this._identifier; + } -class NodeTargetPlugin { - apply(compiler) { - new ExternalsPlugin("commonjs", builtins).apply(compiler); + readableIdentifier(requestShortener) { + return ( + this.rootModule.readableIdentifier(requestShortener) + + ` + ${this._numberOfConcatenatedModules - 1} modules` + ); } -} -module.exports = NodeTargetPlugin; + libIdent(options) { + return this.rootModule.libIdent(options); + } + nameForCondition() { + return this.rootModule.nameForCondition(); + } -/***/ }), + build(options, compilation, resolver, fs, callback) { + throw new Error("Cannot build this module. It should be already built."); + } -/***/ 90010: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + size() { + // Guess size from embedded modules + return this._orderedConcatenationList.reduce((sum, info) => { + switch (info.type) { + case "concatenated": + return sum + info.module.size(); + case "external": + return sum + 5; + } + return sum; + }, 0); + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + /** + * @param {Module} rootModule the root of the concatenation + * @param {Set} modulesSet a set of modules which should be concatenated + * @param {Compilation} compilation the compilation context + * @returns {ConcatenationEntry[]} concatenation list + */ + static createConcatenationList(rootModule, modulesSet, compilation) { + const list = []; + const set = new Set(); + /** + * @param {Module} module a module + * @returns {(function(): Module)[]} imported modules in order + */ + const getConcatenatedImports = module => { + /** @type {WeakMap} */ + const map = new WeakMap(); + const references = module.dependencies + .filter(dep => dep instanceof HarmonyImportDependency) + .map(dep => { + const ref = compilation.getDependencyReference(module, dep); + if (ref) map.set(ref, dep); + return ref; + }) + .filter(ref => ref); + DependencyReference.sort(references); + // TODO webpack 5: remove this hack, see also DependencyReference + return references.map(ref => { + const dep = map.get(ref); + return () => compilation.getDependencyReference(module, dep).module; + }); + }; + const enterModule = getModule => { + const module = getModule(); + if (!module) return; + if (set.has(module)) return; + set.add(module); + if (modulesSet.has(module)) { + const imports = getConcatenatedImports(module); + imports.forEach(enterModule); + list.push({ + type: "concatenated", + module + }); + } else { + list.push({ + type: "external", + get module() { + // We need to use a getter here, because the module in the dependency + // could be replaced by some other process (i. e. also replaced with a + // concatenated module) + return getModule(); + } + }); + } + }; -const NodeMainTemplatePlugin = __webpack_require__(78597); -const NodeChunkTemplatePlugin = __webpack_require__(45249); -const NodeHotUpdateChunkTemplatePlugin = __webpack_require__(95909); + enterModule(() => rootModule); -class NodeTemplatePlugin { - constructor(options) { - options = options || {}; - this.asyncChunkLoading = options.asyncChunkLoading; + return list; } - apply(compiler) { - compiler.hooks.thisCompilation.tap("NodeTemplatePlugin", compilation => { - new NodeMainTemplatePlugin(this.asyncChunkLoading).apply( - compilation.mainTemplate - ); - new NodeChunkTemplatePlugin().apply(compilation.chunkTemplate); - new NodeHotUpdateChunkTemplatePlugin().apply( - compilation.hotUpdateChunkTemplate - ); - }); + _createIdentifier() { + let orderedConcatenationListIdentifiers = ""; + for (let i = 0; i < this._orderedConcatenationList.length; i++) { + if (this._orderedConcatenationList[i].type === "concatenated") { + orderedConcatenationListIdentifiers += this._orderedConcatenationList[ + i + ].module.identifier(); + orderedConcatenationListIdentifiers += " "; + } + } + const hash = createHash("md4"); + hash.update(orderedConcatenationListIdentifiers); + return this.rootModule.identifier() + " " + hash.digest("hex"); } -} - -module.exports = NodeTemplatePlugin; - -/***/ }), - -/***/ 71610: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + source(dependencyTemplates, runtimeTemplate) { + const requestShortener = runtimeTemplate.requestShortener; + // Metainfo for each module + const modulesWithInfo = this._orderedConcatenationList.map((info, idx) => { + switch (info.type) { + case "concatenated": { + const exportMap = new Map(); + const reexportMap = new Map(); + for (const dep of info.module.dependencies) { + if (dep instanceof HarmonyExportSpecifierDependency) { + if (!exportMap.has(dep.name)) { + exportMap.set(dep.name, dep.id); + } + } else if (dep instanceof HarmonyExportExpressionDependency) { + if (!exportMap.has("default")) { + exportMap.set("default", "__WEBPACK_MODULE_DEFAULT_EXPORT__"); + } + } else if ( + dep instanceof HarmonyExportImportedSpecifierDependency + ) { + const exportName = dep.name; + const importName = dep._id; + const importedModule = dep._module; + if (exportName && importName) { + if (!reexportMap.has(exportName)) { + reexportMap.set(exportName, { + module: importedModule, + exportName: importName, + dependency: dep + }); + } + } else if (exportName) { + if (!reexportMap.has(exportName)) { + reexportMap.set(exportName, { + module: importedModule, + exportName: true, + dependency: dep + }); + } + } else if (importedModule) { + for (const name of importedModule.buildMeta.providedExports) { + if (dep.activeExports.has(name) || name === "default") { + continue; + } + if (!reexportMap.has(name)) { + reexportMap.set(name, { + module: importedModule, + exportName: name, + dependency: dep + }); + } + } + } + } + } + return { + type: "concatenated", + module: info.module, + index: idx, + ast: undefined, + internalSource: undefined, + source: undefined, + globalScope: undefined, + moduleScope: undefined, + internalNames: new Map(), + globalExports: new Set(), + exportMap: exportMap, + reexportMap: reexportMap, + hasNamespaceObject: false, + namespaceObjectSource: null + }; + } + case "external": + return { + type: "external", + module: info.module, + index: idx, + name: undefined, + interopNamespaceObjectUsed: false, + interopNamespaceObjectName: undefined, + interopDefaultAccessUsed: false, + interopDefaultAccessName: undefined + }; + default: + throw new Error(`Unsupported concatenation entry type ${info.type}`); + } + }); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // Create mapping from module to info + const moduleToInfoMap = new Map(); + for (const m of modulesWithInfo) { + moduleToInfoMap.set(m.module, m); + } + // Configure template decorators for dependencies + const innerDependencyTemplates = new Map(dependencyTemplates); -const Watchpack = __webpack_require__(77056); -const objectToMap = __webpack_require__(1111); - -class NodeWatchFileSystem { - constructor(inputFileSystem) { - this.inputFileSystem = inputFileSystem; - this.watcherOptions = { - aggregateTimeout: 0 - }; - this.watcher = new Watchpack(this.watcherOptions); - } - - watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) { - if (!Array.isArray(files)) { - throw new Error("Invalid arguments: 'files'"); - } - if (!Array.isArray(dirs)) { - throw new Error("Invalid arguments: 'dirs'"); - } - if (!Array.isArray(missing)) { - throw new Error("Invalid arguments: 'missing'"); - } - if (typeof callback !== "function") { - throw new Error("Invalid arguments: 'callback'"); - } - if (typeof startTime !== "number" && startTime) { - throw new Error("Invalid arguments: 'startTime'"); - } - if (typeof options !== "object") { - throw new Error("Invalid arguments: 'options'"); - } - if (typeof callbackUndelayed !== "function" && callbackUndelayed) { - throw new Error("Invalid arguments: 'callbackUndelayed'"); - } - const oldWatcher = this.watcher; - this.watcher = new Watchpack(options); - - if (callbackUndelayed) { - this.watcher.once("change", callbackUndelayed); - } - const cachedFiles = files; - const cachedDirs = dirs; - this.watcher.once("aggregated", (changes, removals) => { - changes = changes.concat(removals); - if (this.inputFileSystem && this.inputFileSystem.purge) { - this.inputFileSystem.purge(changes); - } - const times = objectToMap(this.watcher.getTimes()); - files = new Set(files); - dirs = new Set(dirs); - missing = new Set(missing); - removals = new Set(removals.filter(file => files.has(file))); - callback( - null, - changes.filter(file => files.has(file)).sort(), - changes.filter(file => dirs.has(file)).sort(), - changes.filter(file => missing.has(file)).sort(), - times, - times, - removals - ); - }); + innerDependencyTemplates.set( + HarmonyImportSpecifierDependency, + new HarmonyImportSpecifierDependencyConcatenatedTemplate( + dependencyTemplates.get(HarmonyImportSpecifierDependency), + moduleToInfoMap + ) + ); + innerDependencyTemplates.set( + HarmonyImportSideEffectDependency, + new HarmonyImportSideEffectDependencyConcatenatedTemplate( + dependencyTemplates.get(HarmonyImportSideEffectDependency), + moduleToInfoMap + ) + ); + innerDependencyTemplates.set( + HarmonyExportSpecifierDependency, + new NullTemplate() + ); + innerDependencyTemplates.set( + HarmonyExportExpressionDependency, + new HarmonyExportExpressionDependencyConcatenatedTemplate( + dependencyTemplates.get(HarmonyExportExpressionDependency), + this.rootModule + ) + ); + innerDependencyTemplates.set( + HarmonyExportImportedSpecifierDependency, + new NullTemplate() + ); + innerDependencyTemplates.set( + HarmonyCompatibilityDependency, + new NullTemplate() + ); - this.watcher.watch( - cachedFiles.concat(missing), - cachedDirs.concat(missing), - startTime + // Must use full identifier in our cache here to ensure that the source + // is updated should our dependencies list change. + // TODO webpack 5 refactor + innerDependencyTemplates.set( + "hash", + innerDependencyTemplates.get("hash") + this.identifier() ); - if (oldWatcher) { - oldWatcher.close(); - } - return { - close: () => { - if (this.watcher) { - this.watcher.close(); - this.watcher = null; - } - }, - pause: () => { - if (this.watcher) { - this.watcher.pause(); - } - }, - getFileTimestamps: () => { - if (this.watcher) { - return objectToMap(this.watcher.getTimes()); - } else { - return new Map(); - } - }, - getContextTimestamps: () => { - if (this.watcher) { - return objectToMap(this.watcher.getTimes()); - } else { - return new Map(); + // Generate source code and analyse scopes + // Prepare a ReplaceSource for the final source + for (const info of modulesWithInfo) { + if (info.type === "concatenated") { + const m = info.module; + const source = m.source(innerDependencyTemplates, runtimeTemplate); + const code = source.source(); + let ast; + try { + ast = Parser.parse(code, { + sourceType: "module" + }); + } catch (err) { + if ( + err.loc && + typeof err.loc === "object" && + typeof err.loc.line === "number" + ) { + const lineNumber = err.loc.line; + const lines = code.split("\n"); + err.message += + "\n| " + + lines + .slice(Math.max(0, lineNumber - 3), lineNumber + 2) + .join("\n| "); + } + throw err; } + const scopeManager = eslintScope.analyze(ast, { + ecmaVersion: 6, + sourceType: "module", + optimistic: true, + ignoreEval: true, + impliedStrict: true + }); + const globalScope = scopeManager.acquire(ast); + const moduleScope = globalScope.childScopes[0]; + const resultSource = new ReplaceSource(source); + info.ast = ast; + info.internalSource = source; + info.source = resultSource; + info.globalScope = globalScope; + info.moduleScope = moduleScope; } - }; - } -} + } -module.exports = NodeWatchFileSystem; + // List of all used names to avoid conflicts + const allUsedNames = new Set([ + "__WEBPACK_MODULE_DEFAULT_EXPORT__", // avoid using this internal name + "abstract", + "arguments", + "async", + "await", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "double", + "else", + "enum", + "eval", + "export", + "extends", + "false", + "final", + "finally", + "float", + "for", + "function", + "goto", + "if", + "implements", + "import", + "in", + "instanceof", + "int", + "interface", + "let", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "typeof", + "var", + "void", + "volatile", + "while", + "with", + "yield", -/***/ }), + "module", + "__dirname", + "__filename", + "exports", -/***/ 73839: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + "Array", + "Date", + "eval", + "function", + "hasOwnProperty", + "Infinity", + "isFinite", + "isNaN", + "isPrototypeOf", + "length", + "Math", + "NaN", + "name", + "Number", + "Object", + "prototype", + "String", + "toString", + "undefined", + "valueOf", -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + "alert", + "all", + "anchor", + "anchors", + "area", + "assign", + "blur", + "button", + "checkbox", + "clearInterval", + "clearTimeout", + "clientInformation", + "close", + "closed", + "confirm", + "constructor", + "crypto", + "decodeURI", + "decodeURIComponent", + "defaultStatus", + "document", + "element", + "elements", + "embed", + "embeds", + "encodeURI", + "encodeURIComponent", + "escape", + "event", + "fileUpload", + "focus", + "form", + "forms", + "frame", + "innerHeight", + "innerWidth", + "layer", + "layers", + "link", + "location", + "mimeTypes", + "navigate", + "navigator", + "frames", + "frameRate", + "hidden", + "history", + "image", + "images", + "offscreenBuffering", + "open", + "opener", + "option", + "outerHeight", + "outerWidth", + "packages", + "pageXOffset", + "pageYOffset", + "parent", + "parseFloat", + "parseInt", + "password", + "pkcs11", + "plugin", + "prompt", + "propertyIsEnum", + "radio", + "reset", + "screenX", + "screenY", + "scroll", + "secure", + "select", + "self", + "setInterval", + "setTimeout", + "status", + "submit", + "taint", + "text", + "textarea", + "top", + "unescape", + "untaint", + "window", + "onblur", + "onclick", + "onerror", + "onfocus", + "onkeydown", + "onkeypress", + "onkeyup", + "onmouseover", + "onload", + "onmouseup", + "onmousedown", + "onsubmit" + ]); -const Template = __webpack_require__(96066); -const WasmMainTemplatePlugin = __webpack_require__(65331); + // Set of already checked scopes + const alreadyCheckedScopes = new Set(); -class ReadFileCompileWasmTemplatePlugin { - constructor(options) { - this.options = options || {}; - } + // get all global names + for (const info of modulesWithInfo) { + const superClassExpressions = []; - apply(compiler) { - compiler.hooks.thisCompilation.tap( - "ReadFileCompileWasmTemplatePlugin", - compilation => { - const generateLoadBinaryCode = path => - Template.asString([ - "new Promise(function (resolve, reject) {", - Template.indent([ - "var { readFile } = require('fs');", - "var { join } = require('path');", - "", - "try {", - Template.indent([ - `readFile(join(__dirname, ${path}), function(err, buffer){`, - Template.indent([ - "if (err) return reject(err);", - "", - "// Fake fetch response", - "resolve({", - Template.indent([ - "arrayBuffer() { return Promise.resolve(buffer); }" - ]), - "});" - ]), - "});" - ]), - "} catch (err) { reject(err); }" - ]), - "})" - ]); + // ignore symbols from moduleScope + if (info.moduleScope) { + alreadyCheckedScopes.add(info.moduleScope); - const plugin = new WasmMainTemplatePlugin( - Object.assign( - { - generateLoadBinaryCode, - supportsStreaming: false - }, - this.options - ) - ); - plugin.apply(compilation.mainTemplate); + // The super class expression in class scopes behaves weird + // We store ranges of all super class expressions to make + // renaming to work correctly + for (const childScope of info.moduleScope.childScopes) { + if (childScope.type !== "class") continue; + if (!childScope.block.superClass) continue; + superClassExpressions.push({ + range: childScope.block.superClass.range, + variables: childScope.variables + }); + } } - ); - } -} - -module.exports = ReadFileCompileWasmTemplatePlugin; - - -/***/ }), - -/***/ 7886: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const truncateArgs = __webpack_require__(62299); -const util = __webpack_require__(31669); - -const tty = process.stderr.isTTY && process.env.TERM !== "dumb"; + // add global symbols + if (info.globalScope) { + for (const reference of info.globalScope.through) { + const name = reference.identifier.name; + if ( + /^__WEBPACK_MODULE_REFERENCE__\d+_([\da-f]+|ns)(_call)?(_strict)?__$/.test( + name + ) + ) { + for (const expr of superClassExpressions) { + if ( + expr.range[0] <= reference.identifier.range[0] && + expr.range[1] >= reference.identifier.range[1] + ) { + for (const variable of expr.variables) { + allUsedNames.add(variable.name); + } + } + } + addScopeSymbols1( + reference.from, + allUsedNames, + alreadyCheckedScopes + ); + } else { + allUsedNames.add(name); + } + } + } -let currentStatusMessage = undefined; -let hasStatusMessage = false; -let currentIndent = ""; -let currentCollapsed = 0; + // add exported globals + if (info.type === "concatenated") { + const variables = new Set(); + for (const variable of info.moduleScope.variables) { + variables.add(variable.name); + } + for (const [, variable] of info.exportMap) { + if (!variables.has(variable)) { + info.globalExports.add(variable); + } + } + } + } -const indent = (str, prefix, colorPrefix, colorSuffix) => { - if (str === "") return str; - prefix = currentIndent + prefix; - if (tty) { - return ( - prefix + - colorPrefix + - str.replace(/\n/g, colorSuffix + "\n" + prefix + colorPrefix) + - colorSuffix - ); - } else { - return prefix + str.replace(/\n/g, "\n" + prefix); - } -}; - -const clearStatusMessage = () => { - if (hasStatusMessage) { - process.stderr.write("\x1b[2K\r"); - hasStatusMessage = false; - } -}; - -const writeStatusMessage = () => { - if (!currentStatusMessage) return; - const l = process.stderr.columns; - const args = l - ? truncateArgs(currentStatusMessage, l - 1) - : currentStatusMessage; - const str = args.join(" "); - const coloredStr = `\u001b[1m${str}\u001b[39m\u001b[22m`; - process.stderr.write(`\x1b[2K\r${coloredStr}`); - hasStatusMessage = true; -}; + // generate names for symbols + for (const info of modulesWithInfo) { + switch (info.type) { + case "concatenated": { + const namespaceObjectName = this.findNewName( + "namespaceObject", + allUsedNames, + null, + info.module.readableIdentifier(requestShortener) + ); + allUsedNames.add(namespaceObjectName); + info.internalNames.set(namespaceObjectName, namespaceObjectName); + info.exportMap.set(true, namespaceObjectName); + for (const variable of info.moduleScope.variables) { + const name = variable.name; + if (allUsedNames.has(name)) { + const references = getAllReferences(variable); + const symbolsInReferences = new Set(); + const alreadyCheckedInnerScopes = new Set(); + for (const ref of references) { + addScopeSymbols2( + ref.from, + symbolsInReferences, + alreadyCheckedInnerScopes, + alreadyCheckedScopes + ); + } + const newName = this.findNewName( + name, + allUsedNames, + symbolsInReferences, + info.module.readableIdentifier(requestShortener) + ); + allUsedNames.add(newName); + info.internalNames.set(name, newName); + const source = info.source; + const allIdentifiers = new Set( + references.map(r => r.identifier).concat(variable.identifiers) + ); + for (const identifier of allIdentifiers) { + const r = identifier.range; + const path = getPathInAst(info.ast, identifier); + if ( + path && + path.length > 1 && + path[1].type === "Property" && + path[1].shorthand + ) { + source.insert(r[1], `: ${newName}`); + } else { + source.replace(r[0], r[1] - 1, newName); + } + } + } else { + allUsedNames.add(name); + info.internalNames.set(name, name); + } + } + break; + } + case "external": { + const externalName = this.findNewName( + "", + allUsedNames, + null, + info.module.readableIdentifier(requestShortener) + ); + allUsedNames.add(externalName); + info.name = externalName; + if ( + info.module.buildMeta.exportsType === "named" || + !info.module.buildMeta.exportsType + ) { + const externalNameInterop = this.findNewName( + "namespaceObject", + allUsedNames, + null, + info.module.readableIdentifier(requestShortener) + ); + allUsedNames.add(externalNameInterop); + info.interopNamespaceObjectName = externalNameInterop; + } + if (!info.module.buildMeta.exportsType) { + const externalNameInterop = this.findNewName( + "default", + allUsedNames, + null, + info.module.readableIdentifier(requestShortener) + ); + allUsedNames.add(externalNameInterop); + info.interopDefaultAccessName = externalNameInterop; + } + break; + } + } + } -const writeColored = (prefix, colorPrefix, colorSuffix) => { - return (...args) => { - if (currentCollapsed > 0) return; - clearStatusMessage(); - // @ts-ignore - const str = indent(util.format(...args), prefix, colorPrefix, colorSuffix); - process.stderr.write(str + "\n"); - writeStatusMessage(); - }; -}; + // Find and replace referenced to modules + for (const info of modulesWithInfo) { + if (info.type === "concatenated") { + for (const reference of info.globalScope.through) { + const name = reference.identifier.name; + const match = /^__WEBPACK_MODULE_REFERENCE__(\d+)_([\da-f]+|ns)(_call)?(_strict)?__$/.exec( + name + ); + if (match) { + const referencedModule = modulesWithInfo[+match[1]]; + let exportName; + if (match[2] === "ns") { + exportName = true; + } else { + const exportData = match[2]; + exportName = Buffer.from(exportData, "hex").toString("utf-8"); + } + const asCall = !!match[3]; + const strictHarmonyModule = !!match[4]; + const finalName = getFinalName( + referencedModule, + exportName, + moduleToInfoMap, + requestShortener, + asCall, + strictHarmonyModule + ); + const r = reference.identifier.range; + const source = info.source; + source.replace(r[0], r[1] - 1, finalName); + } + } + } + } -const writeGroupMessage = writeColored( - "<-> ", - "\u001b[1m\u001b[36m", - "\u001b[39m\u001b[22m" -); + // Map with all root exposed used exports + /** @type {Map} */ + const exportsMap = new Map(); -const writeGroupCollapsedMessage = writeColored( - "<+> ", - "\u001b[1m\u001b[36m", - "\u001b[39m\u001b[22m" -); + // Set with all root exposed unused exports + /** @type {Set} */ + const unusedExports = new Set(); -module.exports = { - log: writeColored(" ", "\u001b[1m", "\u001b[22m"), - debug: writeColored(" ", "", ""), - trace: writeColored(" ", "", ""), - info: writeColored(" ", "\u001b[1m\u001b[32m", "\u001b[39m\u001b[22m"), - warn: writeColored(" ", "\u001b[1m\u001b[33m", "\u001b[39m\u001b[22m"), - error: writeColored(" ", "\u001b[1m\u001b[31m", "\u001b[39m\u001b[22m"), - logTime: writeColored(" ", "\u001b[1m\u001b[35m", "\u001b[39m\u001b[22m"), - group: (...args) => { - writeGroupMessage(...args); - if (currentCollapsed > 0) { - currentCollapsed++; - } else { - currentIndent += " "; - } - }, - groupCollapsed: (...args) => { - writeGroupCollapsedMessage(...args); - currentCollapsed++; - }, - groupEnd: () => { - if (currentCollapsed > 0) currentCollapsed--; - else if (currentIndent.length >= 2) - currentIndent = currentIndent.slice(0, currentIndent.length - 2); - }, - // eslint-disable-next-line node/no-unsupported-features/node-builtins - profile: console.profile && (name => console.profile(name)), - // eslint-disable-next-line node/no-unsupported-features/node-builtins - profileEnd: console.profileEnd && (name => console.profileEnd(name)), - clear: - tty && - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.clear && - (() => { - clearStatusMessage(); - // eslint-disable-next-line node/no-unsupported-features/node-builtins - console.clear(); - writeStatusMessage(); - }), - status: tty - ? (name, ...args) => { - args = args.filter(Boolean); - if (name === undefined && args.length === 0) { - clearStatusMessage(); - currentStatusMessage = undefined; - } else if ( - typeof name === "string" && - name.startsWith("[webpack.Progress] ") - ) { - currentStatusMessage = [name.slice(19), ...args]; - writeStatusMessage(); - } else if (name === "[webpack.Progress]") { - currentStatusMessage = [...args]; - writeStatusMessage(); + for (const dep of this.rootModule.dependencies) { + if (dep instanceof HarmonyExportSpecifierDependency) { + const used = this.rootModule.isUsed(dep.name); + if (used) { + const info = moduleToInfoMap.get(this.rootModule); + if (!exportsMap.has(used)) { + exportsMap.set( + used, + () => `/* binding */ ${info.internalNames.get(dep.id)}` + ); + } } else { - currentStatusMessage = [name, ...args]; - writeStatusMessage(); + unusedExports.add(dep.name || "namespace"); } - } - : writeColored(" ", "", "") -}; - - -/***/ }), - -/***/ 88197: -/***/ (function(module) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + } else if (dep instanceof HarmonyExportImportedSpecifierDependency) { + const exportDefs = getHarmonyExportImportedSpecifierDependencyExports( + dep + ); + for (const def of exportDefs) { + const info = moduleToInfoMap.get(def.module); + const used = dep.originModule.isUsed(def.name); + if (used) { + if (!exportsMap.has(used)) { + exportsMap.set(used, requestShortener => { + const finalName = getFinalName( + info, + def.id, + moduleToInfoMap, + requestShortener, + false, + this.rootModule.buildMeta.strictHarmonyModule + ); + return `/* reexport */ ${finalName}`; + }); + } + } else { + unusedExports.add(def.name); + } + } + } + } + const result = new ConcatSource(); -class AggressiveMergingPlugin { - constructor(options) { - if ( - (options !== undefined && typeof options !== "object") || - Array.isArray(options) - ) { - throw new Error( - "Argument should be an options object. To use defaults, pass in nothing.\nFor more info on options, see https://webpack.js.org/plugins/" + // add harmony compatibility flag (must be first because of possible circular dependencies) + const usedExports = this.rootModule.usedExports; + if (usedExports === true || usedExports === null) { + result.add(`// ESM COMPAT FLAG\n`); + result.add( + runtimeTemplate.defineEsModuleFlagStatement({ + exportsArgument: this.exportsArgument + }) ); } - this.options = options || {}; - } - - apply(compiler) { - const options = this.options; - const minSizeReduce = options.minSizeReduce || 1.5; - compiler.hooks.thisCompilation.tap( - "AggressiveMergingPlugin", - compilation => { - compilation.hooks.optimizeChunksAdvanced.tap( - "AggressiveMergingPlugin", - chunks => { - let combinations = []; - chunks.forEach((a, idx) => { - if (a.canBeInitial()) return; - for (let i = 0; i < idx; i++) { - const b = chunks[i]; - if (b.canBeInitial()) continue; - combinations.push({ - a, - b, - improvement: undefined - }); - } - }); - - for (const pair of combinations) { - const a = pair.b.size({ - chunkOverhead: 0 - }); - const b = pair.a.size({ - chunkOverhead: 0 - }); - const ab = pair.b.integratedSize(pair.a, { - chunkOverhead: 0 - }); - let newSize; - if (ab === false) { - pair.improvement = false; - return; - } else { - newSize = ab; - } - - pair.improvement = (a + b) / newSize; - } - combinations = combinations.filter(pair => { - return pair.improvement !== false; - }); - combinations.sort((a, b) => { - return b.improvement - a.improvement; - }); + // define exports + if (exportsMap.size > 0) { + result.add(`\n// EXPORTS\n`); + for (const [key, value] of exportsMap) { + result.add( + `__webpack_require__.d(${this.exportsArgument}, ${JSON.stringify( + key + )}, function() { return ${value(requestShortener)}; });\n` + ); + } + } - const pair = combinations[0]; + // list unused exports + if (unusedExports.size > 0) { + result.add( + `\n// UNUSED EXPORTS: ${joinIterableWithComma(unusedExports)}\n` + ); + } - if (!pair) return; - if (pair.improvement < minSizeReduce) return; + // define required namespace objects (must be before evaluation modules) + for (const info of modulesWithInfo) { + if (info.namespaceObjectSource) { + result.add( + `\n// NAMESPACE OBJECT: ${info.module.readableIdentifier( + requestShortener + )}\n` + ); + result.add(info.namespaceObjectSource); + } + } - if (pair.b.integrate(pair.a, "aggressive-merge")) { - chunks.splice(chunks.indexOf(pair.a), 1); - return true; + // evaluate modules in order + for (const info of modulesWithInfo) { + switch (info.type) { + case "concatenated": + result.add( + `\n// CONCATENATED MODULE: ${info.module.readableIdentifier( + requestShortener + )}\n` + ); + result.add(info.source); + break; + case "external": + result.add( + `\n// EXTERNAL MODULE: ${info.module.readableIdentifier( + requestShortener + )}\n` + ); + result.add( + `var ${info.name} = __webpack_require__(${JSON.stringify( + info.module.id + )});\n` + ); + if (info.interopNamespaceObjectUsed) { + if (info.module.buildMeta.exportsType === "named") { + result.add( + `var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name}, 2);\n` + ); + } else if (!info.module.buildMeta.exportsType) { + result.add( + `var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name});\n` + ); } } - ); + if (info.interopDefaultAccessUsed) { + result.add( + `var ${info.interopDefaultAccessName} = /*#__PURE__*/__webpack_require__.n(${info.name});\n` + ); + } + break; + default: + throw new Error(`Unsupported concatenation entry type ${info.type}`); } - ); - } -} - -module.exports = AggressiveMergingPlugin; - - -/***/ }), - -/***/ 26688: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + return result; + } + findNewName(oldName, usedNamed1, usedNamed2, extraInfo) { + let name = oldName; -const identifierUtils = __webpack_require__(94658); -const { intersect } = __webpack_require__(54262); -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(71884); + if (name === "__WEBPACK_MODULE_DEFAULT_EXPORT__") name = ""; -/** @typedef {import("../../declarations/plugins/optimize/AggressiveSplittingPlugin").AggressiveSplittingPluginOptions} AggressiveSplittingPluginOptions */ + // Remove uncool stuff + extraInfo = extraInfo.replace( + /\.+\/|(\/index)?\.([a-zA-Z0-9]{1,4})($|\s|\?)|\s*\+\s*\d+\s*modules/g, + "" + ); -const moveModuleBetween = (oldChunk, newChunk) => { - return module => { - oldChunk.moveModule(module, newChunk); - }; -}; + const splittedInfo = extraInfo.split("/"); + while (splittedInfo.length) { + name = splittedInfo.pop() + (name ? "_" + name : ""); + const nameIdent = Template.toIdentifier(name); + if ( + !usedNamed1.has(nameIdent) && + (!usedNamed2 || !usedNamed2.has(nameIdent)) + ) + return nameIdent; + } -const isNotAEntryModule = entryModule => { - return module => { - return entryModule !== module; - }; -}; + let i = 0; + let nameWithNumber = Template.toIdentifier(`${name}_${i}`); + while ( + usedNamed1.has(nameWithNumber) || + (usedNamed2 && usedNamed2.has(nameWithNumber)) + ) { + i++; + nameWithNumber = Template.toIdentifier(`${name}_${i}`); + } + return nameWithNumber; + } -class AggressiveSplittingPlugin { /** - * @param {AggressiveSplittingPluginOptions=} options options object + * @param {Hash} hash the hash used to track dependencies + * @returns {void} */ - constructor(options) { - if (!options) options = {}; - - validateOptions(schema, options, "Aggressive Splitting Plugin"); - - this.options = options; - if (typeof this.options.minSize !== "number") { - this.options.minSize = 30 * 1024; + updateHash(hash) { + for (const info of this._orderedConcatenationList) { + switch (info.type) { + case "concatenated": + info.module.updateHash(hash); + break; + case "external": + hash.update(`${info.module.id}`); + break; + } } - if (typeof this.options.maxSize !== "number") { - this.options.maxSize = 50 * 1024; + super.updateHash(hash); + } +} + +class HarmonyImportSpecifierDependencyConcatenatedTemplate { + constructor(originalTemplate, modulesMap) { + this.originalTemplate = originalTemplate; + this.modulesMap = modulesMap; + } + + getHarmonyInitOrder(dep) { + const module = dep._module; + const info = this.modulesMap.get(module); + if (!info) { + return this.originalTemplate.getHarmonyInitOrder(dep); } - if (typeof this.options.chunkOverhead !== "number") { - this.options.chunkOverhead = 0; + return NaN; + } + + harmonyInit(dep, source, runtimeTemplate, dependencyTemplates) { + const module = dep._module; + const info = this.modulesMap.get(module); + if (!info) { + this.originalTemplate.harmonyInit( + dep, + source, + runtimeTemplate, + dependencyTemplates + ); + return; } - if (typeof this.options.entryChunkMultiplicator !== "number") { - this.options.entryChunkMultiplicator = 1; + } + + apply(dep, source, runtime, dependencyTemplates) { + const module = dep._module; + const info = this.modulesMap.get(module); + if (!info) { + this.originalTemplate.apply(dep, source, runtime, dependencyTemplates); + return; + } + let content; + const callFlag = dep.call ? "_call" : ""; + const strictFlag = dep.originModule.buildMeta.strictHarmonyModule + ? "_strict" + : ""; + if (dep._id === null) { + content = `__WEBPACK_MODULE_REFERENCE__${info.index}_ns${strictFlag}__`; + } else if (dep.namespaceObjectAsContext) { + content = `__WEBPACK_MODULE_REFERENCE__${ + info.index + }_ns${strictFlag}__[${JSON.stringify(dep._id)}]`; + } else { + const exportData = Buffer.from(dep._id, "utf-8").toString("hex"); + content = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${callFlag}${strictFlag}__`; + } + if (dep.shorthand) { + content = dep.name + ": " + content; } + source.replace(dep.range[0], dep.range[1] - 1, content); } - apply(compiler) { - compiler.hooks.thisCompilation.tap( - "AggressiveSplittingPlugin", - compilation => { - let needAdditionalSeal = false; - let newSplits; - let fromAggressiveSplittingSet; - let chunkSplitDataMap; - compilation.hooks.optimize.tap("AggressiveSplittingPlugin", () => { - newSplits = []; - fromAggressiveSplittingSet = new Set(); - chunkSplitDataMap = new Map(); - }); - compilation.hooks.optimizeChunksAdvanced.tap( - "AggressiveSplittingPlugin", - chunks => { - // Precompute stuff - const nameToModuleMap = new Map(); - const moduleToNameMap = new Map(); - for (const m of compilation.modules) { - const name = identifierUtils.makePathsRelative( - compiler.context, - m.identifier(), - compilation.cache - ); - nameToModuleMap.set(name, m); - moduleToNameMap.set(m, name); - } +} - // Check used chunk ids - const usedIds = new Set(); - for (const chunk of chunks) { - usedIds.add(chunk.id); - } +class HarmonyImportSideEffectDependencyConcatenatedTemplate { + constructor(originalTemplate, modulesMap) { + this.originalTemplate = originalTemplate; + this.modulesMap = modulesMap; + } - const recordedSplits = - (compilation.records && compilation.records.aggressiveSplits) || - []; - const usedSplits = newSplits - ? recordedSplits.concat(newSplits) - : recordedSplits; + getHarmonyInitOrder(dep) { + const module = dep._module; + const info = this.modulesMap.get(module); + if (!info) { + return this.originalTemplate.getHarmonyInitOrder(dep); + } + return NaN; + } - const minSize = this.options.minSize; - const maxSize = this.options.maxSize; + harmonyInit(dep, source, runtime, dependencyTemplates) { + const module = dep._module; + const info = this.modulesMap.get(module); + if (!info) { + this.originalTemplate.harmonyInit( + dep, + source, + runtime, + dependencyTemplates + ); + return; + } + } - const applySplit = splitData => { - // Cannot split if id is already taken - if (splitData.id !== undefined && usedIds.has(splitData.id)) { - return false; - } + apply(dep, source, runtime, dependencyTemplates) { + const module = dep._module; + const info = this.modulesMap.get(module); + if (!info) { + this.originalTemplate.apply(dep, source, runtime, dependencyTemplates); + return; + } + } +} - // Get module objects from names - const selectedModules = splitData.modules.map(name => - nameToModuleMap.get(name) - ); +class HarmonyExportExpressionDependencyConcatenatedTemplate { + constructor(originalTemplate, rootModule) { + this.originalTemplate = originalTemplate; + this.rootModule = rootModule; + } - // Does the modules exist at all? - if (!selectedModules.every(Boolean)) return false; + apply(dep, source, runtime, dependencyTemplates) { + let content = + "/* harmony default export */ var __WEBPACK_MODULE_DEFAULT_EXPORT__ = "; + if (dep.originModule === this.rootModule) { + const used = dep.originModule.isUsed("default"); + const exportsName = dep.originModule.exportsArgument; + if (used) content += `${exportsName}[${JSON.stringify(used)}] = `; + } - // Check if size matches (faster than waiting for hash) - const size = selectedModules.reduce( - (sum, m) => sum + m.size(), - 0 - ); - if (size !== splitData.size) return false; + if (dep.range) { + source.replace( + dep.rangeStatement[0], + dep.range[0] - 1, + content + "(" + dep.prefix + ); + source.replace(dep.range[1], dep.rangeStatement[1] - 1, ");"); + return; + } - // get chunks with all modules - const selectedChunks = intersect( - selectedModules.map(m => new Set(m.chunksIterable)) - ); + source.replace( + dep.rangeStatement[0], + dep.rangeStatement[1] - 1, + content + dep.prefix + ); + } +} - // No relevant chunks found - if (selectedChunks.size === 0) return false; +class NullTemplate { + apply() {} +} - // The found chunk is already the split or similar - if ( - selectedChunks.size === 1 && - Array.from(selectedChunks)[0].getNumberOfModules() === - selectedModules.length - ) { - const chunk = Array.from(selectedChunks)[0]; - if (fromAggressiveSplittingSet.has(chunk)) return false; - fromAggressiveSplittingSet.add(chunk); - chunkSplitDataMap.set(chunk, splitData); - return true; - } +module.exports = ConcatenatedModule; - // split the chunk into two parts - const newChunk = compilation.addChunk(); - newChunk.chunkReason = "aggressive splitted"; - for (const chunk of selectedChunks) { - selectedModules.forEach(moveModuleBetween(chunk, newChunk)); - chunk.split(newChunk); - chunk.name = null; - } - fromAggressiveSplittingSet.add(newChunk); - chunkSplitDataMap.set(newChunk, splitData); - if (splitData.id !== null && splitData.id !== undefined) { - newChunk.id = splitData.id; - } - return true; - }; +/***/ }), - // try to restore to recorded splitting - let changed = false; - for (let j = 0; j < usedSplits.length; j++) { - const splitData = usedSplits[j]; - if (applySplit(splitData)) changed = true; - } +/***/ 29720: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // for any chunk which isn't splitted yet, split it and create a new entry - // start with the biggest chunk - const sortedChunks = chunks.slice().sort((a, b) => { - const diff1 = b.modulesSize() - a.modulesSize(); - if (diff1) return diff1; - const diff2 = a.getNumberOfModules() - b.getNumberOfModules(); - if (diff2) return diff2; - const modulesA = Array.from(a.modulesIterable); - const modulesB = Array.from(b.modulesIterable); - modulesA.sort(); - modulesB.sort(); - const aI = modulesA[Symbol.iterator](); - const bI = modulesB[Symbol.iterator](); - // eslint-disable-next-line no-constant-condition - while (true) { - const aItem = aI.next(); - const bItem = bI.next(); - if (aItem.done) return 0; - const aModuleIdentifier = aItem.value.identifier(); - const bModuleIdentifier = bItem.value.identifier(); - if (aModuleIdentifier > bModuleIdentifier) return -1; - if (aModuleIdentifier < bModuleIdentifier) return 1; - } - }); - for (const chunk of sortedChunks) { - if (fromAggressiveSplittingSet.has(chunk)) continue; - const size = chunk.modulesSize(); - if (size > maxSize && chunk.getNumberOfModules() > 1) { - const modules = chunk - .getModules() - .filter(isNotAEntryModule(chunk.entryModule)) - .sort((a, b) => { - a = a.identifier(); - b = b.identifier(); - if (a > b) return 1; - if (a < b) return -1; - return 0; - }); - const selectedModules = []; - let selectedModulesSize = 0; - for (let k = 0; k < modules.length; k++) { - const module = modules[k]; - const newSize = selectedModulesSize + module.size(); - if (newSize > maxSize && selectedModulesSize >= minSize) { - break; - } - selectedModulesSize = newSize; - selectedModules.push(module); - } - if (selectedModules.length === 0) continue; - const splitData = { - modules: selectedModules - .map(m => moduleToNameMap.get(m)) - .sort(), - size: selectedModulesSize - }; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - if (applySplit(splitData)) { - newSplits = (newSplits || []).concat(splitData); - changed = true; - } - } - } - if (changed) return true; - } - ); - compilation.hooks.recordHash.tap( - "AggressiveSplittingPlugin", - records => { - // 4. save made splittings to records - const allSplits = new Set(); - const invalidSplits = new Set(); - // Check if some splittings are invalid - // We remove invalid splittings and try again - for (const chunk of compilation.chunks) { - const splitData = chunkSplitDataMap.get(chunk); - if (splitData !== undefined) { - if (splitData.hash && chunk.hash !== splitData.hash) { - // Split was successful, but hash doesn't equal - // We can throw away the split since it's useless now - invalidSplits.add(splitData); +const GraphHelpers = __webpack_require__(32973); + +class EnsureChunkConditionsPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "EnsureChunkConditionsPlugin", + compilation => { + const handler = chunks => { + let changed = false; + for (const module of compilation.modules) { + if (!module.chunkCondition) continue; + const sourceChunks = new Set(); + const chunkGroups = new Set(); + for (const chunk of module.chunksIterable) { + if (!module.chunkCondition(chunk)) { + sourceChunks.add(chunk); + for (const group of chunk.groupsIterable) { + chunkGroups.add(group); } } } - - if (invalidSplits.size > 0) { - records.aggressiveSplits = records.aggressiveSplits.filter( - splitData => !invalidSplits.has(splitData) - ); - needAdditionalSeal = true; - } else { - // set hash and id values on all (new) splittings - for (const chunk of compilation.chunks) { - const splitData = chunkSplitDataMap.get(chunk); - if (splitData !== undefined) { - splitData.hash = chunk.hash; - splitData.id = chunk.id; - allSplits.add(splitData); - // set flag for stats - chunk.recorded = true; + if (sourceChunks.size === 0) continue; + const targetChunks = new Set(); + chunkGroupLoop: for (const chunkGroup of chunkGroups) { + // Can module be placed in a chunk of this group? + for (const chunk of chunkGroup.chunks) { + if (module.chunkCondition(chunk)) { + targetChunks.add(chunk); + continue chunkGroupLoop; } } - - // Also add all unused historial splits (after the used ones) - // They can still be used in some future compilation - const recordedSplits = - compilation.records && compilation.records.aggressiveSplits; - if (recordedSplits) { - for (const splitData of recordedSplits) { - if (!invalidSplits.has(splitData)) allSplits.add(splitData); - } + // We reached the entrypoint: fail + if (chunkGroup.isInitial()) { + throw new Error( + "Cannot fullfil chunk condition of " + module.identifier() + ); + } + // Try placing in all parents + for (const group of chunkGroup.parentsIterable) { + chunkGroups.add(group); } - - // record all splits - records.aggressiveSplits = Array.from(allSplits); - - needAdditionalSeal = false; } - } - ); - compilation.hooks.needAdditionalSeal.tap( - "AggressiveSplittingPlugin", - () => { - if (needAdditionalSeal) { - needAdditionalSeal = false; - return true; + for (const sourceChunk of sourceChunks) { + GraphHelpers.disconnectChunkAndModule(sourceChunk, module); + } + for (const targetChunk of targetChunks) { + GraphHelpers.connectChunkAndModule(targetChunk, module); } } + if (changed) return true; + }; + compilation.hooks.optimizeChunksBasic.tap( + "EnsureChunkConditionsPlugin", + handler + ); + compilation.hooks.optimizeExtractedChunksBasic.tap( + "EnsureChunkConditionsPlugin", + handler ); } ); } } -module.exports = AggressiveSplittingPlugin; +module.exports = EnsureChunkConditionsPlugin; /***/ }), -/***/ 30346: +/***/ 25850: /***/ (function(module) { "use strict"; @@ -88021,71 +85911,104 @@ module.exports = AggressiveSplittingPlugin; */ -const sortByIndex = (a, b) => { - return a.index - b.index; -}; - -const sortByIndex2 = (a, b) => { - return a.index2 - b.index2; -}; - -class ChunkModuleIdRangePlugin { - constructor(options) { - this.options = options; - } - +class FlagIncludedChunksPlugin { apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap("ChunkModuleIdRangePlugin", compilation => { - compilation.hooks.moduleIds.tap("ChunkModuleIdRangePlugin", modules => { - const chunk = compilation.chunks.find( - chunk => chunk.name === options.name - ); - if (!chunk) { - throw new Error( - `ChunkModuleIdRangePlugin: Chunk with name '${options.name}"' was not found` + compiler.hooks.compilation.tap("FlagIncludedChunksPlugin", compilation => { + compilation.hooks.optimizeChunkIds.tap( + "FlagIncludedChunksPlugin", + chunks => { + // prepare two bit integers for each module + // 2^31 is the max number represented as SMI in v8 + // we want the bits distributed this way: + // the bit 2^31 is pretty rar and only one module should get it + // so it has a probability of 1 / modulesCount + // the first bit (2^0) is the easiest and every module could get it + // if it doesn't get a better bit + // from bit 2^n to 2^(n+1) there is a probability of p + // so 1 / modulesCount == p^31 + // <=> p = sqrt31(1 / modulesCount) + // so we use a modulo of 1 / sqrt31(1 / modulesCount) + const moduleBits = new WeakMap(); + const modulesCount = compilation.modules.length; + + // precalculate the modulo values for each bit + const modulo = 1 / Math.pow(1 / modulesCount, 1 / 31); + const modulos = Array.from( + { length: 31 }, + (x, i) => Math.pow(modulo, i) | 0 ); - } - let chunkModules; - if (options.order) { - chunkModules = Array.from(chunk.modulesIterable); - switch (options.order) { - case "index": - chunkModules.sort(sortByIndex); - break; - case "index2": - chunkModules.sort(sortByIndex2); - break; - default: - throw new Error( - "ChunkModuleIdRangePlugin: unexpected value of order" - ); + // iterate all modules to generate bit values + let i = 0; + for (const module of compilation.modules) { + let bit = 30; + while (i % modulos[bit] !== 0) { + bit--; + } + moduleBits.set(module, 1 << bit); + i++; } - } else { - chunkModules = modules.filter(m => { - return m.chunksIterable.has(chunk); - }); - } - let currentId = options.start || 0; - for (let i = 0; i < chunkModules.length; i++) { - const m = chunkModules[i]; - if (m.id === null) { - m.id = currentId++; + // interate all chunks to generate bitmaps + const chunkModulesHash = new WeakMap(); + for (const chunk of chunks) { + let hash = 0; + for (const module of chunk.modulesIterable) { + hash |= moduleBits.get(module); + } + chunkModulesHash.set(chunk, hash); } - if (options.end && currentId > options.end) break; - } - }); - }); + + for (const chunkA of chunks) { + const chunkAHash = chunkModulesHash.get(chunkA); + const chunkAModulesCount = chunkA.getNumberOfModules(); + if (chunkAModulesCount === 0) continue; + let bestModule = undefined; + for (const module of chunkA.modulesIterable) { + if ( + bestModule === undefined || + bestModule.getNumberOfChunks() > module.getNumberOfChunks() + ) + bestModule = module; + } + loopB: for (const chunkB of bestModule.chunksIterable) { + // as we iterate the same iterables twice + // skip if we find ourselves + if (chunkA === chunkB) continue; + + const chunkBModulesCount = chunkB.getNumberOfModules(); + + // ids for empty chunks are not included + if (chunkBModulesCount === 0) continue; + + // instead of swapping A and B just bail + // as we loop twice the current A will be B and B then A + if (chunkAModulesCount > chunkBModulesCount) continue; + + // is chunkA in chunkB? + + // we do a cheap check for the hash value + const chunkBHash = chunkModulesHash.get(chunkB); + if ((chunkBHash & chunkAHash) !== chunkAHash) continue; + + // compare all modules + for (const m of chunkA.modulesIterable) { + if (!chunkB.containsModule(m)) continue loopB; + } + chunkB.ids.push(chunkA.id); + } + } + } + ); + }); } } -module.exports = ChunkModuleIdRangePlugin; +module.exports = FlagIncludedChunksPlugin; /***/ }), -/***/ 16953: +/***/ 3846: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -88095,1482 +86018,991 @@ module.exports = ChunkModuleIdRangePlugin; */ -const Module = __webpack_require__(75993); -const Template = __webpack_require__(96066); -const Parser = __webpack_require__(70558); -const eslintScope = __webpack_require__(41632); -const { ConcatSource, ReplaceSource } = __webpack_require__(53665); -const DependencyReference = __webpack_require__(71722); -const HarmonyImportDependency = __webpack_require__(81599); -const HarmonyImportSideEffectDependency = __webpack_require__(79171); -const HarmonyImportSpecifierDependency = __webpack_require__(95966); -const HarmonyExportSpecifierDependency = __webpack_require__(34834); -const HarmonyExportExpressionDependency = __webpack_require__(84245); -const HarmonyExportImportedSpecifierDependency = __webpack_require__(22864); -const HarmonyCompatibilityDependency = __webpack_require__(1533); -const createHash = __webpack_require__(15660); - -/** @typedef {import("../Dependency")} Dependency */ -/** @typedef {import("../Compilation")} Compilation */ -/** @typedef {import("../util/createHash").Hash} Hash */ -/** @typedef {import("../RequestShortener")} RequestShortener */ +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(27993); +const LazyBucketSortedSet = __webpack_require__(52315); -const joinIterableWithComma = iterable => { - // This is more performant than Array.from().join(", ") - // as it doesn't create an array - let str = ""; - let first = true; - for (const item of iterable) { - if (first) { - first = false; - } else { - str += ", "; - } - str += item; - } - return str; -}; +/** @typedef {import("../../declarations/plugins/optimize/LimitChunkCountPlugin").LimitChunkCountPluginOptions} LimitChunkCountPluginOptions */ +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../Compiler")} Compiler */ /** - * @typedef {Object} ConcatenationEntry - * @property {"concatenated" | "external"} type - * @property {Module} module + * @typedef {Object} ChunkCombination + * @property {boolean} deleted this is set to true when combination was removed + * @property {number} sizeDiff + * @property {number} integratedSize + * @property {Chunk} a + * @property {Chunk} b + * @property {number} aIdx + * @property {number} bIdx + * @property {number} aSize + * @property {number} bSize */ -const ensureNsObjSource = ( - info, - moduleToInfoMap, - requestShortener, - strictHarmonyModule -) => { - if (!info.hasNamespaceObject) { - info.hasNamespaceObject = true; - const name = info.exportMap.get(true); - const nsObj = [`var ${name} = {};`, `__webpack_require__.r(${name});`]; - for (const exportName of info.module.buildMeta.providedExports) { - const finalName = getFinalName( - info, - exportName, - moduleToInfoMap, - requestShortener, - false, - strictHarmonyModule - ); - nsObj.push( - `__webpack_require__.d(${name}, ${JSON.stringify( - exportName - )}, function() { return ${finalName}; });` - ); - } - info.namespaceObjectSource = nsObj.join("\n") + "\n"; +const addToSetMap = (map, key, value) => { + const set = map.get(key); + if (set === undefined) { + map.set(key, new Set([value])); + } else { + set.add(value); } }; -const getExternalImport = ( - importedModule, - info, - exportName, - asCall, - strictHarmonyModule -) => { - const used = importedModule.isUsed(exportName); - if (!used) return "/* unused reexport */undefined"; - const comment = - used !== exportName ? ` ${Template.toNormalComment(exportName)}` : ""; - switch (importedModule.buildMeta.exportsType) { - case "named": - if (exportName === "default") { - return info.name; - } else if (exportName === true) { - info.interopNamespaceObjectUsed = true; - return info.interopNamespaceObjectName; - } else { - break; - } - case "namespace": - if (exportName === true) { - return info.name; - } else { - break; - } - default: - if (strictHarmonyModule) { - if (exportName === "default") { - return info.name; - } else if (exportName === true) { - info.interopNamespaceObjectUsed = true; - return info.interopNamespaceObjectName; - } else { - return "/* non-default import from non-esm module */undefined"; - } - } else { - if (exportName === "default") { - info.interopDefaultAccessUsed = true; - return asCall - ? `${info.interopDefaultAccessName}()` - : `${info.interopDefaultAccessName}.a`; - } else if (exportName === true) { - return info.name; - } else { - break; - } - } - } - const reference = `${info.name}[${JSON.stringify(used)}${comment}]`; - if (asCall) return `Object(${reference})`; - return reference; -}; +class LimitChunkCountPlugin { + /** + * @param {LimitChunkCountPluginOptions=} options options object + */ + constructor(options) { + if (!options) options = {}; -const getFinalName = ( - info, - exportName, - moduleToInfoMap, - requestShortener, - asCall, - strictHarmonyModule, - alreadyVisited = new Set() -) => { - switch (info.type) { - case "concatenated": { - const directExport = info.exportMap.get(exportName); - if (directExport) { - if (exportName === true) { - ensureNsObjSource( - info, - moduleToInfoMap, - requestShortener, - strictHarmonyModule - ); - } else if (!info.module.isUsed(exportName)) { - return "/* unused export */ undefined"; - } - if (info.globalExports.has(directExport)) { - return directExport; - } - const name = info.internalNames.get(directExport); - if (!name) { - throw new Error( - `The export "${directExport}" in "${info.module.readableIdentifier( - requestShortener - )}" has no internal name` - ); - } - return name; - } - const reexport = info.reexportMap.get(exportName); - if (reexport) { - if (alreadyVisited.has(reexport)) { - throw new Error( - `Circular reexports ${Array.from( - alreadyVisited, - e => - `"${e.module.readableIdentifier(requestShortener)}".${ - e.exportName - }` - ).join( - " --> " - )} -(circular)-> "${reexport.module.readableIdentifier( - requestShortener - )}".${reexport.exportName}` - ); - } - alreadyVisited.add(reexport); - const refInfo = moduleToInfoMap.get(reexport.module); - if (refInfo) { - // module is in the concatenation - return getFinalName( - refInfo, - reexport.exportName, - moduleToInfoMap, - requestShortener, - asCall, - strictHarmonyModule, - alreadyVisited - ); - } - } - const problem = - `Cannot get final name for export "${exportName}" in "${info.module.readableIdentifier( - requestShortener - )}"` + - ` (known exports: ${Array.from(info.exportMap.keys()) - .filter(name => name !== true) - .join(" ")}, ` + - `known reexports: ${Array.from(info.reexportMap.keys()).join(" ")})`; - return `${Template.toNormalComment(problem)} undefined`; - } - case "external": { - const importedModule = info.module; - return getExternalImport( - importedModule, - info, - exportName, - asCall, - strictHarmonyModule - ); - } + validateOptions(schema, options, "Limit Chunk Count Plugin"); + this.options = options; } -}; -const addScopeSymbols1 = (s, nameSet, scopeSet) => { - let scope = s; - while (scope) { - if (scopeSet.has(scope)) break; - scopeSet.add(scope); - for (const variable of scope.variables) { - nameSet.add(variable.name); - } - scope = scope.upper; - } -}; + /** + * @param {Compiler} compiler the webpack compiler + * @returns {void} + */ + apply(compiler) { + const options = this.options; + compiler.hooks.compilation.tap("LimitChunkCountPlugin", compilation => { + compilation.hooks.optimizeChunksAdvanced.tap( + "LimitChunkCountPlugin", + chunks => { + const maxChunks = options.maxChunks; + if (!maxChunks) return; + if (maxChunks < 1) return; + if (chunks.length <= maxChunks) return; -const addScopeSymbols2 = (s, nameSet, scopeSet1, scopeSet2) => { - let scope = s; - while (scope) { - if (scopeSet1.has(scope)) break; - if (scopeSet2.has(scope)) break; - scopeSet1.add(scope); - for (const variable of scope.variables) { - nameSet.add(variable.name); - } - scope = scope.upper; - } -}; + let remainingChunksToMerge = chunks.length - maxChunks; -const getAllReferences = variable => { - let set = variable.references; - // Look for inner scope variables too (like in class Foo { t() { Foo } }) - const identifiers = new Set(variable.identifiers); - for (const scope of variable.scope.childScopes) { - for (const innerVar of scope.variables) { - if (innerVar.identifiers.some(id => identifiers.has(id))) { - set = set.concat(innerVar.references); - break; - } - } - } - return set; -}; + // order chunks in a deterministic way + const orderedChunks = chunks.slice().sort((a, b) => a.compareTo(b)); -const getPathInAst = (ast, node) => { - if (ast === node) { - return []; - } + // create a lazy sorted data structure to keep all combinations + // this is large. Size = chunks * (chunks - 1) / 2 + // It uses a multi layer bucket sort plus normal sort in the last layer + // It's also lazy so only accessed buckets are sorted + const combinations = new LazyBucketSortedSet( + // Layer 1: ordered by largest size benefit + c => c.sizeDiff, + (a, b) => b - a, + // Layer 2: ordered by smallest combined size + c => c.integratedSize, + (a, b) => a - b, + // Layer 3: ordered by position difference in orderedChunk (-> to be deterministic) + c => c.bIdx - c.aIdx, + (a, b) => a - b, + // Layer 4: ordered by position in orderedChunk (-> to be deterministic) + (a, b) => a.bIdx - b.bIdx + ); - const nr = node.range; + // we keep a mappng from chunk to all combinations + // but this mapping is not kept up-to-date with deletions + // so `deleted` flag need to be considered when iterating this + /** @type {Map>} */ + const combinationsByChunk = new Map(); - const enterNode = n => { - if (!n) return undefined; - const r = n.range; - if (r) { - if (r[0] <= nr[0] && r[1] >= nr[1]) { - const path = getPathInAst(n, node); - if (path) { - path.push(n); - return path; - } - } - } - return undefined; - }; + orderedChunks.forEach((b, bIdx) => { + // create combination pairs with size and integrated size + for (let aIdx = 0; aIdx < bIdx; aIdx++) { + const a = orderedChunks[aIdx]; + const integratedSize = a.integratedSize(b, options); - var i; - if (Array.isArray(ast)) { - for (i = 0; i < ast.length; i++) { - const enterResult = enterNode(ast[i]); - if (enterResult !== undefined) return enterResult; - } - } else if (ast && typeof ast === "object") { - const keys = Object.keys(ast); - for (i = 0; i < keys.length; i++) { - const value = ast[keys[i]]; - if (Array.isArray(value)) { - const pathResult = getPathInAst(value, node); - if (pathResult !== undefined) return pathResult; - } else if (value && typeof value === "object") { - const enterResult = enterNode(value); - if (enterResult !== undefined) return enterResult; - } - } - } -}; + // filter pairs that do not have an integratedSize + // meaning they can NOT be integrated! + if (integratedSize === false) continue; -const getHarmonyExportImportedSpecifierDependencyExports = dep => { - const importModule = dep._module; - if (!importModule) return []; - if (dep._id) { - // export { named } from "module" - return [ - { - name: dep.name, - id: dep._id, - module: importModule - } - ]; - } - if (dep.name) { - // export * as abc from "module" - return [ - { - name: dep.name, - id: true, - module: importModule - } - ]; - } - // export * from "module" - return importModule.buildMeta.providedExports - .filter(exp => exp !== "default" && !dep.activeExports.has(exp)) - .map(exp => { - return { - name: exp, - id: exp, - module: importModule - }; - }); -}; + const aSize = a.size(options); + const bSize = b.size(options); + const c = { + deleted: false, + sizeDiff: aSize + bSize - integratedSize, + integratedSize, + a, + b, + aIdx, + bIdx, + aSize, + bSize + }; + combinations.add(c); + addToSetMap(combinationsByChunk, a, c); + addToSetMap(combinationsByChunk, b, c); + } + return combinations; + }); -class ConcatenatedModule extends Module { - constructor(rootModule, modules, concatenationList) { - super("javascript/esm", null); - super.setChunks(rootModule._chunks); + // list of modified chunks during this run + // combinations affected by this change are skipped to allow + // futher optimizations + /** @type {Set} */ + const modifiedChunks = new Set(); - // Info from Factory - this.rootModule = rootModule; - this.factoryMeta = rootModule.factoryMeta; + let changed = false; + // eslint-disable-next-line no-constant-condition + loop: while (true) { + const combination = combinations.popFirst(); + if (combination === undefined) break; - // Info from Compilation - this.index = rootModule.index; - this.index2 = rootModule.index2; - this.depth = rootModule.depth; + combination.deleted = true; + const { a, b, integratedSize } = combination; - // Info from Optimization - this.used = rootModule.used; - this.usedExports = rootModule.usedExports; + // skip over pair when + // one of the already merged chunks is a parent of one of the chunks + if (modifiedChunks.size > 0) { + const queue = new Set(a.groupsIterable); + for (const group of b.groupsIterable) { + queue.add(group); + } + for (const group of queue) { + for (const mChunk of modifiedChunks) { + if (mChunk !== a && mChunk !== b && mChunk.isInGroup(group)) { + // This is a potential pair which needs recalculation + // We can't do that now, but it merge before following pairs + // so we leave space for it, and consider chunks as modified + // just for the worse case + remainingChunksToMerge--; + if (remainingChunksToMerge <= 0) break loop; + modifiedChunks.add(a); + modifiedChunks.add(b); + continue loop; + } + } + for (const parent of group.parentsIterable) { + queue.add(parent); + } + } + } - // Info from Build - this.buildInfo = { - strict: true, - cacheable: modules.every(m => m.buildInfo.cacheable), - moduleArgument: rootModule.buildInfo.moduleArgument, - exportsArgument: rootModule.buildInfo.exportsArgument, - fileDependencies: new Set(), - contextDependencies: new Set(), - assets: undefined - }; - this.built = modules.some(m => m.built); - this.buildMeta = rootModule.buildMeta; - - // Caching - this._numberOfConcatenatedModules = modules.length; - - // Graph - const modulesSet = new Set(modules); - this.reasons = rootModule.reasons.filter( - reason => - !(reason.dependency instanceof HarmonyImportDependency) || - !modulesSet.has(reason.module) - ); + // merge the chunks + if (a.integrate(b, "limit")) { + chunks.splice(chunks.indexOf(b), 1); - this.dependencies = []; - this.blocks = []; + // flag chunk a as modified as further optimization are possible for all children here + modifiedChunks.add(a); - this.warnings = []; - this.errors = []; - this._orderedConcatenationList = - concatenationList || - ConcatenatedModule.createConcatenationList(rootModule, modulesSet, null); - for (const info of this._orderedConcatenationList) { - if (info.type === "concatenated") { - const m = info.module; + changed = true; + remainingChunksToMerge--; + if (remainingChunksToMerge <= 0) break; - // populate dependencies - for (const d of m.dependencies.filter( - dep => - !(dep instanceof HarmonyImportDependency) || - !modulesSet.has(dep._module) - )) { - this.dependencies.push(d); - } - // populate blocks - for (const d of m.blocks) { - this.blocks.push(d); - } - // populate file dependencies - if (m.buildInfo.fileDependencies) { - for (const file of m.buildInfo.fileDependencies) { - this.buildInfo.fileDependencies.add(file); - } - } - // populate context dependencies - if (m.buildInfo.contextDependencies) { - for (const context of m.buildInfo.contextDependencies) { - this.buildInfo.contextDependencies.add(context); - } - } - // populate warnings - for (const warning of m.warnings) { - this.warnings.push(warning); - } - // populate errors - for (const error of m.errors) { - this.errors.push(error); - } + // Update all affected combinations + // delete all combination with the removed chunk + // we will use combinations with the kept chunk instead + for (const combination of combinationsByChunk.get(b)) { + if (combination.deleted) continue; + combination.deleted = true; + combinations.delete(combination); + } - if (m.buildInfo.assets) { - if (this.buildInfo.assets === undefined) { - this.buildInfo.assets = Object.create(null); - } - Object.assign(this.buildInfo.assets, m.buildInfo.assets); - } - if (m.buildInfo.assetsInfo) { - if (this.buildInfo.assetsInfo === undefined) { - this.buildInfo.assetsInfo = new Map(); - } - for (const [key, value] of m.buildInfo.assetsInfo) { - this.buildInfo.assetsInfo.set(key, value); + // Update combinations with the kept chunk with new sizes + for (const combination of combinationsByChunk.get(a)) { + if (combination.deleted) continue; + if (combination.a === a) { + // Update size + const newIntegratedSize = a.integratedSize( + combination.b, + options + ); + if (newIntegratedSize === false) { + combination.deleted = true; + combinations.delete(combination); + continue; + } + const finishUpdate = combinations.startUpdate(combination); + combination.integratedSize = newIntegratedSize; + combination.aSize = integratedSize; + combination.sizeDiff = + combination.bSize + integratedSize - newIntegratedSize; + finishUpdate(); + } else if (combination.b === a) { + // Update size + const newIntegratedSize = combination.a.integratedSize( + a, + options + ); + if (newIntegratedSize === false) { + combination.deleted = true; + combinations.delete(combination); + continue; + } + const finishUpdate = combinations.startUpdate(combination); + combination.integratedSize = newIntegratedSize; + combination.bSize = integratedSize; + combination.sizeDiff = + integratedSize + combination.aSize - newIntegratedSize; + finishUpdate(); + } + } + } } + if (changed) return true; } - } - } - this._identifier = this._createIdentifier(); + ); + }); } +} +module.exports = LimitChunkCountPlugin; - get modules() { - return this._orderedConcatenationList - .filter(info => info.type === "concatenated") - .map(info => info.module); - } - identifier() { - return this._identifier; - } +/***/ }), - readableIdentifier(requestShortener) { - return ( - this.rootModule.readableIdentifier(requestShortener) + - ` + ${this._numberOfConcatenatedModules - 1} modules` - ); - } +/***/ 46214: +/***/ (function(module) { - libIdent(options) { - return this.rootModule.libIdent(options); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - nameForCondition() { - return this.rootModule.nameForCondition(); - } - build(options, compilation, resolver, fs, callback) { - throw new Error("Cannot build this module. It should be already built."); - } +class MergeDuplicateChunksPlugin { + apply(compiler) { + compiler.hooks.compilation.tap( + "MergeDuplicateChunksPlugin", + compilation => { + compilation.hooks.optimizeChunksBasic.tap( + "MergeDuplicateChunksPlugin", + chunks => { + // remember already tested chunks for performance + const notDuplicates = new Set(); - size() { - // Guess size from embedded modules - return this._orderedConcatenationList.reduce((sum, info) => { - switch (info.type) { - case "concatenated": - return sum + info.module.size(); - case "external": - return sum + 5; + // for each chunk + for (const chunk of chunks) { + // track a Set of all chunk that could be duplicates + let possibleDuplicates; + for (const module of chunk.modulesIterable) { + if (possibleDuplicates === undefined) { + // when possibleDuplicates is not yet set, + // create a new Set from chunks of the current module + // including only chunks with the same number of modules + for (const dup of module.chunksIterable) { + if ( + dup !== chunk && + chunk.getNumberOfModules() === dup.getNumberOfModules() && + !notDuplicates.has(dup) + ) { + // delay allocating the new Set until here, reduce memory pressure + if (possibleDuplicates === undefined) { + possibleDuplicates = new Set(); + } + possibleDuplicates.add(dup); + } + } + // when no chunk is possible we can break here + if (possibleDuplicates === undefined) break; + } else { + // validate existing possible duplicates + for (const dup of possibleDuplicates) { + // remove possible duplicate when module is not contained + if (!dup.containsModule(module)) { + possibleDuplicates.delete(dup); + } + } + // when all chunks has been removed we can break here + if (possibleDuplicates.size === 0) break; + } + } + + // when we found duplicates + if ( + possibleDuplicates !== undefined && + possibleDuplicates.size > 0 + ) { + for (const otherChunk of possibleDuplicates) { + if (otherChunk.hasRuntime() !== chunk.hasRuntime()) continue; + // merge them + if (chunk.integrate(otherChunk, "duplicate")) { + chunks.splice(chunks.indexOf(otherChunk), 1); + } + } + } + + // don't check already processed chunks twice + notDuplicates.add(chunk); + } + } + ); } - return sum; - }, 0); + ); } +} +module.exports = MergeDuplicateChunksPlugin; - /** - * @param {Module} rootModule the root of the concatenation - * @param {Set} modulesSet a set of modules which should be concatenated - * @param {Compilation} compilation the compilation context - * @returns {ConcatenationEntry[]} concatenation list - */ - static createConcatenationList(rootModule, modulesSet, compilation) { - const list = []; - const set = new Set(); - /** - * @param {Module} module a module - * @returns {(function(): Module)[]} imported modules in order - */ - const getConcatenatedImports = module => { - /** @type {WeakMap} */ - const map = new WeakMap(); - const references = module.dependencies - .filter(dep => dep instanceof HarmonyImportDependency) - .map(dep => { - const ref = compilation.getDependencyReference(module, dep); - if (ref) map.set(ref, dep); - return ref; - }) - .filter(ref => ref); - DependencyReference.sort(references); - // TODO webpack 5: remove this hack, see also DependencyReference - return references.map(ref => { - const dep = map.get(ref); - return () => compilation.getDependencyReference(module, dep).module; - }); - }; +/***/ }), - const enterModule = getModule => { - const module = getModule(); - if (!module) return; - if (set.has(module)) return; - set.add(module); - if (modulesSet.has(module)) { - const imports = getConcatenatedImports(module); - imports.forEach(enterModule); - list.push({ - type: "concatenated", - module - }); - } else { - list.push({ - type: "external", - get module() { - // We need to use a getter here, because the module in the dependency - // could be replaced by some other process (i. e. also replaced with a - // concatenated module) - return getModule(); - } - }); - } - }; +/***/ 55607: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - enterModule(() => rootModule); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - return list; - } - _createIdentifier() { - let orderedConcatenationListIdentifiers = ""; - for (let i = 0; i < this._orderedConcatenationList.length; i++) { - if (this._orderedConcatenationList[i].type === "concatenated") { - orderedConcatenationListIdentifiers += this._orderedConcatenationList[ - i - ].module.identifier(); - orderedConcatenationListIdentifiers += " "; - } - } - const hash = createHash("md4"); - hash.update(orderedConcatenationListIdentifiers); - return this.rootModule.identifier() + " " + hash.digest("hex"); +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(8670); + +/** @typedef {import("../../declarations/plugins/optimize/MinChunkSizePlugin").MinChunkSizePluginOptions} MinChunkSizePluginOptions */ + +class MinChunkSizePlugin { + /** + * @param {MinChunkSizePluginOptions} options options object + */ + constructor(options) { + validateOptions(schema, options, "Min Chunk Size Plugin"); + this.options = options; } - source(dependencyTemplates, runtimeTemplate) { - const requestShortener = runtimeTemplate.requestShortener; - // Metainfo for each module - const modulesWithInfo = this._orderedConcatenationList.map((info, idx) => { - switch (info.type) { - case "concatenated": { - const exportMap = new Map(); - const reexportMap = new Map(); - for (const dep of info.module.dependencies) { - if (dep instanceof HarmonyExportSpecifierDependency) { - if (!exportMap.has(dep.name)) { - exportMap.set(dep.name, dep.id); - } - } else if (dep instanceof HarmonyExportExpressionDependency) { - if (!exportMap.has("default")) { - exportMap.set("default", "__WEBPACK_MODULE_DEFAULT_EXPORT__"); - } - } else if ( - dep instanceof HarmonyExportImportedSpecifierDependency - ) { - const exportName = dep.name; - const importName = dep._id; - const importedModule = dep._module; - if (exportName && importName) { - if (!reexportMap.has(exportName)) { - reexportMap.set(exportName, { - module: importedModule, - exportName: importName, - dependency: dep - }); - } - } else if (exportName) { - if (!reexportMap.has(exportName)) { - reexportMap.set(exportName, { - module: importedModule, - exportName: true, - dependency: dep - }); - } - } else if (importedModule) { - for (const name of importedModule.buildMeta.providedExports) { - if (dep.activeExports.has(name) || name === "default") { - continue; - } - if (!reexportMap.has(name)) { - reexportMap.set(name, { - module: importedModule, - exportName: name, - dependency: dep - }); - } - } - } - } - } - return { - type: "concatenated", - module: info.module, - index: idx, - ast: undefined, - internalSource: undefined, - source: undefined, - globalScope: undefined, - moduleScope: undefined, - internalNames: new Map(), - globalExports: new Set(), - exportMap: exportMap, - reexportMap: reexportMap, - hasNamespaceObject: false, - namespaceObjectSource: null + apply(compiler) { + const options = this.options; + const minChunkSize = options.minChunkSize; + compiler.hooks.compilation.tap("MinChunkSizePlugin", compilation => { + compilation.hooks.optimizeChunksAdvanced.tap( + "MinChunkSizePlugin", + chunks => { + const equalOptions = { + chunkOverhead: 1, + entryChunkMultiplicator: 1 }; + + const sortedSizeFilteredExtendedPairCombinations = chunks + .reduce((combinations, a, idx) => { + // create combination pairs + for (let i = 0; i < idx; i++) { + const b = chunks[i]; + combinations.push([b, a]); + } + return combinations; + }, []) + .filter(pair => { + // check if one of the chunks sizes is smaller than the minChunkSize + const p0SmallerThanMinChunkSize = + pair[0].size(equalOptions) < minChunkSize; + const p1SmallerThanMinChunkSize = + pair[1].size(equalOptions) < minChunkSize; + return p0SmallerThanMinChunkSize || p1SmallerThanMinChunkSize; + }) + .map(pair => { + // extend combination pairs with size and integrated size + const a = pair[0].size(options); + const b = pair[1].size(options); + const ab = pair[0].integratedSize(pair[1], options); + return [a + b - ab, ab, pair[0], pair[1]]; + }) + .filter(pair => { + // filter pairs that do not have an integratedSize + // meaning they can NOT be integrated! + return pair[1] !== false; + }) + .sort((a, b) => { + // sadly javascript does an inplace sort here + // sort by size + const diff = b[0] - a[0]; + if (diff !== 0) return diff; + return a[1] - b[1]; + }); + + if (sortedSizeFilteredExtendedPairCombinations.length === 0) return; + + const pair = sortedSizeFilteredExtendedPairCombinations[0]; + + pair[2].integrate(pair[3], "min-size"); + chunks.splice(chunks.indexOf(pair[3]), 1); + return true; } - case "external": - return { - type: "external", - module: info.module, - index: idx, - name: undefined, - interopNamespaceObjectUsed: false, - interopNamespaceObjectName: undefined, - interopDefaultAccessUsed: false, - interopDefaultAccessName: undefined - }; - default: - throw new Error(`Unsupported concatenation entry type ${info.type}`); - } + ); }); + } +} +module.exports = MinChunkSizePlugin; - // Create mapping from module to info - const moduleToInfoMap = new Map(); - for (const m of modulesWithInfo) { - moduleToInfoMap.set(m.module, m); - } - // Configure template decorators for dependencies - const innerDependencyTemplates = new Map(dependencyTemplates); +/***/ }), - innerDependencyTemplates.set( - HarmonyImportSpecifierDependency, - new HarmonyImportSpecifierDependencyConcatenatedTemplate( - dependencyTemplates.get(HarmonyImportSpecifierDependency), - moduleToInfoMap - ) - ); - innerDependencyTemplates.set( - HarmonyImportSideEffectDependency, - new HarmonyImportSideEffectDependencyConcatenatedTemplate( - dependencyTemplates.get(HarmonyImportSideEffectDependency), - moduleToInfoMap - ) - ); - innerDependencyTemplates.set( - HarmonyExportSpecifierDependency, - new NullTemplate() - ); - innerDependencyTemplates.set( - HarmonyExportExpressionDependency, - new HarmonyExportExpressionDependencyConcatenatedTemplate( - dependencyTemplates.get(HarmonyExportExpressionDependency), - this.rootModule - ) - ); - innerDependencyTemplates.set( - HarmonyExportImportedSpecifierDependency, - new NullTemplate() - ); - innerDependencyTemplates.set( - HarmonyCompatibilityDependency, - new NullTemplate() - ); +/***/ 25472: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - // Must use full identifier in our cache here to ensure that the source - // is updated should our dependencies list change. - // TODO webpack 5 refactor - innerDependencyTemplates.set( - "hash", - innerDependencyTemplates.get("hash") + this.identifier() - ); +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // Generate source code and analyse scopes - // Prepare a ReplaceSource for the final source - for (const info of modulesWithInfo) { - if (info.type === "concatenated") { - const m = info.module; - const source = m.source(innerDependencyTemplates, runtimeTemplate); - const code = source.source(); - let ast; - try { - ast = Parser.parse(code, { - sourceType: "module" - }); - } catch (err) { - if ( - err.loc && - typeof err.loc === "object" && - typeof err.loc.line === "number" - ) { - const lineNumber = err.loc.line; - const lines = code.split("\n"); - err.message += - "\n| " + - lines - .slice(Math.max(0, lineNumber - 3), lineNumber + 2) - .join("\n| "); - } - throw err; - } - const scopeManager = eslintScope.analyze(ast, { - ecmaVersion: 6, - sourceType: "module", - optimistic: true, - ignoreEval: true, - impliedStrict: true - }); - const globalScope = scopeManager.acquire(ast); - const moduleScope = globalScope.childScopes[0]; - const resultSource = new ReplaceSource(source); - info.ast = ast; - info.internalSource = source; - info.source = resultSource; - info.globalScope = globalScope; - info.moduleScope = moduleScope; - } + +const WebpackError = __webpack_require__(97391); +const SizeFormatHelpers = __webpack_require__(12496); + +class MinMaxSizeWarning extends WebpackError { + constructor(keys, minSize, maxSize) { + let keysMessage = "Fallback cache group"; + if (keys) { + keysMessage = + keys.length > 1 + ? `Cache groups ${keys.sort().join(", ")}` + : `Cache group ${keys[0]}`; } + super( + `SplitChunksPlugin\n` + + `${keysMessage}\n` + + `Configured minSize (${SizeFormatHelpers.formatSize(minSize)}) is ` + + `bigger than maxSize (${SizeFormatHelpers.formatSize(maxSize)}).\n` + + "This seem to be a invalid optimiziation.splitChunks configuration." + ); + } +} - // List of all used names to avoid conflicts - const allUsedNames = new Set([ - "__WEBPACK_MODULE_DEFAULT_EXPORT__", // avoid using this internal name +module.exports = MinMaxSizeWarning; - "abstract", - "arguments", - "async", - "await", - "boolean", - "break", - "byte", - "case", - "catch", - "char", - "class", - "const", - "continue", - "debugger", - "default", - "delete", - "do", - "double", - "else", - "enum", - "eval", - "export", - "extends", - "false", - "final", - "finally", - "float", - "for", - "function", - "goto", - "if", - "implements", - "import", - "in", - "instanceof", - "int", - "interface", - "let", - "long", - "native", - "new", - "null", - "package", - "private", - "protected", - "public", - "return", - "short", - "static", - "super", - "switch", - "synchronized", - "this", - "throw", - "throws", - "transient", - "true", - "try", - "typeof", - "var", - "void", - "volatile", - "while", - "with", - "yield", - "module", - "__dirname", - "__filename", - "exports", +/***/ }), - "Array", - "Date", - "eval", - "function", - "hasOwnProperty", - "Infinity", - "isFinite", - "isNaN", - "isPrototypeOf", - "length", - "Math", - "NaN", - "name", - "Number", - "Object", - "prototype", - "String", - "toString", - "undefined", - "valueOf", +/***/ 45184: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - "alert", - "all", - "anchor", - "anchors", - "area", - "assign", - "blur", - "button", - "checkbox", - "clearInterval", - "clearTimeout", - "clientInformation", - "close", - "closed", - "confirm", - "constructor", - "crypto", - "decodeURI", - "decodeURIComponent", - "defaultStatus", - "document", - "element", - "elements", - "embed", - "embeds", - "encodeURI", - "encodeURIComponent", - "escape", - "event", - "fileUpload", - "focus", - "form", - "forms", - "frame", - "innerHeight", - "innerWidth", - "layer", - "layers", - "link", - "location", - "mimeTypes", - "navigate", - "navigator", - "frames", - "frameRate", - "hidden", - "history", - "image", - "images", - "offscreenBuffering", - "open", - "opener", - "option", - "outerHeight", - "outerWidth", - "packages", - "pageXOffset", - "pageYOffset", - "parent", - "parseFloat", - "parseInt", - "password", - "pkcs11", - "plugin", - "prompt", - "propertyIsEnum", - "radio", - "reset", - "screenX", - "screenY", - "scroll", - "secure", - "select", - "self", - "setInterval", - "setTimeout", - "status", - "submit", - "taint", - "text", - "textarea", - "top", - "unescape", - "untaint", - "window", +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - "onblur", - "onclick", - "onerror", - "onfocus", - "onkeydown", - "onkeypress", - "onkeyup", - "onmouseover", - "onload", - "onmouseup", - "onmousedown", - "onsubmit" - ]); - // Set of already checked scopes - const alreadyCheckedScopes = new Set(); +const HarmonyImportDependency = __webpack_require__(81599); +const ModuleHotAcceptDependency = __webpack_require__(29018); +const ModuleHotDeclineDependency = __webpack_require__(60482); +const ConcatenatedModule = __webpack_require__(16953); +const HarmonyCompatibilityDependency = __webpack_require__(1533); +const StackedSetMap = __webpack_require__(92251); - // get all global names - for (const info of modulesWithInfo) { - const superClassExpressions = []; +const formatBailoutReason = msg => { + return "ModuleConcatenation bailout: " + msg; +}; - // ignore symbols from moduleScope - if (info.moduleScope) { - alreadyCheckedScopes.add(info.moduleScope); +class ModuleConcatenationPlugin { + constructor(options) { + if (typeof options !== "object") options = {}; + this.options = options; + } - // The super class expression in class scopes behaves weird - // We store ranges of all super class expressions to make - // renaming to work correctly - for (const childScope of info.moduleScope.childScopes) { - if (childScope.type !== "class") continue; - if (!childScope.block.superClass) continue; - superClassExpressions.push({ - range: childScope.block.superClass.range, - variables: childScope.variables + apply(compiler) { + compiler.hooks.compilation.tap( + "ModuleConcatenationPlugin", + (compilation, { normalModuleFactory }) => { + const handler = (parser, parserOptions) => { + parser.hooks.call.for("eval").tap("ModuleConcatenationPlugin", () => { + // Because of variable renaming we can't use modules with eval. + parser.state.module.buildMeta.moduleConcatenationBailout = "eval()"; }); - } - } + }; - // add global symbols - if (info.globalScope) { - for (const reference of info.globalScope.through) { - const name = reference.identifier.name; - if ( - /^__WEBPACK_MODULE_REFERENCE__\d+_([\da-f]+|ns)(_call)?(_strict)?__$/.test( - name - ) - ) { - for (const expr of superClassExpressions) { + normalModuleFactory.hooks.parser + .for("javascript/auto") + .tap("ModuleConcatenationPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/dynamic") + .tap("ModuleConcatenationPlugin", handler); + normalModuleFactory.hooks.parser + .for("javascript/esm") + .tap("ModuleConcatenationPlugin", handler); + + const bailoutReasonMap = new Map(); + + const setBailoutReason = (module, reason) => { + bailoutReasonMap.set(module, reason); + module.optimizationBailout.push( + typeof reason === "function" + ? rs => formatBailoutReason(reason(rs)) + : formatBailoutReason(reason) + ); + }; + + const getBailoutReason = (module, requestShortener) => { + const reason = bailoutReasonMap.get(module); + if (typeof reason === "function") return reason(requestShortener); + return reason; + }; + + compilation.hooks.optimizeChunkModules.tap( + "ModuleConcatenationPlugin", + (allChunks, modules) => { + const relevantModules = []; + const possibleInners = new Set(); + for (const module of modules) { + // Only harmony modules are valid for optimization if ( - expr.range[0] <= reference.identifier.range[0] && - expr.range[1] >= reference.identifier.range[1] + !module.buildMeta || + module.buildMeta.exportsType !== "namespace" || + !module.dependencies.some( + d => d instanceof HarmonyCompatibilityDependency + ) ) { - for (const variable of expr.variables) { - allUsedNames.add(variable.name); - } + setBailoutReason(module, "Module is not an ECMAScript module"); + continue; } - } - addScopeSymbols1( - reference.from, - allUsedNames, - alreadyCheckedScopes - ); - } else { - allUsedNames.add(name); - } - } - } - // add exported globals - if (info.type === "concatenated") { - const variables = new Set(); - for (const variable of info.moduleScope.variables) { - variables.add(variable.name); - } - for (const [, variable] of info.exportMap) { - if (!variables.has(variable)) { - info.globalExports.add(variable); - } - } - } - } + // Some expressions are not compatible with module concatenation + // because they may produce unexpected results. The plugin bails out + // if some were detected upfront. + if ( + module.buildMeta && + module.buildMeta.moduleConcatenationBailout + ) { + setBailoutReason( + module, + `Module uses ${module.buildMeta.moduleConcatenationBailout}` + ); + continue; + } - // generate names for symbols - for (const info of modulesWithInfo) { - switch (info.type) { - case "concatenated": { - const namespaceObjectName = this.findNewName( - "namespaceObject", - allUsedNames, - null, - info.module.readableIdentifier(requestShortener) - ); - allUsedNames.add(namespaceObjectName); - info.internalNames.set(namespaceObjectName, namespaceObjectName); - info.exportMap.set(true, namespaceObjectName); - for (const variable of info.moduleScope.variables) { - const name = variable.name; - if (allUsedNames.has(name)) { - const references = getAllReferences(variable); - const symbolsInReferences = new Set(); - const alreadyCheckedInnerScopes = new Set(); - for (const ref of references) { - addScopeSymbols2( - ref.from, - symbolsInReferences, - alreadyCheckedInnerScopes, - alreadyCheckedScopes + // Exports must be known (and not dynamic) + if (!Array.isArray(module.buildMeta.providedExports)) { + setBailoutReason(module, "Module exports are unknown"); + continue; + } + + // Using dependency variables is not possible as this wraps the code in a function + if (module.variables.length > 0) { + setBailoutReason( + module, + `Module uses injected variables (${module.variables + .map(v => v.name) + .join(", ")})` ); + continue; } - const newName = this.findNewName( - name, - allUsedNames, - symbolsInReferences, - info.module.readableIdentifier(requestShortener) - ); - allUsedNames.add(newName); - info.internalNames.set(name, newName); - const source = info.source; - const allIdentifiers = new Set( - references.map(r => r.identifier).concat(variable.identifiers) - ); - for (const identifier of allIdentifiers) { - const r = identifier.range; - const path = getPathInAst(info.ast, identifier); - if ( - path && - path.length > 1 && - path[1].type === "Property" && - path[1].shorthand - ) { - source.insert(r[1], `: ${newName}`); - } else { - source.replace(r[0], r[1] - 1, newName); - } + + // Hot Module Replacement need it's own module to work correctly + if ( + module.dependencies.some( + dep => + dep instanceof ModuleHotAcceptDependency || + dep instanceof ModuleHotDeclineDependency + ) + ) { + setBailoutReason(module, "Module uses Hot Module Replacement"); + continue; } - } else { - allUsedNames.add(name); - info.internalNames.set(name, name); - } - } - break; - } - case "external": { - const externalName = this.findNewName( - "", - allUsedNames, - null, - info.module.readableIdentifier(requestShortener) - ); - allUsedNames.add(externalName); - info.name = externalName; - if ( - info.module.buildMeta.exportsType === "named" || - !info.module.buildMeta.exportsType - ) { - const externalNameInterop = this.findNewName( - "namespaceObject", - allUsedNames, - null, - info.module.readableIdentifier(requestShortener) - ); - allUsedNames.add(externalNameInterop); - info.interopNamespaceObjectName = externalNameInterop; - } - if (!info.module.buildMeta.exportsType) { - const externalNameInterop = this.findNewName( - "default", - allUsedNames, - null, - info.module.readableIdentifier(requestShortener) - ); - allUsedNames.add(externalNameInterop); - info.interopDefaultAccessName = externalNameInterop; - } - break; - } - } - } - // Find and replace referenced to modules - for (const info of modulesWithInfo) { - if (info.type === "concatenated") { - for (const reference of info.globalScope.through) { - const name = reference.identifier.name; - const match = /^__WEBPACK_MODULE_REFERENCE__(\d+)_([\da-f]+|ns)(_call)?(_strict)?__$/.exec( - name - ); - if (match) { - const referencedModule = modulesWithInfo[+match[1]]; - let exportName; - if (match[2] === "ns") { - exportName = true; - } else { - const exportData = match[2]; - exportName = Buffer.from(exportData, "hex").toString("utf-8"); + relevantModules.push(module); + + // Module must not be the entry points + if (module.isEntryModule()) { + setBailoutReason(module, "Module is an entry point"); + continue; + } + + // Module must be in any chunk (we don't want to do useless work) + if (module.getNumberOfChunks() === 0) { + setBailoutReason(module, "Module is not in any chunk"); + continue; + } + + // Module must only be used by Harmony Imports + const nonHarmonyReasons = module.reasons.filter( + reason => + !reason.dependency || + !(reason.dependency instanceof HarmonyImportDependency) + ); + if (nonHarmonyReasons.length > 0) { + const importingModules = new Set( + nonHarmonyReasons.map(r => r.module).filter(Boolean) + ); + const importingExplanations = new Set( + nonHarmonyReasons.map(r => r.explanation).filter(Boolean) + ); + const importingModuleTypes = new Map( + Array.from(importingModules).map( + m => /** @type {[string, Set]} */ ([ + m, + new Set( + nonHarmonyReasons + .filter(r => r.module === m) + .map(r => r.dependency.type) + .sort() + ) + ]) + ) + ); + setBailoutReason(module, requestShortener => { + const names = Array.from(importingModules) + .map( + m => + `${m.readableIdentifier( + requestShortener + )} (referenced with ${Array.from( + importingModuleTypes.get(m) + ).join(", ")})` + ) + .sort(); + const explanations = Array.from(importingExplanations).sort(); + if (names.length > 0 && explanations.length === 0) { + return `Module is referenced from these modules with unsupported syntax: ${names.join( + ", " + )}`; + } else if (names.length === 0 && explanations.length > 0) { + return `Module is referenced by: ${explanations.join( + ", " + )}`; + } else if (names.length > 0 && explanations.length > 0) { + return `Module is referenced from these modules with unsupported syntax: ${names.join( + ", " + )} and by: ${explanations.join(", ")}`; + } else { + return "Module is referenced in a unsupported way"; + } + }); + continue; + } + + possibleInners.add(module); } - const asCall = !!match[3]; - const strictHarmonyModule = !!match[4]; - const finalName = getFinalName( - referencedModule, - exportName, - moduleToInfoMap, - requestShortener, - asCall, - strictHarmonyModule - ); - const r = reference.identifier.range; - const source = info.source; - source.replace(r[0], r[1] - 1, finalName); - } - } - } - } + // sort by depth + // modules with lower depth are more likely suited as roots + // this improves performance, because modules already selected as inner are skipped + relevantModules.sort((a, b) => { + return a.depth - b.depth; + }); + const concatConfigurations = []; + const usedAsInner = new Set(); + for (const currentRoot of relevantModules) { + // when used by another configuration as inner: + // the other configuration is better and we can skip this one + if (usedAsInner.has(currentRoot)) continue; - // Map with all root exposed used exports - /** @type {Map} */ - const exportsMap = new Map(); + // create a configuration with the root + const currentConfiguration = new ConcatConfiguration(currentRoot); - // Set with all root exposed unused exports - /** @type {Set} */ - const unusedExports = new Set(); + // cache failures to add modules + const failureCache = new Map(); - for (const dep of this.rootModule.dependencies) { - if (dep instanceof HarmonyExportSpecifierDependency) { - const used = this.rootModule.isUsed(dep.name); - if (used) { - const info = moduleToInfoMap.get(this.rootModule); - if (!exportsMap.has(used)) { - exportsMap.set( - used, - () => `/* binding */ ${info.internalNames.get(dep.id)}` - ); - } - } else { - unusedExports.add(dep.name || "namespace"); - } - } else if (dep instanceof HarmonyExportImportedSpecifierDependency) { - const exportDefs = getHarmonyExportImportedSpecifierDependencyExports( - dep - ); - for (const def of exportDefs) { - const info = moduleToInfoMap.get(def.module); - const used = dep.originModule.isUsed(def.name); - if (used) { - if (!exportsMap.has(used)) { - exportsMap.set(used, requestShortener => { - const finalName = getFinalName( - info, - def.id, - moduleToInfoMap, - requestShortener, - false, - this.rootModule.buildMeta.strictHarmonyModule + // try to add all imports + for (const imp of this._getImports(compilation, currentRoot)) { + const problem = this._tryToAdd( + compilation, + currentConfiguration, + imp, + possibleInners, + failureCache ); - return `/* reexport */ ${finalName}`; - }); + if (problem) { + failureCache.set(imp, problem); + currentConfiguration.addWarning(imp, problem); + } + } + if (!currentConfiguration.isEmpty()) { + concatConfigurations.push(currentConfiguration); + for (const module of currentConfiguration.getModules()) { + if (module !== currentConfiguration.rootModule) { + usedAsInner.add(module); + } + } + } } - } else { - unusedExports.add(def.name); + // HACK: Sort configurations by length and start with the longest one + // to get the biggers groups possible. Used modules are marked with usedModules + // TODO: Allow to reuse existing configuration while trying to add dependencies. + // This would improve performance. O(n^2) -> O(n) + concatConfigurations.sort((a, b) => { + return b.modules.size - a.modules.size; + }); + const usedModules = new Set(); + for (const concatConfiguration of concatConfigurations) { + if (usedModules.has(concatConfiguration.rootModule)) continue; + const modules = concatConfiguration.getModules(); + const rootModule = concatConfiguration.rootModule; + const newModule = new ConcatenatedModule( + rootModule, + Array.from(modules), + ConcatenatedModule.createConcatenationList( + rootModule, + modules, + compilation + ) + ); + for (const warning of concatConfiguration.getWarningsSorted()) { + newModule.optimizationBailout.push(requestShortener => { + const reason = getBailoutReason(warning[0], requestShortener); + const reasonWithPrefix = reason ? ` (<- ${reason})` : ""; + if (warning[0] === warning[1]) { + return formatBailoutReason( + `Cannot concat with ${warning[0].readableIdentifier( + requestShortener + )}${reasonWithPrefix}` + ); + } else { + return formatBailoutReason( + `Cannot concat with ${warning[0].readableIdentifier( + requestShortener + )} because of ${warning[1].readableIdentifier( + requestShortener + )}${reasonWithPrefix}` + ); + } + }); + } + const chunks = concatConfiguration.rootModule.getChunks(); + for (const m of modules) { + usedModules.add(m); + for (const chunk of chunks) { + chunk.removeModule(m); + } + } + for (const chunk of chunks) { + chunk.addModule(newModule); + newModule.addChunk(chunk); + } + for (const chunk of allChunks) { + if (chunk.entryModule === concatConfiguration.rootModule) { + chunk.entryModule = newModule; + } + } + compilation.modules.push(newModule); + for (const reason of newModule.reasons) { + if (reason.dependency.module === concatConfiguration.rootModule) + reason.dependency.module = newModule; + if ( + reason.dependency.redirectedModule === + concatConfiguration.rootModule + ) + reason.dependency.redirectedModule = newModule; + } + // TODO: remove when LTS node version contains fixed v8 version + // @see https://github.com/webpack/webpack/pull/6613 + // Turbofan does not correctly inline for-of loops with polymorphic input arrays. + // Work around issue by using a standard for loop and assigning dep.module.reasons + for (let i = 0; i < newModule.dependencies.length; i++) { + let dep = newModule.dependencies[i]; + if (dep.module) { + let reasons = dep.module.reasons; + for (let j = 0; j < reasons.length; j++) { + let reason = reasons[j]; + if (reason.dependency === dep) { + reason.module = newModule; + } + } + } + } + } + compilation.modules = compilation.modules.filter( + m => !usedModules.has(m) + ); } - } + ); } - } + ); + } - const result = new ConcatSource(); + _getImports(compilation, module) { + return new Set( + module.dependencies - // add harmony compatibility flag (must be first because of possible circular dependencies) - const usedExports = this.rootModule.usedExports; - if (usedExports === true || usedExports === null) { - result.add(`// ESM COMPAT FLAG\n`); - result.add( - runtimeTemplate.defineEsModuleFlagStatement({ - exportsArgument: this.exportsArgument + // Get reference info only for harmony Dependencies + .map(dep => { + if (!(dep instanceof HarmonyImportDependency)) return null; + if (!compilation) return dep.getReference(); + return compilation.getDependencyReference(module, dep); }) - ); - } - // define exports - if (exportsMap.size > 0) { - result.add(`\n// EXPORTS\n`); - for (const [key, value] of exportsMap) { - result.add( - `__webpack_require__.d(${this.exportsArgument}, ${JSON.stringify( - key - )}, function() { return ${value(requestShortener)}; });\n` - ); - } - } + // Reference is valid and has a module + // Dependencies are simple enough to concat them + .filter( + ref => + ref && + ref.module && + (Array.isArray(ref.importedNames) || + Array.isArray(ref.module.buildMeta.providedExports)) + ) - // list unused exports - if (unusedExports.size > 0) { - result.add( - `\n// UNUSED EXPORTS: ${joinIterableWithComma(unusedExports)}\n` - ); - } + // Take the imported module + .map(ref => ref.module) + ); + } - // define required namespace objects (must be before evaluation modules) - for (const info of modulesWithInfo) { - if (info.namespaceObjectSource) { - result.add( - `\n// NAMESPACE OBJECT: ${info.module.readableIdentifier( - requestShortener - )}\n` - ); - result.add(info.namespaceObjectSource); - } + _tryToAdd(compilation, config, module, possibleModules, failureCache) { + const cacheEntry = failureCache.get(module); + if (cacheEntry) { + return cacheEntry; } - // evaluate modules in order - for (const info of modulesWithInfo) { - switch (info.type) { - case "concatenated": - result.add( - `\n// CONCATENATED MODULE: ${info.module.readableIdentifier( - requestShortener - )}\n` - ); - result.add(info.source); - break; - case "external": - result.add( - `\n// EXTERNAL MODULE: ${info.module.readableIdentifier( - requestShortener - )}\n` - ); - result.add( - `var ${info.name} = __webpack_require__(${JSON.stringify( - info.module.id - )});\n` - ); - if (info.interopNamespaceObjectUsed) { - if (info.module.buildMeta.exportsType === "named") { - result.add( - `var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name}, 2);\n` - ); - } else if (!info.module.buildMeta.exportsType) { - result.add( - `var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name});\n` - ); - } - } - if (info.interopDefaultAccessUsed) { - result.add( - `var ${info.interopDefaultAccessName} = /*#__PURE__*/__webpack_require__.n(${info.name});\n` - ); - } - break; - default: - throw new Error(`Unsupported concatenation entry type ${info.type}`); - } + // Already added? + if (config.has(module)) { + return null; } - return result; - } + // Not possible to add? + if (!possibleModules.has(module)) { + failureCache.set(module, module); // cache failures for performance + return module; + } - findNewName(oldName, usedNamed1, usedNamed2, extraInfo) { - let name = oldName; + // module must be in the same chunks + if (!config.rootModule.hasEqualsChunks(module)) { + failureCache.set(module, module); // cache failures for performance + return module; + } - if (name === "__WEBPACK_MODULE_DEFAULT_EXPORT__") name = ""; + // Clone config to make experimental changes + const testConfig = config.clone(); - // Remove uncool stuff - extraInfo = extraInfo.replace( - /\.+\/|(\/index)?\.([a-zA-Z0-9]{1,4})($|\s|\?)|\s*\+\s*\d+\s*modules/g, - "" - ); + // Add the module + testConfig.add(module); - const splittedInfo = extraInfo.split("/"); - while (splittedInfo.length) { - name = splittedInfo.pop() + (name ? "_" + name : ""); - const nameIdent = Template.toIdentifier(name); + // Every module which depends on the added module must be in the configuration too. + for (const reason of module.reasons) { + // Modules that are not used can be ignored if ( - !usedNamed1.has(nameIdent) && - (!usedNamed2 || !usedNamed2.has(nameIdent)) + reason.module.factoryMeta.sideEffectFree && + reason.module.used === false ) - return nameIdent; - } + continue; - let i = 0; - let nameWithNumber = Template.toIdentifier(`${name}_${i}`); - while ( - usedNamed1.has(nameWithNumber) || - (usedNamed2 && usedNamed2.has(nameWithNumber)) - ) { - i++; - nameWithNumber = Template.toIdentifier(`${name}_${i}`); + const problem = this._tryToAdd( + compilation, + testConfig, + reason.module, + possibleModules, + failureCache + ); + if (problem) { + failureCache.set(module, problem); // cache failures for performance + return problem; + } } - return nameWithNumber; - } - /** - * @param {Hash} hash the hash used to track dependencies - * @returns {void} - */ - updateHash(hash) { - for (const info of this._orderedConcatenationList) { - switch (info.type) { - case "concatenated": - info.module.updateHash(hash); - break; - case "external": - hash.update(`${info.module.id}`); - break; + // Commit experimental changes + config.set(testConfig); + + // Eagerly try to add imports too if possible + for (const imp of this._getImports(compilation, module)) { + const problem = this._tryToAdd( + compilation, + config, + imp, + possibleModules, + failureCache + ); + if (problem) { + config.addWarning(imp, problem); } } - super.updateHash(hash); + return null; } } -class HarmonyImportSpecifierDependencyConcatenatedTemplate { - constructor(originalTemplate, modulesMap) { - this.originalTemplate = originalTemplate; - this.modulesMap = modulesMap; - } - - getHarmonyInitOrder(dep) { - const module = dep._module; - const info = this.modulesMap.get(module); - if (!info) { - return this.originalTemplate.getHarmonyInitOrder(dep); +class ConcatConfiguration { + constructor(rootModule, cloneFrom) { + this.rootModule = rootModule; + if (cloneFrom) { + this.modules = cloneFrom.modules.createChild(5); + this.warnings = cloneFrom.warnings.createChild(5); + } else { + this.modules = new StackedSetMap(); + this.modules.add(rootModule); + this.warnings = new StackedSetMap(); } - return NaN; } - harmonyInit(dep, source, runtimeTemplate, dependencyTemplates) { - const module = dep._module; - const info = this.modulesMap.get(module); - if (!info) { - this.originalTemplate.harmonyInit( - dep, - source, - runtimeTemplate, - dependencyTemplates - ); - return; - } + add(module) { + this.modules.add(module); } - apply(dep, source, runtime, dependencyTemplates) { - const module = dep._module; - const info = this.modulesMap.get(module); - if (!info) { - this.originalTemplate.apply(dep, source, runtime, dependencyTemplates); - return; - } - let content; - const callFlag = dep.call ? "_call" : ""; - const strictFlag = dep.originModule.buildMeta.strictHarmonyModule - ? "_strict" - : ""; - if (dep._id === null) { - content = `__WEBPACK_MODULE_REFERENCE__${info.index}_ns${strictFlag}__`; - } else if (dep.namespaceObjectAsContext) { - content = `__WEBPACK_MODULE_REFERENCE__${ - info.index - }_ns${strictFlag}__[${JSON.stringify(dep._id)}]`; - } else { - const exportData = Buffer.from(dep._id, "utf-8").toString("hex"); - content = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${callFlag}${strictFlag}__`; - } - if (dep.shorthand) { - content = dep.name + ": " + content; - } - source.replace(dep.range[0], dep.range[1] - 1, content); + has(module) { + return this.modules.has(module); } -} -class HarmonyImportSideEffectDependencyConcatenatedTemplate { - constructor(originalTemplate, modulesMap) { - this.originalTemplate = originalTemplate; - this.modulesMap = modulesMap; + isEmpty() { + return this.modules.size === 1; } - getHarmonyInitOrder(dep) { - const module = dep._module; - const info = this.modulesMap.get(module); - if (!info) { - return this.originalTemplate.getHarmonyInitOrder(dep); - } - return NaN; + addWarning(module, problem) { + this.warnings.set(module, problem); } - harmonyInit(dep, source, runtime, dependencyTemplates) { - const module = dep._module; - const info = this.modulesMap.get(module); - if (!info) { - this.originalTemplate.harmonyInit( - dep, - source, - runtime, - dependencyTemplates - ); - return; - } + getWarningsSorted() { + return new Map( + this.warnings.asPairArray().sort((a, b) => { + const ai = a[0].identifier(); + const bi = b[0].identifier(); + if (ai < bi) return -1; + if (ai > bi) return 1; + return 0; + }) + ); } - apply(dep, source, runtime, dependencyTemplates) { - const module = dep._module; - const info = this.modulesMap.get(module); - if (!info) { - this.originalTemplate.apply(dep, source, runtime, dependencyTemplates); - return; - } + getModules() { + return this.modules.asSet(); } -} -class HarmonyExportExpressionDependencyConcatenatedTemplate { - constructor(originalTemplate, rootModule) { - this.originalTemplate = originalTemplate; - this.rootModule = rootModule; + clone() { + return new ConcatConfiguration(this.rootModule, this); } - apply(dep, source, runtime, dependencyTemplates) { - let content = - "/* harmony default export */ var __WEBPACK_MODULE_DEFAULT_EXPORT__ = "; - if (dep.originModule === this.rootModule) { - const used = dep.originModule.isUsed("default"); - const exportsName = dep.originModule.exportsArgument; - if (used) content += `${exportsName}[${JSON.stringify(used)}] = `; - } - - if (dep.range) { - source.replace( - dep.rangeStatement[0], - dep.range[0] - 1, - content + "(" + dep.prefix - ); - source.replace(dep.range[1], dep.rangeStatement[1] - 1, ");"); - return; - } - - source.replace( - dep.rangeStatement[0], - dep.rangeStatement[1] - 1, - content + dep.prefix - ); + set(config) { + this.rootModule = config.rootModule; + this.modules = config.modules; + this.warnings = config.warnings; } } -class NullTemplate { - apply() {} +module.exports = ModuleConcatenationPlugin; + + +/***/ }), + +/***/ 68053: +/***/ (function(module) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +/** @typedef {import("../Compiler")} Compiler */ + +class NaturalChunkOrderPlugin { + /** + * @param {Compiler} compiler webpack compiler + * @returns {void} + */ + apply(compiler) { + compiler.hooks.compilation.tap("NaturalChunkOrderPlugin", compilation => { + compilation.hooks.optimizeChunkOrder.tap( + "NaturalChunkOrderPlugin", + chunks => { + chunks.sort((chunkA, chunkB) => { + const a = chunkA.modulesIterable[Symbol.iterator](); + const b = chunkB.modulesIterable[Symbol.iterator](); + // eslint-disable-next-line no-constant-condition + while (true) { + const aItem = a.next(); + const bItem = b.next(); + if (aItem.done && bItem.done) return 0; + if (aItem.done) return -1; + if (bItem.done) return 1; + const aModuleId = aItem.value.id; + const bModuleId = bItem.value.id; + if (aModuleId < bModuleId) return -1; + if (aModuleId > bModuleId) return 1; + } + }); + } + ); + }); + } } -module.exports = ConcatenatedModule; +module.exports = NaturalChunkOrderPlugin; /***/ }), -/***/ 29720: +/***/ 83741: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -89580,76 +87012,72 @@ module.exports = ConcatenatedModule; */ -const GraphHelpers = __webpack_require__(32973); +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(88771); + +/** @typedef {import("../../declarations/plugins/optimize/OccurrenceOrderChunkIdsPlugin").OccurrenceOrderChunkIdsPluginOptions} OccurrenceOrderChunkIdsPluginOptions */ + +class OccurrenceOrderChunkIdsPlugin { + /** + * @param {OccurrenceOrderChunkIdsPluginOptions=} options options object + */ + constructor(options = {}) { + validateOptions(schema, options, "Occurrence Order Chunk Ids Plugin"); + this.options = options; + } -class EnsureChunkConditionsPlugin { apply(compiler) { + const prioritiseInitial = this.options.prioritiseInitial; compiler.hooks.compilation.tap( - "EnsureChunkConditionsPlugin", + "OccurrenceOrderChunkIdsPlugin", compilation => { - const handler = chunks => { - let changed = false; - for (const module of compilation.modules) { - if (!module.chunkCondition) continue; - const sourceChunks = new Set(); - const chunkGroups = new Set(); - for (const chunk of module.chunksIterable) { - if (!module.chunkCondition(chunk)) { - sourceChunks.add(chunk); - for (const group of chunk.groupsIterable) { - chunkGroups.add(group); + compilation.hooks.optimizeChunkOrder.tap( + "OccurrenceOrderChunkIdsPlugin", + chunks => { + const occursInInitialChunksMap = new Map(); + const originalOrder = new Map(); + + let i = 0; + for (const c of chunks) { + let occurs = 0; + for (const chunkGroup of c.groupsIterable) { + for (const parent of chunkGroup.parentsIterable) { + if (parent.isInitial()) occurs++; } } + occursInInitialChunksMap.set(c, occurs); + originalOrder.set(c, i++); } - if (sourceChunks.size === 0) continue; - const targetChunks = new Set(); - chunkGroupLoop: for (const chunkGroup of chunkGroups) { - // Can module be placed in a chunk of this group? - for (const chunk of chunkGroup.chunks) { - if (module.chunkCondition(chunk)) { - targetChunks.add(chunk); - continue chunkGroupLoop; - } - } - // We reached the entrypoint: fail - if (chunkGroup.isInitial()) { - throw new Error( - "Cannot fullfil chunk condition of " + module.identifier() - ); - } - // Try placing in all parents - for (const group of chunkGroup.parentsIterable) { - chunkGroups.add(group); + + chunks.sort((a, b) => { + if (prioritiseInitial) { + const aEntryOccurs = occursInInitialChunksMap.get(a); + const bEntryOccurs = occursInInitialChunksMap.get(b); + if (aEntryOccurs > bEntryOccurs) return -1; + if (aEntryOccurs < bEntryOccurs) return 1; } - } - for (const sourceChunk of sourceChunks) { - GraphHelpers.disconnectChunkAndModule(sourceChunk, module); - } - for (const targetChunk of targetChunks) { - GraphHelpers.connectChunkAndModule(targetChunk, module); - } + const aOccurs = a.getNumberOfGroups(); + const bOccurs = b.getNumberOfGroups(); + if (aOccurs > bOccurs) return -1; + if (aOccurs < bOccurs) return 1; + const orgA = originalOrder.get(a); + const orgB = originalOrder.get(b); + return orgA - orgB; + }); } - if (changed) return true; - }; - compilation.hooks.optimizeChunksBasic.tap( - "EnsureChunkConditionsPlugin", - handler - ); - compilation.hooks.optimizeExtractedChunksBasic.tap( - "EnsureChunkConditionsPlugin", - handler ); } ); } } -module.exports = EnsureChunkConditionsPlugin; + +module.exports = OccurrenceOrderChunkIdsPlugin; /***/ }), -/***/ 25850: -/***/ (function(module) { +/***/ 62000: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -89658,105 +87086,118 @@ module.exports = EnsureChunkConditionsPlugin; */ -class FlagIncludedChunksPlugin { - apply(compiler) { - compiler.hooks.compilation.tap("FlagIncludedChunksPlugin", compilation => { - compilation.hooks.optimizeChunkIds.tap( - "FlagIncludedChunksPlugin", - chunks => { - // prepare two bit integers for each module - // 2^31 is the max number represented as SMI in v8 - // we want the bits distributed this way: - // the bit 2^31 is pretty rar and only one module should get it - // so it has a probability of 1 / modulesCount - // the first bit (2^0) is the easiest and every module could get it - // if it doesn't get a better bit - // from bit 2^n to 2^(n+1) there is a probability of p - // so 1 / modulesCount == p^31 - // <=> p = sqrt31(1 / modulesCount) - // so we use a modulo of 1 / sqrt31(1 / modulesCount) - const moduleBits = new WeakMap(); - const modulesCount = compilation.modules.length; +const validateOptions = __webpack_require__(33225); +const schema = __webpack_require__(81430); - // precalculate the modulo values for each bit - const modulo = 1 / Math.pow(1 / modulesCount, 1 / 31); - const modulos = Array.from( - { length: 31 }, - (x, i) => Math.pow(modulo, i) | 0 - ); +/** @typedef {import("../../declarations/plugins/optimize/OccurrenceOrderModuleIdsPlugin").OccurrenceOrderModuleIdsPluginOptions} OccurrenceOrderModuleIdsPluginOptions */ - // iterate all modules to generate bit values - let i = 0; - for (const module of compilation.modules) { - let bit = 30; - while (i % modulos[bit] !== 0) { - bit--; - } - moduleBits.set(module, 1 << bit); - i++; - } +class OccurrenceOrderModuleIdsPlugin { + /** + * @param {OccurrenceOrderModuleIdsPluginOptions=} options options object + */ + constructor(options = {}) { + validateOptions(schema, options, "Occurrence Order Module Ids Plugin"); + this.options = options; + } - // interate all chunks to generate bitmaps - const chunkModulesHash = new WeakMap(); - for (const chunk of chunks) { - let hash = 0; - for (const module of chunk.modulesIterable) { - hash |= moduleBits.get(module); - } - chunkModulesHash.set(chunk, hash); - } + apply(compiler) { + const prioritiseInitial = this.options.prioritiseInitial; + compiler.hooks.compilation.tap( + "OccurrenceOrderModuleIdsPlugin", + compilation => { + compilation.hooks.optimizeModuleOrder.tap( + "OccurrenceOrderModuleIdsPlugin", + modules => { + const occursInInitialChunksMap = new Map(); + const occursInAllChunksMap = new Map(); - for (const chunkA of chunks) { - const chunkAHash = chunkModulesHash.get(chunkA); - const chunkAModulesCount = chunkA.getNumberOfModules(); - if (chunkAModulesCount === 0) continue; - let bestModule = undefined; - for (const module of chunkA.modulesIterable) { - if ( - bestModule === undefined || - bestModule.getNumberOfChunks() > module.getNumberOfChunks() - ) - bestModule = module; + const initialChunkChunkMap = new Map(); + const entryCountMap = new Map(); + for (const m of modules) { + let initial = 0; + let entry = 0; + for (const c of m.chunksIterable) { + if (c.canBeInitial()) initial++; + if (c.entryModule === m) entry++; + } + initialChunkChunkMap.set(m, initial); + entryCountMap.set(m, entry); } - loopB: for (const chunkB of bestModule.chunksIterable) { - // as we iterate the same iterables twice - // skip if we find ourselves - if (chunkA === chunkB) continue; - - const chunkBModulesCount = chunkB.getNumberOfModules(); - - // ids for empty chunks are not included - if (chunkBModulesCount === 0) continue; - // instead of swapping A and B just bail - // as we loop twice the current A will be B and B then A - if (chunkAModulesCount > chunkBModulesCount) continue; + const countOccursInEntry = (sum, r) => { + if (!r.module) { + return sum; + } + const count = initialChunkChunkMap.get(r.module); + if (!count) { + return sum; + } + return sum + count; + }; + const countOccurs = (sum, r) => { + if (!r.module) { + return sum; + } + let factor = 1; + if (typeof r.dependency.getNumberOfIdOccurrences === "function") { + factor = r.dependency.getNumberOfIdOccurrences(); + } + if (factor === 0) { + return sum; + } + return sum + factor * r.module.getNumberOfChunks(); + }; - // is chunkA in chunkB? + if (prioritiseInitial) { + for (const m of modules) { + const result = + m.reasons.reduce(countOccursInEntry, 0) + + initialChunkChunkMap.get(m) + + entryCountMap.get(m); + occursInInitialChunksMap.set(m, result); + } + } - // we do a cheap check for the hash value - const chunkBHash = chunkModulesHash.get(chunkB); - if ((chunkBHash & chunkAHash) !== chunkAHash) continue; + const originalOrder = new Map(); + let i = 0; + for (const m of modules) { + const result = + m.reasons.reduce(countOccurs, 0) + + m.getNumberOfChunks() + + entryCountMap.get(m); + occursInAllChunksMap.set(m, result); + originalOrder.set(m, i++); + } - // compare all modules - for (const m of chunkA.modulesIterable) { - if (!chunkB.containsModule(m)) continue loopB; + modules.sort((a, b) => { + if (prioritiseInitial) { + const aEntryOccurs = occursInInitialChunksMap.get(a); + const bEntryOccurs = occursInInitialChunksMap.get(b); + if (aEntryOccurs > bEntryOccurs) return -1; + if (aEntryOccurs < bEntryOccurs) return 1; } - chunkB.ids.push(chunkA.id); - } + const aOccurs = occursInAllChunksMap.get(a); + const bOccurs = occursInAllChunksMap.get(b); + if (aOccurs > bOccurs) return -1; + if (aOccurs < bOccurs) return 1; + const orgA = originalOrder.get(a); + const orgB = originalOrder.get(b); + return orgA - orgB; + }); } - } - ); - }); + ); + } + ); } } -module.exports = FlagIncludedChunksPlugin; + +module.exports = OccurrenceOrderModuleIdsPlugin; /***/ }), -/***/ 3846: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 67340: +/***/ (function(module) { "use strict"; /* @@ -89765,237 +87206,191 @@ module.exports = FlagIncludedChunksPlugin; */ -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(27993); -const LazyBucketSortedSet = __webpack_require__(52315); +// TODO webpack 5 remove this plugin +// It has been splitted into separate plugins for modules and chunks +class OccurrenceOrderPlugin { + constructor(preferEntry) { + if (preferEntry !== undefined && typeof preferEntry !== "boolean") { + throw new Error( + "Argument should be a boolean.\nFor more info on this plugin, see https://webpack.js.org/plugins/" + ); + } + this.preferEntry = preferEntry; + } + apply(compiler) { + const preferEntry = this.preferEntry; + compiler.hooks.compilation.tap("OccurrenceOrderPlugin", compilation => { + compilation.hooks.optimizeModuleOrder.tap( + "OccurrenceOrderPlugin", + modules => { + const occursInInitialChunksMap = new Map(); + const occursInAllChunksMap = new Map(); -/** @typedef {import("../../declarations/plugins/optimize/LimitChunkCountPlugin").LimitChunkCountPluginOptions} LimitChunkCountPluginOptions */ -/** @typedef {import("../Chunk")} Chunk */ -/** @typedef {import("../Compiler")} Compiler */ + const initialChunkChunkMap = new Map(); + const entryCountMap = new Map(); + for (const m of modules) { + let initial = 0; + let entry = 0; + for (const c of m.chunksIterable) { + if (c.canBeInitial()) initial++; + if (c.entryModule === m) entry++; + } + initialChunkChunkMap.set(m, initial); + entryCountMap.set(m, entry); + } -/** - * @typedef {Object} ChunkCombination - * @property {boolean} deleted this is set to true when combination was removed - * @property {number} sizeDiff - * @property {number} integratedSize - * @property {Chunk} a - * @property {Chunk} b - * @property {number} aIdx - * @property {number} bIdx - * @property {number} aSize - * @property {number} bSize - */ - -const addToSetMap = (map, key, value) => { - const set = map.get(key); - if (set === undefined) { - map.set(key, new Set([value])); - } else { - set.add(value); - } -}; - -class LimitChunkCountPlugin { - /** - * @param {LimitChunkCountPluginOptions=} options options object - */ - constructor(options) { - if (!options) options = {}; - - validateOptions(schema, options, "Limit Chunk Count Plugin"); - this.options = options; - } - - /** - * @param {Compiler} compiler the webpack compiler - * @returns {void} - */ - apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap("LimitChunkCountPlugin", compilation => { - compilation.hooks.optimizeChunksAdvanced.tap( - "LimitChunkCountPlugin", - chunks => { - const maxChunks = options.maxChunks; - if (!maxChunks) return; - if (maxChunks < 1) return; - if (chunks.length <= maxChunks) return; - - let remainingChunksToMerge = chunks.length - maxChunks; - - // order chunks in a deterministic way - const orderedChunks = chunks.slice().sort((a, b) => a.compareTo(b)); - - // create a lazy sorted data structure to keep all combinations - // this is large. Size = chunks * (chunks - 1) / 2 - // It uses a multi layer bucket sort plus normal sort in the last layer - // It's also lazy so only accessed buckets are sorted - const combinations = new LazyBucketSortedSet( - // Layer 1: ordered by largest size benefit - c => c.sizeDiff, - (a, b) => b - a, - // Layer 2: ordered by smallest combined size - c => c.integratedSize, - (a, b) => a - b, - // Layer 3: ordered by position difference in orderedChunk (-> to be deterministic) - c => c.bIdx - c.aIdx, - (a, b) => a - b, - // Layer 4: ordered by position in orderedChunk (-> to be deterministic) - (a, b) => a.bIdx - b.bIdx - ); - - // we keep a mappng from chunk to all combinations - // but this mapping is not kept up-to-date with deletions - // so `deleted` flag need to be considered when iterating this - /** @type {Map>} */ - const combinationsByChunk = new Map(); + const countOccursInEntry = (sum, r) => { + if (!r.module) { + return sum; + } + return sum + initialChunkChunkMap.get(r.module); + }; + const countOccurs = (sum, r) => { + if (!r.module) { + return sum; + } + let factor = 1; + if (typeof r.dependency.getNumberOfIdOccurrences === "function") { + factor = r.dependency.getNumberOfIdOccurrences(); + } + if (factor === 0) { + return sum; + } + return sum + factor * r.module.getNumberOfChunks(); + }; - orderedChunks.forEach((b, bIdx) => { - // create combination pairs with size and integrated size - for (let aIdx = 0; aIdx < bIdx; aIdx++) { - const a = orderedChunks[aIdx]; - const integratedSize = a.integratedSize(b, options); + if (preferEntry) { + for (const m of modules) { + const result = + m.reasons.reduce(countOccursInEntry, 0) + + initialChunkChunkMap.get(m) + + entryCountMap.get(m); + occursInInitialChunksMap.set(m, result); + } + } - // filter pairs that do not have an integratedSize - // meaning they can NOT be integrated! - if (integratedSize === false) continue; + const originalOrder = new Map(); + let i = 0; + for (const m of modules) { + const result = + m.reasons.reduce(countOccurs, 0) + + m.getNumberOfChunks() + + entryCountMap.get(m); + occursInAllChunksMap.set(m, result); + originalOrder.set(m, i++); + } - const aSize = a.size(options); - const bSize = b.size(options); - const c = { - deleted: false, - sizeDiff: aSize + bSize - integratedSize, - integratedSize, - a, - b, - aIdx, - bIdx, - aSize, - bSize - }; - combinations.add(c); - addToSetMap(combinationsByChunk, a, c); - addToSetMap(combinationsByChunk, b, c); + modules.sort((a, b) => { + if (preferEntry) { + const aEntryOccurs = occursInInitialChunksMap.get(a); + const bEntryOccurs = occursInInitialChunksMap.get(b); + if (aEntryOccurs > bEntryOccurs) return -1; + if (aEntryOccurs < bEntryOccurs) return 1; } - return combinations; + const aOccurs = occursInAllChunksMap.get(a); + const bOccurs = occursInAllChunksMap.get(b); + if (aOccurs > bOccurs) return -1; + if (aOccurs < bOccurs) return 1; + const orgA = originalOrder.get(a); + const orgB = originalOrder.get(b); + return orgA - orgB; }); + } + ); + compilation.hooks.optimizeChunkOrder.tap( + "OccurrenceOrderPlugin", + chunks => { + const occursInInitialChunksMap = new Map(); + const originalOrder = new Map(); - // list of modified chunks during this run - // combinations affected by this change are skipped to allow - // futher optimizations - /** @type {Set} */ - const modifiedChunks = new Set(); + let i = 0; + for (const c of chunks) { + let occurs = 0; + for (const chunkGroup of c.groupsIterable) { + for (const parent of chunkGroup.parentsIterable) { + if (parent.isInitial()) occurs++; + } + } + occursInInitialChunksMap.set(c, occurs); + originalOrder.set(c, i++); + } - let changed = false; - // eslint-disable-next-line no-constant-condition - loop: while (true) { - const combination = combinations.popFirst(); - if (combination === undefined) break; + chunks.sort((a, b) => { + const aEntryOccurs = occursInInitialChunksMap.get(a); + const bEntryOccurs = occursInInitialChunksMap.get(b); + if (aEntryOccurs > bEntryOccurs) return -1; + if (aEntryOccurs < bEntryOccurs) return 1; + const aOccurs = a.getNumberOfGroups(); + const bOccurs = b.getNumberOfGroups(); + if (aOccurs > bOccurs) return -1; + if (aOccurs < bOccurs) return 1; + const orgA = originalOrder.get(a); + const orgB = originalOrder.get(b); + return orgA - orgB; + }); + } + ); + }); + } +} - combination.deleted = true; - const { a, b, integratedSize } = combination; +module.exports = OccurrenceOrderPlugin; - // skip over pair when - // one of the already merged chunks is a parent of one of the chunks - if (modifiedChunks.size > 0) { - const queue = new Set(a.groupsIterable); - for (const group of b.groupsIterable) { - queue.add(group); - } - for (const group of queue) { - for (const mChunk of modifiedChunks) { - if (mChunk !== a && mChunk !== b && mChunk.isInGroup(group)) { - // This is a potential pair which needs recalculation - // We can't do that now, but it merge before following pairs - // so we leave space for it, and consider chunks as modified - // just for the worse case - remainingChunksToMerge--; - if (remainingChunksToMerge <= 0) break loop; - modifiedChunks.add(a); - modifiedChunks.add(b); - continue loop; - } - } - for (const parent of group.parentsIterable) { - queue.add(parent); - } - } - } - // merge the chunks - if (a.integrate(b, "limit")) { - chunks.splice(chunks.indexOf(b), 1); +/***/ }), - // flag chunk a as modified as further optimization are possible for all children here - modifiedChunks.add(a); +/***/ 78085: +/***/ (function(module) { - changed = true; - remainingChunksToMerge--; - if (remainingChunksToMerge <= 0) break; +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // Update all affected combinations - // delete all combination with the removed chunk - // we will use combinations with the kept chunk instead - for (const combination of combinationsByChunk.get(b)) { - if (combination.deleted) continue; - combination.deleted = true; - combinations.delete(combination); - } - // Update combinations with the kept chunk with new sizes - for (const combination of combinationsByChunk.get(a)) { - if (combination.deleted) continue; - if (combination.a === a) { - // Update size - const newIntegratedSize = a.integratedSize( - combination.b, - options - ); - if (newIntegratedSize === false) { - combination.deleted = true; - combinations.delete(combination); - continue; - } - const finishUpdate = combinations.startUpdate(combination); - combination.integratedSize = newIntegratedSize; - combination.aSize = integratedSize; - combination.sizeDiff = - combination.bSize + integratedSize - newIntegratedSize; - finishUpdate(); - } else if (combination.b === a) { - // Update size - const newIntegratedSize = combination.a.integratedSize( - a, - options - ); - if (newIntegratedSize === false) { - combination.deleted = true; - combinations.delete(combination); - continue; - } - const finishUpdate = combinations.startUpdate(combination); - combination.integratedSize = newIntegratedSize; - combination.bSize = integratedSize; - combination.sizeDiff = - integratedSize + combination.aSize - newIntegratedSize; - finishUpdate(); - } - } - } +class RemoveEmptyChunksPlugin { + apply(compiler) { + compiler.hooks.compilation.tap("RemoveEmptyChunksPlugin", compilation => { + const handler = chunks => { + for (let i = chunks.length - 1; i >= 0; i--) { + const chunk = chunks[i]; + if ( + chunk.isEmpty() && + !chunk.hasRuntime() && + !chunk.hasEntryModule() + ) { + chunk.remove("empty"); + chunks.splice(i, 1); } - if (changed) return true; } + }; + compilation.hooks.optimizeChunksBasic.tap( + "RemoveEmptyChunksPlugin", + handler + ); + compilation.hooks.optimizeChunksAdvanced.tap( + "RemoveEmptyChunksPlugin", + handler + ); + compilation.hooks.optimizeExtractedChunksBasic.tap( + "RemoveEmptyChunksPlugin", + handler + ); + compilation.hooks.optimizeExtractedChunksAdvanced.tap( + "RemoveEmptyChunksPlugin", + handler ); }); } } -module.exports = LimitChunkCountPlugin; +module.exports = RemoveEmptyChunksPlugin; /***/ }), -/***/ 46214: -/***/ (function(module) { +/***/ 58142: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -90004,84 +87399,133 @@ module.exports = LimitChunkCountPlugin; */ -class MergeDuplicateChunksPlugin { +const Queue = __webpack_require__(38637); +const { intersect } = __webpack_require__(54262); + +const getParentChunksWithModule = (currentChunk, module) => { + const chunks = []; + const stack = new Set(currentChunk.parentsIterable); + + for (const chunk of stack) { + if (chunk.containsModule(module)) { + chunks.push(chunk); + } else { + for (const parent of chunk.parentsIterable) { + stack.add(parent); + } + } + } + + return chunks; +}; + +class RemoveParentModulesPlugin { apply(compiler) { - compiler.hooks.compilation.tap( - "MergeDuplicateChunksPlugin", - compilation => { - compilation.hooks.optimizeChunksBasic.tap( - "MergeDuplicateChunksPlugin", - chunks => { - // remember already tested chunks for performance - const notDuplicates = new Set(); + compiler.hooks.compilation.tap("RemoveParentModulesPlugin", compilation => { + const handler = (chunks, chunkGroups) => { + const queue = new Queue(); + const availableModulesMap = new WeakMap(); - // for each chunk - for (const chunk of chunks) { - // track a Set of all chunk that could be duplicates - let possibleDuplicates; - for (const module of chunk.modulesIterable) { - if (possibleDuplicates === undefined) { - // when possibleDuplicates is not yet set, - // create a new Set from chunks of the current module - // including only chunks with the same number of modules - for (const dup of module.chunksIterable) { - if ( - dup !== chunk && - chunk.getNumberOfModules() === dup.getNumberOfModules() && - !notDuplicates.has(dup) - ) { - // delay allocating the new Set until here, reduce memory pressure - if (possibleDuplicates === undefined) { - possibleDuplicates = new Set(); - } - possibleDuplicates.add(dup); - } - } - // when no chunk is possible we can break here - if (possibleDuplicates === undefined) break; - } else { - // validate existing possible duplicates - for (const dup of possibleDuplicates) { - // remove possible duplicate when module is not contained - if (!dup.containsModule(module)) { - possibleDuplicates.delete(dup); - } + for (const chunkGroup of compilation.entrypoints.values()) { + // initialize available modules for chunks without parents + availableModulesMap.set(chunkGroup, new Set()); + for (const child of chunkGroup.childrenIterable) { + queue.enqueue(child); + } + } + + while (queue.length > 0) { + const chunkGroup = queue.dequeue(); + let availableModules = availableModulesMap.get(chunkGroup); + let changed = false; + for (const parent of chunkGroup.parentsIterable) { + const availableModulesInParent = availableModulesMap.get(parent); + if (availableModulesInParent !== undefined) { + // If we know the available modules in parent: process these + if (availableModules === undefined) { + // if we have not own info yet: create new entry + availableModules = new Set(availableModulesInParent); + for (const chunk of parent.chunks) { + for (const m of chunk.modulesIterable) { + availableModules.add(m); } - // when all chunks has been removed we can break here - if (possibleDuplicates.size === 0) break; } - } - - // when we found duplicates - if ( - possibleDuplicates !== undefined && - possibleDuplicates.size > 0 - ) { - for (const otherChunk of possibleDuplicates) { - if (otherChunk.hasRuntime() !== chunk.hasRuntime()) continue; - // merge them - if (chunk.integrate(otherChunk, "duplicate")) { - chunks.splice(chunks.indexOf(otherChunk), 1); + availableModulesMap.set(chunkGroup, availableModules); + changed = true; + } else { + for (const m of availableModules) { + if ( + !parent.containsModule(m) && + !availableModulesInParent.has(m) + ) { + availableModules.delete(m); + changed = true; } } } + } + } + if (changed) { + // if something changed: enqueue our children + for (const child of chunkGroup.childrenIterable) { + queue.enqueue(child); + } + } + } - // don't check already processed chunks twice - notDuplicates.add(chunk); + // now we have available modules for every chunk + for (const chunk of chunks) { + const availableModulesSets = Array.from( + chunk.groupsIterable, + chunkGroup => availableModulesMap.get(chunkGroup) + ); + if (availableModulesSets.some(s => s === undefined)) continue; // No info about this chunk group + const availableModules = + availableModulesSets.length === 1 + ? availableModulesSets[0] + : intersect(availableModulesSets); + const numberOfModules = chunk.getNumberOfModules(); + const toRemove = new Set(); + if (numberOfModules < availableModules.size) { + for (const m of chunk.modulesIterable) { + if (availableModules.has(m)) { + toRemove.add(m); + } + } + } else { + for (const m of availableModules) { + if (chunk.containsModule(m)) { + toRemove.add(m); + } } } - ); - } - ); + for (const module of toRemove) { + module.rewriteChunkInReasons( + chunk, + getParentChunksWithModule(chunk, module) + ); + chunk.removeModule(module); + } + } + }; + compilation.hooks.optimizeChunksBasic.tap( + "RemoveParentModulesPlugin", + handler + ); + compilation.hooks.optimizeExtractedChunksBasic.tap( + "RemoveParentModulesPlugin", + handler + ); + }); } } -module.exports = MergeDuplicateChunksPlugin; +module.exports = RemoveParentModulesPlugin; /***/ }), -/***/ 55607: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 76894: +/***/ (function(module) { "use strict"; /* @@ -90090,87 +87534,46 @@ module.exports = MergeDuplicateChunksPlugin; */ -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(8670); - -/** @typedef {import("../../declarations/plugins/optimize/MinChunkSizePlugin").MinChunkSizePluginOptions} MinChunkSizePluginOptions */ - -class MinChunkSizePlugin { - /** - * @param {MinChunkSizePluginOptions} options options object - */ +module.exports = class RuntimeChunkPlugin { constructor(options) { - validateOptions(schema, options, "Min Chunk Size Plugin"); - this.options = options; + this.options = Object.assign( + { + name: entrypoint => `runtime~${entrypoint.name}` + }, + options + ); } apply(compiler) { - const options = this.options; - const minChunkSize = options.minChunkSize; - compiler.hooks.compilation.tap("MinChunkSizePlugin", compilation => { - compilation.hooks.optimizeChunksAdvanced.tap( - "MinChunkSizePlugin", - chunks => { - const equalOptions = { - chunkOverhead: 1, - entryChunkMultiplicator: 1 - }; - - const sortedSizeFilteredExtendedPairCombinations = chunks - .reduce((combinations, a, idx) => { - // create combination pairs - for (let i = 0; i < idx; i++) { - const b = chunks[i]; - combinations.push([b, a]); - } - return combinations; - }, []) - .filter(pair => { - // check if one of the chunks sizes is smaller than the minChunkSize - const p0SmallerThanMinChunkSize = - pair[0].size(equalOptions) < minChunkSize; - const p1SmallerThanMinChunkSize = - pair[1].size(equalOptions) < minChunkSize; - return p0SmallerThanMinChunkSize || p1SmallerThanMinChunkSize; - }) - .map(pair => { - // extend combination pairs with size and integrated size - const a = pair[0].size(options); - const b = pair[1].size(options); - const ab = pair[0].integratedSize(pair[1], options); - return [a + b - ab, ab, pair[0], pair[1]]; - }) - .filter(pair => { - // filter pairs that do not have an integratedSize - // meaning they can NOT be integrated! - return pair[1] !== false; - }) - .sort((a, b) => { - // sadly javascript does an inplace sort here - // sort by size - const diff = b[0] - a[0]; - if (diff !== 0) return diff; - return a[1] - b[1]; - }); - - if (sortedSizeFilteredExtendedPairCombinations.length === 0) return; - - const pair = sortedSizeFilteredExtendedPairCombinations[0]; - - pair[2].integrate(pair[3], "min-size"); - chunks.splice(chunks.indexOf(pair[3]), 1); - return true; + compiler.hooks.thisCompilation.tap("RuntimeChunkPlugin", compilation => { + compilation.hooks.optimizeChunksAdvanced.tap("RuntimeChunkPlugin", () => { + for (const entrypoint of compilation.entrypoints.values()) { + const chunk = entrypoint.getRuntimeChunk(); + let name = this.options.name; + if (typeof name === "function") { + name = name(entrypoint); + } + if ( + chunk.getNumberOfModules() > 0 || + !chunk.preventIntegration || + chunk.name !== name + ) { + const newChunk = compilation.addChunk(name); + newChunk.preventIntegration = true; + entrypoint.unshiftChunk(newChunk); + newChunk.addGroup(entrypoint); + entrypoint.setRuntimeChunk(newChunk); + } } - ); + }); }); } -} -module.exports = MinChunkSizePlugin; +}; /***/ }), -/***/ 25472: +/***/ 83654: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90180,528 +87583,358 @@ module.exports = MinChunkSizePlugin; */ -const WebpackError = __webpack_require__(97391); -const SizeFormatHelpers = __webpack_require__(12496); - -class MinMaxSizeWarning extends WebpackError { - constructor(keys, minSize, maxSize) { - let keysMessage = "Fallback cache group"; - if (keys) { - keysMessage = - keys.length > 1 - ? `Cache groups ${keys.sort().join(", ")}` - : `Cache group ${keys[0]}`; - } - super( - `SplitChunksPlugin\n` + - `${keysMessage}\n` + - `Configured minSize (${SizeFormatHelpers.formatSize(minSize)}) is ` + - `bigger than maxSize (${SizeFormatHelpers.formatSize(maxSize)}).\n` + - "This seem to be a invalid optimiziation.splitChunks configuration." - ); - } -} - -module.exports = MinMaxSizeWarning; - - -/***/ }), +const mm = __webpack_require__(67849); +const HarmonyExportImportedSpecifierDependency = __webpack_require__(22864); +const HarmonyImportSideEffectDependency = __webpack_require__(79171); +const HarmonyImportSpecifierDependency = __webpack_require__(95966); -/***/ 45184: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../Dependency")} Dependency */ -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +/** + * @typedef {Object} ExportInModule + * @property {Module} module the module + * @property {string} exportName the name of the export + * @property {boolean} checked if the export is conditional + */ +/** + * @typedef {Object} ReexportInfo + * @property {Map} static + * @property {Map>} dynamic + */ -const HarmonyImportDependency = __webpack_require__(81599); -const ModuleHotAcceptDependency = __webpack_require__(29018); -const ModuleHotDeclineDependency = __webpack_require__(60482); -const ConcatenatedModule = __webpack_require__(16953); -const HarmonyCompatibilityDependency = __webpack_require__(1533); -const StackedSetMap = __webpack_require__(92251); +/** + * @param {ReexportInfo} info info object + * @param {string} exportName name of export + * @returns {ExportInModule | undefined} static export + */ +const getMappingFromInfo = (info, exportName) => { + const staticMappings = info.static.get(exportName); + if (staticMappings !== undefined) { + if (staticMappings.length === 1) return staticMappings[0]; + return undefined; + } + const dynamicMappings = Array.from(info.dynamic).filter( + ([_, ignored]) => !ignored.has(exportName) + ); + if (dynamicMappings.length === 1) { + return { + module: dynamicMappings[0][0], + exportName, + checked: true + }; + } + return undefined; +}; -const formatBailoutReason = msg => { - return "ModuleConcatenation bailout: " + msg; +/** + * @param {ReexportInfo} info info object + * @param {string} exportName name of export of source module + * @param {Module} module the target module + * @param {string} innerExportName name of export of target module + * @param {boolean} checked true, if existence of target module is checked + */ +const addStaticReexport = ( + info, + exportName, + module, + innerExportName, + checked +) => { + let mappings = info.static.get(exportName); + if (mappings !== undefined) { + for (const mapping of mappings) { + if (mapping.module === module && mapping.exportName === innerExportName) { + mapping.checked = mapping.checked && checked; + return; + } + } + } else { + mappings = []; + info.static.set(exportName, mappings); + } + mappings.push({ + module, + exportName: innerExportName, + checked + }); }; -class ModuleConcatenationPlugin { - constructor(options) { - if (typeof options !== "object") options = {}; - this.options = options; +/** + * @param {ReexportInfo} info info object + * @param {Module} module the reexport module + * @param {Set} ignored ignore list + * @returns {void} + */ +const addDynamicReexport = (info, module, ignored) => { + const existingList = info.dynamic.get(module); + if (existingList !== undefined) { + for (const key of existingList) { + if (!ignored.has(key)) existingList.delete(key); + } + } else { + info.dynamic.set(module, new Set(ignored)); } +}; +class SideEffectsFlagPlugin { apply(compiler) { - compiler.hooks.compilation.tap( - "ModuleConcatenationPlugin", - (compilation, { normalModuleFactory }) => { - const handler = (parser, parserOptions) => { - parser.hooks.call.for("eval").tap("ModuleConcatenationPlugin", () => { - // Because of variable renaming we can't use modules with eval. - parser.state.module.buildMeta.moduleConcatenationBailout = "eval()"; - }); - }; - - normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ModuleConcatenationPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ModuleConcatenationPlugin", handler); - normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ModuleConcatenationPlugin", handler); - - const bailoutReasonMap = new Map(); - - const setBailoutReason = (module, reason) => { - bailoutReasonMap.set(module, reason); - module.optimizationBailout.push( - typeof reason === "function" - ? rs => formatBailoutReason(reason(rs)) - : formatBailoutReason(reason) + compiler.hooks.normalModuleFactory.tap("SideEffectsFlagPlugin", nmf => { + nmf.hooks.module.tap("SideEffectsFlagPlugin", (module, data) => { + const resolveData = data.resourceResolveData; + if ( + resolveData && + resolveData.descriptionFileData && + resolveData.relativePath + ) { + const sideEffects = resolveData.descriptionFileData.sideEffects; + const hasSideEffects = SideEffectsFlagPlugin.moduleHasSideEffects( + resolveData.relativePath, + sideEffects ); - }; + if (!hasSideEffects) { + module.factoryMeta.sideEffectFree = true; + } + } - const getBailoutReason = (module, requestShortener) => { - const reason = bailoutReasonMap.get(module); - if (typeof reason === "function") return reason(requestShortener); - return reason; - }; + return module; + }); + nmf.hooks.module.tap("SideEffectsFlagPlugin", (module, data) => { + if (data.settings.sideEffects === false) { + module.factoryMeta.sideEffectFree = true; + } else if (data.settings.sideEffects === true) { + module.factoryMeta.sideEffectFree = false; + } + }); + }); + compiler.hooks.compilation.tap("SideEffectsFlagPlugin", compilation => { + compilation.hooks.optimizeDependencies.tap( + "SideEffectsFlagPlugin", + modules => { + /** @type {Map} */ + const reexportMaps = new Map(); - compilation.hooks.optimizeChunkModules.tap( - "ModuleConcatenationPlugin", - (allChunks, modules) => { - const relevantModules = []; - const possibleInners = new Set(); - for (const module of modules) { - // Only harmony modules are valid for optimization - if ( - !module.buildMeta || - module.buildMeta.exportsType !== "namespace" || - !module.dependencies.some( - d => d instanceof HarmonyCompatibilityDependency - ) + // Capture reexports of sideEffectFree modules + for (const module of modules) { + /** @type {Dependency[]} */ + const removeDependencies = []; + for (const dep of module.dependencies) { + if (dep instanceof HarmonyImportSideEffectDependency) { + if (dep.module && dep.module.factoryMeta.sideEffectFree) { + removeDependencies.push(dep); + } + } else if ( + dep instanceof HarmonyExportImportedSpecifierDependency ) { - setBailoutReason(module, "Module is not an ECMAScript module"); - continue; + if (module.factoryMeta.sideEffectFree) { + const mode = dep.getMode(true); + if ( + mode.type === "safe-reexport" || + mode.type === "checked-reexport" || + mode.type === "dynamic-reexport" || + mode.type === "reexport-non-harmony-default" || + mode.type === "reexport-non-harmony-default-strict" || + mode.type === "reexport-named-default" + ) { + let info = reexportMaps.get(module); + if (!info) { + reexportMaps.set( + module, + (info = { + static: new Map(), + dynamic: new Map() + }) + ); + } + const targetModule = dep._module; + switch (mode.type) { + case "safe-reexport": + for (const [key, id] of mode.map) { + if (id) { + addStaticReexport( + info, + key, + targetModule, + id, + false + ); + } + } + break; + case "checked-reexport": + for (const [key, id] of mode.map) { + if (id) { + addStaticReexport( + info, + key, + targetModule, + id, + true + ); + } + } + break; + case "dynamic-reexport": + addDynamicReexport(info, targetModule, mode.ignored); + break; + case "reexport-non-harmony-default": + case "reexport-non-harmony-default-strict": + case "reexport-named-default": + addStaticReexport( + info, + mode.name, + targetModule, + "default", + false + ); + break; + } + } + } } + } + } - // Some expressions are not compatible with module concatenation - // because they may produce unexpected results. The plugin bails out - // if some were detected upfront. - if ( - module.buildMeta && - module.buildMeta.moduleConcatenationBailout - ) { - setBailoutReason( - module, - `Module uses ${module.buildMeta.moduleConcatenationBailout}` - ); - continue; - } + // Flatten reexports + for (const info of reexportMaps.values()) { + const dynamicReexports = info.dynamic; + info.dynamic = new Map(); + for (const reexport of dynamicReexports) { + let [targetModule, ignored] = reexport; + for (;;) { + const innerInfo = reexportMaps.get(targetModule); + if (!innerInfo) break; - // Exports must be known (and not dynamic) - if (!Array.isArray(module.buildMeta.providedExports)) { - setBailoutReason(module, "Module exports are unknown"); - continue; + for (const [key, reexports] of innerInfo.static) { + if (ignored.has(key)) continue; + for (const { module, exportName, checked } of reexports) { + addStaticReexport(info, key, module, exportName, checked); + } + } + + // Follow dynamic reexport if there is only one + if (innerInfo.dynamic.size !== 1) { + // When there are more then one, we don't know which one + break; + } + + ignored = new Set(ignored); + for (const [innerModule, innerIgnored] of innerInfo.dynamic) { + for (const key of innerIgnored) { + if (ignored.has(key)) continue; + // This reexports ends here + addStaticReexport(info, key, targetModule, key, true); + ignored.add(key); + } + targetModule = innerModule; + } } - // Using dependency variables is not possible as this wraps the code in a function - if (module.variables.length > 0) { - setBailoutReason( - module, - `Module uses injected variables (${module.variables - .map(v => v.name) - .join(", ")})` + // Update reexport as all other cases has been handled + addDynamicReexport(info, targetModule, ignored); + } + } + + for (const info of reexportMaps.values()) { + const staticReexports = info.static; + info.static = new Map(); + for (const [key, reexports] of staticReexports) { + for (let mapping of reexports) { + for (;;) { + const innerInfo = reexportMaps.get(mapping.module); + if (!innerInfo) break; + + const newMapping = getMappingFromInfo( + innerInfo, + mapping.exportName + ); + if (!newMapping) break; + mapping = newMapping; + } + addStaticReexport( + info, + key, + mapping.module, + mapping.exportName, + mapping.checked ); - continue; } + } + } - // Hot Module Replacement need it's own module to work correctly + // Update imports along the reexports from sideEffectFree modules + for (const pair of reexportMaps) { + const module = pair[0]; + const info = pair[1]; + let newReasons = undefined; + for (let i = 0; i < module.reasons.length; i++) { + const reason = module.reasons[i]; + const dep = reason.dependency; if ( - module.dependencies.some( - dep => - dep instanceof ModuleHotAcceptDependency || - dep instanceof ModuleHotDeclineDependency - ) + (dep instanceof HarmonyExportImportedSpecifierDependency || + (dep instanceof HarmonyImportSpecifierDependency && + !dep.namespaceObjectAsContext)) && + dep._id ) { - setBailoutReason(module, "Module uses Hot Module Replacement"); - continue; - } - - relevantModules.push(module); - - // Module must not be the entry points - if (module.isEntryModule()) { - setBailoutReason(module, "Module is an entry point"); - continue; + const mapping = getMappingFromInfo(info, dep._id); + if (mapping) { + dep.redirectedModule = mapping.module; + dep.redirectedId = mapping.exportName; + mapping.module.addReason( + reason.module, + dep, + reason.explanation + ? reason.explanation + + " (skipped side-effect-free modules)" + : "(skipped side-effect-free modules)" + ); + // removing the currect reason, by not adding it to the newReasons array + // lazily create the newReasons array + if (newReasons === undefined) { + newReasons = i === 0 ? [] : module.reasons.slice(0, i); + } + continue; + } } + if (newReasons !== undefined) newReasons.push(reason); + } + if (newReasons !== undefined) { + module.reasons = newReasons; + } + } + } + ); + }); + } - // Module must be in any chunk (we don't want to do useless work) - if (module.getNumberOfChunks() === 0) { - setBailoutReason(module, "Module is not in any chunk"); - continue; - } - - // Module must only be used by Harmony Imports - const nonHarmonyReasons = module.reasons.filter( - reason => - !reason.dependency || - !(reason.dependency instanceof HarmonyImportDependency) - ); - if (nonHarmonyReasons.length > 0) { - const importingModules = new Set( - nonHarmonyReasons.map(r => r.module).filter(Boolean) - ); - const importingExplanations = new Set( - nonHarmonyReasons.map(r => r.explanation).filter(Boolean) - ); - const importingModuleTypes = new Map( - Array.from(importingModules).map( - m => /** @type {[string, Set]} */ ([ - m, - new Set( - nonHarmonyReasons - .filter(r => r.module === m) - .map(r => r.dependency.type) - .sort() - ) - ]) - ) - ); - setBailoutReason(module, requestShortener => { - const names = Array.from(importingModules) - .map( - m => - `${m.readableIdentifier( - requestShortener - )} (referenced with ${Array.from( - importingModuleTypes.get(m) - ).join(", ")})` - ) - .sort(); - const explanations = Array.from(importingExplanations).sort(); - if (names.length > 0 && explanations.length === 0) { - return `Module is referenced from these modules with unsupported syntax: ${names.join( - ", " - )}`; - } else if (names.length === 0 && explanations.length > 0) { - return `Module is referenced by: ${explanations.join( - ", " - )}`; - } else if (names.length > 0 && explanations.length > 0) { - return `Module is referenced from these modules with unsupported syntax: ${names.join( - ", " - )} and by: ${explanations.join(", ")}`; - } else { - return "Module is referenced in a unsupported way"; - } - }); - continue; - } - - possibleInners.add(module); - } - // sort by depth - // modules with lower depth are more likely suited as roots - // this improves performance, because modules already selected as inner are skipped - relevantModules.sort((a, b) => { - return a.depth - b.depth; - }); - const concatConfigurations = []; - const usedAsInner = new Set(); - for (const currentRoot of relevantModules) { - // when used by another configuration as inner: - // the other configuration is better and we can skip this one - if (usedAsInner.has(currentRoot)) continue; - - // create a configuration with the root - const currentConfiguration = new ConcatConfiguration(currentRoot); - - // cache failures to add modules - const failureCache = new Map(); - - // try to add all imports - for (const imp of this._getImports(compilation, currentRoot)) { - const problem = this._tryToAdd( - compilation, - currentConfiguration, - imp, - possibleInners, - failureCache - ); - if (problem) { - failureCache.set(imp, problem); - currentConfiguration.addWarning(imp, problem); - } - } - if (!currentConfiguration.isEmpty()) { - concatConfigurations.push(currentConfiguration); - for (const module of currentConfiguration.getModules()) { - if (module !== currentConfiguration.rootModule) { - usedAsInner.add(module); - } - } - } - } - // HACK: Sort configurations by length and start with the longest one - // to get the biggers groups possible. Used modules are marked with usedModules - // TODO: Allow to reuse existing configuration while trying to add dependencies. - // This would improve performance. O(n^2) -> O(n) - concatConfigurations.sort((a, b) => { - return b.modules.size - a.modules.size; - }); - const usedModules = new Set(); - for (const concatConfiguration of concatConfigurations) { - if (usedModules.has(concatConfiguration.rootModule)) continue; - const modules = concatConfiguration.getModules(); - const rootModule = concatConfiguration.rootModule; - const newModule = new ConcatenatedModule( - rootModule, - Array.from(modules), - ConcatenatedModule.createConcatenationList( - rootModule, - modules, - compilation - ) - ); - for (const warning of concatConfiguration.getWarningsSorted()) { - newModule.optimizationBailout.push(requestShortener => { - const reason = getBailoutReason(warning[0], requestShortener); - const reasonWithPrefix = reason ? ` (<- ${reason})` : ""; - if (warning[0] === warning[1]) { - return formatBailoutReason( - `Cannot concat with ${warning[0].readableIdentifier( - requestShortener - )}${reasonWithPrefix}` - ); - } else { - return formatBailoutReason( - `Cannot concat with ${warning[0].readableIdentifier( - requestShortener - )} because of ${warning[1].readableIdentifier( - requestShortener - )}${reasonWithPrefix}` - ); - } - }); - } - const chunks = concatConfiguration.rootModule.getChunks(); - for (const m of modules) { - usedModules.add(m); - for (const chunk of chunks) { - chunk.removeModule(m); - } - } - for (const chunk of chunks) { - chunk.addModule(newModule); - newModule.addChunk(chunk); - } - for (const chunk of allChunks) { - if (chunk.entryModule === concatConfiguration.rootModule) { - chunk.entryModule = newModule; - } - } - compilation.modules.push(newModule); - for (const reason of newModule.reasons) { - if (reason.dependency.module === concatConfiguration.rootModule) - reason.dependency.module = newModule; - if ( - reason.dependency.redirectedModule === - concatConfiguration.rootModule - ) - reason.dependency.redirectedModule = newModule; - } - // TODO: remove when LTS node version contains fixed v8 version - // @see https://github.com/webpack/webpack/pull/6613 - // Turbofan does not correctly inline for-of loops with polymorphic input arrays. - // Work around issue by using a standard for loop and assigning dep.module.reasons - for (let i = 0; i < newModule.dependencies.length; i++) { - let dep = newModule.dependencies[i]; - if (dep.module) { - let reasons = dep.module.reasons; - for (let j = 0; j < reasons.length; j++) { - let reason = reasons[j]; - if (reason.dependency === dep) { - reason.module = newModule; - } - } - } - } - } - compilation.modules = compilation.modules.filter( - m => !usedModules.has(m) - ); - } + static moduleHasSideEffects(moduleName, flagValue) { + switch (typeof flagValue) { + case "undefined": + return true; + case "boolean": + return flagValue; + case "string": + if (process.platform === "win32") { + flagValue = flagValue.replace(/\\/g, "/"); + } + return mm.isMatch(moduleName, flagValue, { + matchBase: true + }); + case "object": + return flagValue.some(glob => + SideEffectsFlagPlugin.moduleHasSideEffects(moduleName, glob) ); - } - ); - } - - _getImports(compilation, module) { - return new Set( - module.dependencies - - // Get reference info only for harmony Dependencies - .map(dep => { - if (!(dep instanceof HarmonyImportDependency)) return null; - if (!compilation) return dep.getReference(); - return compilation.getDependencyReference(module, dep); - }) - - // Reference is valid and has a module - // Dependencies are simple enough to concat them - .filter( - ref => - ref && - ref.module && - (Array.isArray(ref.importedNames) || - Array.isArray(ref.module.buildMeta.providedExports)) - ) - - // Take the imported module - .map(ref => ref.module) - ); - } - - _tryToAdd(compilation, config, module, possibleModules, failureCache) { - const cacheEntry = failureCache.get(module); - if (cacheEntry) { - return cacheEntry; - } - - // Already added? - if (config.has(module)) { - return null; - } - - // Not possible to add? - if (!possibleModules.has(module)) { - failureCache.set(module, module); // cache failures for performance - return module; - } - - // module must be in the same chunks - if (!config.rootModule.hasEqualsChunks(module)) { - failureCache.set(module, module); // cache failures for performance - return module; - } - - // Clone config to make experimental changes - const testConfig = config.clone(); - - // Add the module - testConfig.add(module); - - // Every module which depends on the added module must be in the configuration too. - for (const reason of module.reasons) { - // Modules that are not used can be ignored - if ( - reason.module.factoryMeta.sideEffectFree && - reason.module.used === false - ) - continue; - - const problem = this._tryToAdd( - compilation, - testConfig, - reason.module, - possibleModules, - failureCache - ); - if (problem) { - failureCache.set(module, problem); // cache failures for performance - return problem; - } - } - - // Commit experimental changes - config.set(testConfig); - - // Eagerly try to add imports too if possible - for (const imp of this._getImports(compilation, module)) { - const problem = this._tryToAdd( - compilation, - config, - imp, - possibleModules, - failureCache - ); - if (problem) { - config.addWarning(imp, problem); - } - } - return null; - } -} - -class ConcatConfiguration { - constructor(rootModule, cloneFrom) { - this.rootModule = rootModule; - if (cloneFrom) { - this.modules = cloneFrom.modules.createChild(5); - this.warnings = cloneFrom.warnings.createChild(5); - } else { - this.modules = new StackedSetMap(); - this.modules.add(rootModule); - this.warnings = new StackedSetMap(); } } - - add(module) { - this.modules.add(module); - } - - has(module) { - return this.modules.has(module); - } - - isEmpty() { - return this.modules.size === 1; - } - - addWarning(module, problem) { - this.warnings.set(module, problem); - } - - getWarningsSorted() { - return new Map( - this.warnings.asPairArray().sort((a, b) => { - const ai = a[0].identifier(); - const bi = b[0].identifier(); - if (ai < bi) return -1; - if (ai > bi) return 1; - return 0; - }) - ); - } - - getModules() { - return this.modules.asSet(); - } - - clone() { - return new ConcatConfiguration(this.rootModule, this); - } - - set(config) { - this.rootModule = config.rootModule; - this.modules = config.modules; - this.warnings = config.warnings; - } } - -module.exports = ModuleConcatenationPlugin; +module.exports = SideEffectsFlagPlugin; /***/ }), -/***/ 68053: -/***/ (function(module) { +/***/ 60474: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* @@ -90710,977 +87943,1211 @@ module.exports = ModuleConcatenationPlugin; */ +const crypto = __webpack_require__(76417); +const SortableSet = __webpack_require__(50071); +const GraphHelpers = __webpack_require__(32973); +const { isSubset } = __webpack_require__(54262); +const deterministicGrouping = __webpack_require__(30815); +const MinMaxSizeWarning = __webpack_require__(25472); +const contextify = __webpack_require__(94658).contextify; + /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../util/deterministicGrouping").Options} DeterministicGroupingOptionsForModule */ +/** @typedef {import("../util/deterministicGrouping").GroupedItems} DeterministicGroupingGroupedItemsForModule */ -class NaturalChunkOrderPlugin { - /** - * @param {Compiler} compiler webpack compiler - * @returns {void} - */ - apply(compiler) { - compiler.hooks.compilation.tap("NaturalChunkOrderPlugin", compilation => { - compilation.hooks.optimizeChunkOrder.tap( - "NaturalChunkOrderPlugin", - chunks => { - chunks.sort((chunkA, chunkB) => { - const a = chunkA.modulesIterable[Symbol.iterator](); - const b = chunkB.modulesIterable[Symbol.iterator](); - // eslint-disable-next-line no-constant-condition - while (true) { - const aItem = a.next(); - const bItem = b.next(); - if (aItem.done && bItem.done) return 0; - if (aItem.done) return -1; - if (bItem.done) return 1; - const aModuleId = aItem.value.id; - const bModuleId = bItem.value.id; - if (aModuleId < bModuleId) return -1; - if (aModuleId > bModuleId) return 1; - } - }); - } - ); - }); - } -} +const deterministicGroupingForModules = /** @type {function(DeterministicGroupingOptionsForModule): DeterministicGroupingGroupedItemsForModule[]} */ (deterministicGrouping); -module.exports = NaturalChunkOrderPlugin; +const hashFilename = name => { + return crypto + .createHash("md4") + .update(name) + .digest("hex") + .slice(0, 8); +}; +const sortByIdentifier = (a, b) => { + if (a.identifier() > b.identifier()) return 1; + if (a.identifier() < b.identifier()) return -1; + return 0; +}; -/***/ }), +const getRequests = chunk => { + let requests = 0; + for (const chunkGroup of chunk.groupsIterable) { + requests = Math.max(requests, chunkGroup.chunks.length); + } + return requests; +}; -/***/ 83741: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +const getModulesSize = modules => { + let sum = 0; + for (const m of modules) { + sum += m.size(); + } + return sum; +}; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ +/** + * @template T + * @param {Set} a set + * @param {Set} b other set + * @returns {boolean} true if at least one item of a is in b + */ +const isOverlap = (a, b) => { + for (const item of a) { + if (b.has(item)) return true; + } + return false; +}; +const compareEntries = (a, b) => { + // 1. by priority + const diffPriority = a.cacheGroup.priority - b.cacheGroup.priority; + if (diffPriority) return diffPriority; + // 2. by number of chunks + const diffCount = a.chunks.size - b.chunks.size; + if (diffCount) return diffCount; + // 3. by size reduction + const aSizeReduce = a.size * (a.chunks.size - 1); + const bSizeReduce = b.size * (b.chunks.size - 1); + const diffSizeReduce = aSizeReduce - bSizeReduce; + if (diffSizeReduce) return diffSizeReduce; + // 4. by cache group index + const indexDiff = a.cacheGroupIndex - b.cacheGroupIndex; + if (indexDiff) return indexDiff; + // 5. by number of modules (to be able to compare by identifier) + const modulesA = a.modules; + const modulesB = b.modules; + const diff = modulesA.size - modulesB.size; + if (diff) return diff; + // 6. by module identifiers + modulesA.sort(); + modulesB.sort(); + const aI = modulesA[Symbol.iterator](); + const bI = modulesB[Symbol.iterator](); + // eslint-disable-next-line no-constant-condition + while (true) { + const aItem = aI.next(); + const bItem = bI.next(); + if (aItem.done) return 0; + const aModuleIdentifier = aItem.value.identifier(); + const bModuleIdentifier = bItem.value.identifier(); + if (aModuleIdentifier > bModuleIdentifier) return -1; + if (aModuleIdentifier < bModuleIdentifier) return 1; + } +}; -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(88771); +const compareNumbers = (a, b) => a - b; -/** @typedef {import("../../declarations/plugins/optimize/OccurrenceOrderChunkIdsPlugin").OccurrenceOrderChunkIdsPluginOptions} OccurrenceOrderChunkIdsPluginOptions */ +const INITIAL_CHUNK_FILTER = chunk => chunk.canBeInitial(); +const ASYNC_CHUNK_FILTER = chunk => !chunk.canBeInitial(); +const ALL_CHUNK_FILTER = chunk => true; -class OccurrenceOrderChunkIdsPlugin { - /** - * @param {OccurrenceOrderChunkIdsPluginOptions=} options options object - */ - constructor(options = {}) { - validateOptions(schema, options, "Occurrence Order Chunk Ids Plugin"); - this.options = options; +module.exports = class SplitChunksPlugin { + constructor(options) { + this.options = SplitChunksPlugin.normalizeOptions(options); } - apply(compiler) { - const prioritiseInitial = this.options.prioritiseInitial; - compiler.hooks.compilation.tap( - "OccurrenceOrderChunkIdsPlugin", - compilation => { - compilation.hooks.optimizeChunkOrder.tap( - "OccurrenceOrderChunkIdsPlugin", - chunks => { - const occursInInitialChunksMap = new Map(); - const originalOrder = new Map(); + static normalizeOptions(options = {}) { + return { + chunksFilter: SplitChunksPlugin.normalizeChunksFilter( + options.chunks || "all" + ), + minSize: options.minSize || 0, + enforceSizeThreshold: options.enforceSizeThreshold || 0, + maxSize: options.maxSize || 0, + minChunks: options.minChunks || 1, + maxAsyncRequests: options.maxAsyncRequests || 1, + maxInitialRequests: options.maxInitialRequests || 1, + hidePathInfo: options.hidePathInfo || false, + filename: options.filename || undefined, + getCacheGroups: SplitChunksPlugin.normalizeCacheGroups({ + cacheGroups: options.cacheGroups, + name: options.name, + automaticNameDelimiter: options.automaticNameDelimiter, + automaticNameMaxLength: options.automaticNameMaxLength + }), + automaticNameDelimiter: options.automaticNameDelimiter, + automaticNameMaxLength: options.automaticNameMaxLength || 109, + fallbackCacheGroup: SplitChunksPlugin.normalizeFallbackCacheGroup( + options.fallbackCacheGroup || {}, + options + ) + }; + } - let i = 0; - for (const c of chunks) { - let occurs = 0; - for (const chunkGroup of c.groupsIterable) { - for (const parent of chunkGroup.parentsIterable) { - if (parent.isInitial()) occurs++; + static normalizeName({ + name, + automaticNameDelimiter, + automaticNamePrefix, + automaticNameMaxLength + }) { + if (name === true) { + /** @type {WeakMap>} */ + const cache = new WeakMap(); + const fn = (module, chunks, cacheGroup) => { + let cacheEntry = cache.get(chunks); + if (cacheEntry === undefined) { + cacheEntry = {}; + cache.set(chunks, cacheEntry); + } else if (cacheGroup in cacheEntry) { + return cacheEntry[cacheGroup]; + } + const names = chunks.map(c => c.name); + if (!names.every(Boolean)) { + cacheEntry[cacheGroup] = undefined; + return; + } + names.sort(); + const prefix = + typeof automaticNamePrefix === "string" + ? automaticNamePrefix + : cacheGroup; + const namePrefix = prefix ? prefix + automaticNameDelimiter : ""; + let name = namePrefix + names.join(automaticNameDelimiter); + // Filenames and paths can't be too long otherwise an + // ENAMETOOLONG error is raised. If the generated name if too + // long, it is truncated and a hash is appended. The limit has + // been set to 109 to prevent `[name].[chunkhash].[ext]` from + // generating a 256+ character string. + if (name.length > automaticNameMaxLength) { + const hashedFilename = hashFilename(name); + const sliceLength = + automaticNameMaxLength - + (automaticNameDelimiter.length + hashedFilename.length); + name = + name.slice(0, sliceLength) + + automaticNameDelimiter + + hashedFilename; + } + cacheEntry[cacheGroup] = name; + return name; + }; + return fn; + } + if (typeof name === "string") { + const fn = () => { + return name; + }; + return fn; + } + if (typeof name === "function") return name; + } + + static normalizeChunksFilter(chunks) { + if (chunks === "initial") { + return INITIAL_CHUNK_FILTER; + } + if (chunks === "async") { + return ASYNC_CHUNK_FILTER; + } + if (chunks === "all") { + return ALL_CHUNK_FILTER; + } + if (typeof chunks === "function") return chunks; + } + + static normalizeFallbackCacheGroup( + { + minSize = undefined, + maxSize = undefined, + automaticNameDelimiter = undefined + }, + { + minSize: defaultMinSize = undefined, + maxSize: defaultMaxSize = undefined, + automaticNameDelimiter: defaultAutomaticNameDelimiter = undefined + } + ) { + return { + minSize: typeof minSize === "number" ? minSize : defaultMinSize || 0, + maxSize: typeof maxSize === "number" ? maxSize : defaultMaxSize || 0, + automaticNameDelimiter: + automaticNameDelimiter || defaultAutomaticNameDelimiter || "~" + }; + } + + static normalizeCacheGroups({ + cacheGroups, + name, + automaticNameDelimiter, + automaticNameMaxLength + }) { + if (typeof cacheGroups === "function") { + // TODO webpack 5 remove this + if (cacheGroups.length !== 1) { + return module => cacheGroups(module, module.getChunks()); + } + return cacheGroups; + } + if (cacheGroups && typeof cacheGroups === "object") { + const fn = module => { + let results; + for (const key of Object.keys(cacheGroups)) { + let option = cacheGroups[key]; + if (option === false) continue; + if (option instanceof RegExp || typeof option === "string") { + option = { + test: option + }; + } + if (typeof option === "function") { + let result = option(module); + if (result) { + if (results === undefined) results = []; + for (const r of Array.isArray(result) ? result : [result]) { + const result = Object.assign({ key }, r); + if (result.name) result.getName = () => result.name; + if (result.chunks) { + result.chunksFilter = SplitChunksPlugin.normalizeChunksFilter( + result.chunks + ); } + results.push(result); } - occursInInitialChunksMap.set(c, occurs); - originalOrder.set(c, i++); } - - chunks.sort((a, b) => { - if (prioritiseInitial) { - const aEntryOccurs = occursInInitialChunksMap.get(a); - const bEntryOccurs = occursInInitialChunksMap.get(b); - if (aEntryOccurs > bEntryOccurs) return -1; - if (aEntryOccurs < bEntryOccurs) return 1; - } - const aOccurs = a.getNumberOfGroups(); - const bOccurs = b.getNumberOfGroups(); - if (aOccurs > bOccurs) return -1; - if (aOccurs < bOccurs) return 1; - const orgA = originalOrder.get(a); - const orgB = originalOrder.get(b); - return orgA - orgB; + } else if (SplitChunksPlugin.checkTest(option.test, module)) { + if (results === undefined) results = []; + results.push({ + key: key, + priority: option.priority, + getName: + SplitChunksPlugin.normalizeName({ + name: option.name || name, + automaticNameDelimiter: + typeof option.automaticNameDelimiter === "string" + ? option.automaticNameDelimiter + : automaticNameDelimiter, + automaticNamePrefix: option.automaticNamePrefix, + automaticNameMaxLength: + option.automaticNameMaxLength || automaticNameMaxLength + }) || (() => {}), + chunksFilter: SplitChunksPlugin.normalizeChunksFilter( + option.chunks + ), + enforce: option.enforce, + minSize: option.minSize, + enforceSizeThreshold: option.enforceSizeThreshold, + maxSize: option.maxSize, + minChunks: option.minChunks, + maxAsyncRequests: option.maxAsyncRequests, + maxInitialRequests: option.maxInitialRequests, + filename: option.filename, + reuseExistingChunk: option.reuseExistingChunk }); } - ); - } - ); + } + return results; + }; + return fn; + } + const fn = () => {}; + return fn; } -} - -module.exports = OccurrenceOrderChunkIdsPlugin; - - -/***/ }), - -/***/ 62000: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -const validateOptions = __webpack_require__(33225); -const schema = __webpack_require__(81430); -/** @typedef {import("../../declarations/plugins/optimize/OccurrenceOrderModuleIdsPlugin").OccurrenceOrderModuleIdsPluginOptions} OccurrenceOrderModuleIdsPluginOptions */ + static checkTest(test, module) { + if (test === undefined) return true; + if (typeof test === "function") { + if (test.length !== 1) { + return test(module, module.getChunks()); + } + return test(module); + } + if (typeof test === "boolean") return test; + if (typeof test === "string") { + if ( + module.nameForCondition && + module.nameForCondition().startsWith(test) + ) { + return true; + } + for (const chunk of module.chunksIterable) { + if (chunk.name && chunk.name.startsWith(test)) { + return true; + } + } + return false; + } + if (test instanceof RegExp) { + if (module.nameForCondition && test.test(module.nameForCondition())) { + return true; + } + for (const chunk of module.chunksIterable) { + if (chunk.name && test.test(chunk.name)) { + return true; + } + } + return false; + } + return false; + } -class OccurrenceOrderModuleIdsPlugin { /** - * @param {OccurrenceOrderModuleIdsPluginOptions=} options options object + * @param {Compiler} compiler webpack compiler + * @returns {void} */ - constructor(options = {}) { - validateOptions(schema, options, "Occurrence Order Module Ids Plugin"); - this.options = options; - } - apply(compiler) { - const prioritiseInitial = this.options.prioritiseInitial; - compiler.hooks.compilation.tap( - "OccurrenceOrderModuleIdsPlugin", - compilation => { - compilation.hooks.optimizeModuleOrder.tap( - "OccurrenceOrderModuleIdsPlugin", - modules => { - const occursInInitialChunksMap = new Map(); - const occursInAllChunksMap = new Map(); - - const initialChunkChunkMap = new Map(); - const entryCountMap = new Map(); - for (const m of modules) { - let initial = 0; - let entry = 0; - for (const c of m.chunksIterable) { - if (c.canBeInitial()) initial++; - if (c.entryModule === m) entry++; - } - initialChunkChunkMap.set(m, initial); - entryCountMap.set(m, entry); + compiler.hooks.thisCompilation.tap("SplitChunksPlugin", compilation => { + let alreadyOptimized = false; + compilation.hooks.unseal.tap("SplitChunksPlugin", () => { + alreadyOptimized = false; + }); + compilation.hooks.optimizeChunksAdvanced.tap( + "SplitChunksPlugin", + chunks => { + if (alreadyOptimized) return; + alreadyOptimized = true; + // Give each selected chunk an index (to create strings from chunks) + const indexMap = new Map(); + let index = 1; + for (const chunk of chunks) { + indexMap.set(chunk, index++); + } + const getKey = chunks => { + return Array.from(chunks, c => indexMap.get(c)) + .sort(compareNumbers) + .join(); + }; + /** @type {Map>} */ + const chunkSetsInGraph = new Map(); + for (const module of compilation.modules) { + const chunksKey = getKey(module.chunksIterable); + if (!chunkSetsInGraph.has(chunksKey)) { + chunkSetsInGraph.set(chunksKey, new Set(module.chunksIterable)); } + } - const countOccursInEntry = (sum, r) => { - if (!r.module) { - return sum; - } - const count = initialChunkChunkMap.get(r.module); - if (!count) { - return sum; - } - return sum + count; - }; - const countOccurs = (sum, r) => { - if (!r.module) { - return sum; - } - let factor = 1; - if (typeof r.dependency.getNumberOfIdOccurrences === "function") { - factor = r.dependency.getNumberOfIdOccurrences(); - } - if (factor === 0) { - return sum; - } - return sum + factor * r.module.getNumberOfChunks(); - }; - - if (prioritiseInitial) { - for (const m of modules) { - const result = - m.reasons.reduce(countOccursInEntry, 0) + - initialChunkChunkMap.get(m) + - entryCountMap.get(m); - occursInInitialChunksMap.set(m, result); - } + // group these set of chunks by count + // to allow to check less sets via isSubset + // (only smaller sets can be subset) + /** @type {Map>>} */ + const chunkSetsByCount = new Map(); + for (const chunksSet of chunkSetsInGraph.values()) { + const count = chunksSet.size; + let array = chunkSetsByCount.get(count); + if (array === undefined) { + array = []; + chunkSetsByCount.set(count, array); } + array.push(chunksSet); + } - const originalOrder = new Map(); - let i = 0; - for (const m of modules) { - const result = - m.reasons.reduce(countOccurs, 0) + - m.getNumberOfChunks() + - entryCountMap.get(m); - occursInAllChunksMap.set(m, result); - originalOrder.set(m, i++); - } + // Create a list of possible combinations + const combinationsCache = new Map(); // Map[]> - modules.sort((a, b) => { - if (prioritiseInitial) { - const aEntryOccurs = occursInInitialChunksMap.get(a); - const bEntryOccurs = occursInInitialChunksMap.get(b); - if (aEntryOccurs > bEntryOccurs) return -1; - if (aEntryOccurs < bEntryOccurs) return 1; + const getCombinations = key => { + const chunksSet = chunkSetsInGraph.get(key); + var array = [chunksSet]; + if (chunksSet.size > 1) { + for (const [count, setArray] of chunkSetsByCount) { + // "equal" is not needed because they would have been merge in the first step + if (count < chunksSet.size) { + for (const set of setArray) { + if (isSubset(chunksSet, set)) { + array.push(set); + } + } + } } - const aOccurs = occursInAllChunksMap.get(a); - const bOccurs = occursInAllChunksMap.get(b); - if (aOccurs > bOccurs) return -1; - if (aOccurs < bOccurs) return 1; - const orgA = originalOrder.get(a); - const orgB = originalOrder.get(b); - return orgA - orgB; - }); - } - ); - } - ); - } -} + } + return array; + }; -module.exports = OccurrenceOrderModuleIdsPlugin; + /** + * @typedef {Object} SelectedChunksResult + * @property {Chunk[]} chunks the list of chunks + * @property {string} key a key of the list + */ + /** + * @typedef {function(Chunk): boolean} ChunkFilterFunction + */ -/***/ }), + /** @type {WeakMap, WeakMap>} */ + const selectedChunksCacheByChunksSet = new WeakMap(); -/***/ 67340: -/***/ (function(module) { + /** + * get list and key by applying the filter function to the list + * It is cached for performance reasons + * @param {Set} chunks list of chunks + * @param {ChunkFilterFunction} chunkFilter filter function for chunks + * @returns {SelectedChunksResult} list and key + */ + const getSelectedChunks = (chunks, chunkFilter) => { + let entry = selectedChunksCacheByChunksSet.get(chunks); + if (entry === undefined) { + entry = new WeakMap(); + selectedChunksCacheByChunksSet.set(chunks, entry); + } + /** @type {SelectedChunksResult} */ + let entry2 = entry.get(chunkFilter); + if (entry2 === undefined) { + /** @type {Chunk[]} */ + const selectedChunks = []; + for (const chunk of chunks) { + if (chunkFilter(chunk)) selectedChunks.push(chunk); + } + entry2 = { + chunks: selectedChunks, + key: getKey(selectedChunks) + }; + entry.set(chunkFilter, entry2); + } + return entry2; + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + /** + * @typedef {Object} ChunksInfoItem + * @property {SortableSet} modules + * @property {TODO} cacheGroup + * @property {number} cacheGroupIndex + * @property {string} name + * @property {number} size + * @property {Set} chunks + * @property {Set} reuseableChunks + * @property {Set} chunksKeys + */ + // Map a list of chunks to a list of modules + // For the key the chunk "index" is used, the value is a SortableSet of modules + /** @type {Map} */ + const chunksInfoMap = new Map(); -// TODO webpack 5 remove this plugin -// It has been splitted into separate plugins for modules and chunks -class OccurrenceOrderPlugin { - constructor(preferEntry) { - if (preferEntry !== undefined && typeof preferEntry !== "boolean") { - throw new Error( - "Argument should be a boolean.\nFor more info on this plugin, see https://webpack.js.org/plugins/" - ); - } - this.preferEntry = preferEntry; - } - apply(compiler) { - const preferEntry = this.preferEntry; - compiler.hooks.compilation.tap("OccurrenceOrderPlugin", compilation => { - compilation.hooks.optimizeModuleOrder.tap( - "OccurrenceOrderPlugin", - modules => { - const occursInInitialChunksMap = new Map(); - const occursInAllChunksMap = new Map(); - - const initialChunkChunkMap = new Map(); - const entryCountMap = new Map(); - for (const m of modules) { - let initial = 0; - let entry = 0; - for (const c of m.chunksIterable) { - if (c.canBeInitial()) initial++; - if (c.entryModule === m) entry++; - } - initialChunkChunkMap.set(m, initial); - entryCountMap.set(m, entry); - } - - const countOccursInEntry = (sum, r) => { - if (!r.module) { - return sum; - } - return sum + initialChunkChunkMap.get(r.module); - }; - const countOccurs = (sum, r) => { - if (!r.module) { - return sum; - } - let factor = 1; - if (typeof r.dependency.getNumberOfIdOccurrences === "function") { - factor = r.dependency.getNumberOfIdOccurrences(); + /** + * @param {TODO} cacheGroup the current cache group + * @param {number} cacheGroupIndex the index of the cache group of ordering + * @param {Chunk[]} selectedChunks chunks selected for this module + * @param {string} selectedChunksKey a key of selectedChunks + * @param {Module} module the current module + * @returns {void} + */ + const addModuleToChunksInfoMap = ( + cacheGroup, + cacheGroupIndex, + selectedChunks, + selectedChunksKey, + module + ) => { + // Break if minimum number of chunks is not reached + if (selectedChunks.length < cacheGroup.minChunks) return; + // Determine name for split chunk + const name = cacheGroup.getName( + module, + selectedChunks, + cacheGroup.key + ); + // Create key for maps + // When it has a name we use the name as key + // Elsewise we create the key from chunks and cache group key + // This automatically merges equal names + const key = + cacheGroup.key + + (name ? ` name:${name}` : ` chunks:${selectedChunksKey}`); + // Add module to maps + let info = chunksInfoMap.get(key); + if (info === undefined) { + chunksInfoMap.set( + key, + (info = { + modules: new SortableSet(undefined, sortByIdentifier), + cacheGroup, + cacheGroupIndex, + name, + size: 0, + chunks: new Set(), + reuseableChunks: new Set(), + chunksKeys: new Set() + }) + ); } - if (factor === 0) { - return sum; + info.modules.add(module); + info.size += module.size(); + if (!info.chunksKeys.has(selectedChunksKey)) { + info.chunksKeys.add(selectedChunksKey); + for (const chunk of selectedChunks) { + info.chunks.add(chunk); + } } - return sum + factor * r.module.getNumberOfChunks(); }; - if (preferEntry) { - for (const m of modules) { - const result = - m.reasons.reduce(countOccursInEntry, 0) + - initialChunkChunkMap.get(m) + - entryCountMap.get(m); - occursInInitialChunksMap.set(m, result); + // Walk through all modules + for (const module of compilation.modules) { + // Get cache group + let cacheGroups = this.options.getCacheGroups(module); + if (!Array.isArray(cacheGroups) || cacheGroups.length === 0) { + continue; } - } - - const originalOrder = new Map(); - let i = 0; - for (const m of modules) { - const result = - m.reasons.reduce(countOccurs, 0) + - m.getNumberOfChunks() + - entryCountMap.get(m); - occursInAllChunksMap.set(m, result); - originalOrder.set(m, i++); - } - modules.sort((a, b) => { - if (preferEntry) { - const aEntryOccurs = occursInInitialChunksMap.get(a); - const bEntryOccurs = occursInInitialChunksMap.get(b); - if (aEntryOccurs > bEntryOccurs) return -1; - if (aEntryOccurs < bEntryOccurs) return 1; + // Prepare some values + const chunksKey = getKey(module.chunksIterable); + let combs = combinationsCache.get(chunksKey); + if (combs === undefined) { + combs = getCombinations(chunksKey); + combinationsCache.set(chunksKey, combs); } - const aOccurs = occursInAllChunksMap.get(a); - const bOccurs = occursInAllChunksMap.get(b); - if (aOccurs > bOccurs) return -1; - if (aOccurs < bOccurs) return 1; - const orgA = originalOrder.get(a); - const orgB = originalOrder.get(b); - return orgA - orgB; - }); - } - ); - compilation.hooks.optimizeChunkOrder.tap( - "OccurrenceOrderPlugin", - chunks => { - const occursInInitialChunksMap = new Map(); - const originalOrder = new Map(); - let i = 0; - for (const c of chunks) { - let occurs = 0; - for (const chunkGroup of c.groupsIterable) { - for (const parent of chunkGroup.parentsIterable) { - if (parent.isInitial()) occurs++; + let cacheGroupIndex = 0; + for (const cacheGroupSource of cacheGroups) { + const minSize = + cacheGroupSource.minSize !== undefined + ? cacheGroupSource.minSize + : cacheGroupSource.enforce + ? 0 + : this.options.minSize; + const enforceSizeThreshold = + cacheGroupSource.enforceSizeThreshold !== undefined + ? cacheGroupSource.enforceSizeThreshold + : cacheGroupSource.enforce + ? 0 + : this.options.enforceSizeThreshold; + const cacheGroup = { + key: cacheGroupSource.key, + priority: cacheGroupSource.priority || 0, + chunksFilter: + cacheGroupSource.chunksFilter || this.options.chunksFilter, + minSize, + minSizeForMaxSize: + cacheGroupSource.minSize !== undefined + ? cacheGroupSource.minSize + : this.options.minSize, + enforceSizeThreshold, + maxSize: + cacheGroupSource.maxSize !== undefined + ? cacheGroupSource.maxSize + : cacheGroupSource.enforce + ? 0 + : this.options.maxSize, + minChunks: + cacheGroupSource.minChunks !== undefined + ? cacheGroupSource.minChunks + : cacheGroupSource.enforce + ? 1 + : this.options.minChunks, + maxAsyncRequests: + cacheGroupSource.maxAsyncRequests !== undefined + ? cacheGroupSource.maxAsyncRequests + : cacheGroupSource.enforce + ? Infinity + : this.options.maxAsyncRequests, + maxInitialRequests: + cacheGroupSource.maxInitialRequests !== undefined + ? cacheGroupSource.maxInitialRequests + : cacheGroupSource.enforce + ? Infinity + : this.options.maxInitialRequests, + getName: + cacheGroupSource.getName !== undefined + ? cacheGroupSource.getName + : this.options.getName, + filename: + cacheGroupSource.filename !== undefined + ? cacheGroupSource.filename + : this.options.filename, + automaticNameDelimiter: + cacheGroupSource.automaticNameDelimiter !== undefined + ? cacheGroupSource.automaticNameDelimiter + : this.options.automaticNameDelimiter, + reuseExistingChunk: cacheGroupSource.reuseExistingChunk, + _validateSize: minSize > 0, + _conditionalEnforce: enforceSizeThreshold > 0 + }; + // For all combination of chunk selection + for (const chunkCombination of combs) { + // Break if minimum number of chunks is not reached + if (chunkCombination.size < cacheGroup.minChunks) continue; + // Select chunks by configuration + const { + chunks: selectedChunks, + key: selectedChunksKey + } = getSelectedChunks( + chunkCombination, + cacheGroup.chunksFilter + ); + + addModuleToChunksInfoMap( + cacheGroup, + cacheGroupIndex, + selectedChunks, + selectedChunksKey, + module + ); } + cacheGroupIndex++; } - occursInInitialChunksMap.set(c, occurs); - originalOrder.set(c, i++); } - chunks.sort((a, b) => { - const aEntryOccurs = occursInInitialChunksMap.get(a); - const bEntryOccurs = occursInInitialChunksMap.get(b); - if (aEntryOccurs > bEntryOccurs) return -1; - if (aEntryOccurs < bEntryOccurs) return 1; - const aOccurs = a.getNumberOfGroups(); - const bOccurs = b.getNumberOfGroups(); - if (aOccurs > bOccurs) return -1; - if (aOccurs < bOccurs) return 1; - const orgA = originalOrder.get(a); - const orgB = originalOrder.get(b); - return orgA - orgB; - }); - } - ); - }); - } -} - -module.exports = OccurrenceOrderPlugin; - - -/***/ }), - -/***/ 78085: -/***/ (function(module) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - - -class RemoveEmptyChunksPlugin { - apply(compiler) { - compiler.hooks.compilation.tap("RemoveEmptyChunksPlugin", compilation => { - const handler = chunks => { - for (let i = chunks.length - 1; i >= 0; i--) { - const chunk = chunks[i]; - if ( - chunk.isEmpty() && - !chunk.hasRuntime() && - !chunk.hasEntryModule() - ) { - chunk.remove("empty"); - chunks.splice(i, 1); + // Filter items were size < minSize + for (const pair of chunksInfoMap) { + const info = pair[1]; + if ( + info.cacheGroup._validateSize && + info.size < info.cacheGroup.minSize + ) { + chunksInfoMap.delete(pair[0]); + } } - } - }; - compilation.hooks.optimizeChunksBasic.tap( - "RemoveEmptyChunksPlugin", - handler - ); - compilation.hooks.optimizeChunksAdvanced.tap( - "RemoveEmptyChunksPlugin", - handler - ); - compilation.hooks.optimizeExtractedChunksBasic.tap( - "RemoveEmptyChunksPlugin", - handler - ); - compilation.hooks.optimizeExtractedChunksAdvanced.tap( - "RemoveEmptyChunksPlugin", - handler - ); - }); - } -} -module.exports = RemoveEmptyChunksPlugin; - - -/***/ }), -/***/ 58142: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + /** @type {Map} */ + const maxSizeQueueMap = new Map(); + while (chunksInfoMap.size > 0) { + // Find best matching entry + let bestEntryKey; + let bestEntry; + for (const pair of chunksInfoMap) { + const key = pair[0]; + const info = pair[1]; + if (bestEntry === undefined) { + bestEntry = info; + bestEntryKey = key; + } else if (compareEntries(bestEntry, info) < 0) { + bestEntry = info; + bestEntryKey = key; + } + } -const Queue = __webpack_require__(38637); -const { intersect } = __webpack_require__(54262); + const item = bestEntry; + chunksInfoMap.delete(bestEntryKey); -const getParentChunksWithModule = (currentChunk, module) => { - const chunks = []; - const stack = new Set(currentChunk.parentsIterable); + let chunkName = item.name; + // Variable for the new chunk (lazy created) + /** @type {Chunk} */ + let newChunk; + // When no chunk name, check if we can reuse a chunk instead of creating a new one + let isReused = false; + if (item.cacheGroup.reuseExistingChunk) { + outer: for (const chunk of item.chunks) { + if (chunk.getNumberOfModules() !== item.modules.size) continue; + if (chunk.hasEntryModule()) continue; + for (const module of item.modules) { + if (!chunk.containsModule(module)) continue outer; + } + if (!newChunk || !newChunk.name) { + newChunk = chunk; + } else if ( + chunk.name && + chunk.name.length < newChunk.name.length + ) { + newChunk = chunk; + } else if ( + chunk.name && + chunk.name.length === newChunk.name.length && + chunk.name < newChunk.name + ) { + newChunk = chunk; + } + chunkName = undefined; + isReused = true; + } + } + // Check if maxRequests condition can be fulfilled - for (const chunk of stack) { - if (chunk.containsModule(module)) { - chunks.push(chunk); - } else { - for (const parent of chunk.parentsIterable) { - stack.add(parent); - } - } - } + const selectedChunks = Array.from(item.chunks).filter(chunk => { + // skip if we address ourself + return ( + (!chunkName || chunk.name !== chunkName) && chunk !== newChunk + ); + }); - return chunks; -}; + const enforced = + item.cacheGroup._conditionalEnforce && + item.size >= item.cacheGroup.enforceSizeThreshold; -class RemoveParentModulesPlugin { - apply(compiler) { - compiler.hooks.compilation.tap("RemoveParentModulesPlugin", compilation => { - const handler = (chunks, chunkGroups) => { - const queue = new Queue(); - const availableModulesMap = new WeakMap(); + // Skip when no chunk selected + if (selectedChunks.length === 0) continue; - for (const chunkGroup of compilation.entrypoints.values()) { - // initialize available modules for chunks without parents - availableModulesMap.set(chunkGroup, new Set()); - for (const child of chunkGroup.childrenIterable) { - queue.enqueue(child); - } - } + const usedChunks = new Set(selectedChunks); - while (queue.length > 0) { - const chunkGroup = queue.dequeue(); - let availableModules = availableModulesMap.get(chunkGroup); - let changed = false; - for (const parent of chunkGroup.parentsIterable) { - const availableModulesInParent = availableModulesMap.get(parent); - if (availableModulesInParent !== undefined) { - // If we know the available modules in parent: process these - if (availableModules === undefined) { - // if we have not own info yet: create new entry - availableModules = new Set(availableModulesInParent); - for (const chunk of parent.chunks) { - for (const m of chunk.modulesIterable) { - availableModules.add(m); - } - } - availableModulesMap.set(chunkGroup, availableModules); - changed = true; - } else { - for (const m of availableModules) { - if ( - !parent.containsModule(m) && - !availableModulesInParent.has(m) - ) { - availableModules.delete(m); - changed = true; - } + // Check if maxRequests condition can be fulfilled + if ( + !enforced && + (Number.isFinite(item.cacheGroup.maxInitialRequests) || + Number.isFinite(item.cacheGroup.maxAsyncRequests)) + ) { + for (const chunk of usedChunks) { + // respect max requests + const maxRequests = chunk.isOnlyInitial() + ? item.cacheGroup.maxInitialRequests + : chunk.canBeInitial() + ? Math.min( + item.cacheGroup.maxInitialRequests, + item.cacheGroup.maxAsyncRequests + ) + : item.cacheGroup.maxAsyncRequests; + if ( + isFinite(maxRequests) && + getRequests(chunk) >= maxRequests + ) { + usedChunks.delete(chunk); } } } - } - if (changed) { - // if something changed: enqueue our children - for (const child of chunkGroup.childrenIterable) { - queue.enqueue(child); - } - } - } - // now we have available modules for every chunk - for (const chunk of chunks) { - const availableModulesSets = Array.from( - chunk.groupsIterable, - chunkGroup => availableModulesMap.get(chunkGroup) - ); - if (availableModulesSets.some(s => s === undefined)) continue; // No info about this chunk group - const availableModules = - availableModulesSets.length === 1 - ? availableModulesSets[0] - : intersect(availableModulesSets); - const numberOfModules = chunk.getNumberOfModules(); - const toRemove = new Set(); - if (numberOfModules < availableModules.size) { - for (const m of chunk.modulesIterable) { - if (availableModules.has(m)) { - toRemove.add(m); + outer: for (const chunk of usedChunks) { + for (const module of item.modules) { + if (chunk.containsModule(module)) continue outer; } + usedChunks.delete(chunk); } - } else { - for (const m of availableModules) { - if (chunk.containsModule(m)) { - toRemove.add(m); + + // Were some (invalid) chunks removed from usedChunks? + // => readd all modules to the queue, as things could have been changed + if (usedChunks.size < selectedChunks.length) { + if (usedChunks.size >= item.cacheGroup.minChunks) { + const chunksArr = Array.from(usedChunks); + for (const module of item.modules) { + addModuleToChunksInfoMap( + item.cacheGroup, + item.cacheGroupIndex, + chunksArr, + getKey(usedChunks), + module + ); + } + } + continue; + } + + // Create the new chunk if not reusing one + if (!isReused) { + newChunk = compilation.addChunk(chunkName); + } + // Walk through all chunks + for (const chunk of usedChunks) { + // Add graph connections for splitted chunk + chunk.split(newChunk); + } + + // Add a note to the chunk + newChunk.chunkReason = isReused + ? "reused as split chunk" + : "split chunk"; + if (item.cacheGroup.key) { + newChunk.chunkReason += ` (cache group: ${item.cacheGroup.key})`; + } + if (chunkName) { + newChunk.chunkReason += ` (name: ${chunkName})`; + // If the chosen name is already an entry point we remove the entry point + const entrypoint = compilation.entrypoints.get(chunkName); + if (entrypoint) { + compilation.entrypoints.delete(chunkName); + entrypoint.remove(); + newChunk.entryModule = undefined; + } + } + if (item.cacheGroup.filename) { + if (!newChunk.isOnlyInitial()) { + throw new Error( + "SplitChunksPlugin: You are trying to set a filename for a chunk which is (also) loaded on demand. " + + "The runtime can only handle loading of chunks which match the chunkFilename schema. " + + "Using a custom filename would fail at runtime. " + + `(cache group: ${item.cacheGroup.key})` + ); + } + newChunk.filenameTemplate = item.cacheGroup.filename; + } + if (!isReused) { + // Add all modules to the new chunk + for (const module of item.modules) { + if (typeof module.chunkCondition === "function") { + if (!module.chunkCondition(newChunk)) continue; + } + // Add module to new chunk + GraphHelpers.connectChunkAndModule(newChunk, module); + // Remove module from used chunks + for (const chunk of usedChunks) { + chunk.removeModule(module); + module.rewriteChunkInReasons(chunk, [newChunk]); + } + } + } else { + // Remove all modules from used chunks + for (const module of item.modules) { + for (const chunk of usedChunks) { + chunk.removeModule(module); + module.rewriteChunkInReasons(chunk, [newChunk]); + } + } + } + + if (item.cacheGroup.maxSize > 0) { + const oldMaxSizeSettings = maxSizeQueueMap.get(newChunk); + maxSizeQueueMap.set(newChunk, { + minSize: Math.max( + oldMaxSizeSettings ? oldMaxSizeSettings.minSize : 0, + item.cacheGroup.minSizeForMaxSize + ), + maxSize: Math.min( + oldMaxSizeSettings ? oldMaxSizeSettings.maxSize : Infinity, + item.cacheGroup.maxSize + ), + automaticNameDelimiter: item.cacheGroup.automaticNameDelimiter, + keys: oldMaxSizeSettings + ? oldMaxSizeSettings.keys.concat(item.cacheGroup.key) + : [item.cacheGroup.key] + }); + } + + // remove all modules from other entries and update size + for (const [key, info] of chunksInfoMap) { + if (isOverlap(info.chunks, usedChunks)) { + // update modules and total size + // may remove it from the map when < minSize + const oldSize = info.modules.size; + for (const module of item.modules) { + info.modules.delete(module); + } + if (info.modules.size !== oldSize) { + if (info.modules.size === 0) { + chunksInfoMap.delete(key); + continue; + } + info.size = getModulesSize(info.modules); + if ( + info.cacheGroup._validateSize && + info.size < info.cacheGroup.minSize + ) { + chunksInfoMap.delete(key); + } + if (info.modules.size === 0) { + chunksInfoMap.delete(key); + } + } } } } - for (const module of toRemove) { - module.rewriteChunkInReasons( - chunk, - getParentChunksWithModule(chunk, module) - ); - chunk.removeModule(module); + + const incorrectMinMaxSizeSet = new Set(); + + // Make sure that maxSize is fulfilled + for (const chunk of compilation.chunks.slice()) { + const { minSize, maxSize, automaticNameDelimiter, keys } = + maxSizeQueueMap.get(chunk) || this.options.fallbackCacheGroup; + if (!maxSize) continue; + if (minSize > maxSize) { + const warningKey = `${keys && keys.join()} ${minSize} ${maxSize}`; + if (!incorrectMinMaxSizeSet.has(warningKey)) { + incorrectMinMaxSizeSet.add(warningKey); + compilation.warnings.push( + new MinMaxSizeWarning(keys, minSize, maxSize) + ); + } + } + const results = deterministicGroupingForModules({ + maxSize: Math.max(minSize, maxSize), + minSize, + items: chunk.modulesIterable, + getKey(module) { + const ident = contextify( + compilation.options.context, + module.identifier() + ); + const name = module.nameForCondition + ? contextify( + compilation.options.context, + module.nameForCondition() + ) + : ident.replace(/^.*!|\?[^?!]*$/g, ""); + const fullKey = + name + automaticNameDelimiter + hashFilename(ident); + return fullKey.replace(/[\\/?]/g, "_"); + }, + getSize(module) { + return module.size(); + } + }); + results.sort((a, b) => { + if (a.key < b.key) return -1; + if (a.key > b.key) return 1; + return 0; + }); + for (let i = 0; i < results.length; i++) { + const group = results[i]; + const key = this.options.hidePathInfo + ? hashFilename(group.key) + : group.key; + let name = chunk.name + ? chunk.name + automaticNameDelimiter + key + : null; + if (name && name.length > 100) { + name = + name.slice(0, 100) + + automaticNameDelimiter + + hashFilename(name); + } + let newPart; + if (i !== results.length - 1) { + newPart = compilation.addChunk(name); + chunk.split(newPart); + newPart.chunkReason = chunk.chunkReason; + // Add all modules to the new chunk + for (const module of group.items) { + if (typeof module.chunkCondition === "function") { + if (!module.chunkCondition(newPart)) continue; + } + // Add module to new chunk + GraphHelpers.connectChunkAndModule(newPart, module); + // Remove module from used chunks + chunk.removeModule(module); + module.rewriteChunkInReasons(chunk, [newPart]); + } + } else { + // change the chunk to be a part + newPart = chunk; + chunk.name = name; + } + } } } - }; - compilation.hooks.optimizeChunksBasic.tap( - "RemoveParentModulesPlugin", - handler - ); - compilation.hooks.optimizeExtractedChunksBasic.tap( - "RemoveParentModulesPlugin", - handler ); }); } -} -module.exports = RemoveParentModulesPlugin; +}; /***/ }), -/***/ 76894: -/***/ (function(module) { +/***/ 89339: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra + Author Sean Larkin @thelarkinn */ -module.exports = class RuntimeChunkPlugin { - constructor(options) { - this.options = Object.assign( - { - name: entrypoint => `runtime~${entrypoint.name}` - }, - options - ); - } +const WebpackError = __webpack_require__(97391); +const SizeFormatHelpers = __webpack_require__(12496); - apply(compiler) { - compiler.hooks.thisCompilation.tap("RuntimeChunkPlugin", compilation => { - compilation.hooks.optimizeChunksAdvanced.tap("RuntimeChunkPlugin", () => { - for (const entrypoint of compilation.entrypoints.values()) { - const chunk = entrypoint.getRuntimeChunk(); - let name = this.options.name; - if (typeof name === "function") { - name = name(entrypoint); - } - if ( - chunk.getNumberOfModules() > 0 || - !chunk.preventIntegration || - chunk.name !== name - ) { - const newChunk = compilation.addChunk(name); - newChunk.preventIntegration = true; - entrypoint.unshiftChunk(newChunk); - newChunk.addGroup(entrypoint); - entrypoint.setRuntimeChunk(newChunk); - } - } - }); - }); +module.exports = class AssetsOverSizeLimitWarning extends WebpackError { + constructor(assetsOverSizeLimit, assetLimit) { + const assetLists = assetsOverSizeLimit + .map( + asset => + `\n ${asset.name} (${SizeFormatHelpers.formatSize(asset.size)})` + ) + .join(""); + + super(`asset size limit: The following asset(s) exceed the recommended size limit (${SizeFormatHelpers.formatSize( + assetLimit + )}). +This can impact web performance. +Assets: ${assetLists}`); + + this.name = "AssetsOverSizeLimitWarning"; + this.assets = assetsOverSizeLimit; + + Error.captureStackTrace(this, this.constructor); } }; /***/ }), -/***/ 83654: +/***/ 41336: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra + Author Sean Larkin @thelarkinn */ -const mm = __webpack_require__(53024); -const HarmonyExportImportedSpecifierDependency = __webpack_require__(22864); -const HarmonyImportSideEffectDependency = __webpack_require__(79171); -const HarmonyImportSpecifierDependency = __webpack_require__(95966); - -/** @typedef {import("../Module")} Module */ -/** @typedef {import("../Dependency")} Dependency */ +const WebpackError = __webpack_require__(97391); +const SizeFormatHelpers = __webpack_require__(12496); -/** - * @typedef {Object} ExportInModule - * @property {Module} module the module - * @property {string} exportName the name of the export - * @property {boolean} checked if the export is conditional - */ +module.exports = class EntrypointsOverSizeLimitWarning extends WebpackError { + constructor(entrypoints, entrypointLimit) { + const entrypointList = entrypoints + .map( + entrypoint => + `\n ${entrypoint.name} (${SizeFormatHelpers.formatSize( + entrypoint.size + )})\n${entrypoint.files.map(asset => ` ${asset}`).join("\n")}` + ) + .join(""); + super(`entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (${SizeFormatHelpers.formatSize( + entrypointLimit + )}). This can impact web performance. +Entrypoints:${entrypointList}\n`); -/** - * @typedef {Object} ReexportInfo - * @property {Map} static - * @property {Map>} dynamic - */ + this.name = "EntrypointsOverSizeLimitWarning"; + this.entrypoints = entrypoints; -/** - * @param {ReexportInfo} info info object - * @param {string} exportName name of export - * @returns {ExportInModule | undefined} static export - */ -const getMappingFromInfo = (info, exportName) => { - const staticMappings = info.static.get(exportName); - if (staticMappings !== undefined) { - if (staticMappings.length === 1) return staticMappings[0]; - return undefined; - } - const dynamicMappings = Array.from(info.dynamic).filter( - ([_, ignored]) => !ignored.has(exportName) - ); - if (dynamicMappings.length === 1) { - return { - module: dynamicMappings[0][0], - exportName, - checked: true - }; + Error.captureStackTrace(this, this.constructor); } - return undefined; }; -/** - * @param {ReexportInfo} info info object - * @param {string} exportName name of export of source module - * @param {Module} module the target module - * @param {string} innerExportName name of export of target module - * @param {boolean} checked true, if existence of target module is checked - */ -const addStaticReexport = ( - info, - exportName, - module, - innerExportName, - checked -) => { - let mappings = info.static.get(exportName); - if (mappings !== undefined) { - for (const mapping of mappings) { - if (mapping.module === module && mapping.exportName === innerExportName) { - mapping.checked = mapping.checked && checked; - return; - } - } - } else { - mappings = []; - info.static.set(exportName, mappings); + +/***/ }), + +/***/ 53006: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Sean Larkin @thelarkinn +*/ + + +const WebpackError = __webpack_require__(97391); + +module.exports = class NoAsyncChunksWarning extends WebpackError { + constructor() { + super( + "webpack performance recommendations: \n" + + "You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.\n" + + "For more info visit https://webpack.js.org/guides/code-splitting/" + ); + + this.name = "NoAsyncChunksWarning"; + + Error.captureStackTrace(this, this.constructor); } - mappings.push({ - module, - exportName: innerExportName, - checked - }); }; -/** - * @param {ReexportInfo} info info object - * @param {Module} module the reexport module - * @param {Set} ignored ignore list - * @returns {void} - */ -const addDynamicReexport = (info, module, ignored) => { - const existingList = info.dynamic.get(module); - if (existingList !== undefined) { - for (const key of existingList) { - if (!ignored.has(key)) existingList.delete(key); - } - } else { - info.dynamic.set(module, new Set(ignored)); + +/***/ }), + +/***/ 68310: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Sean Larkin @thelarkinn +*/ + +const EntrypointsOverSizeLimitWarning = __webpack_require__(41336); +const AssetsOverSizeLimitWarning = __webpack_require__(89339); +const NoAsyncChunksWarning = __webpack_require__(53006); + +/** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Entrypoint")} Entrypoint */ + +module.exports = class SizeLimitsPlugin { + constructor(options) { + this.hints = options.hints; + this.maxAssetSize = options.maxAssetSize; + this.maxEntrypointSize = options.maxEntrypointSize; + this.assetFilter = options.assetFilter; } -}; -class SideEffectsFlagPlugin { + /** + * @param {Compiler} compiler webpack compiler + * @returns {void} + */ apply(compiler) { - compiler.hooks.normalModuleFactory.tap("SideEffectsFlagPlugin", nmf => { - nmf.hooks.module.tap("SideEffectsFlagPlugin", (module, data) => { - const resolveData = data.resourceResolveData; - if ( - resolveData && - resolveData.descriptionFileData && - resolveData.relativePath - ) { - const sideEffects = resolveData.descriptionFileData.sideEffects; - const hasSideEffects = SideEffectsFlagPlugin.moduleHasSideEffects( - resolveData.relativePath, - sideEffects - ); - if (!hasSideEffects) { - module.factoryMeta.sideEffectFree = true; + const entrypointSizeLimit = this.maxEntrypointSize; + const assetSizeLimit = this.maxAssetSize; + const hints = this.hints; + const assetFilter = + this.assetFilter || ((name, source, info) => !info.development); + + compiler.hooks.afterEmit.tap("SizeLimitsPlugin", compilation => { + const warnings = []; + + /** + * @param {Entrypoint} entrypoint an entrypoint + * @returns {number} the size of the entrypoint + */ + const getEntrypointSize = entrypoint => + entrypoint.getFiles().reduce((currentSize, file) => { + const asset = compilation.getAsset(file); + if ( + asset && + assetFilter(asset.name, asset.source, asset.info) && + asset.source + ) { + return currentSize + (asset.info.size || asset.source.size()); } + + return currentSize; + }, 0); + + const assetsOverSizeLimit = []; + for (const { name, source, info } of compilation.getAssets()) { + if (!assetFilter(name, source, info) || !source) { + continue; } - return module; - }); - nmf.hooks.module.tap("SideEffectsFlagPlugin", (module, data) => { - if (data.settings.sideEffects === false) { - module.factoryMeta.sideEffectFree = true; - } else if (data.settings.sideEffects === true) { - module.factoryMeta.sideEffectFree = false; + const size = info.size || source.size(); + if (size > assetSizeLimit) { + assetsOverSizeLimit.push({ + name, + size + }); + /** @type {any} */ (source).isOverSizeLimit = true; } - }); - }); - compiler.hooks.compilation.tap("SideEffectsFlagPlugin", compilation => { - compilation.hooks.optimizeDependencies.tap( - "SideEffectsFlagPlugin", - modules => { - /** @type {Map} */ - const reexportMaps = new Map(); + } - // Capture reexports of sideEffectFree modules - for (const module of modules) { - /** @type {Dependency[]} */ - const removeDependencies = []; - for (const dep of module.dependencies) { - if (dep instanceof HarmonyImportSideEffectDependency) { - if (dep.module && dep.module.factoryMeta.sideEffectFree) { - removeDependencies.push(dep); - } - } else if ( - dep instanceof HarmonyExportImportedSpecifierDependency - ) { - if (module.factoryMeta.sideEffectFree) { - const mode = dep.getMode(true); - if ( - mode.type === "safe-reexport" || - mode.type === "checked-reexport" || - mode.type === "dynamic-reexport" || - mode.type === "reexport-non-harmony-default" || - mode.type === "reexport-non-harmony-default-strict" || - mode.type === "reexport-named-default" - ) { - let info = reexportMaps.get(module); - if (!info) { - reexportMaps.set( - module, - (info = { - static: new Map(), - dynamic: new Map() - }) - ); - } - const targetModule = dep._module; - switch (mode.type) { - case "safe-reexport": - for (const [key, id] of mode.map) { - if (id) { - addStaticReexport( - info, - key, - targetModule, - id, - false - ); - } - } - break; - case "checked-reexport": - for (const [key, id] of mode.map) { - if (id) { - addStaticReexport( - info, - key, - targetModule, - id, - true - ); - } - } - break; - case "dynamic-reexport": - addDynamicReexport(info, targetModule, mode.ignored); - break; - case "reexport-non-harmony-default": - case "reexport-non-harmony-default-strict": - case "reexport-named-default": - addStaticReexport( - info, - mode.name, - targetModule, - "default", - false - ); - break; - } - } - } - } - } - } - - // Flatten reexports - for (const info of reexportMaps.values()) { - const dynamicReexports = info.dynamic; - info.dynamic = new Map(); - for (const reexport of dynamicReexports) { - let [targetModule, ignored] = reexport; - for (;;) { - const innerInfo = reexportMaps.get(targetModule); - if (!innerInfo) break; - - for (const [key, reexports] of innerInfo.static) { - if (ignored.has(key)) continue; - for (const { module, exportName, checked } of reexports) { - addStaticReexport(info, key, module, exportName, checked); - } - } + const fileFilter = name => { + const asset = compilation.getAsset(name); + return asset && assetFilter(asset.name, asset.source, asset.info); + }; - // Follow dynamic reexport if there is only one - if (innerInfo.dynamic.size !== 1) { - // When there are more then one, we don't know which one - break; - } + const entrypointsOverLimit = []; + for (const [name, entry] of compilation.entrypoints) { + const size = getEntrypointSize(entry); - ignored = new Set(ignored); - for (const [innerModule, innerIgnored] of innerInfo.dynamic) { - for (const key of innerIgnored) { - if (ignored.has(key)) continue; - // This reexports ends here - addStaticReexport(info, key, targetModule, key, true); - ignored.add(key); - } - targetModule = innerModule; - } - } + if (size > entrypointSizeLimit) { + entrypointsOverLimit.push({ + name: name, + size: size, + files: entry.getFiles().filter(fileFilter) + }); + /** @type {any} */ (entry).isOverSizeLimit = true; + } + } - // Update reexport as all other cases has been handled - addDynamicReexport(info, targetModule, ignored); - } - } + if (hints) { + // 1. Individual Chunk: Size < 250kb + // 2. Collective Initial Chunks [entrypoint] (Each Set?): Size < 250kb + // 3. No Async Chunks + // if !1, then 2, if !2 return + if (assetsOverSizeLimit.length > 0) { + warnings.push( + new AssetsOverSizeLimitWarning(assetsOverSizeLimit, assetSizeLimit) + ); + } + if (entrypointsOverLimit.length > 0) { + warnings.push( + new EntrypointsOverSizeLimitWarning( + entrypointsOverLimit, + entrypointSizeLimit + ) + ); + } - for (const info of reexportMaps.values()) { - const staticReexports = info.static; - info.static = new Map(); - for (const [key, reexports] of staticReexports) { - for (let mapping of reexports) { - for (;;) { - const innerInfo = reexportMaps.get(mapping.module); - if (!innerInfo) break; + if (warnings.length > 0) { + const hasAsyncChunks = + compilation.chunks.filter(chunk => !chunk.canBeInitial()).length > + 0; - const newMapping = getMappingFromInfo( - innerInfo, - mapping.exportName - ); - if (!newMapping) break; - mapping = newMapping; - } - addStaticReexport( - info, - key, - mapping.module, - mapping.exportName, - mapping.checked - ); - } - } + if (!hasAsyncChunks) { + warnings.push(new NoAsyncChunksWarning()); } - // Update imports along the reexports from sideEffectFree modules - for (const pair of reexportMaps) { - const module = pair[0]; - const info = pair[1]; - let newReasons = undefined; - for (let i = 0; i < module.reasons.length; i++) { - const reason = module.reasons[i]; - const dep = reason.dependency; - if ( - (dep instanceof HarmonyExportImportedSpecifierDependency || - (dep instanceof HarmonyImportSpecifierDependency && - !dep.namespaceObjectAsContext)) && - dep._id - ) { - const mapping = getMappingFromInfo(info, dep._id); - if (mapping) { - dep.redirectedModule = mapping.module; - dep.redirectedId = mapping.exportName; - mapping.module.addReason( - reason.module, - dep, - reason.explanation - ? reason.explanation + - " (skipped side-effect-free modules)" - : "(skipped side-effect-free modules)" - ); - // removing the currect reason, by not adding it to the newReasons array - // lazily create the newReasons array - if (newReasons === undefined) { - newReasons = i === 0 ? [] : module.reasons.slice(0, i); - } - continue; - } - } - if (newReasons !== undefined) newReasons.push(reason); - } - if (newReasons !== undefined) { - module.reasons = newReasons; - } + if (hints === "error") { + compilation.errors.push(...warnings); + } else { + compilation.warnings.push(...warnings); } } - ); + } }); } - - static moduleHasSideEffects(moduleName, flagValue) { - switch (typeof flagValue) { - case "undefined": - return true; - case "boolean": - return flagValue; - case "string": - if (process.platform === "win32") { - flagValue = flagValue.replace(/\\/g, "/"); - } - return mm.isMatch(moduleName, flagValue, { - matchBase: true - }); - case "object": - return flagValue.some(glob => - SideEffectsFlagPlugin.moduleHasSideEffects(moduleName, glob) - ); - } - } -} -module.exports = SideEffectsFlagPlugin; +}; /***/ }), -/***/ 60474: +/***/ 52315: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -91690,1211 +89157,4359 @@ module.exports = SideEffectsFlagPlugin; */ -const crypto = __webpack_require__(76417); -const SortableSet = __webpack_require__(50071); -const GraphHelpers = __webpack_require__(32973); -const { isSubset } = __webpack_require__(54262); -const deterministicGrouping = __webpack_require__(30815); -const MinMaxSizeWarning = __webpack_require__(25472); -const contextify = __webpack_require__(94658).contextify; - -/** @typedef {import("../Compiler")} Compiler */ -/** @typedef {import("../Chunk")} Chunk */ -/** @typedef {import("../Module")} Module */ -/** @typedef {import("../util/deterministicGrouping").Options} DeterministicGroupingOptionsForModule */ -/** @typedef {import("../util/deterministicGrouping").GroupedItems} DeterministicGroupingGroupedItemsForModule */ - -const deterministicGroupingForModules = /** @type {function(DeterministicGroupingOptionsForModule): DeterministicGroupingGroupedItemsForModule[]} */ (deterministicGrouping); - -const hashFilename = name => { - return crypto - .createHash("md4") - .update(name) - .digest("hex") - .slice(0, 8); -}; - -const sortByIdentifier = (a, b) => { - if (a.identifier() > b.identifier()) return 1; - if (a.identifier() < b.identifier()) return -1; - return 0; -}; - -const getRequests = chunk => { - let requests = 0; - for (const chunkGroup of chunk.groupsIterable) { - requests = Math.max(requests, chunkGroup.chunks.length); - } - return requests; -}; -const getModulesSize = modules => { - let sum = 0; - for (const m of modules) { - sum += m.size(); - } - return sum; -}; +const SortableSet = __webpack_require__(50071); /** * @template T - * @param {Set} a set - * @param {Set} b other set - * @returns {boolean} true if at least one item of a is in b + * @template K + * Multi layer bucket sorted set + * Supports adding non-existing items (DO NOT ADD ITEM TWICE) + * Supports removing exiting items (DO NOT REMOVE ITEM NOT IN SET) + * Supports popping the first items according to defined order + * Supports iterating all items without order + * Supports updating an item in an efficient way + * Supports size property, which is the number of items + * Items are lazy partially sorted when needed */ -const isOverlap = (a, b) => { - for (const item of a) { - if (b.has(item)) return true; - } - return false; -}; - -const compareEntries = (a, b) => { - // 1. by priority - const diffPriority = a.cacheGroup.priority - b.cacheGroup.priority; - if (diffPriority) return diffPriority; - // 2. by number of chunks - const diffCount = a.chunks.size - b.chunks.size; - if (diffCount) return diffCount; - // 3. by size reduction - const aSizeReduce = a.size * (a.chunks.size - 1); - const bSizeReduce = b.size * (b.chunks.size - 1); - const diffSizeReduce = aSizeReduce - bSizeReduce; - if (diffSizeReduce) return diffSizeReduce; - // 4. by cache group index - const indexDiff = a.cacheGroupIndex - b.cacheGroupIndex; - if (indexDiff) return indexDiff; - // 5. by number of modules (to be able to compare by identifier) - const modulesA = a.modules; - const modulesB = b.modules; - const diff = modulesA.size - modulesB.size; - if (diff) return diff; - // 6. by module identifiers - modulesA.sort(); - modulesB.sort(); - const aI = modulesA[Symbol.iterator](); - const bI = modulesB[Symbol.iterator](); - // eslint-disable-next-line no-constant-condition - while (true) { - const aItem = aI.next(); - const bItem = bI.next(); - if (aItem.done) return 0; - const aModuleIdentifier = aItem.value.identifier(); - const bModuleIdentifier = bItem.value.identifier(); - if (aModuleIdentifier > bModuleIdentifier) return -1; - if (aModuleIdentifier < bModuleIdentifier) return 1; - } -}; - -const compareNumbers = (a, b) => a - b; - -const INITIAL_CHUNK_FILTER = chunk => chunk.canBeInitial(); -const ASYNC_CHUNK_FILTER = chunk => !chunk.canBeInitial(); -const ALL_CHUNK_FILTER = chunk => true; - -module.exports = class SplitChunksPlugin { - constructor(options) { - this.options = SplitChunksPlugin.normalizeOptions(options); +class LazyBucketSortedSet { + /** + * @param {function(T): K} getKey function to get key from item + * @param {function(K, K): number} comparator comparator to sort keys + * @param {...((function(T): any) | (function(any, any): number))} args more pairs of getKey and comparator plus optional final comparator for the last layer + */ + constructor(getKey, comparator, ...args) { + this._getKey = getKey; + this._innerArgs = args; + this._leaf = args.length <= 1; + this._keys = new SortableSet(undefined, comparator); + /** @type {Map | SortableSet>} */ + this._map = new Map(); + this._unsortedItems = new Set(); + this.size = 0; } - static normalizeOptions(options = {}) { - return { - chunksFilter: SplitChunksPlugin.normalizeChunksFilter( - options.chunks || "all" - ), - minSize: options.minSize || 0, - enforceSizeThreshold: options.enforceSizeThreshold || 0, - maxSize: options.maxSize || 0, - minChunks: options.minChunks || 1, - maxAsyncRequests: options.maxAsyncRequests || 1, - maxInitialRequests: options.maxInitialRequests || 1, - hidePathInfo: options.hidePathInfo || false, - filename: options.filename || undefined, - getCacheGroups: SplitChunksPlugin.normalizeCacheGroups({ - cacheGroups: options.cacheGroups, - name: options.name, - automaticNameDelimiter: options.automaticNameDelimiter, - automaticNameMaxLength: options.automaticNameMaxLength - }), - automaticNameDelimiter: options.automaticNameDelimiter, - automaticNameMaxLength: options.automaticNameMaxLength || 109, - fallbackCacheGroup: SplitChunksPlugin.normalizeFallbackCacheGroup( - options.fallbackCacheGroup || {}, - options - ) - }; + /** + * @param {T} item an item + * @returns {void} + */ + add(item) { + this.size++; + this._unsortedItems.add(item); } - static normalizeName({ - name, - automaticNameDelimiter, - automaticNamePrefix, - automaticNameMaxLength - }) { - if (name === true) { - /** @type {WeakMap>} */ - const cache = new WeakMap(); - const fn = (module, chunks, cacheGroup) => { - let cacheEntry = cache.get(chunks); - if (cacheEntry === undefined) { - cacheEntry = {}; - cache.set(chunks, cacheEntry); - } else if (cacheGroup in cacheEntry) { - return cacheEntry[cacheGroup]; - } - const names = chunks.map(c => c.name); - if (!names.every(Boolean)) { - cacheEntry[cacheGroup] = undefined; - return; - } - names.sort(); - const prefix = - typeof automaticNamePrefix === "string" - ? automaticNamePrefix - : cacheGroup; - const namePrefix = prefix ? prefix + automaticNameDelimiter : ""; - let name = namePrefix + names.join(automaticNameDelimiter); - // Filenames and paths can't be too long otherwise an - // ENAMETOOLONG error is raised. If the generated name if too - // long, it is truncated and a hash is appended. The limit has - // been set to 109 to prevent `[name].[chunkhash].[ext]` from - // generating a 256+ character string. - if (name.length > automaticNameMaxLength) { - const hashedFilename = hashFilename(name); - const sliceLength = - automaticNameMaxLength - - (automaticNameDelimiter.length + hashedFilename.length); - name = - name.slice(0, sliceLength) + - automaticNameDelimiter + - hashedFilename; - } - cacheEntry[cacheGroup] = name; - return name; - }; - return fn; - } - if (typeof name === "string") { - const fn = () => { - return name; - }; - return fn; + /** + * @param {K} key key of item + * @param {T} item the item + * @returns {void} + */ + _addInternal(key, item) { + let entry = this._map.get(key); + if (entry === undefined) { + entry = this._leaf + ? new SortableSet(undefined, this._innerArgs[0]) + : new /** @type {any} */ (LazyBucketSortedSet)(...this._innerArgs); + this._keys.add(key); + this._map.set(key, entry); } - if (typeof name === "function") return name; + entry.add(item); } - static normalizeChunksFilter(chunks) { - if (chunks === "initial") { - return INITIAL_CHUNK_FILTER; - } - if (chunks === "async") { - return ASYNC_CHUNK_FILTER; + /** + * @param {T} item an item + * @returns {void} + */ + delete(item) { + this.size--; + if (this._unsortedItems.has(item)) { + this._unsortedItems.delete(item); + return; } - if (chunks === "all") { - return ALL_CHUNK_FILTER; + const key = this._getKey(item); + const entry = this._map.get(key); + entry.delete(item); + if (entry.size === 0) { + this._deleteKey(key); } - if (typeof chunks === "function") return chunks; } - static normalizeFallbackCacheGroup( - { - minSize = undefined, - maxSize = undefined, - automaticNameDelimiter = undefined - }, - { - minSize: defaultMinSize = undefined, - maxSize: defaultMaxSize = undefined, - automaticNameDelimiter: defaultAutomaticNameDelimiter = undefined - } - ) { - return { - minSize: typeof minSize === "number" ? minSize : defaultMinSize || 0, - maxSize: typeof maxSize === "number" ? maxSize : defaultMaxSize || 0, - automaticNameDelimiter: - automaticNameDelimiter || defaultAutomaticNameDelimiter || "~" - }; + /** + * @param {K} key key to be removed + * @returns {void} + */ + _deleteKey(key) { + this._keys.delete(key); + this._map.delete(key); } - static normalizeCacheGroups({ - cacheGroups, - name, - automaticNameDelimiter, - automaticNameMaxLength - }) { - if (typeof cacheGroups === "function") { - // TODO webpack 5 remove this - if (cacheGroups.length !== 1) { - return module => cacheGroups(module, module.getChunks()); + /** + * @returns {T | undefined} an item + */ + popFirst() { + if (this.size === 0) return undefined; + this.size--; + if (this._unsortedItems.size > 0) { + for (const item of this._unsortedItems) { + const key = this._getKey(item); + this._addInternal(key, item); } - return cacheGroups; + this._unsortedItems.clear(); } - if (cacheGroups && typeof cacheGroups === "object") { - const fn = module => { - let results; - for (const key of Object.keys(cacheGroups)) { - let option = cacheGroups[key]; - if (option === false) continue; - if (option instanceof RegExp || typeof option === "string") { - option = { - test: option - }; + this._keys.sort(); + const key = this._keys.values().next().value; + const entry = this._map.get(key); + if (this._leaf) { + const leafEntry = /** @type {SortableSet} */ (entry); + leafEntry.sort(); + const item = leafEntry.values().next().value; + leafEntry.delete(item); + if (leafEntry.size === 0) { + this._deleteKey(key); + } + return item; + } else { + const nodeEntry = /** @type {LazyBucketSortedSet} */ (entry); + const item = nodeEntry.popFirst(); + if (nodeEntry.size === 0) { + this._deleteKey(key); + } + return item; + } + } + + /** + * @param {T} item to be updated item + * @returns {function(true=): void} finish update + */ + startUpdate(item) { + if (this._unsortedItems.has(item)) { + return remove => { + if (remove) { + this._unsortedItems.delete(item); + this.size--; + return; + } + }; + } + const key = this._getKey(item); + if (this._leaf) { + const oldEntry = /** @type {SortableSet} */ (this._map.get(key)); + return remove => { + if (remove) { + this.size--; + oldEntry.delete(item); + if (oldEntry.size === 0) { + this._deleteKey(key); } - if (typeof option === "function") { - let result = option(module); - if (result) { - if (results === undefined) results = []; - for (const r of Array.isArray(result) ? result : [result]) { - const result = Object.assign({ key }, r); - if (result.name) result.getName = () => result.name; - if (result.chunks) { - result.chunksFilter = SplitChunksPlugin.normalizeChunksFilter( - result.chunks - ); - } - results.push(result); - } - } - } else if (SplitChunksPlugin.checkTest(option.test, module)) { - if (results === undefined) results = []; - results.push({ - key: key, - priority: option.priority, - getName: - SplitChunksPlugin.normalizeName({ - name: option.name || name, - automaticNameDelimiter: - typeof option.automaticNameDelimiter === "string" - ? option.automaticNameDelimiter - : automaticNameDelimiter, - automaticNamePrefix: option.automaticNamePrefix, - automaticNameMaxLength: - option.automaticNameMaxLength || automaticNameMaxLength - }) || (() => {}), - chunksFilter: SplitChunksPlugin.normalizeChunksFilter( - option.chunks - ), - enforce: option.enforce, - minSize: option.minSize, - enforceSizeThreshold: option.enforceSizeThreshold, - maxSize: option.maxSize, - minChunks: option.minChunks, - maxAsyncRequests: option.maxAsyncRequests, - maxInitialRequests: option.maxInitialRequests, - filename: option.filename, - reuseExistingChunk: option.reuseExistingChunk - }); + return; + } + const newKey = this._getKey(item); + if (key === newKey) { + // This flags the sortable set as unordered + oldEntry.add(item); + } else { + oldEntry.delete(item); + if (oldEntry.size === 0) { + this._deleteKey(key); } + this._addInternal(newKey, item); + } + }; + } else { + const oldEntry = /** @type {LazyBucketSortedSet} */ (this._map.get( + key + )); + const finishUpdate = oldEntry.startUpdate(item); + return remove => { + if (remove) { + this.size--; + finishUpdate(true); + if (oldEntry.size === 0) { + this._deleteKey(key); + } + return; + } + const newKey = this._getKey(item); + if (key === newKey) { + finishUpdate(); + } else { + finishUpdate(true); + if (oldEntry.size === 0) { + this._deleteKey(key); + } + this._addInternal(newKey, item); } - return results; }; - return fn; } - const fn = () => {}; - return fn; } - static checkTest(test, module) { - if (test === undefined) return true; - if (typeof test === "function") { - if (test.length !== 1) { - return test(module, module.getChunks()); - } - return test(module); - } - if (typeof test === "boolean") return test; - if (typeof test === "string") { - if ( - module.nameForCondition && - module.nameForCondition().startsWith(test) - ) { - return true; - } - for (const chunk of module.chunksIterable) { - if (chunk.name && chunk.name.startsWith(test)) { - return true; - } + /** + * @param {Iterator[]} iterators list of iterators to append to + * @returns {void} + */ + _appendIterators(iterators) { + if (this._unsortedItems.size > 0) + iterators.push(this._unsortedItems[Symbol.iterator]()); + for (const key of this._keys) { + const entry = this._map.get(key); + if (this._leaf) { + const leafEntry = /** @type {SortableSet} */ (entry); + const iterator = leafEntry[Symbol.iterator](); + iterators.push(iterator); + } else { + const nodeEntry = /** @type {LazyBucketSortedSet} */ (entry); + nodeEntry._appendIterators(iterators); } - return false; } - if (test instanceof RegExp) { - if (module.nameForCondition && test.test(module.nameForCondition())) { - return true; - } - for (const chunk of module.chunksIterable) { - if (chunk.name && test.test(chunk.name)) { - return true; + } + + /** + * @returns {Iterator} the iterator + */ + [Symbol.iterator]() { + const iterators = []; + this._appendIterators(iterators); + iterators.reverse(); + let currentIterator = iterators.pop(); + return { + next: () => { + const res = currentIterator.next(); + if (res.done) { + if (iterators.length === 0) return res; + currentIterator = iterators.pop(); + return currentIterator.next(); } + return res; } - return false; - } - return false; + }; } +} + +module.exports = LazyBucketSortedSet; + + +/***/ }), + +/***/ 38637: +/***/ (function(module) { + +"use strict"; + +/** + * @template T + */ +class Queue { /** - * @param {Compiler} compiler webpack compiler - * @returns {void} + * @param {Iterable=} items The initial elements. */ - apply(compiler) { - compiler.hooks.thisCompilation.tap("SplitChunksPlugin", compilation => { - let alreadyOptimized = false; - compilation.hooks.unseal.tap("SplitChunksPlugin", () => { - alreadyOptimized = false; - }); - compilation.hooks.optimizeChunksAdvanced.tap( - "SplitChunksPlugin", - chunks => { - if (alreadyOptimized) return; - alreadyOptimized = true; - // Give each selected chunk an index (to create strings from chunks) - const indexMap = new Map(); - let index = 1; - for (const chunk of chunks) { - indexMap.set(chunk, index++); - } - const getKey = chunks => { - return Array.from(chunks, c => indexMap.get(c)) - .sort(compareNumbers) - .join(); - }; - /** @type {Map>} */ - const chunkSetsInGraph = new Map(); - for (const module of compilation.modules) { - const chunksKey = getKey(module.chunksIterable); - if (!chunkSetsInGraph.has(chunksKey)) { - chunkSetsInGraph.set(chunksKey, new Set(module.chunksIterable)); - } - } + constructor(items) { + /** @private @type {Set} */ + this.set = new Set(items); + /** @private @type {Iterator} */ + this.iterator = this.set[Symbol.iterator](); + } - // group these set of chunks by count - // to allow to check less sets via isSubset - // (only smaller sets can be subset) - /** @type {Map>>} */ - const chunkSetsByCount = new Map(); - for (const chunksSet of chunkSetsInGraph.values()) { - const count = chunksSet.size; - let array = chunkSetsByCount.get(count); - if (array === undefined) { - array = []; - chunkSetsByCount.set(count, array); - } - array.push(chunksSet); - } + /** + * Returns the number of elements in this queue. + * @returns {number} The number of elements in this queue. + */ + get length() { + return this.set.size; + } - // Create a list of possible combinations - const combinationsCache = new Map(); // Map[]> + /** + * Appends the specified element to this queue. + * @param {T} item The element to add. + * @returns {void} + */ + enqueue(item) { + this.set.add(item); + } - const getCombinations = key => { - const chunksSet = chunkSetsInGraph.get(key); - var array = [chunksSet]; - if (chunksSet.size > 1) { - for (const [count, setArray] of chunkSetsByCount) { - // "equal" is not needed because they would have been merge in the first step - if (count < chunksSet.size) { - for (const set of setArray) { - if (isSubset(chunksSet, set)) { - array.push(set); - } - } - } - } - } - return array; - }; + /** + * Retrieves and removes the head of this queue. + * @returns {T | undefined} The head of the queue of `undefined` if this queue is empty. + */ + dequeue() { + const result = this.iterator.next(); + if (result.done) return undefined; + this.set.delete(result.value); + return result.value; + } +} - /** - * @typedef {Object} SelectedChunksResult - * @property {Chunk[]} chunks the list of chunks - * @property {string} key a key of the list - */ +module.exports = Queue; - /** - * @typedef {function(Chunk): boolean} ChunkFilterFunction - */ - /** @type {WeakMap, WeakMap>} */ - const selectedChunksCacheByChunksSet = new WeakMap(); +/***/ }), - /** - * get list and key by applying the filter function to the list - * It is cached for performance reasons - * @param {Set} chunks list of chunks - * @param {ChunkFilterFunction} chunkFilter filter function for chunks - * @returns {SelectedChunksResult} list and key - */ - const getSelectedChunks = (chunks, chunkFilter) => { - let entry = selectedChunksCacheByChunksSet.get(chunks); - if (entry === undefined) { - entry = new WeakMap(); - selectedChunksCacheByChunksSet.set(chunks, entry); - } - /** @type {SelectedChunksResult} */ - let entry2 = entry.get(chunkFilter); - if (entry2 === undefined) { - /** @type {Chunk[]} */ - const selectedChunks = []; - for (const chunk of chunks) { - if (chunkFilter(chunk)) selectedChunks.push(chunk); - } - entry2 = { - chunks: selectedChunks, - key: getKey(selectedChunks) - }; - entry.set(chunkFilter, entry2); - } - return entry2; - }; +/***/ 33349: +/***/ (function(module) { - /** - * @typedef {Object} ChunksInfoItem - * @property {SortableSet} modules - * @property {TODO} cacheGroup - * @property {number} cacheGroupIndex - * @property {string} name - * @property {number} size - * @property {Set} chunks - * @property {Set} reuseableChunks - * @property {Set} chunksKeys - */ +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // Map a list of chunks to a list of modules - // For the key the chunk "index" is used, the value is a SortableSet of modules - /** @type {Map} */ - const chunksInfoMap = new Map(); - /** - * @param {TODO} cacheGroup the current cache group - * @param {number} cacheGroupIndex the index of the cache group of ordering - * @param {Chunk[]} selectedChunks chunks selected for this module - * @param {string} selectedChunksKey a key of selectedChunks - * @param {Module} module the current module - * @returns {void} - */ - const addModuleToChunksInfoMap = ( - cacheGroup, - cacheGroupIndex, - selectedChunks, - selectedChunksKey, - module - ) => { - // Break if minimum number of chunks is not reached - if (selectedChunks.length < cacheGroup.minChunks) return; - // Determine name for split chunk - const name = cacheGroup.getName( - module, - selectedChunks, - cacheGroup.key - ); - // Create key for maps - // When it has a name we use the name as key - // Elsewise we create the key from chunks and cache group key - // This automatically merges equal names - const key = - cacheGroup.key + - (name ? ` name:${name}` : ` chunks:${selectedChunksKey}`); - // Add module to maps - let info = chunksInfoMap.get(key); - if (info === undefined) { - chunksInfoMap.set( - key, - (info = { - modules: new SortableSet(undefined, sortByIdentifier), - cacheGroup, - cacheGroupIndex, - name, - size: 0, - chunks: new Set(), - reuseableChunks: new Set(), - chunksKeys: new Set() - }) - ); - } - info.modules.add(module); - info.size += module.size(); - if (!info.chunksKeys.has(selectedChunksKey)) { - info.chunksKeys.add(selectedChunksKey); - for (const chunk of selectedChunks) { - info.chunks.add(chunk); - } - } - }; +class Semaphore { + /** + * Creates an instance of Semaphore. + * + * @param {number} available the amount available number of "tasks" + * in the Semaphore + */ + constructor(available) { + this.available = available; + /** @type {(function(): void)[]} */ + this.waiters = []; + /** @private */ + this._continue = this._continue.bind(this); + } - // Walk through all modules - for (const module of compilation.modules) { - // Get cache group - let cacheGroups = this.options.getCacheGroups(module); - if (!Array.isArray(cacheGroups) || cacheGroups.length === 0) { - continue; - } + /** + * @param {function(): void} callback function block to capture and run + * @returns {void} + */ + acquire(callback) { + if (this.available > 0) { + this.available--; + callback(); + } else { + this.waiters.push(callback); + } + } - // Prepare some values - const chunksKey = getKey(module.chunksIterable); - let combs = combinationsCache.get(chunksKey); - if (combs === undefined) { - combs = getCombinations(chunksKey); - combinationsCache.set(chunksKey, combs); - } + release() { + this.available++; + if (this.waiters.length > 0) { + process.nextTick(this._continue); + } + } - let cacheGroupIndex = 0; - for (const cacheGroupSource of cacheGroups) { - const minSize = - cacheGroupSource.minSize !== undefined - ? cacheGroupSource.minSize - : cacheGroupSource.enforce - ? 0 - : this.options.minSize; - const enforceSizeThreshold = - cacheGroupSource.enforceSizeThreshold !== undefined - ? cacheGroupSource.enforceSizeThreshold - : cacheGroupSource.enforce - ? 0 - : this.options.enforceSizeThreshold; - const cacheGroup = { - key: cacheGroupSource.key, - priority: cacheGroupSource.priority || 0, - chunksFilter: - cacheGroupSource.chunksFilter || this.options.chunksFilter, - minSize, - minSizeForMaxSize: - cacheGroupSource.minSize !== undefined - ? cacheGroupSource.minSize - : this.options.minSize, - enforceSizeThreshold, - maxSize: - cacheGroupSource.maxSize !== undefined - ? cacheGroupSource.maxSize - : cacheGroupSource.enforce - ? 0 - : this.options.maxSize, - minChunks: - cacheGroupSource.minChunks !== undefined - ? cacheGroupSource.minChunks - : cacheGroupSource.enforce - ? 1 - : this.options.minChunks, - maxAsyncRequests: - cacheGroupSource.maxAsyncRequests !== undefined - ? cacheGroupSource.maxAsyncRequests - : cacheGroupSource.enforce - ? Infinity - : this.options.maxAsyncRequests, - maxInitialRequests: - cacheGroupSource.maxInitialRequests !== undefined - ? cacheGroupSource.maxInitialRequests - : cacheGroupSource.enforce - ? Infinity - : this.options.maxInitialRequests, - getName: - cacheGroupSource.getName !== undefined - ? cacheGroupSource.getName - : this.options.getName, - filename: - cacheGroupSource.filename !== undefined - ? cacheGroupSource.filename - : this.options.filename, - automaticNameDelimiter: - cacheGroupSource.automaticNameDelimiter !== undefined - ? cacheGroupSource.automaticNameDelimiter - : this.options.automaticNameDelimiter, - reuseExistingChunk: cacheGroupSource.reuseExistingChunk, - _validateSize: minSize > 0, - _conditionalEnforce: enforceSizeThreshold > 0 - }; - // For all combination of chunk selection - for (const chunkCombination of combs) { - // Break if minimum number of chunks is not reached - if (chunkCombination.size < cacheGroup.minChunks) continue; - // Select chunks by configuration - const { - chunks: selectedChunks, - key: selectedChunksKey - } = getSelectedChunks( - chunkCombination, - cacheGroup.chunksFilter - ); + _continue() { + if (this.available > 0) { + if (this.waiters.length > 0) { + this.available--; + const callback = this.waiters.pop(); + callback(); + } + } + } +} - addModuleToChunksInfoMap( - cacheGroup, - cacheGroupIndex, - selectedChunks, - selectedChunksKey, - module - ); - } - cacheGroupIndex++; - } - } +module.exports = Semaphore; - // Filter items were size < minSize - for (const pair of chunksInfoMap) { - const info = pair[1]; - if ( - info.cacheGroup._validateSize && - info.size < info.cacheGroup.minSize - ) { - chunksInfoMap.delete(pair[0]); - } - } - /** @type {Map} */ - const maxSizeQueueMap = new Map(); +/***/ }), - while (chunksInfoMap.size > 0) { - // Find best matching entry - let bestEntryKey; - let bestEntry; - for (const pair of chunksInfoMap) { - const key = pair[0]; - const info = pair[1]; - if (bestEntry === undefined) { - bestEntry = info; - bestEntryKey = key; - } else if (compareEntries(bestEntry, info) < 0) { - bestEntry = info; - bestEntryKey = key; - } - } +/***/ 54262: +/***/ (function(__unused_webpack_module, exports) { - const item = bestEntry; - chunksInfoMap.delete(bestEntryKey); +"use strict"; - let chunkName = item.name; - // Variable for the new chunk (lazy created) - /** @type {Chunk} */ - let newChunk; - // When no chunk name, check if we can reuse a chunk instead of creating a new one - let isReused = false; - if (item.cacheGroup.reuseExistingChunk) { - outer: for (const chunk of item.chunks) { - if (chunk.getNumberOfModules() !== item.modules.size) continue; - if (chunk.hasEntryModule()) continue; - for (const module of item.modules) { - if (!chunk.containsModule(module)) continue outer; - } - if (!newChunk || !newChunk.name) { - newChunk = chunk; - } else if ( - chunk.name && - chunk.name.length < newChunk.name.length - ) { - newChunk = chunk; - } else if ( - chunk.name && - chunk.name.length === newChunk.name.length && - chunk.name < newChunk.name - ) { - newChunk = chunk; - } - chunkName = undefined; - isReused = true; - } - } - // Check if maxRequests condition can be fulfilled - const selectedChunks = Array.from(item.chunks).filter(chunk => { - // skip if we address ourself - return ( - (!chunkName || chunk.name !== chunkName) && chunk !== newChunk - ); - }); +/** + * intersect creates Set containing the intersection of elements between all sets + * @param {Set[]} sets an array of sets being checked for shared elements + * @returns {Set} returns a new Set containing the intersecting items + */ +const intersect = sets => { + if (sets.length === 0) return new Set(); + if (sets.length === 1) return new Set(sets[0]); + let minSize = Infinity; + let minIndex = -1; + for (let i = 0; i < sets.length; i++) { + const size = sets[i].size; + if (size < minSize) { + minIndex = i; + minSize = size; + } + } + const current = new Set(sets[minIndex]); + for (let i = 0; i < sets.length; i++) { + if (i === minIndex) continue; + const set = sets[i]; + for (const item of current) { + if (!set.has(item)) { + current.delete(item); + } + } + } + return current; +}; - const enforced = - item.cacheGroup._conditionalEnforce && - item.size >= item.cacheGroup.enforceSizeThreshold; +/** + * Checks if a set is the subset of another set + * @param {Set} bigSet a Set which contains the original elements to compare against + * @param {Set} smallSet the set whos elements might be contained inside of bigSet + * @returns {boolean} returns true if smallSet contains all elements inside of the bigSet + */ +const isSubset = (bigSet, smallSet) => { + if (bigSet.size < smallSet.size) return false; + for (const item of smallSet) { + if (!bigSet.has(item)) return false; + } + return true; +}; - // Skip when no chunk selected - if (selectedChunks.length === 0) continue; +exports.intersect = intersect; +exports.isSubset = isSubset; - const usedChunks = new Set(selectedChunks); - // Check if maxRequests condition can be fulfilled - if ( - !enforced && - (Number.isFinite(item.cacheGroup.maxInitialRequests) || - Number.isFinite(item.cacheGroup.maxAsyncRequests)) - ) { - for (const chunk of usedChunks) { - // respect max requests - const maxRequests = chunk.isOnlyInitial() - ? item.cacheGroup.maxInitialRequests - : chunk.canBeInitial() - ? Math.min( - item.cacheGroup.maxInitialRequests, - item.cacheGroup.maxAsyncRequests - ) - : item.cacheGroup.maxAsyncRequests; - if ( - isFinite(maxRequests) && - getRequests(chunk) >= maxRequests - ) { - usedChunks.delete(chunk); - } - } - } +/***/ }), - outer: for (const chunk of usedChunks) { - for (const module of item.modules) { - if (chunk.containsModule(module)) continue outer; - } - usedChunks.delete(chunk); +/***/ 50071: +/***/ (function(module) { + +"use strict"; + + +/** + * A subset of Set that offers sorting functionality + * @template T item type in set + * @extends {Set} + */ +class SortableSet extends Set { + /** + * Create a new sortable set + * @param {Iterable=} initialIterable The initial iterable value + * @typedef {function(T, T): number} SortFunction + * @param {SortFunction=} defaultSort Default sorting function + */ + constructor(initialIterable, defaultSort) { + super(initialIterable); + /** @private @type {function(T, T): number}} */ + this._sortFn = defaultSort; + /** @private @type {function(T, T): number} | null} */ + this._lastActiveSortFn = null; + /** @private @type {Map | undefined} */ + this._cache = undefined; + /** @private @type {Map | undefined} */ + this._cacheOrderIndependent = undefined; + } + + /** + * @param {T} value value to add to set + * @returns {this} returns itself + */ + add(value) { + this._lastActiveSortFn = null; + this._invalidateCache(); + this._invalidateOrderedCache(); + super.add(value); + return this; + } + + /** + * @param {T} value value to delete + * @returns {boolean} true if value existed in set, false otherwise + */ + delete(value) { + this._invalidateCache(); + this._invalidateOrderedCache(); + return super.delete(value); + } + + /** + * @returns {void} + */ + clear() { + this._invalidateCache(); + this._invalidateOrderedCache(); + return super.clear(); + } + + /** + * Sort with a comparer function + * @param {SortFunction} sortFn Sorting comparer function + * @returns {void} + */ + sortWith(sortFn) { + if (this.size <= 1 || sortFn === this._lastActiveSortFn) { + // already sorted - nothing to do + return; + } + + const sortedArray = Array.from(this).sort(sortFn); + super.clear(); + for (let i = 0; i < sortedArray.length; i += 1) { + super.add(sortedArray[i]); + } + this._lastActiveSortFn = sortFn; + this._invalidateCache(); + } + + sort() { + this.sortWith(this._sortFn); + } + + /** + * Get data from cache + * @param {function(SortableSet): T[]} fn function to calculate value + * @returns {T[]} returns result of fn(this), cached until set changes + */ + getFromCache(fn) { + if (this._cache === undefined) { + this._cache = new Map(); + } else { + const data = this._cache.get(fn); + if (data !== undefined) { + return data; + } + } + const newData = fn(this); + this._cache.set(fn, newData); + return newData; + } + + /** + * @param {function(SortableSet): string|number|T[]} fn function to calculate value + * @returns {any} returns result of fn(this), cached until set changes + */ + getFromUnorderedCache(fn) { + if (this._cacheOrderIndependent === undefined) { + this._cacheOrderIndependent = new Map(); + } else { + const data = this._cacheOrderIndependent.get(fn); + if (data !== undefined) { + return data; + } + } + const newData = fn(this); + this._cacheOrderIndependent.set(fn, newData); + return newData; + } + + /** + * @private + * @returns {void} + */ + _invalidateCache() { + if (this._cache !== undefined) { + this._cache.clear(); + } + } + + /** + * @private + * @returns {void} + */ + _invalidateOrderedCache() { + if (this._cacheOrderIndependent !== undefined) { + this._cacheOrderIndependent.clear(); + } + } +} + +module.exports = SortableSet; + + +/***/ }), + +/***/ 92251: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const util = __webpack_require__(31669); + +const TOMBSTONE = {}; +const UNDEFINED_MARKER = {}; + +class StackedSetMap { + constructor(parentStack) { + this.stack = parentStack === undefined ? [] : parentStack.slice(); + this.map = new Map(); + this.stack.push(this.map); + } + + add(item) { + this.map.set(item, true); + } + + set(item, value) { + this.map.set(item, value === undefined ? UNDEFINED_MARKER : value); + } + + delete(item) { + if (this.stack.length > 1) { + this.map.set(item, TOMBSTONE); + } else { + this.map.delete(item); + } + } + + has(item) { + const topValue = this.map.get(item); + if (topValue !== undefined) return topValue !== TOMBSTONE; + if (this.stack.length > 1) { + for (var i = this.stack.length - 2; i >= 0; i--) { + const value = this.stack[i].get(item); + if (value !== undefined) { + this.map.set(item, value); + return value !== TOMBSTONE; + } + } + this.map.set(item, TOMBSTONE); + } + return false; + } + + get(item) { + const topValue = this.map.get(item); + if (topValue !== undefined) { + return topValue === TOMBSTONE || topValue === UNDEFINED_MARKER + ? undefined + : topValue; + } + if (this.stack.length > 1) { + for (var i = this.stack.length - 2; i >= 0; i--) { + const value = this.stack[i].get(item); + if (value !== undefined) { + this.map.set(item, value); + return value === TOMBSTONE || value === UNDEFINED_MARKER + ? undefined + : value; + } + } + this.map.set(item, TOMBSTONE); + } + return undefined; + } + + _compress() { + if (this.stack.length === 1) return; + this.map = new Map(); + for (const data of this.stack) { + for (const pair of data) { + if (pair[1] === TOMBSTONE) { + this.map.delete(pair[0]); + } else { + this.map.set(pair[0], pair[1]); + } + } + } + this.stack = [this.map]; + } + + asArray() { + this._compress(); + return Array.from(this.map.entries(), pair => pair[0]); + } + + asSet() { + return new Set(this.asArray()); + } + + asPairArray() { + this._compress(); + return Array.from(this.map.entries(), pair => + /** @type {[TODO, TODO]} */ (pair[1] === UNDEFINED_MARKER + ? [pair[0], undefined] + : pair) + ); + } + + asMap() { + return new Map(this.asPairArray()); + } + + get size() { + this._compress(); + return this.map.size; + } + + createChild() { + return new StackedSetMap(this.stack); + } + + get length() { + throw new Error("This is no longer an Array"); + } + + set length(value) { + throw new Error("This is no longer an Array"); + } +} + +// TODO remove in webpack 5 +StackedSetMap.prototype.push = util.deprecate( + /** + * @deprecated + * @this {StackedSetMap} + * @param {any} item Item to add + * @returns {void} + */ + function(item) { + this.add(item); + }, + "This is no longer an Array: Use add instead." +); + +module.exports = StackedSetMap; + + +/***/ }), + +/***/ 67916: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + + +const mergeCache = new WeakMap(); + +/** + * Merges two given objects and caches the result to avoid computation if same objects passed as arguments again. + * @example + * // performs cleverMerge(first, second), stores the result in WeakMap and returns result + * cachedCleverMerge({a: 1}, {a: 2}) + * {a: 2} + * // when same arguments passed, gets the result from WeakMap and returns it. + * cachedCleverMerge({a: 1}, {a: 2}) + * {a: 2} + * @param {object} first first object + * @param {object} second second object + * @returns {object} merged object of first and second object + */ +const cachedCleverMerge = (first, second) => { + let innerCache = mergeCache.get(first); + if (innerCache === undefined) { + innerCache = new WeakMap(); + mergeCache.set(first, innerCache); + } + const prevMerge = innerCache.get(second); + if (prevMerge !== undefined) return prevMerge; + const newMerge = cleverMerge(first, second); + innerCache.set(second, newMerge); + return newMerge; +}; + +/** + * Merges two objects. Objects are not deeply merged. + * TODO webpack 5: merge objects deeply clever. + * Arrays might reference the old value with "..." + * @param {object} first first object + * @param {object} second second object + * @returns {object} merged object of first and second object + */ +const cleverMerge = (first, second) => { + const newObject = Object.assign({}, first); + for (const key of Object.keys(second)) { + if (!(key in newObject)) { + newObject[key] = second[key]; + continue; + } + const secondValue = second[key]; + if (!Array.isArray(secondValue)) { + newObject[key] = secondValue; + continue; + } + const firstValue = newObject[key]; + if (Array.isArray(firstValue)) { + const newArray = []; + for (const item of secondValue) { + if (item === "...") { + for (const item of firstValue) { + newArray.push(item); + } + } else { + newArray.push(item); + } + } + newObject[key] = newArray; + } else { + newObject[key] = secondValue; + } + } + return newObject; +}; + +exports.cachedCleverMerge = cachedCleverMerge; +exports.cleverMerge = cleverMerge; + + +/***/ }), + +/***/ 15660: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const AbstractMethodError = __webpack_require__(36104); + +const BULK_SIZE = 1000; + +class Hash { + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + throw new AbstractMethodError(); + } + + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + throw new AbstractMethodError(); + } +} + +exports.Hash = Hash; +/** @typedef {typeof Hash} HashConstructor */ + +class BulkUpdateDecorator extends Hash { + /** + * @param {Hash} hash hash + */ + constructor(hash) { + super(); + this.hash = hash; + this.buffer = ""; + } + + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + if ( + inputEncoding !== undefined || + typeof data !== "string" || + data.length > BULK_SIZE + ) { + if (this.buffer.length > 0) { + this.hash.update(this.buffer); + this.buffer = ""; + } + this.hash.update(data, inputEncoding); + } else { + this.buffer += data; + if (this.buffer.length > BULK_SIZE) { + this.hash.update(this.buffer); + this.buffer = ""; + } + } + return this; + } + + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + if (this.buffer.length > 0) { + this.hash.update(this.buffer); + } + var digestResult = this.hash.digest(encoding); + return typeof digestResult === "string" + ? digestResult + : digestResult.toString(); + } +} + +/** + * istanbul ignore next + */ +class DebugHash extends Hash { + constructor() { + super(); + this.string = ""; + } + + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + if (typeof data !== "string") data = data.toString("utf-8"); + this.string += data; + return this; + } + + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + return this.string.replace(/[^a-z0-9]+/gi, m => + Buffer.from(m).toString("hex") + ); + } +} + +/** + * Creates a hash by name or function + * @param {string | HashConstructor} algorithm the algorithm name or a constructor creating a hash + * @returns {Hash} the hash + */ +module.exports = algorithm => { + if (typeof algorithm === "function") { + return new BulkUpdateDecorator(new algorithm()); + } + switch (algorithm) { + // TODO add non-cryptographic algorithm here + case "debug": + return new DebugHash(); + default: + return new BulkUpdateDecorator(__webpack_require__(76417).createHash(algorithm)); + } +}; + + +/***/ }), + +/***/ 30815: +/***/ (function(module) { + +"use strict"; + + +// Simulations show these probabilities for a single change +// 93.1% that one group is invalidated +// 4.8% that two groups are invalidated +// 1.1% that 3 groups are invalidated +// 0.1% that 4 or more groups are invalidated +// +// And these for removing/adding 10 lexically adjacent files +// 64.5% that one group is invalidated +// 24.8% that two groups are invalidated +// 7.8% that 3 groups are invalidated +// 2.7% that 4 or more groups are invalidated +// +// And these for removing/adding 3 random files +// 0% that one group is invalidated +// 3.7% that two groups are invalidated +// 80.8% that 3 groups are invalidated +// 12.3% that 4 groups are invalidated +// 3.2% that 5 or more groups are invalidated + +/** + * + * @param {string} a key + * @param {string} b key + * @returns {number} the similarity as number + */ +const similarity = (a, b) => { + const l = Math.min(a.length, b.length); + let dist = 0; + for (let i = 0; i < l; i++) { + const ca = a.charCodeAt(i); + const cb = b.charCodeAt(i); + dist += Math.max(0, 10 - Math.abs(ca - cb)); + } + return dist; +}; + +/** + * @param {string} a key + * @param {string} b key + * @returns {string} the common part and a single char for the difference + */ +const getName = (a, b) => { + const l = Math.min(a.length, b.length); + let r = ""; + for (let i = 0; i < l; i++) { + const ca = a.charAt(i); + const cb = b.charAt(i); + r += ca; + if (ca === cb) { + continue; + } + return r; + } + return a; +}; + +/** + * @template T + */ +class Node { + /** + * @param {T} item item + * @param {string} key key + * @param {number} size size + */ + constructor(item, key, size) { + this.item = item; + this.key = key; + this.size = size; + } +} + +/** + * @template T + */ +class Group { + /** + * @param {Node[]} nodes nodes + * @param {number[]} similarities similarities between the nodes (length = nodes.length - 1) + */ + constructor(nodes, similarities) { + this.nodes = nodes; + this.similarities = similarities; + this.size = nodes.reduce((size, node) => size + node.size, 0); + /** @type {string} */ + this.key = undefined; + } +} + +/** + * @template T + * @typedef {Object} GroupedItems + * @property {string} key + * @property {T[]} items + * @property {number} size + */ + +/** + * @template T + * @typedef {Object} Options + * @property {number} maxSize maximum size of a group + * @property {number} minSize minimum size of a group (preferred over maximum size) + * @property {Iterable} items a list of items + * @property {function(T): number} getSize function to get size of an item + * @property {function(T): string} getKey function to get the key of an item + */ + +/** + * @template T + * @param {Options} options options object + * @returns {GroupedItems[]} grouped items + */ +module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { + /** @type {Group[]} */ + const result = []; + + const nodes = Array.from( + items, + item => new Node(item, getKey(item), getSize(item)) + ); + + /** @type {Node[]} */ + const initialNodes = []; + + // lexically ordering of keys + nodes.sort((a, b) => { + if (a.key < b.key) return -1; + if (a.key > b.key) return 1; + return 0; + }); + + // return nodes bigger than maxSize directly as group + for (const node of nodes) { + if (node.size >= maxSize) { + result.push(new Group([node], [])); + } else { + initialNodes.push(node); + } + } + + if (initialNodes.length > 0) { + // calculate similarities between lexically adjacent nodes + /** @type {number[]} */ + const similarities = []; + for (let i = 1; i < initialNodes.length; i++) { + const a = initialNodes[i - 1]; + const b = initialNodes[i]; + similarities.push(similarity(a.key, b.key)); + } + + const initialGroup = new Group(initialNodes, similarities); + + if (initialGroup.size < minSize) { + // We hit an edgecase where the working set is already smaller than minSize + // We merge it with the smallest result node to keep minSize intact + if (result.length > 0) { + const smallestGroup = result.reduce((min, group) => + min.size > group.size ? group : min + ); + for (const node of initialGroup.nodes) smallestGroup.nodes.push(node); + smallestGroup.nodes.sort((a, b) => { + if (a.key < b.key) return -1; + if (a.key > b.key) return 1; + return 0; + }); + } else { + // There are no other nodes + // We use all nodes and have to accept that it's smaller than minSize + result.push(initialGroup); + } + } else { + const queue = [initialGroup]; + + while (queue.length) { + const group = queue.pop(); + // only groups bigger than maxSize need to be splitted + if (group.size < maxSize) { + result.push(group); + continue; + } + + // find unsplittable area from left and right + // going minSize from left and right + // at least one node need to be included otherwise we get stuck + let left = 0; + let leftSize = 0; + while (leftSize <= minSize) { + leftSize += group.nodes[left].size; + left++; + } + let right = group.nodes.length - 1; + let rightSize = 0; + while (rightSize <= minSize) { + rightSize += group.nodes[right].size; + right--; + } + + if (left - 1 > right) { + // can't split group while holding minSize + // because minSize is preferred of maxSize we return + // the group here even while it's too big + // To avoid this make sure maxSize > minSize * 3 + result.push(group); + continue; + } + if (left <= right) { + // when there is a area between left and right + // we look for best split point + // we split at the minimum similarity + // here key space is separated the most + let best = left - 1; + let bestSimilarity = group.similarities[best]; + for (let i = left; i <= right; i++) { + const similarity = group.similarities[i]; + if (similarity < bestSimilarity) { + best = i; + bestSimilarity = similarity; + } + } + left = best + 1; + right = best; + } + + // create two new groups for left and right area + // and queue them up + const rightNodes = [group.nodes[right + 1]]; + /** @type {number[]} */ + const rightSimilaries = []; + for (let i = right + 2; i < group.nodes.length; i++) { + rightSimilaries.push(group.similarities[i - 1]); + rightNodes.push(group.nodes[i]); + } + queue.push(new Group(rightNodes, rightSimilaries)); + + const leftNodes = [group.nodes[0]]; + /** @type {number[]} */ + const leftSimilaries = []; + for (let i = 1; i < left; i++) { + leftSimilaries.push(group.similarities[i - 1]); + leftNodes.push(group.nodes[i]); + } + queue.push(new Group(leftNodes, leftSimilaries)); + } + } + } + + // lexically ordering + result.sort((a, b) => { + if (a.nodes[0].key < b.nodes[0].key) return -1; + if (a.nodes[0].key > b.nodes[0].key) return 1; + return 0; + }); + + // give every group a name + for (let i = 0; i < result.length; i++) { + const group = result[i]; + const first = group.nodes[0]; + const last = group.nodes[group.nodes.length - 1]; + let name = getName(first.key, last.key); + group.key = name; + } + + // return the results + return result.map(group => { + /** @type {GroupedItems} */ + return { + key: group.key, + items: group.nodes.map(node => node.item), + size: group.size + }; + }); +}; + + +/***/ }), + +/***/ 94658: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +const path = __webpack_require__(85622); + +/** + * @param {string} context context for relative path + * @param {string} relativePath path + * @returns {string} absolute path + */ +const requestToAbsolute = (context, relativePath) => { + if (relativePath.startsWith("./") || relativePath.startsWith("../")) + return path.join(context, relativePath); + return relativePath; +}; + +/** + * @typedef {Object} MakeRelativePathsCache + * @property {Map>=} relativePaths + */ + +/** + * + * @param {string} maybeAbsolutePath path to check + * @returns {boolean} returns true if path is "Absolute Path"-like + */ +const looksLikeAbsolutePath = maybeAbsolutePath => { + if (/^\/.*\/$/.test(maybeAbsolutePath)) { + // this 'path' is actually a regexp generated by dynamic requires. + // Don't treat it as an absolute path. + return false; + } + return /^(?:[a-z]:\\|\/)/i.test(maybeAbsolutePath); +}; + +/** + * + * @param {string} p path to normalize + * @returns {string} normalized version of path + */ +const normalizePathSeparator = p => p.replace(/\\/g, "/"); + +/** + * + * @param {string} context context for relative path + * @param {string} identifier identifier for path + * @returns {string} a converted relative path + */ +const _makePathsRelative = (context, identifier) => { + return identifier + .split(/([|! ])/) + .map(str => + looksLikeAbsolutePath(str) + ? normalizePathSeparator(path.relative(context, str)) + : str + ) + .join(""); +}; + +/** + * + * @param {string} context context used to create relative path + * @param {string} identifier identifier used to create relative path + * @param {MakeRelativePathsCache=} cache the cache object being set + * @returns {string} the returned relative path + */ +exports.makePathsRelative = (context, identifier, cache) => { + if (!cache) return _makePathsRelative(context, identifier); + + const relativePaths = + cache.relativePaths || (cache.relativePaths = new Map()); + + let cachedResult; + let contextCache = relativePaths.get(context); + if (contextCache === undefined) { + relativePaths.set(context, (contextCache = new Map())); + } else { + cachedResult = contextCache.get(identifier); + } + + if (cachedResult !== undefined) { + return cachedResult; + } else { + const relativePath = _makePathsRelative(context, identifier); + contextCache.set(identifier, relativePath); + return relativePath; + } +}; + +/** + * @param {string} context absolute context path + * @param {string} request any request string may containing absolute paths, query string, etc. + * @returns {string} a new request string avoiding absolute paths when possible + */ +exports.contextify = (context, request) => { + return request + .split("!") + .map(r => { + const splitPath = r.split("?", 2); + if (/^[a-zA-Z]:\\/.test(splitPath[0])) { + splitPath[0] = path.win32.relative(context, splitPath[0]); + if (!/^[a-zA-Z]:\\/.test(splitPath[0])) { + splitPath[0] = splitPath[0].replace(/\\/g, "/"); + } + } + if (/^\//.test(splitPath[0])) { + splitPath[0] = path.posix.relative(context, splitPath[0]); + } + if (!/^(\.\.\/|\/|[a-zA-Z]:\\)/.test(splitPath[0])) { + splitPath[0] = "./" + splitPath[0]; + } + return splitPath.join("?"); + }) + .join("!"); +}; + +/** + * @param {string} context absolute context path + * @param {string} request any request string + * @returns {string} a new request string using absolute paths when possible + */ +const _absolutify = (context, request) => { + return request + .split("!") + .map(r => requestToAbsolute(context, r)) + .join("!"); +}; + +exports.absolutify = _absolutify; + + +/***/ }), + +/***/ 1111: +/***/ (function(module) { + +/** + * convert an object into its 2D array equivalent to be turned + * into an ES6 map + * + * @param {object} obj any object type that works with Object.keys() + * @returns {Map} an ES6 Map of KV pairs + */ +module.exports = function objectToMap(obj) { + return new Map( + Object.keys(obj).map(key => { + /** @type {[string, string]} */ + const pair = [key, obj[key]]; + return pair; + }) + ); +}; + + +/***/ }), + +/***/ 68935: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Gajus Kuizinas @gajus +*/ + + +const Ajv = __webpack_require__(21414); +const ajv = new Ajv({ + errorDataPath: "configuration", + allErrors: true, + verbose: true +}); +__webpack_require__(82133)(ajv, ["instanceof"]); +__webpack_require__(51613)(ajv); + +const validateSchema = (schema, options) => { + if (Array.isArray(options)) { + const errors = options.map(options => validateObject(schema, options)); + errors.forEach((list, idx) => { + const applyPrefix = err => { + err.dataPath = `[${idx}]${err.dataPath}`; + if (err.children) { + err.children.forEach(applyPrefix); + } + }; + list.forEach(applyPrefix); + }); + return errors.reduce((arr, items) => { + return arr.concat(items); + }, []); + } else { + return validateObject(schema, options); + } +}; + +const validateObject = (schema, options) => { + const validate = ajv.compile(schema); + const valid = validate(options); + return valid ? [] : filterErrors(validate.errors); +}; + +const filterErrors = errors => { + let newErrors = []; + for (const err of errors) { + const dataPath = err.dataPath; + let children = []; + newErrors = newErrors.filter(oldError => { + if (oldError.dataPath.includes(dataPath)) { + if (oldError.children) { + children = children.concat(oldError.children.slice(0)); + } + oldError.children = undefined; + children.push(oldError); + return false; + } + return true; + }); + if (children.length) { + err.children = children; + } + newErrors.push(err); + } + + return newErrors; +}; + +module.exports = validateSchema; + + +/***/ }), + +/***/ 43101: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + + +const WebpackError = __webpack_require__(97391); + +module.exports = class UnsupportedWebAssemblyFeatureError extends WebpackError { + /** @param {string} message Error message */ + constructor(message) { + super(message); + this.name = "UnsupportedWebAssemblyFeatureError"; + this.hideStack = true; + + Error.captureStackTrace(this, this.constructor); + } +}; + + +/***/ }), + +/***/ 10557: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ + + +const UnsupportedWebAssemblyFeatureError = __webpack_require__(43101); + +class WasmFinalizeExportsPlugin { + apply(compiler) { + compiler.hooks.compilation.tap("WasmFinalizeExportsPlugin", compilation => { + compilation.hooks.finishModules.tap( + "WasmFinalizeExportsPlugin", + modules => { + for (const module of modules) { + // 1. if a WebAssembly module + if (module.type.startsWith("webassembly") === true) { + const jsIncompatibleExports = + module.buildMeta.jsIncompatibleExports; + + if (jsIncompatibleExports === undefined) { + continue; + } + + for (const reason of module.reasons) { + // 2. is referenced by a non-WebAssembly module + if (reason.module.type.startsWith("webassembly") === false) { + const ref = compilation.getDependencyReference( + reason.module, + reason.dependency + ); + + if (!ref) continue; + + const importedNames = ref.importedNames; + + if (Array.isArray(importedNames)) { + importedNames.forEach(name => { + // 3. and uses a func with an incompatible JS signature + if ( + Object.prototype.hasOwnProperty.call( + jsIncompatibleExports, + name + ) + ) { + // 4. error + /** @type {any} */ + const error = new UnsupportedWebAssemblyFeatureError( + `Export "${name}" with ${jsIncompatibleExports[name]} can only be used for direct wasm to wasm dependencies` + ); + error.module = module; + error.origin = reason.module; + error.originLoc = reason.dependency.loc; + error.dependencies = [reason.dependency]; + compilation.errors.push(error); + } + }); + } + } + } + } + } + } + ); + }); + } +} + +module.exports = WasmFinalizeExportsPlugin; + + +/***/ }), + +/***/ 65331: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Template = __webpack_require__(96066); +const WebAssemblyUtils = __webpack_require__(52136); + +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../MainTemplate")} MainTemplate */ + +// Get all wasm modules +const getAllWasmModules = chunk => { + const wasmModules = chunk.getAllAsyncChunks(); + const array = []; + for (const chunk of wasmModules) { + for (const m of chunk.modulesIterable) { + if (m.type.startsWith("webassembly")) { + array.push(m); + } + } + } + + return array; +}; + +/** + * generates the import object function for a module + * @param {Module} module the module + * @param {boolean} mangle mangle imports + * @returns {string} source code + */ +const generateImportObject = (module, mangle) => { + const waitForInstances = new Map(); + const properties = []; + const usedWasmDependencies = WebAssemblyUtils.getUsedDependencies( + module, + mangle + ); + for (const usedDep of usedWasmDependencies) { + const dep = usedDep.dependency; + const importedModule = dep.module; + const exportName = dep.name; + const usedName = importedModule && importedModule.isUsed(exportName); + const description = dep.description; + const direct = dep.onlyDirectImport; + + const module = usedDep.module; + const name = usedDep.name; + + if (direct) { + const instanceVar = `m${waitForInstances.size}`; + waitForInstances.set(instanceVar, importedModule.id); + properties.push({ + module, + name, + value: `${instanceVar}[${JSON.stringify(usedName)}]` + }); + } else { + const params = description.signature.params.map( + (param, k) => "p" + k + param.valtype + ); + + const mod = `installedModules[${JSON.stringify(importedModule.id)}]`; + const func = `${mod}.exports[${JSON.stringify(usedName)}]`; + + properties.push({ + module, + name, + value: Template.asString([ + (importedModule.type.startsWith("webassembly") + ? `${mod} ? ${func} : ` + : "") + `function(${params}) {`, + Template.indent([`return ${func}(${params});`]), + "}" + ]) + }); + } + } + + let importObject; + if (mangle) { + importObject = [ + "return {", + Template.indent([ + properties.map(p => `${JSON.stringify(p.name)}: ${p.value}`).join(",\n") + ]), + "};" + ]; + } else { + const propertiesByModule = new Map(); + for (const p of properties) { + let list = propertiesByModule.get(p.module); + if (list === undefined) { + propertiesByModule.set(p.module, (list = [])); + } + list.push(p); + } + importObject = [ + "return {", + Template.indent([ + Array.from(propertiesByModule, ([module, list]) => { + return Template.asString([ + `${JSON.stringify(module)}: {`, + Template.indent([ + list.map(p => `${JSON.stringify(p.name)}: ${p.value}`).join(",\n") + ]), + "}" + ]); + }).join(",\n") + ]), + "};" + ]; + } + + if (waitForInstances.size === 1) { + const moduleId = Array.from(waitForInstances.values())[0]; + const promise = `installedWasmModules[${JSON.stringify(moduleId)}]`; + const variable = Array.from(waitForInstances.keys())[0]; + return Template.asString([ + `${JSON.stringify(module.id)}: function() {`, + Template.indent([ + `return promiseResolve().then(function() { return ${promise}; }).then(function(${variable}) {`, + Template.indent(importObject), + "});" + ]), + "}," + ]); + } else if (waitForInstances.size > 0) { + const promises = Array.from( + waitForInstances.values(), + id => `installedWasmModules[${JSON.stringify(id)}]` + ).join(", "); + const variables = Array.from( + waitForInstances.keys(), + (name, i) => `${name} = array[${i}]` + ).join(", "); + return Template.asString([ + `${JSON.stringify(module.id)}: function() {`, + Template.indent([ + `return promiseResolve().then(function() { return Promise.all([${promises}]); }).then(function(array) {`, + Template.indent([`var ${variables};`, ...importObject]), + "});" + ]), + "}," + ]); + } else { + return Template.asString([ + `${JSON.stringify(module.id)}: function() {`, + Template.indent(importObject), + "}," + ]); + } +}; + +class WasmMainTemplatePlugin { + constructor({ generateLoadBinaryCode, supportsStreaming, mangleImports }) { + this.generateLoadBinaryCode = generateLoadBinaryCode; + this.supportsStreaming = supportsStreaming; + this.mangleImports = mangleImports; + } + + /** + * @param {MainTemplate} mainTemplate main template + * @returns {void} + */ + apply(mainTemplate) { + mainTemplate.hooks.localVars.tap( + "WasmMainTemplatePlugin", + (source, chunk) => { + const wasmModules = getAllWasmModules(chunk); + if (wasmModules.length === 0) return source; + const importObjects = wasmModules.map(module => { + return generateImportObject(module, this.mangleImports); + }); + return Template.asString([ + source, + "", + "// object to store loaded and loading wasm modules", + "var installedWasmModules = {};", + "", + // This function is used to delay reading the installed wasm module promises + // by a microtask. Sorting them doesn't help because there are egdecases where + // sorting is not possible (modules splitted into different chunks). + // So we not even trying and solve this by a microtask delay. + "function promiseResolve() { return Promise.resolve(); }", + "", + "var wasmImportObjects = {", + Template.indent(importObjects), + "};" + ]); + } + ); + mainTemplate.hooks.requireEnsure.tap( + "WasmMainTemplatePlugin", + (source, chunk, hash) => { + const webassemblyModuleFilename = + mainTemplate.outputOptions.webassemblyModuleFilename; + + const chunkModuleMaps = chunk.getChunkModuleMaps(m => + m.type.startsWith("webassembly") + ); + if (Object.keys(chunkModuleMaps.id).length === 0) return source; + const wasmModuleSrcPath = mainTemplate.getAssetPath( + JSON.stringify(webassemblyModuleFilename), + { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, + module: { + id: '" + wasmModuleId + "', + hash: `" + ${JSON.stringify( + chunkModuleMaps.hash + )}[wasmModuleId] + "`, + hashWithLength(length) { + const shortChunkHashMap = Object.create(null); + for (const wasmModuleId of Object.keys(chunkModuleMaps.hash)) { + if (typeof chunkModuleMaps.hash[wasmModuleId] === "string") { + shortChunkHashMap[wasmModuleId] = chunkModuleMaps.hash[ + wasmModuleId + ].substr(0, length); + } + } + return `" + ${JSON.stringify( + shortChunkHashMap + )}[wasmModuleId] + "`; + } + } + } + ); + const createImportObject = content => + this.mangleImports + ? `{ ${JSON.stringify( + WebAssemblyUtils.MANGLED_MODULE + )}: ${content} }` + : content; + return Template.asString([ + source, + "", + "// Fetch + compile chunk loading for webassembly", + "", + `var wasmModules = ${JSON.stringify( + chunkModuleMaps.id + )}[chunkId] || [];`, + "", + "wasmModules.forEach(function(wasmModuleId) {", + Template.indent([ + "var installedWasmModuleData = installedWasmModules[wasmModuleId];", + "", + '// a Promise means "currently loading" or "already loaded".', + "if(installedWasmModuleData)", + Template.indent(["promises.push(installedWasmModuleData);"]), + "else {", + Template.indent([ + `var importObject = wasmImportObjects[wasmModuleId]();`, + `var req = ${this.generateLoadBinaryCode(wasmModuleSrcPath)};`, + "var promise;", + this.supportsStreaming + ? Template.asString([ + "if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') {", + Template.indent([ + "promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {", + Template.indent([ + `return WebAssembly.instantiate(items[0], ${createImportObject( + "items[1]" + )});` + ]), + "});" + ]), + "} else if(typeof WebAssembly.instantiateStreaming === 'function') {", + Template.indent([ + `promise = WebAssembly.instantiateStreaming(req, ${createImportObject( + "importObject" + )});` + ]) + ]) + : Template.asString([ + "if(importObject instanceof Promise) {", + Template.indent([ + "var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });", + "promise = Promise.all([", + Template.indent([ + "bytesPromise.then(function(bytes) { return WebAssembly.compile(bytes); }),", + "importObject" + ]), + "]).then(function(items) {", + Template.indent([ + `return WebAssembly.instantiate(items[0], ${createImportObject( + "items[1]" + )});` + ]), + "});" + ]) + ]), + "} else {", + Template.indent([ + "var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });", + "promise = bytesPromise.then(function(bytes) {", + Template.indent([ + `return WebAssembly.instantiate(bytes, ${createImportObject( + "importObject" + )});` + ]), + "});" + ]), + "}", + "promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {", + Template.indent([ + `return ${mainTemplate.requireFn}.w[wasmModuleId] = (res.instance || res).exports;` + ]), + "}));" + ]), + "}" + ]), + "});" + ]); + } + ); + mainTemplate.hooks.requireExtensions.tap( + "WasmMainTemplatePlugin", + (source, chunk) => { + if (!chunk.hasModuleInGraph(m => m.type.startsWith("webassembly"))) { + return source; + } + return Template.asString([ + source, + "", + "// object with all WebAssembly.instance exports", + `${mainTemplate.requireFn}.w = {};` + ]); + } + ); + mainTemplate.hooks.hash.tap("WasmMainTemplatePlugin", hash => { + hash.update("WasmMainTemplatePlugin"); + hash.update("2"); + }); + } +} + +module.exports = WasmMainTemplatePlugin; + + +/***/ }), + +/***/ 13099: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Generator = __webpack_require__(39172); +const Template = __webpack_require__(96066); +const WebAssemblyUtils = __webpack_require__(52136); +const { RawSource } = __webpack_require__(53665); + +const { editWithAST, addWithAST } = __webpack_require__(65584); +const { decode } = __webpack_require__(8062); +const t = __webpack_require__(98688); +const { + moduleContextFromModuleAST +} = __webpack_require__(71234); + +const WebAssemblyExportImportedDependency = __webpack_require__(18925); + +/** @typedef {import("../Module")} Module */ +/** @typedef {import("./WebAssemblyUtils").UsedWasmDependency} UsedWasmDependency */ +/** @typedef {import("../NormalModule")} NormalModule */ +/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("../Dependency").DependencyTemplate} DependencyTemplate */ + +/** + * @typedef {(ArrayBuffer) => ArrayBuffer} ArrayBufferTransform + */ + +/** + * @template T + * @param {Function[]} fns transforms + * @returns {Function} composed transform + */ +const compose = (...fns) => { + return fns.reduce( + (prevFn, nextFn) => { + return value => nextFn(prevFn(value)); + }, + value => value + ); +}; + +// TODO replace with @callback + +/** + * Removes the start instruction + * + * @param {Object} state unused state + * @returns {ArrayBufferTransform} transform + */ +const removeStartFunc = state => bin => { + return editWithAST(state.ast, bin, { + Start(path) { + path.remove(); + } + }); +}; + +/** + * Get imported globals + * + * @param {Object} ast Module's AST + * @returns {Array} - nodes + */ +const getImportedGlobals = ast => { + const importedGlobals = []; + + t.traverse(ast, { + ModuleImport({ node }) { + if (t.isGlobalType(node.descr)) { + importedGlobals.push(node); + } + } + }); + + return importedGlobals; +}; + +/** + * Get the count for imported func + * + * @param {Object} ast Module's AST + * @returns {Number} - count + */ +const getCountImportedFunc = ast => { + let count = 0; + + t.traverse(ast, { + ModuleImport({ node }) { + if (t.isFuncImportDescr(node.descr)) { + count++; + } + } + }); + + return count; +}; + +/** + * Get next type index + * + * @param {Object} ast Module's AST + * @returns {t.Index} - index + */ +const getNextTypeIndex = ast => { + const typeSectionMetadata = t.getSectionMetadata(ast, "type"); + + if (typeSectionMetadata === undefined) { + return t.indexLiteral(0); + } + + return t.indexLiteral(typeSectionMetadata.vectorOfSize.value); +}; + +/** + * Get next func index + * + * The Func section metadata provide informations for implemented funcs + * in order to have the correct index we shift the index by number of external + * functions. + * + * @param {Object} ast Module's AST + * @param {Number} countImportedFunc number of imported funcs + * @returns {t.Index} - index + */ +const getNextFuncIndex = (ast, countImportedFunc) => { + const funcSectionMetadata = t.getSectionMetadata(ast, "func"); + + if (funcSectionMetadata === undefined) { + return t.indexLiteral(0 + countImportedFunc); + } + + const vectorOfSize = funcSectionMetadata.vectorOfSize.value; + + return t.indexLiteral(vectorOfSize + countImportedFunc); +}; + +/** + * Creates an init instruction for a global type + * @param {t.GlobalType} globalType the global type + * @returns {t.Instruction} init expression + */ +const createDefaultInitForGlobal = globalType => { + if (globalType.valtype[0] === "i") { + // create NumberLiteral global initializer + return t.objectInstruction("const", globalType.valtype, [ + t.numberLiteralFromRaw(66) + ]); + } else if (globalType.valtype[0] === "f") { + // create FloatLiteral global initializer + return t.objectInstruction("const", globalType.valtype, [ + t.floatLiteral(66, false, false, "66") + ]); + } else { + throw new Error("unknown type: " + globalType.valtype); + } +}; + +/** + * Rewrite the import globals: + * - removes the ModuleImport instruction + * - injects at the same offset a mutable global of the same type + * + * Since the imported globals are before the other global declarations, our + * indices will be preserved. + * + * Note that globals will become mutable. + * + * @param {Object} state unused state + * @returns {ArrayBufferTransform} transform + */ +const rewriteImportedGlobals = state => bin => { + const additionalInitCode = state.additionalInitCode; + const newGlobals = []; + + bin = editWithAST(state.ast, bin, { + ModuleImport(path) { + if (t.isGlobalType(path.node.descr)) { + const globalType = path.node.descr; + + globalType.mutability = "var"; + + const init = [ + createDefaultInitForGlobal(globalType), + t.instruction("end") + ]; + + newGlobals.push(t.global(globalType, init)); + + path.remove(); + } + }, + + // in order to preserve non-imported global's order we need to re-inject + // those as well + Global(path) { + const { node } = path; + const [init] = node.init; + + if (init.id === "get_global") { + node.globalType.mutability = "var"; + + const initialGlobalidx = init.args[0]; + + node.init = [ + createDefaultInitForGlobal(node.globalType), + t.instruction("end") + ]; + + additionalInitCode.push( + /** + * get_global in global initializer only works for imported globals. + * They have the same indices as the init params, so use the + * same index. + */ + t.instruction("get_local", [initialGlobalidx]), + t.instruction("set_global", [t.indexLiteral(newGlobals.length)]) + ); + } + + newGlobals.push(node); + + path.remove(); + } + }); + + // Add global declaration instructions + return addWithAST(state.ast, bin, newGlobals); +}; + +/** + * Rewrite the export names + * @param {Object} state state + * @param {Object} state.ast Module's ast + * @param {Module} state.module Module + * @param {Set} state.externalExports Module + * @returns {ArrayBufferTransform} transform + */ +const rewriteExportNames = ({ ast, module, externalExports }) => bin => { + return editWithAST(ast, bin, { + ModuleExport(path) { + const isExternal = externalExports.has(path.node.name); + if (isExternal) { + path.remove(); + return; + } + const usedName = module.isUsed(path.node.name); + if (!usedName) { + path.remove(); + return; + } + path.node.name = usedName; + } + }); +}; + +/** + * Mangle import names and modules + * @param {Object} state state + * @param {Object} state.ast Module's ast + * @param {Map} state.usedDependencyMap mappings to mangle names + * @returns {ArrayBufferTransform} transform + */ +const rewriteImports = ({ ast, usedDependencyMap }) => bin => { + return editWithAST(ast, bin, { + ModuleImport(path) { + const result = usedDependencyMap.get( + path.node.module + ":" + path.node.name + ); + + if (result !== undefined) { + path.node.module = result.module; + path.node.name = result.name; + } + } + }); +}; + +/** + * Add an init function. + * + * The init function fills the globals given input arguments. + * + * @param {Object} state transformation state + * @param {Object} state.ast Module's ast + * @param {t.Identifier} state.initFuncId identifier of the init function + * @param {t.Index} state.startAtFuncOffset index of the start function + * @param {t.ModuleImport[]} state.importedGlobals list of imported globals + * @param {t.Instruction[]} state.additionalInitCode list of addition instructions for the init function + * @param {t.Index} state.nextFuncIndex index of the next function + * @param {t.Index} state.nextTypeIndex index of the next type + * @returns {ArrayBufferTransform} transform + */ +const addInitFunction = ({ + ast, + initFuncId, + startAtFuncOffset, + importedGlobals, + additionalInitCode, + nextFuncIndex, + nextTypeIndex +}) => bin => { + const funcParams = importedGlobals.map(importedGlobal => { + // used for debugging + const id = t.identifier(`${importedGlobal.module}.${importedGlobal.name}`); + + return t.funcParam(importedGlobal.descr.valtype, id); + }); + + const funcBody = importedGlobals.reduce((acc, importedGlobal, index) => { + const args = [t.indexLiteral(index)]; + const body = [ + t.instruction("get_local", args), + t.instruction("set_global", args) + ]; + + return [...acc, ...body]; + }, []); + + if (typeof startAtFuncOffset === "number") { + funcBody.push(t.callInstruction(t.numberLiteralFromRaw(startAtFuncOffset))); + } + + for (const instr of additionalInitCode) { + funcBody.push(instr); + } + + funcBody.push(t.instruction("end")); + + const funcResults = []; + + // Code section + const funcSignature = t.signature(funcParams, funcResults); + const func = t.func(initFuncId, funcSignature, funcBody); + + // Type section + const functype = t.typeInstruction(undefined, funcSignature); + + // Func section + const funcindex = t.indexInFuncSection(nextTypeIndex); + + // Export section + const moduleExport = t.moduleExport( + initFuncId.value, + t.moduleExportDescr("Func", nextFuncIndex) + ); + + return addWithAST(ast, bin, [func, moduleExport, funcindex, functype]); +}; + +/** + * Extract mangle mappings from module + * @param {Module} module current module + * @param {boolean} mangle mangle imports + * @returns {Map} mappings to mangled names + */ +const getUsedDependencyMap = (module, mangle) => { + /** @type {Map} */ + const map = new Map(); + for (const usedDep of WebAssemblyUtils.getUsedDependencies(module, mangle)) { + const dep = usedDep.dependency; + const request = dep.request; + const exportName = dep.name; + map.set(request + ":" + exportName, usedDep); + } + return map; +}; + +class WebAssemblyGenerator extends Generator { + constructor(options) { + super(); + this.options = options; + } + + /** + * @param {NormalModule} module module for which the code should be generated + * @param {Map} dependencyTemplates mapping from dependencies to templates + * @param {RuntimeTemplate} runtimeTemplate the runtime template + * @param {string} type which kind of code should be generated + * @returns {Source} generated code + */ + generate(module, dependencyTemplates, runtimeTemplate, type) { + let bin = module.originalSource().source(); + + const initFuncId = t.identifier( + Array.isArray(module.usedExports) + ? Template.numberToIdentifer(module.usedExports.length) + : "__webpack_init__" + ); + + // parse it + const ast = decode(bin, { + ignoreDataSection: true, + ignoreCodeSection: true, + ignoreCustomNameSection: true + }); + + const moduleContext = moduleContextFromModuleAST(ast.body[0]); + + const importedGlobals = getImportedGlobals(ast); + const countImportedFunc = getCountImportedFunc(ast); + const startAtFuncOffset = moduleContext.getStart(); + const nextFuncIndex = getNextFuncIndex(ast, countImportedFunc); + const nextTypeIndex = getNextTypeIndex(ast); + + const usedDependencyMap = getUsedDependencyMap( + module, + this.options.mangleImports + ); + const externalExports = new Set( + module.dependencies + .filter(d => d instanceof WebAssemblyExportImportedDependency) + .map(d => { + const wasmDep = /** @type {WebAssemblyExportImportedDependency} */ (d); + return wasmDep.exportName; + }) + ); + + /** @type {t.Instruction[]} */ + const additionalInitCode = []; + + const transform = compose( + rewriteExportNames({ + ast, + module, + externalExports + }), + + removeStartFunc({ ast }), + + rewriteImportedGlobals({ ast, additionalInitCode }), + + rewriteImports({ + ast, + usedDependencyMap + }), + + addInitFunction({ + ast, + initFuncId, + importedGlobals, + additionalInitCode, + startAtFuncOffset, + nextFuncIndex, + nextTypeIndex + }) + ); + + const newBin = transform(bin); + + return new RawSource(newBin); + } +} + +module.exports = WebAssemblyGenerator; + + +/***/ }), + +/***/ 45283: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + + +const WebpackError = __webpack_require__(97391); + +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../RequestShortener")} RequestShortener */ + +/** + * @param {Module} module module to get chains from + * @param {RequestShortener} requestShortener to make readable identifiers + * @returns {string[]} all chains to the module + */ +const getInitialModuleChains = (module, requestShortener) => { + const queue = [ + { head: module, message: module.readableIdentifier(requestShortener) } + ]; + /** @type {Set} */ + const results = new Set(); + /** @type {Set} */ + const incompleteResults = new Set(); + /** @type {Set} */ + const visitedModules = new Set(); + + for (const chain of queue) { + const { head, message } = chain; + let final = true; + /** @type {Set} */ + const alreadyReferencedModules = new Set(); + for (const reason of head.reasons) { + const newHead = reason.module; + if (newHead) { + if (!newHead.getChunks().some(c => c.canBeInitial())) continue; + final = false; + if (alreadyReferencedModules.has(newHead)) continue; + alreadyReferencedModules.add(newHead); + const moduleName = newHead.readableIdentifier(requestShortener); + const detail = reason.explanation ? ` (${reason.explanation})` : ""; + const newMessage = `${moduleName}${detail} --> ${message}`; + if (visitedModules.has(newHead)) { + incompleteResults.add(`... --> ${newMessage}`); + continue; + } + visitedModules.add(newHead); + queue.push({ + head: newHead, + message: newMessage + }); + } else { + final = false; + const newMessage = reason.explanation + ? `(${reason.explanation}) --> ${message}` + : message; + results.add(newMessage); + } + } + if (final) { + results.add(message); + } + } + for (const result of incompleteResults) { + results.add(result); + } + return Array.from(results); +}; + +module.exports = class WebAssemblyInInitialChunkError extends WebpackError { + /** + * @param {Module} module WASM module + * @param {RequestShortener} requestShortener request shortener + */ + constructor(module, requestShortener) { + const moduleChains = getInitialModuleChains(module, requestShortener); + const message = `WebAssembly module is included in initial chunk. +This is not allowed, because WebAssembly download and compilation must happen asynchronous. +Add an async splitpoint (i. e. import()) somewhere between your entrypoint and the WebAssembly module: +${moduleChains.map(s => `* ${s}`).join("\n")}`; + + super(message); + this.name = "WebAssemblyInInitialChunkError"; + this.hideStack = true; + this.module = module; + + Error.captureStackTrace(this, this.constructor); + } +}; + + +/***/ }), + +/***/ 13411: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Generator = __webpack_require__(39172); +const Template = __webpack_require__(96066); +const { RawSource } = __webpack_require__(53665); +const WebAssemblyImportDependency = __webpack_require__(52959); +const WebAssemblyExportImportedDependency = __webpack_require__(18925); + +/** @typedef {import("../NormalModule")} NormalModule */ +/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("../Dependency").DependencyTemplate} DependencyTemplate */ + +class WebAssemblyJavascriptGenerator extends Generator { + /** + * @param {NormalModule} module module for which the code should be generated + * @param {Map} dependencyTemplates mapping from dependencies to templates + * @param {RuntimeTemplate} runtimeTemplate the runtime template + * @param {string} type which kind of code should be generated + * @returns {Source} generated code + */ + generate(module, dependencyTemplates, runtimeTemplate, type) { + const initIdentifer = Array.isArray(module.usedExports) + ? Template.numberToIdentifer(module.usedExports.length) + : "__webpack_init__"; + + let needExportsCopy = false; + const importedModules = new Map(); + const initParams = []; + let index = 0; + for (const dep of module.dependencies) { + const depAsAny = /** @type {any} */ (dep); + if (dep.module) { + let importData = importedModules.get(dep.module); + if (importData === undefined) { + importedModules.set( + dep.module, + (importData = { + importVar: `m${index}`, + index, + request: + "userRequest" in depAsAny ? depAsAny.userRequest : undefined, + names: new Set(), + reexports: [] + }) + ); + index++; + } + if (dep instanceof WebAssemblyImportDependency) { + importData.names.add(dep.name); + if (dep.description.type === "GlobalType") { + const exportName = dep.name; + const usedName = dep.module && dep.module.isUsed(exportName); + + if (dep.module) { + if (usedName) { + initParams.push( + runtimeTemplate.exportFromImport({ + module: dep.module, + request: dep.request, + importVar: importData.importVar, + originModule: module, + exportName: dep.name, + asiSafe: true, + isCall: false, + callContext: null + }) + ); + } + } + } + } + if (dep instanceof WebAssemblyExportImportedDependency) { + importData.names.add(dep.name); + const usedName = module.isUsed(dep.exportName); + if (usedName) { + const exportProp = `${module.exportsArgument}[${JSON.stringify( + usedName + )}]`; + const defineStatement = Template.asString([ + `${exportProp} = ${runtimeTemplate.exportFromImport({ + module: dep.module, + request: dep.request, + importVar: importData.importVar, + originModule: module, + exportName: dep.name, + asiSafe: true, + isCall: false, + callContext: null + })};`, + `if(WebAssembly.Global) ${exportProp} = ` + + `new WebAssembly.Global({ value: ${JSON.stringify( + dep.valueType + )} }, ${exportProp});` + ]); + importData.reexports.push(defineStatement); + needExportsCopy = true; + } + } + } + } + const importsCode = Template.asString( + Array.from( + importedModules, + ([module, { importVar, request, reexports }]) => { + const importStatement = runtimeTemplate.importStatement({ + module, + request, + importVar, + originModule: module + }); + return importStatement + reexports.join("\n"); + } + ) + ); + + // create source + const source = new RawSource( + [ + '"use strict";', + "// Instantiate WebAssembly module", + "var wasmExports = __webpack_require__.w[module.i];", + + !Array.isArray(module.usedExports) + ? `__webpack_require__.r(${module.exportsArgument});` + : "", + + // this must be before import for circular dependencies + "// export exports from WebAssembly module", + Array.isArray(module.usedExports) && !needExportsCopy + ? `${module.moduleArgument}.exports = wasmExports;` + : "for(var name in wasmExports) " + + `if(name != ${JSON.stringify(initIdentifer)}) ` + + `${module.exportsArgument}[name] = wasmExports[name];`, + "// exec imports from WebAssembly module (for esm order)", + importsCode, + "", + "// exec wasm module", + `wasmExports[${JSON.stringify(initIdentifer)}](${initParams.join( + ", " + )})` + ].join("\n") + ); + return source; + } +} + +module.exports = WebAssemblyJavascriptGenerator; + + +/***/ }), + +/***/ 99510: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Generator = __webpack_require__(39172); +const WebAssemblyExportImportedDependency = __webpack_require__(18925); +const WebAssemblyImportDependency = __webpack_require__(52959); +const WebAssemblyInInitialChunkError = __webpack_require__(45283); + +/** @typedef {import("../Compiler")} Compiler */ + +let WebAssemblyGenerator; +let WebAssemblyJavascriptGenerator; +let WebAssemblyParser; + +class WebAssemblyModulesPlugin { + constructor(options) { + this.options = options; + } + + /** + * @param {Compiler} compiler compiler + * @returns {void} + */ + apply(compiler) { + compiler.hooks.compilation.tap( + "WebAssemblyModulesPlugin", + (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set( + WebAssemblyImportDependency, + normalModuleFactory + ); + + compilation.dependencyFactories.set( + WebAssemblyExportImportedDependency, + normalModuleFactory + ); + + normalModuleFactory.hooks.createParser + .for("webassembly/experimental") + .tap("WebAssemblyModulesPlugin", () => { + if (WebAssemblyParser === undefined) { + WebAssemblyParser = __webpack_require__(77703); + } + return new WebAssemblyParser(); + }); + + normalModuleFactory.hooks.createGenerator + .for("webassembly/experimental") + .tap("WebAssemblyModulesPlugin", () => { + if (WebAssemblyGenerator === undefined) { + WebAssemblyGenerator = __webpack_require__(13099); + } + if (WebAssemblyJavascriptGenerator === undefined) { + WebAssemblyJavascriptGenerator = __webpack_require__(13411); + } + return Generator.byType({ + javascript: new WebAssemblyJavascriptGenerator(), + webassembly: new WebAssemblyGenerator(this.options) + }); + }); + + compilation.chunkTemplate.hooks.renderManifest.tap( + "WebAssemblyModulesPlugin", + (result, options) => { + const chunk = options.chunk; + const outputOptions = options.outputOptions; + const moduleTemplates = options.moduleTemplates; + const dependencyTemplates = options.dependencyTemplates; + + for (const module of chunk.modulesIterable) { + if (module.type && module.type.startsWith("webassembly")) { + const filenameTemplate = + outputOptions.webassemblyModuleFilename; + + result.push({ + render: () => + this.renderWebAssembly( + module, + moduleTemplates.webassembly, + dependencyTemplates + ), + filenameTemplate, + pathOptions: { + module + }, + identifier: `webassemblyModule${module.id}`, + hash: module.hash + }); + } + } + + return result; + } + ); + + compilation.hooks.afterChunks.tap("WebAssemblyModulesPlugin", () => { + const initialWasmModules = new Set(); + for (const chunk of compilation.chunks) { + if (chunk.canBeInitial()) { + for (const module of chunk.modulesIterable) { + if (module.type.startsWith("webassembly")) { + initialWasmModules.add(module); + } + } + } + } + for (const module of initialWasmModules) { + compilation.errors.push( + new WebAssemblyInInitialChunkError( + module, + compilation.requestShortener + ) + ); + } + }); + } + ); + } + + renderWebAssembly(module, moduleTemplate, dependencyTemplates) { + return moduleTemplate.render(module, dependencyTemplates, {}); + } +} + +module.exports = WebAssemblyModulesPlugin; + + +/***/ }), + +/***/ 77703: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const t = __webpack_require__(98688); +const { decode } = __webpack_require__(8062); +const { + moduleContextFromModuleAST +} = __webpack_require__(71234); + +const { Tapable } = __webpack_require__(92402); +const WebAssemblyImportDependency = __webpack_require__(52959); +const WebAssemblyExportImportedDependency = __webpack_require__(18925); + +/** @typedef {import("../Module")} Module */ + +const JS_COMPAT_TYPES = new Set(["i32", "f32", "f64"]); + +/** + * @param {t.Signature} signature the func signature + * @returns {null | string} the type incompatible with js types + */ +const getJsIncompatibleType = signature => { + for (const param of signature.params) { + if (!JS_COMPAT_TYPES.has(param.valtype)) { + return `${param.valtype} as parameter`; + } + } + for (const type of signature.results) { + if (!JS_COMPAT_TYPES.has(type)) return `${type} as result`; + } + return null; +}; + +/** + * TODO why are there two different Signature types? + * @param {t.FuncSignature} signature the func signature + * @returns {null | string} the type incompatible with js types + */ +const getJsIncompatibleTypeOfFuncSignature = signature => { + for (const param of signature.args) { + if (!JS_COMPAT_TYPES.has(param)) { + return `${param} as parameter`; + } + } + for (const type of signature.result) { + if (!JS_COMPAT_TYPES.has(type)) return `${type} as result`; + } + return null; +}; + +const decoderOpts = { + ignoreCodeSection: true, + ignoreDataSection: true, + + // this will avoid having to lookup with identifiers in the ModuleContext + ignoreCustomNameSection: true +}; + +class WebAssemblyParser extends Tapable { + constructor(options) { + super(); + this.hooks = {}; + this.options = options; + } + + parse(binary, state) { + // flag it as ESM + state.module.buildMeta.exportsType = "namespace"; + + // parse it + const program = decode(binary, decoderOpts); + const module = program.body[0]; + + const moduleContext = moduleContextFromModuleAST(module); + + // extract imports and exports + const exports = (state.module.buildMeta.providedExports = []); + const jsIncompatibleExports = (state.module.buildMeta.jsIncompatibleExports = []); + + const importedGlobals = []; + t.traverse(module, { + ModuleExport({ node }) { + const descriptor = node.descr; + + if (descriptor.exportType === "Func") { + const funcidx = descriptor.id.value; + + /** @type {t.FuncSignature} */ + const funcSignature = moduleContext.getFunction(funcidx); + + const incompatibleType = getJsIncompatibleTypeOfFuncSignature( + funcSignature + ); + + if (incompatibleType) { + jsIncompatibleExports[node.name] = incompatibleType; + } + } + + exports.push(node.name); + + if (node.descr && node.descr.exportType === "Global") { + const refNode = importedGlobals[node.descr.id.value]; + if (refNode) { + const dep = new WebAssemblyExportImportedDependency( + node.name, + refNode.module, + refNode.name, + refNode.descr.valtype + ); + + state.module.addDependency(dep); + } + } + }, + + Global({ node }) { + const init = node.init[0]; + + let importNode = null; + + if (init.id === "get_global") { + const globalIdx = init.args[0].value; + + if (globalIdx < importedGlobals.length) { + importNode = importedGlobals[globalIdx]; + } + } + + importedGlobals.push(importNode); + }, + + ModuleImport({ node }) { + /** @type {false | string} */ + let onlyDirectImport = false; + + if (t.isMemory(node.descr) === true) { + onlyDirectImport = "Memory"; + } else if (t.isTable(node.descr) === true) { + onlyDirectImport = "Table"; + } else if (t.isFuncImportDescr(node.descr) === true) { + const incompatibleType = getJsIncompatibleType(node.descr.signature); + if (incompatibleType) { + onlyDirectImport = `Non-JS-compatible Func Sigurature (${incompatibleType})`; + } + } else if (t.isGlobalType(node.descr) === true) { + const type = node.descr.valtype; + if (!JS_COMPAT_TYPES.has(type)) { + onlyDirectImport = `Non-JS-compatible Global Type (${type})`; + } + } + + const dep = new WebAssemblyImportDependency( + node.module, + node.name, + node.descr, + onlyDirectImport + ); + + state.module.addDependency(dep); + + if (t.isGlobalType(node.descr)) { + importedGlobals.push(node); + } + } + }); + + return state; + } +} + +module.exports = WebAssemblyParser; + + +/***/ }), + +/***/ 52136: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const Template = __webpack_require__(96066); +const WebAssemblyImportDependency = __webpack_require__(52959); + +/** @typedef {import("../Module")} Module */ + +/** @typedef {Object} UsedWasmDependency + * @property {WebAssemblyImportDependency} dependency the dependency + * @property {string} name the export name + * @property {string} module the module name + */ + +const MANGLED_MODULE = "a"; + +/** + * @param {Module} module the module + * @param {boolean} mangle mangle module and export names + * @returns {UsedWasmDependency[]} used dependencies and (mangled) name + */ +const getUsedDependencies = (module, mangle) => { + /** @type {UsedWasmDependency[]} */ + const array = []; + let importIndex = 0; + for (const dep of module.dependencies) { + if (dep instanceof WebAssemblyImportDependency) { + if (dep.description.type === "GlobalType" || dep.module === null) { + continue; + } + + const exportName = dep.name; + // TODO add the following 3 lines when removing of ModuleExport is possible + // const importedModule = dep.module; + // const usedName = importedModule && importedModule.isUsed(exportName); + // if (usedName !== false) { + if (mangle) { + array.push({ + dependency: dep, + name: Template.numberToIdentifer(importIndex++), + module: MANGLED_MODULE + }); + } else { + array.push({ + dependency: dep, + name: exportName, + module: dep.request + }); + } + } + } + return array; +}; + +exports.getUsedDependencies = getUsedDependencies; +exports.MANGLED_MODULE = MANGLED_MODULE; + + +/***/ }), + +/***/ 52669: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const WasmMainTemplatePlugin = __webpack_require__(65331); + +class FetchCompileWasmTemplatePlugin { + constructor(options) { + this.options = options || {}; + } + + apply(compiler) { + compiler.hooks.thisCompilation.tap( + "FetchCompileWasmTemplatePlugin", + compilation => { + const mainTemplate = compilation.mainTemplate; + const generateLoadBinaryCode = path => + `fetch(${mainTemplate.requireFn}.p + ${path})`; + + const plugin = new WasmMainTemplatePlugin( + Object.assign( + { + generateLoadBinaryCode, + supportsStreaming: true + }, + this.options + ) + ); + plugin.apply(mainTemplate); + } + ); + } +} + +module.exports = FetchCompileWasmTemplatePlugin; + + +/***/ }), + +/***/ 31898: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const { ConcatSource } = __webpack_require__(53665); + +/** @typedef {import("../ChunkTemplate")} ChunkTemplate */ + +const getEntryInfo = chunk => { + return [chunk.entryModule].filter(Boolean).map(m => + [m.id].concat( + Array.from(chunk.groupsIterable)[0] + .chunks.filter(c => c !== chunk) + .map(c => c.id) + ) + ); +}; + +class JsonpChunkTemplatePlugin { + /** + * @param {ChunkTemplate} chunkTemplate the chunk template + * @returns {void} + */ + apply(chunkTemplate) { + chunkTemplate.hooks.render.tap( + "JsonpChunkTemplatePlugin", + (modules, chunk) => { + const jsonpFunction = chunkTemplate.outputOptions.jsonpFunction; + const globalObject = chunkTemplate.outputOptions.globalObject; + const source = new ConcatSource(); + const prefetchChunks = chunk.getChildIdsByOrders().prefetch; + source.add( + `(${globalObject}[${JSON.stringify( + jsonpFunction + )}] = ${globalObject}[${JSON.stringify( + jsonpFunction + )}] || []).push([${JSON.stringify(chunk.ids)},` + ); + source.add(modules); + const entries = getEntryInfo(chunk); + if (entries.length > 0) { + source.add(`,${JSON.stringify(entries)}`); + } else if (prefetchChunks && prefetchChunks.length) { + source.add(`,0`); + } + + if (prefetchChunks && prefetchChunks.length) { + source.add(`,${JSON.stringify(prefetchChunks)}`); + } + source.add("])"); + return source; + } + ); + chunkTemplate.hooks.hash.tap("JsonpChunkTemplatePlugin", hash => { + hash.update("JsonpChunkTemplatePlugin"); + hash.update("4"); + hash.update(`${chunkTemplate.outputOptions.jsonpFunction}`); + hash.update(`${chunkTemplate.outputOptions.globalObject}`); + }); + chunkTemplate.hooks.hashForChunk.tap( + "JsonpChunkTemplatePlugin", + (hash, chunk) => { + hash.update(JSON.stringify(getEntryInfo(chunk))); + hash.update(JSON.stringify(chunk.getChildIdsByOrders().prefetch) || ""); + } + ); + } +} +module.exports = JsonpChunkTemplatePlugin; + + +/***/ }), + +/***/ 13732: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const { ConcatSource } = __webpack_require__(53665); + +class JsonpExportMainTemplatePlugin { + /** + * @param {string} name jsonp function name + */ + constructor(name) { + this.name = name; + } + + apply(compilation) { + const { mainTemplate, chunkTemplate } = compilation; + + const onRenderWithEntry = (source, chunk, hash) => { + const name = mainTemplate.getAssetPath(this.name || "", { + hash, + chunk + }); + return new ConcatSource(`${name}(`, source, ");"); + }; + + for (const template of [mainTemplate, chunkTemplate]) { + template.hooks.renderWithEntry.tap( + "JsonpExportMainTemplatePlugin", + onRenderWithEntry + ); + } + + mainTemplate.hooks.globalHashPaths.tap( + "JsonpExportMainTemplatePlugin", + paths => { + if (this.name) paths.push(this.name); + return paths; + } + ); + + mainTemplate.hooks.hash.tap("JsonpExportMainTemplatePlugin", hash => { + hash.update("jsonp export"); + hash.update(`${this.name}`); + }); + } +} + +module.exports = JsonpExportMainTemplatePlugin; + + +/***/ }), + +/***/ 44458: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const { ConcatSource } = __webpack_require__(53665); + +class JsonpHotUpdateChunkTemplatePlugin { + apply(hotUpdateChunkTemplate) { + hotUpdateChunkTemplate.hooks.render.tap( + "JsonpHotUpdateChunkTemplatePlugin", + (modulesSource, modules, removedModules, hash, id) => { + const source = new ConcatSource(); + source.add( + `${ + hotUpdateChunkTemplate.outputOptions.hotUpdateFunction + }(${JSON.stringify(id)},` + ); + source.add(modulesSource); + source.add(")"); + return source; + } + ); + hotUpdateChunkTemplate.hooks.hash.tap( + "JsonpHotUpdateChunkTemplatePlugin", + hash => { + hash.update("JsonpHotUpdateChunkTemplatePlugin"); + hash.update("3"); + hash.update( + `${hotUpdateChunkTemplate.outputOptions.hotUpdateFunction}` + ); + hash.update(`${hotUpdateChunkTemplate.outputOptions.library}`); + } + ); + } +} + +module.exports = JsonpHotUpdateChunkTemplatePlugin; + + +/***/ }), + +/***/ 24916: +/***/ (function(module) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// eslint-disable-next-line no-unused-vars +var hotAddUpdateChunk = undefined; +var parentHotUpdateCallback = undefined; +var $require$ = undefined; +var $hotMainFilename$ = undefined; +var $hotChunkFilename$ = undefined; +var $crossOriginLoading$ = undefined; + +module.exports = function() { + // eslint-disable-next-line no-unused-vars + function webpackHotUpdateCallback(chunkId, moreModules) { + hotAddUpdateChunk(chunkId, moreModules); + if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); + } //$semicolon + + // eslint-disable-next-line no-unused-vars + function hotDownloadUpdateChunk(chunkId) { + var script = document.createElement("script"); + script.charset = "utf-8"; + script.src = $require$.p + $hotChunkFilename$; + if ($crossOriginLoading$) script.crossOrigin = $crossOriginLoading$; + document.head.appendChild(script); + } + + // eslint-disable-next-line no-unused-vars + function hotDownloadManifest(requestTimeout) { + requestTimeout = requestTimeout || 10000; + return new Promise(function(resolve, reject) { + if (typeof XMLHttpRequest === "undefined") { + return reject(new Error("No browser support")); + } + try { + var request = new XMLHttpRequest(); + var requestPath = $require$.p + $hotMainFilename$; + request.open("GET", requestPath, true); + request.timeout = requestTimeout; + request.send(null); + } catch (err) { + return reject(err); + } + request.onreadystatechange = function() { + if (request.readyState !== 4) return; + if (request.status === 0) { + // timeout + reject( + new Error("Manifest request to " + requestPath + " timed out.") + ); + } else if (request.status === 404) { + // no update available + resolve(); + } else if (request.status !== 200 && request.status !== 304) { + // other failure + reject(new Error("Manifest request to " + requestPath + " failed.")); + } else { + // success + try { + var update = JSON.parse(request.responseText); + } catch (e) { + reject(e); + return; + } + resolve(update); + } + }; + }); + } +}; + + +/***/ }), + +/***/ 38017: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +const { SyncWaterfallHook } = __webpack_require__(92402); +const Template = __webpack_require__(96066); + +class JsonpMainTemplatePlugin { + apply(mainTemplate) { + const needChunkOnDemandLoadingCode = chunk => { + for (const chunkGroup of chunk.groupsIterable) { + if (chunkGroup.getNumberOfChildren() > 0) return true; + } + return false; + }; + const needChunkLoadingCode = chunk => { + for (const chunkGroup of chunk.groupsIterable) { + if (chunkGroup.chunks.length > 1) return true; + if (chunkGroup.getNumberOfChildren() > 0) return true; + } + return false; + }; + const needEntryDeferringCode = chunk => { + for (const chunkGroup of chunk.groupsIterable) { + if (chunkGroup.chunks.length > 1) return true; + } + return false; + }; + const needPrefetchingCode = chunk => { + const allPrefetchChunks = chunk.getChildIdsByOrdersMap(true).prefetch; + return allPrefetchChunks && Object.keys(allPrefetchChunks).length; + }; + + // TODO webpack 5, no adding to .hooks, use WeakMap and static methods + ["jsonpScript", "linkPreload", "linkPrefetch"].forEach(hook => { + if (!mainTemplate.hooks[hook]) { + mainTemplate.hooks[hook] = new SyncWaterfallHook([ + "source", + "chunk", + "hash" + ]); + } + }); + + const getScriptSrcPath = (hash, chunk, chunkIdExpression) => { + const chunkFilename = mainTemplate.outputOptions.chunkFilename; + const chunkMaps = chunk.getChunkMaps(); + return mainTemplate.getAssetPath(JSON.stringify(chunkFilename), { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, + chunk: { + id: `" + ${chunkIdExpression} + "`, + hash: `" + ${JSON.stringify( + chunkMaps.hash + )}[${chunkIdExpression}] + "`, + hashWithLength(length) { + const shortChunkHashMap = Object.create(null); + for (const chunkId of Object.keys(chunkMaps.hash)) { + if (typeof chunkMaps.hash[chunkId] === "string") { + shortChunkHashMap[chunkId] = chunkMaps.hash[chunkId].substr( + 0, + length + ); + } + } + return `" + ${JSON.stringify( + shortChunkHashMap + )}[${chunkIdExpression}] + "`; + }, + name: `" + (${JSON.stringify( + chunkMaps.name + )}[${chunkIdExpression}]||${chunkIdExpression}) + "`, + contentHash: { + javascript: `" + ${JSON.stringify( + chunkMaps.contentHash.javascript + )}[${chunkIdExpression}] + "` + }, + contentHashWithLength: { + javascript: length => { + const shortContentHashMap = {}; + const contentHash = chunkMaps.contentHash.javascript; + for (const chunkId of Object.keys(contentHash)) { + if (typeof contentHash[chunkId] === "string") { + shortContentHashMap[chunkId] = contentHash[chunkId].substr( + 0, + length + ); + } + } + return `" + ${JSON.stringify( + shortContentHashMap + )}[${chunkIdExpression}] + "`; + } + } + }, + contentHashType: "javascript" + }); + }; + mainTemplate.hooks.localVars.tap( + "JsonpMainTemplatePlugin", + (source, chunk, hash) => { + const extraCode = []; + if (needChunkLoadingCode(chunk)) { + extraCode.push( + "", + "// object to store loaded and loading chunks", + "// undefined = chunk not loaded, null = chunk preloaded/prefetched", + "// Promise = chunk loading, 0 = chunk loaded", + "var installedChunks = {", + Template.indent( + chunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(",\n") + ), + "};", + "", + needEntryDeferringCode(chunk) + ? needPrefetchingCode(chunk) + ? "var deferredModules = [], deferredPrefetch = [];" + : "var deferredModules = [];" + : "" + ); + } + if (needChunkOnDemandLoadingCode(chunk)) { + extraCode.push( + "", + "// script path function", + "function jsonpScriptSrc(chunkId) {", + Template.indent([ + `return ${mainTemplate.requireFn}.p + ${getScriptSrcPath( + hash, + chunk, + "chunkId" + )}` + ]), + "}" + ); + } + if (extraCode.length === 0) return source; + return Template.asString([source, ...extraCode]); + } + ); + + mainTemplate.hooks.jsonpScript.tap( + "JsonpMainTemplatePlugin", + (_, chunk, hash) => { + const crossOriginLoading = + mainTemplate.outputOptions.crossOriginLoading; + const chunkLoadTimeout = mainTemplate.outputOptions.chunkLoadTimeout; + const jsonpScriptType = mainTemplate.outputOptions.jsonpScriptType; + + return Template.asString([ + "var script = document.createElement('script');", + "var onScriptComplete;", + jsonpScriptType + ? `script.type = ${JSON.stringify(jsonpScriptType)};` + : "", + "script.charset = 'utf-8';", + `script.timeout = ${chunkLoadTimeout / 1000};`, + `if (${mainTemplate.requireFn}.nc) {`, + Template.indent( + `script.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` + ), + "}", + "script.src = jsonpScriptSrc(chunkId);", + crossOriginLoading + ? Template.asString([ + "if (script.src.indexOf(window.location.origin + '/') !== 0) {", + Template.indent( + `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + ), + "}" + ]) + : "", + "// create error before stack unwound to get useful stacktrace later", + "var error = new Error();", + "onScriptComplete = function (event) {", + Template.indent([ + "// avoid mem leaks in IE.", + "script.onerror = script.onload = null;", + "clearTimeout(timeout);", + "var chunk = installedChunks[chunkId];", + "if(chunk !== 0) {", + Template.indent([ + "if(chunk) {", + Template.indent([ + "var errorType = event && (event.type === 'load' ? 'missing' : event.type);", + "var realSrc = event && event.target && event.target.src;", + "error.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';", + "error.name = 'ChunkLoadError';", + "error.type = errorType;", + "error.request = realSrc;", + "chunk[1](error);" + ]), + "}", + "installedChunks[chunkId] = undefined;" + ]), + "}" + ]), + "};", + "var timeout = setTimeout(function(){", + Template.indent([ + "onScriptComplete({ type: 'timeout', target: script });" + ]), + `}, ${chunkLoadTimeout});`, + "script.onerror = script.onload = onScriptComplete;" + ]); + } + ); + mainTemplate.hooks.linkPreload.tap( + "JsonpMainTemplatePlugin", + (_, chunk, hash) => { + const crossOriginLoading = + mainTemplate.outputOptions.crossOriginLoading; + const jsonpScriptType = mainTemplate.outputOptions.jsonpScriptType; + + return Template.asString([ + "var link = document.createElement('link');", + jsonpScriptType + ? `link.type = ${JSON.stringify(jsonpScriptType)};` + : "", + "link.charset = 'utf-8';", + `if (${mainTemplate.requireFn}.nc) {`, + Template.indent( + `link.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` + ), + "}", + 'link.rel = "preload";', + 'link.as = "script";', + "link.href = jsonpScriptSrc(chunkId);", + crossOriginLoading + ? Template.asString([ + "if (link.href.indexOf(window.location.origin + '/') !== 0) {", + Template.indent( + `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + ), + "}" + ]) + : "" + ]); + } + ); + mainTemplate.hooks.linkPrefetch.tap( + "JsonpMainTemplatePlugin", + (_, chunk, hash) => { + const crossOriginLoading = + mainTemplate.outputOptions.crossOriginLoading; + + return Template.asString([ + "var link = document.createElement('link');", + crossOriginLoading + ? `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + : "", + `if (${mainTemplate.requireFn}.nc) {`, + Template.indent( + `link.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` + ), + "}", + 'link.rel = "prefetch";', + 'link.as = "script";', + "link.href = jsonpScriptSrc(chunkId);" + ]); + } + ); + mainTemplate.hooks.requireEnsure.tap( + "JsonpMainTemplatePlugin load", + (source, chunk, hash) => { + return Template.asString([ + source, + "", + "// JSONP chunk loading for javascript", + "", + "var installedChunkData = installedChunks[chunkId];", + 'if(installedChunkData !== 0) { // 0 means "already installed".', + Template.indent([ + "", + '// a Promise means "currently loading".', + "if(installedChunkData) {", + Template.indent(["promises.push(installedChunkData[2]);"]), + "} else {", + Template.indent([ + "// setup Promise in chunk cache", + "var promise = new Promise(function(resolve, reject) {", + Template.indent([ + "installedChunkData = installedChunks[chunkId] = [resolve, reject];" + ]), + "});", + "promises.push(installedChunkData[2] = promise);", + "", + "// start chunk loading", + mainTemplate.hooks.jsonpScript.call("", chunk, hash), + "document.head.appendChild(script);" + ]), + "}" + ]), + "}" + ]); + } + ); + mainTemplate.hooks.requireEnsure.tap( + { + name: "JsonpMainTemplatePlugin preload", + stage: 10 + }, + (source, chunk, hash) => { + const chunkMap = chunk.getChildIdsByOrdersMap().preload; + if (!chunkMap || Object.keys(chunkMap).length === 0) return source; + return Template.asString([ + source, + "", + "// chunk preloadng for javascript", + "", + `var chunkPreloadMap = ${JSON.stringify(chunkMap, null, "\t")};`, + "", + "var chunkPreloadData = chunkPreloadMap[chunkId];", + "if(chunkPreloadData) {", + Template.indent([ + "chunkPreloadData.forEach(function(chunkId) {", + Template.indent([ + "if(installedChunks[chunkId] === undefined) {", + Template.indent([ + "installedChunks[chunkId] = null;", + mainTemplate.hooks.linkPreload.call("", chunk, hash), + "document.head.appendChild(link);" + ]), + "}" + ]), + "});" + ]), + "}" + ]); + } + ); + mainTemplate.hooks.requireExtensions.tap( + "JsonpMainTemplatePlugin", + (source, chunk) => { + if (!needChunkOnDemandLoadingCode(chunk)) return source; + + return Template.asString([ + source, + "", + "// on error function for async loading", + `${mainTemplate.requireFn}.oe = function(err) { console.error(err); throw err; };` + ]); + } + ); + mainTemplate.hooks.bootstrap.tap( + "JsonpMainTemplatePlugin", + (source, chunk, hash) => { + if (needChunkLoadingCode(chunk)) { + const withDefer = needEntryDeferringCode(chunk); + const withPrefetch = needPrefetchingCode(chunk); + return Template.asString([ + source, + "", + "// install a JSONP callback for chunk loading", + "function webpackJsonpCallback(data) {", + Template.indent([ + "var chunkIds = data[0];", + "var moreModules = data[1];", + withDefer ? "var executeModules = data[2];" : "", + withPrefetch ? "var prefetchChunks = data[3] || [];" : "", + '// add "moreModules" to the modules object,', + '// then flag all "chunkIds" as loaded and fire callback', + "var moduleId, chunkId, i = 0, resolves = [];", + "for(;i < chunkIds.length; i++) {", + Template.indent([ + "chunkId = chunkIds[i];", + "if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {", + Template.indent("resolves.push(installedChunks[chunkId][0]);"), + "}", + "installedChunks[chunkId] = 0;" + ]), + "}", + "for(moduleId in moreModules) {", + Template.indent([ + "if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {", + Template.indent( + mainTemplate.renderAddModule( + hash, + chunk, + "moduleId", + "moreModules[moduleId]" + ) + ), + "}" + ]), + "}", + "if(parentJsonpFunction) parentJsonpFunction(data);", + withPrefetch + ? withDefer + ? "deferredPrefetch.push.apply(deferredPrefetch, prefetchChunks);" + : Template.asString([ + "// chunk prefetching for javascript", + "prefetchChunks.forEach(function(chunkId) {", + Template.indent([ + "if(installedChunks[chunkId] === undefined) {", + Template.indent([ + "installedChunks[chunkId] = null;", + mainTemplate.hooks.linkPrefetch.call("", chunk, hash), + "document.head.appendChild(link);" + ]), + "}" + ]), + "});" + ]) + : "", + "while(resolves.length) {", + Template.indent("resolves.shift()();"), + "}", + withDefer + ? Template.asString([ + "", + "// add entry modules from loaded chunk to deferred list", + "deferredModules.push.apply(deferredModules, executeModules || []);", + "", + "// run deferred modules when all chunks ready", + "return checkDeferredModules();" + ]) + : "" + ]), + "};", + withDefer + ? Template.asString([ + "function checkDeferredModules() {", + Template.indent([ + "var result;", + "for(var i = 0; i < deferredModules.length; i++) {", + Template.indent([ + "var deferredModule = deferredModules[i];", + "var fulfilled = true;", + "for(var j = 1; j < deferredModule.length; j++) {", + Template.indent([ + "var depId = deferredModule[j];", + "if(installedChunks[depId] !== 0) fulfilled = false;" + ]), + "}", + "if(fulfilled) {", + Template.indent([ + "deferredModules.splice(i--, 1);", + "result = " + + mainTemplate.requireFn + + "(" + + mainTemplate.requireFn + + ".s = deferredModule[0]);" + ]), + "}" + ]), + "}", + withPrefetch + ? Template.asString([ + "if(deferredModules.length === 0) {", + Template.indent([ + "// chunk prefetching for javascript", + "deferredPrefetch.forEach(function(chunkId) {", + Template.indent([ + "if(installedChunks[chunkId] === undefined) {", + Template.indent([ + "installedChunks[chunkId] = null;", + mainTemplate.hooks.linkPrefetch.call( + "", + chunk, + hash + ), + "document.head.appendChild(link);" + ]), + "}" + ]), + "});", + "deferredPrefetch.length = 0;" + ]), + "}" + ]) + : "", + "return result;" + ]), + "}" + ]) + : "" + ]); + } + return source; + } + ); + mainTemplate.hooks.beforeStartup.tap( + "JsonpMainTemplatePlugin", + (source, chunk, hash) => { + if (needChunkLoadingCode(chunk)) { + var jsonpFunction = mainTemplate.outputOptions.jsonpFunction; + var globalObject = mainTemplate.outputOptions.globalObject; + return Template.asString([ + `var jsonpArray = ${globalObject}[${JSON.stringify( + jsonpFunction + )}] = ${globalObject}[${JSON.stringify(jsonpFunction)}] || [];`, + "var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);", + "jsonpArray.push = webpackJsonpCallback;", + "jsonpArray = jsonpArray.slice();", + "for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);", + "var parentJsonpFunction = oldJsonpFunction;", + "", + source + ]); + } + return source; + } + ); + mainTemplate.hooks.afterStartup.tap( + "JsonpMainTemplatePlugin", + (source, chunk, hash) => { + const prefetchChunks = chunk.getChildIdsByOrders().prefetch; + if ( + needChunkLoadingCode(chunk) && + prefetchChunks && + prefetchChunks.length + ) { + return Template.asString([ + source, + `webpackJsonpCallback([[], {}, 0, ${JSON.stringify( + prefetchChunks + )}]);` + ]); + } + return source; + } + ); + mainTemplate.hooks.startup.tap( + "JsonpMainTemplatePlugin", + (source, chunk, hash) => { + if (needEntryDeferringCode(chunk)) { + if (chunk.hasEntryModule()) { + const entries = [chunk.entryModule].filter(Boolean).map(m => + [m.id].concat( + Array.from(chunk.groupsIterable)[0] + .chunks.filter(c => c !== chunk) + .map(c => c.id) + ) + ); + return Template.asString([ + "// add entry module to deferred list", + `deferredModules.push(${entries + .map(e => JSON.stringify(e)) + .join(", ")});`, + "// run deferred modules when ready", + "return checkDeferredModules();" + ]); + } else { + return Template.asString([ + "// run deferred modules from other chunks", + "checkDeferredModules();" + ]); + } + } + return source; + } + ); + mainTemplate.hooks.hotBootstrap.tap( + "JsonpMainTemplatePlugin", + (source, chunk, hash) => { + const globalObject = mainTemplate.outputOptions.globalObject; + const hotUpdateChunkFilename = + mainTemplate.outputOptions.hotUpdateChunkFilename; + const hotUpdateMainFilename = + mainTemplate.outputOptions.hotUpdateMainFilename; + const crossOriginLoading = + mainTemplate.outputOptions.crossOriginLoading; + const hotUpdateFunction = mainTemplate.outputOptions.hotUpdateFunction; + const currentHotUpdateChunkFilename = mainTemplate.getAssetPath( + JSON.stringify(hotUpdateChunkFilename), + { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, + chunk: { + id: '" + chunkId + "' } + } + ); + const currentHotUpdateMainFilename = mainTemplate.getAssetPath( + JSON.stringify(hotUpdateMainFilename), + { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "` + } + ); + const runtimeSource = Template.getFunctionContent( + __webpack_require__(24916) + ) + .replace(/\/\/\$semicolon/g, ";") + .replace(/\$require\$/g, mainTemplate.requireFn) + .replace( + /\$crossOriginLoading\$/g, + crossOriginLoading ? JSON.stringify(crossOriginLoading) : "null" + ) + .replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename) + .replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename) + .replace(/\$hash\$/g, JSON.stringify(hash)); + return `${source} +function hotDisposeChunk(chunkId) { + delete installedChunks[chunkId]; +} +var parentHotUpdateCallback = ${globalObject}[${JSON.stringify( + hotUpdateFunction + )}]; +${globalObject}[${JSON.stringify(hotUpdateFunction)}] = ${runtimeSource}`; + } + ); + mainTemplate.hooks.hash.tap("JsonpMainTemplatePlugin", hash => { + hash.update("jsonp"); + hash.update("6"); + }); + } +} +module.exports = JsonpMainTemplatePlugin; - // Were some (invalid) chunks removed from usedChunks? - // => readd all modules to the queue, as things could have been changed - if (usedChunks.size < selectedChunks.length) { - if (usedChunks.size >= item.cacheGroup.minChunks) { - const chunksArr = Array.from(usedChunks); - for (const module of item.modules) { - addModuleToChunksInfoMap( - item.cacheGroup, - item.cacheGroupIndex, - chunksArr, - getKey(usedChunks), - module - ); - } - } - continue; - } - // Create the new chunk if not reusing one - if (!isReused) { - newChunk = compilation.addChunk(chunkName); - } - // Walk through all chunks - for (const chunk of usedChunks) { - // Add graph connections for splitted chunk - chunk.split(newChunk); - } +/***/ }), - // Add a note to the chunk - newChunk.chunkReason = isReused - ? "reused as split chunk" - : "split chunk"; - if (item.cacheGroup.key) { - newChunk.chunkReason += ` (cache group: ${item.cacheGroup.key})`; - } - if (chunkName) { - newChunk.chunkReason += ` (name: ${chunkName})`; - // If the chosen name is already an entry point we remove the entry point - const entrypoint = compilation.entrypoints.get(chunkName); - if (entrypoint) { - compilation.entrypoints.delete(chunkName); - entrypoint.remove(); - newChunk.entryModule = undefined; - } - } - if (item.cacheGroup.filename) { - if (!newChunk.isOnlyInitial()) { - throw new Error( - "SplitChunksPlugin: You are trying to set a filename for a chunk which is (also) loaded on demand. " + - "The runtime can only handle loading of chunks which match the chunkFilename schema. " + - "Using a custom filename would fail at runtime. " + - `(cache group: ${item.cacheGroup.key})` - ); - } - newChunk.filenameTemplate = item.cacheGroup.filename; - } - if (!isReused) { - // Add all modules to the new chunk - for (const module of item.modules) { - if (typeof module.chunkCondition === "function") { - if (!module.chunkCondition(newChunk)) continue; - } - // Add module to new chunk - GraphHelpers.connectChunkAndModule(newChunk, module); - // Remove module from used chunks - for (const chunk of usedChunks) { - chunk.removeModule(module); - module.rewriteChunkInReasons(chunk, [newChunk]); - } - } - } else { - // Remove all modules from used chunks - for (const module of item.modules) { - for (const chunk of usedChunks) { - chunk.removeModule(module); - module.rewriteChunkInReasons(chunk, [newChunk]); - } - } - } +/***/ 92764: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - if (item.cacheGroup.maxSize > 0) { - const oldMaxSizeSettings = maxSizeQueueMap.get(newChunk); - maxSizeQueueMap.set(newChunk, { - minSize: Math.max( - oldMaxSizeSettings ? oldMaxSizeSettings.minSize : 0, - item.cacheGroup.minSizeForMaxSize - ), - maxSize: Math.min( - oldMaxSizeSettings ? oldMaxSizeSettings.maxSize : Infinity, - item.cacheGroup.maxSize - ), - automaticNameDelimiter: item.cacheGroup.automaticNameDelimiter, - keys: oldMaxSizeSettings - ? oldMaxSizeSettings.keys.concat(item.cacheGroup.key) - : [item.cacheGroup.key] - }); - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - // remove all modules from other entries and update size - for (const [key, info] of chunksInfoMap) { - if (isOverlap(info.chunks, usedChunks)) { - // update modules and total size - // may remove it from the map when < minSize - const oldSize = info.modules.size; - for (const module of item.modules) { - info.modules.delete(module); - } - if (info.modules.size !== oldSize) { - if (info.modules.size === 0) { - chunksInfoMap.delete(key); - continue; - } - info.size = getModulesSize(info.modules); - if ( - info.cacheGroup._validateSize && - info.size < info.cacheGroup.minSize - ) { - chunksInfoMap.delete(key); - } - if (info.modules.size === 0) { - chunksInfoMap.delete(key); - } - } - } - } - } - const incorrectMinMaxSizeSet = new Set(); +const JsonpMainTemplatePlugin = __webpack_require__(38017); +const JsonpChunkTemplatePlugin = __webpack_require__(31898); +const JsonpHotUpdateChunkTemplatePlugin = __webpack_require__(44458); - // Make sure that maxSize is fulfilled - for (const chunk of compilation.chunks.slice()) { - const { minSize, maxSize, automaticNameDelimiter, keys } = - maxSizeQueueMap.get(chunk) || this.options.fallbackCacheGroup; - if (!maxSize) continue; - if (minSize > maxSize) { - const warningKey = `${keys && keys.join()} ${minSize} ${maxSize}`; - if (!incorrectMinMaxSizeSet.has(warningKey)) { - incorrectMinMaxSizeSet.add(warningKey); - compilation.warnings.push( - new MinMaxSizeWarning(keys, minSize, maxSize) - ); - } - } - const results = deterministicGroupingForModules({ - maxSize: Math.max(minSize, maxSize), - minSize, - items: chunk.modulesIterable, - getKey(module) { - const ident = contextify( - compilation.options.context, - module.identifier() - ); - const name = module.nameForCondition - ? contextify( - compilation.options.context, - module.nameForCondition() - ) - : ident.replace(/^.*!|\?[^?!]*$/g, ""); - const fullKey = - name + automaticNameDelimiter + hashFilename(ident); - return fullKey.replace(/[\\/?]/g, "_"); - }, - getSize(module) { - return module.size(); - } - }); - results.sort((a, b) => { - if (a.key < b.key) return -1; - if (a.key > b.key) return 1; - return 0; - }); - for (let i = 0; i < results.length; i++) { - const group = results[i]; - const key = this.options.hidePathInfo - ? hashFilename(group.key) - : group.key; - let name = chunk.name - ? chunk.name + automaticNameDelimiter + key - : null; - if (name && name.length > 100) { - name = - name.slice(0, 100) + - automaticNameDelimiter + - hashFilename(name); - } - let newPart; - if (i !== results.length - 1) { - newPart = compilation.addChunk(name); - chunk.split(newPart); - newPart.chunkReason = chunk.chunkReason; - // Add all modules to the new chunk - for (const module of group.items) { - if (typeof module.chunkCondition === "function") { - if (!module.chunkCondition(newPart)) continue; - } - // Add module to new chunk - GraphHelpers.connectChunkAndModule(newPart, module); - // Remove module from used chunks - chunk.removeModule(module); - module.rewriteChunkInReasons(chunk, [newPart]); - } - } else { - // change the chunk to be a part - newPart = chunk; - chunk.name = name; - } - } - } - } +class JsonpTemplatePlugin { + apply(compiler) { + compiler.hooks.thisCompilation.tap("JsonpTemplatePlugin", compilation => { + new JsonpMainTemplatePlugin().apply(compilation.mainTemplate); + new JsonpChunkTemplatePlugin().apply(compilation.chunkTemplate); + new JsonpHotUpdateChunkTemplatePlugin().apply( + compilation.hotUpdateChunkTemplate ); }); } -}; +} + +module.exports = JsonpTemplatePlugin; /***/ }), -/***/ 89339: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 92929: +/***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Sean Larkin @thelarkinn + Author Tobias Koppers @sokra */ -const WebpackError = __webpack_require__(97391); -const SizeFormatHelpers = __webpack_require__(12496); +const Compiler = __webpack_require__(58705); +const MultiCompiler = __webpack_require__(10238); +const NodeEnvironmentPlugin = __webpack_require__(52520); +const WebpackOptionsApply = __webpack_require__(2779); +const WebpackOptionsDefaulter = __webpack_require__(60016); +const validateSchema = __webpack_require__(68935); +const WebpackOptionsValidationError = __webpack_require__(285); +const webpackOptionsSchema = __webpack_require__(37863); +const RemovedPluginError = __webpack_require__(15377); +const version = __webpack_require__(71618)/* .version */ .i8; -module.exports = class AssetsOverSizeLimitWarning extends WebpackError { - constructor(assetsOverSizeLimit, assetLimit) { - const assetLists = assetsOverSizeLimit - .map( - asset => - `\n ${asset.name} (${SizeFormatHelpers.formatSize(asset.size)})` - ) - .join(""); +/** @typedef {import("../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ - super(`asset size limit: The following asset(s) exceed the recommended size limit (${SizeFormatHelpers.formatSize( - assetLimit - )}). -This can impact web performance. -Assets: ${assetLists}`); +/** + * @param {WebpackOptions} options options object + * @param {function(Error=, Stats=): void=} callback callback + * @returns {Compiler | MultiCompiler} the compiler object + */ +const webpack = (options, callback) => { + const webpackOptionsValidationErrors = validateSchema( + webpackOptionsSchema, + options + ); + if (webpackOptionsValidationErrors.length) { + throw new WebpackOptionsValidationError(webpackOptionsValidationErrors); + } + let compiler; + if (Array.isArray(options)) { + compiler = new MultiCompiler( + Array.from(options).map(options => webpack(options)) + ); + } else if (typeof options === "object") { + options = new WebpackOptionsDefaulter().process(options); + + compiler = new Compiler(options.context); + compiler.options = options; + new NodeEnvironmentPlugin({ + infrastructureLogging: options.infrastructureLogging + }).apply(compiler); + if (options.plugins && Array.isArray(options.plugins)) { + for (const plugin of options.plugins) { + if (typeof plugin === "function") { + plugin.call(compiler, compiler); + } else { + plugin.apply(compiler); + } + } + } + compiler.hooks.environment.call(); + compiler.hooks.afterEnvironment.call(); + compiler.options = new WebpackOptionsApply().process(options, compiler); + } else { + throw new Error("Invalid argument: options"); + } + if (callback) { + if (typeof callback !== "function") { + throw new Error("Invalid argument: callback"); + } + if ( + options.watch === true || + (Array.isArray(options) && options.some(o => o.watch)) + ) { + const watchOptions = Array.isArray(options) + ? options.map(o => o.watchOptions || {}) + : options.watchOptions || {}; + return compiler.watch(watchOptions, callback); + } + compiler.run(callback); + } + return compiler; +}; + +exports = module.exports = webpack; +exports.version = version; + +webpack.WebpackOptionsDefaulter = WebpackOptionsDefaulter; +webpack.WebpackOptionsApply = WebpackOptionsApply; +webpack.Compiler = Compiler; +webpack.MultiCompiler = MultiCompiler; +webpack.NodeEnvironmentPlugin = NodeEnvironmentPlugin; +// @ts-ignore Global @this directive is not supported +webpack.validate = validateSchema.bind(this, webpackOptionsSchema); +webpack.validateSchema = validateSchema; +webpack.WebpackOptionsValidationError = WebpackOptionsValidationError; + +const exportPlugins = (obj, mappings) => { + for (const name of Object.keys(mappings)) { + Object.defineProperty(obj, name, { + configurable: false, + enumerable: true, + get: mappings[name] + }); + } +}; + +exportPlugins(exports, { + AutomaticPrefetchPlugin: () => __webpack_require__(51596), + BannerPlugin: () => __webpack_require__(4009), + CachePlugin: () => __webpack_require__(6465), + ContextExclusionPlugin: () => __webpack_require__(10706), + ContextReplacementPlugin: () => __webpack_require__(27295), + DefinePlugin: () => __webpack_require__(97374), + Dependency: () => __webpack_require__(57282), + DllPlugin: () => __webpack_require__(45255), + DllReferencePlugin: () => __webpack_require__(86231), + EnvironmentPlugin: () => __webpack_require__(6098), + EvalDevToolModulePlugin: () => __webpack_require__(65200), + EvalSourceMapDevToolPlugin: () => __webpack_require__(99994), + ExtendedAPIPlugin: () => __webpack_require__(17270), + ExternalsPlugin: () => __webpack_require__(75705), + HashedModuleIdsPlugin: () => __webpack_require__(50268), + HotModuleReplacementPlugin: () => __webpack_require__(69575), + IgnorePlugin: () => __webpack_require__(41364), + LibraryTemplatePlugin: () => __webpack_require__(65237), + LoaderOptionsPlugin: () => __webpack_require__(48775), + LoaderTargetPlugin: () => __webpack_require__(95154), + MemoryOutputFileSystem: () => __webpack_require__(50332), + Module: () => __webpack_require__(75993), + ModuleFilenameHelpers: () => __webpack_require__(71474), + NamedChunksPlugin: () => __webpack_require__(70419), + NamedModulesPlugin: () => __webpack_require__(86707), + NoEmitOnErrorsPlugin: () => __webpack_require__(22615), + NormalModuleReplacementPlugin: () => + __webpack_require__(73253), + PrefetchPlugin: () => __webpack_require__(27850), + ProgressPlugin: () => __webpack_require__(63123), + ProvidePlugin: () => __webpack_require__(72861), + SetVarMainTemplatePlugin: () => __webpack_require__(37098), + SingleEntryPlugin: () => __webpack_require__(19070), + SourceMapDevToolPlugin: () => __webpack_require__(11851), + Stats: () => __webpack_require__(99977), + Template: () => __webpack_require__(96066), + UmdMainTemplatePlugin: () => __webpack_require__(75374), + WatchIgnorePlugin: () => __webpack_require__(88015) +}); +exportPlugins((exports.dependencies = {}), { + DependencyReference: () => __webpack_require__(71722) +}); +exportPlugins((exports.optimize = {}), { + AggressiveMergingPlugin: () => __webpack_require__(88197), + AggressiveSplittingPlugin: () => + __webpack_require__(26688), + ChunkModuleIdRangePlugin: () => + __webpack_require__(30346), + LimitChunkCountPlugin: () => __webpack_require__(3846), + MinChunkSizePlugin: () => __webpack_require__(55607), + ModuleConcatenationPlugin: () => + __webpack_require__(45184), + OccurrenceOrderPlugin: () => __webpack_require__(67340), + OccurrenceModuleOrderPlugin: () => + __webpack_require__(62000), + OccurrenceChunkOrderPlugin: () => + __webpack_require__(83741), + RuntimeChunkPlugin: () => __webpack_require__(76894), + SideEffectsFlagPlugin: () => __webpack_require__(83654), + SplitChunksPlugin: () => __webpack_require__(60474) +}); +exportPlugins((exports.web = {}), { + FetchCompileWasmTemplatePlugin: () => + __webpack_require__(52669), + JsonpTemplatePlugin: () => __webpack_require__(92764) +}); +exportPlugins((exports.webworker = {}), { + WebWorkerTemplatePlugin: () => __webpack_require__(21328) +}); +exportPlugins((exports.node = {}), { + NodeTemplatePlugin: () => __webpack_require__(90010), + ReadFileCompileWasmTemplatePlugin: () => + __webpack_require__(73839) +}); +exportPlugins((exports.debug = {}), { + ProfilingPlugin: () => __webpack_require__(72890) +}); +exportPlugins((exports.util = {}), { + createHash: () => __webpack_require__(15660) +}); + +const defineMissingPluginError = (namespace, pluginName, errorMessage) => { + Object.defineProperty(namespace, pluginName, { + configurable: false, + enumerable: true, + get() { + throw new RemovedPluginError(errorMessage); + } + }); +}; - this.name = "AssetsOverSizeLimitWarning"; - this.assets = assetsOverSizeLimit; +// TODO remove in webpack 5 +defineMissingPluginError( + exports.optimize, + "UglifyJsPlugin", + "webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead." +); - Error.captureStackTrace(this, this.constructor); - } -}; +// TODO remove in webpack 5 +defineMissingPluginError( + exports.optimize, + "CommonsChunkPlugin", + "webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead." +); /***/ }), -/***/ 41336: +/***/ 37919: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Sean Larkin @thelarkinn + Author Tobias Koppers @sokra */ -const WebpackError = __webpack_require__(97391); -const SizeFormatHelpers = __webpack_require__(12496); - -module.exports = class EntrypointsOverSizeLimitWarning extends WebpackError { - constructor(entrypoints, entrypointLimit) { - const entrypointList = entrypoints - .map( - entrypoint => - `\n ${entrypoint.name} (${SizeFormatHelpers.formatSize( - entrypoint.size - )})\n${entrypoint.files.map(asset => ` ${asset}`).join("\n")}` - ) - .join(""); - super(`entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (${SizeFormatHelpers.formatSize( - entrypointLimit - )}). This can impact web performance. -Entrypoints:${entrypointList}\n`); - - this.name = "EntrypointsOverSizeLimitWarning"; - this.entrypoints = entrypoints; +const { ConcatSource } = __webpack_require__(53665); - Error.captureStackTrace(this, this.constructor); +class WebWorkerChunkTemplatePlugin { + apply(chunkTemplate) { + chunkTemplate.hooks.render.tap( + "WebWorkerChunkTemplatePlugin", + (modules, chunk) => { + const chunkCallbackName = chunkTemplate.outputOptions.chunkCallbackName; + const globalObject = chunkTemplate.outputOptions.globalObject; + const source = new ConcatSource(); + source.add( + `${globalObject}[${JSON.stringify( + chunkCallbackName + )}](${JSON.stringify(chunk.ids)},` + ); + source.add(modules); + source.add(")"); + return source; + } + ); + chunkTemplate.hooks.hash.tap("WebWorkerChunkTemplatePlugin", hash => { + hash.update("webworker"); + hash.update("3"); + hash.update(`${chunkTemplate.outputOptions.chunkCallbackName}`); + hash.update(`${chunkTemplate.outputOptions.globalObject}`); + }); } -}; +} +module.exports = WebWorkerChunkTemplatePlugin; /***/ }), -/***/ 53006: +/***/ 45493: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Sean Larkin @thelarkinn + Author Tobias Koppers @sokra */ +const { ConcatSource } = __webpack_require__(53665); -const WebpackError = __webpack_require__(97391); - -module.exports = class NoAsyncChunksWarning extends WebpackError { - constructor() { - super( - "webpack performance recommendations: \n" + - "You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.\n" + - "For more info visit https://webpack.js.org/guides/code-splitting/" +class WebWorkerHotUpdateChunkTemplatePlugin { + apply(hotUpdateChunkTemplate) { + hotUpdateChunkTemplate.hooks.render.tap( + "WebWorkerHotUpdateChunkTemplatePlugin", + (modulesSource, modules, removedModules, hash, id) => { + const hotUpdateFunction = + hotUpdateChunkTemplate.outputOptions.hotUpdateFunction; + const globalObject = hotUpdateChunkTemplate.outputOptions.globalObject; + const source = new ConcatSource(); + source.add( + `${globalObject}[${JSON.stringify( + hotUpdateFunction + )}](${JSON.stringify(id)},` + ); + source.add(modulesSource); + source.add(")"); + return source; + } + ); + hotUpdateChunkTemplate.hooks.hash.tap( + "WebWorkerHotUpdateChunkTemplatePlugin", + hash => { + hash.update("WebWorkerHotUpdateChunkTemplatePlugin"); + hash.update("3"); + hash.update( + hotUpdateChunkTemplate.outputOptions.hotUpdateFunction + "" + ); + hash.update(hotUpdateChunkTemplate.outputOptions.globalObject + ""); + } ); - - this.name = "NoAsyncChunksWarning"; - - Error.captureStackTrace(this, this.constructor); } -}; +} +module.exports = WebWorkerHotUpdateChunkTemplatePlugin; /***/ }), -/***/ 68310: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 72337: +/***/ (function(module) { -"use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php - Author Sean Larkin @thelarkinn + Author Tobias Koppers @sokra */ +// eslint-disable-next-line no-unused-vars +var hotAddUpdateChunk = undefined; +var parentHotUpdateCallback = undefined; +var $require$ = undefined; +var $hotChunkFilename$ = undefined; +var $hotMainFilename$ = undefined; +var installedChunks = undefined; +var importScripts = undefined; -const EntrypointsOverSizeLimitWarning = __webpack_require__(41336); -const AssetsOverSizeLimitWarning = __webpack_require__(89339); -const NoAsyncChunksWarning = __webpack_require__(53006); - -/** @typedef {import("../Compiler")} Compiler */ -/** @typedef {import("../Entrypoint")} Entrypoint */ +module.exports = function() { + // eslint-disable-next-line no-unused-vars + function webpackHotUpdateCallback(chunkId, moreModules) { + hotAddUpdateChunk(chunkId, moreModules); + if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); + } //$semicolon -module.exports = class SizeLimitsPlugin { - constructor(options) { - this.hints = options.hints; - this.maxAssetSize = options.maxAssetSize; - this.maxEntrypointSize = options.maxEntrypointSize; - this.assetFilter = options.assetFilter; + // eslint-disable-next-line no-unused-vars + function hotDownloadUpdateChunk(chunkId) { + importScripts($require$.p + $hotChunkFilename$); } - /** - * @param {Compiler} compiler webpack compiler - * @returns {void} - */ - apply(compiler) { - const entrypointSizeLimit = this.maxEntrypointSize; - const assetSizeLimit = this.maxAssetSize; - const hints = this.hints; - const assetFilter = - this.assetFilter || ((name, source, info) => !info.development); - - compiler.hooks.afterEmit.tap("SizeLimitsPlugin", compilation => { - const warnings = []; - - /** - * @param {Entrypoint} entrypoint an entrypoint - * @returns {number} the size of the entrypoint - */ - const getEntrypointSize = entrypoint => - entrypoint.getFiles().reduce((currentSize, file) => { - const asset = compilation.getAsset(file); - if ( - asset && - assetFilter(asset.name, asset.source, asset.info) && - asset.source - ) { - return currentSize + (asset.info.size || asset.source.size()); - } - - return currentSize; - }, 0); - - const assetsOverSizeLimit = []; - for (const { name, source, info } of compilation.getAssets()) { - if (!assetFilter(name, source, info) || !source) { - continue; - } - - const size = info.size || source.size(); - if (size > assetSizeLimit) { - assetsOverSizeLimit.push({ - name, - size - }); - /** @type {any} */ (source).isOverSizeLimit = true; - } + // eslint-disable-next-line no-unused-vars + function hotDownloadManifest(requestTimeout) { + requestTimeout = requestTimeout || 10000; + return new Promise(function(resolve, reject) { + if (typeof XMLHttpRequest === "undefined") { + return reject(new Error("No browser support")); } - - const fileFilter = name => { - const asset = compilation.getAsset(name); - return asset && assetFilter(asset.name, asset.source, asset.info); - }; - - const entrypointsOverLimit = []; - for (const [name, entry] of compilation.entrypoints) { - const size = getEntrypointSize(entry); - - if (size > entrypointSizeLimit) { - entrypointsOverLimit.push({ - name: name, - size: size, - files: entry.getFiles().filter(fileFilter) - }); - /** @type {any} */ (entry).isOverSizeLimit = true; - } + try { + var request = new XMLHttpRequest(); + var requestPath = $require$.p + $hotMainFilename$; + request.open("GET", requestPath, true); + request.timeout = requestTimeout; + request.send(null); + } catch (err) { + return reject(err); } - - if (hints) { - // 1. Individual Chunk: Size < 250kb - // 2. Collective Initial Chunks [entrypoint] (Each Set?): Size < 250kb - // 3. No Async Chunks - // if !1, then 2, if !2 return - if (assetsOverSizeLimit.length > 0) { - warnings.push( - new AssetsOverSizeLimitWarning(assetsOverSizeLimit, assetSizeLimit) - ); - } - if (entrypointsOverLimit.length > 0) { - warnings.push( - new EntrypointsOverSizeLimitWarning( - entrypointsOverLimit, - entrypointSizeLimit - ) + request.onreadystatechange = function() { + if (request.readyState !== 4) return; + if (request.status === 0) { + // timeout + reject( + new Error("Manifest request to " + requestPath + " timed out.") ); - } - - if (warnings.length > 0) { - const hasAsyncChunks = - compilation.chunks.filter(chunk => !chunk.canBeInitial()).length > - 0; - - if (!hasAsyncChunks) { - warnings.push(new NoAsyncChunksWarning()); - } - - if (hints === "error") { - compilation.errors.push(...warnings); - } else { - compilation.warnings.push(...warnings); + } else if (request.status === 404) { + // no update available + resolve(); + } else if (request.status !== 200 && request.status !== 304) { + // other failure + reject(new Error("Manifest request to " + requestPath + " failed.")); + } else { + // success + try { + var update = JSON.parse(request.responseText); + } catch (e) { + reject(e); + return; } + resolve(update); } - } + }; }); } + + //eslint-disable-next-line no-unused-vars + function hotDisposeChunk(chunkId) { + delete installedChunks[chunkId]; + } }; /***/ }), -/***/ 52315: +/***/ 20482: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -92904,10017 +93519,9013 @@ module.exports = class SizeLimitsPlugin { */ +const Template = __webpack_require__(96066); -const SortableSet = __webpack_require__(50071); - -/** - * @template T - * @template K - * Multi layer bucket sorted set - * Supports adding non-existing items (DO NOT ADD ITEM TWICE) - * Supports removing exiting items (DO NOT REMOVE ITEM NOT IN SET) - * Supports popping the first items according to defined order - * Supports iterating all items without order - * Supports updating an item in an efficient way - * Supports size property, which is the number of items - * Items are lazy partially sorted when needed - */ -class LazyBucketSortedSet { - /** - * @param {function(T): K} getKey function to get key from item - * @param {function(K, K): number} comparator comparator to sort keys - * @param {...((function(T): any) | (function(any, any): number))} args more pairs of getKey and comparator plus optional final comparator for the last layer - */ - constructor(getKey, comparator, ...args) { - this._getKey = getKey; - this._innerArgs = args; - this._leaf = args.length <= 1; - this._keys = new SortableSet(undefined, comparator); - /** @type {Map | SortableSet>} */ - this._map = new Map(); - this._unsortedItems = new Set(); - this.size = 0; - } +class WebWorkerMainTemplatePlugin { + apply(mainTemplate) { + const needChunkOnDemandLoadingCode = chunk => { + for (const chunkGroup of chunk.groupsIterable) { + if (chunkGroup.getNumberOfChildren() > 0) return true; + } + return false; + }; + mainTemplate.hooks.localVars.tap( + "WebWorkerMainTemplatePlugin", + (source, chunk) => { + if (needChunkOnDemandLoadingCode(chunk)) { + return Template.asString([ + source, + "", + "// object to store loaded chunks", + '// "1" means "already loaded"', + "var installedChunks = {", + Template.indent( + chunk.ids.map(id => `${JSON.stringify(id)}: 1`).join(",\n") + ), + "};" + ]); + } + return source; + } + ); + mainTemplate.hooks.requireEnsure.tap( + "WebWorkerMainTemplatePlugin", + (_, chunk, hash) => { + const chunkFilename = mainTemplate.outputOptions.chunkFilename; + const chunkMaps = chunk.getChunkMaps(); + return Template.asString([ + "promises.push(Promise.resolve().then(function() {", + Template.indent([ + '// "1" is the signal for "already loaded"', + "if(!installedChunks[chunkId]) {", + Template.indent([ + "importScripts(" + + "__webpack_require__.p + " + + mainTemplate.getAssetPath(JSON.stringify(chunkFilename), { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode( + hash, + length + )} + "`, + chunk: { + id: '" + chunkId + "', + hash: `" + ${JSON.stringify(chunkMaps.hash)}[chunkId] + "`, + hashWithLength(length) { + const shortChunkHashMap = Object.create(null); + for (const chunkId of Object.keys(chunkMaps.hash)) { + if (typeof chunkMaps.hash[chunkId] === "string") { + shortChunkHashMap[chunkId] = chunkMaps.hash[ + chunkId + ].substr(0, length); + } + } + return `" + ${JSON.stringify( + shortChunkHashMap + )}[chunkId] + "`; + }, + contentHash: { + javascript: `" + ${JSON.stringify( + chunkMaps.contentHash.javascript + )}[chunkId] + "` + }, + contentHashWithLength: { + javascript: length => { + const shortContentHashMap = {}; + const contentHash = chunkMaps.contentHash.javascript; + for (const chunkId of Object.keys(contentHash)) { + if (typeof contentHash[chunkId] === "string") { + shortContentHashMap[chunkId] = contentHash[ + chunkId + ].substr(0, length); + } + } + return `" + ${JSON.stringify( + shortContentHashMap + )}[chunkId] + "`; + } + }, + name: `" + (${JSON.stringify( + chunkMaps.name + )}[chunkId]||chunkId) + "` + }, + contentHashType: "javascript" + }) + + ");" + ]), + "}" + ]), + "}));" + ]); + } + ); + mainTemplate.hooks.bootstrap.tap( + "WebWorkerMainTemplatePlugin", + (source, chunk, hash) => { + if (needChunkOnDemandLoadingCode(chunk)) { + const chunkCallbackName = + mainTemplate.outputOptions.chunkCallbackName; + const globalObject = mainTemplate.outputOptions.globalObject; + return Template.asString([ + source, + `${globalObject}[${JSON.stringify( + chunkCallbackName + )}] = function webpackChunkCallback(chunkIds, moreModules) {`, + Template.indent([ + "for(var moduleId in moreModules) {", + Template.indent( + mainTemplate.renderAddModule( + hash, + chunk, + "moduleId", + "moreModules[moduleId]" + ) + ), + "}", + "while(chunkIds.length)", + Template.indent("installedChunks[chunkIds.pop()] = 1;") + ]), + "};" + ]); + } + return source; + } + ); + mainTemplate.hooks.hotBootstrap.tap( + "WebWorkerMainTemplatePlugin", + (source, chunk, hash) => { + const hotUpdateChunkFilename = + mainTemplate.outputOptions.hotUpdateChunkFilename; + const hotUpdateMainFilename = + mainTemplate.outputOptions.hotUpdateMainFilename; + const hotUpdateFunction = mainTemplate.outputOptions.hotUpdateFunction; + const globalObject = mainTemplate.outputOptions.globalObject; + const currentHotUpdateChunkFilename = mainTemplate.getAssetPath( + JSON.stringify(hotUpdateChunkFilename), + { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, + chunk: { + id: '" + chunkId + "' + } + } + ); + const currentHotUpdateMainFilename = mainTemplate.getAssetPath( + JSON.stringify(hotUpdateMainFilename), + { + hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, + hashWithLength: length => + `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "` + } + ); - /** - * @param {T} item an item - * @returns {void} - */ - add(item) { - this.size++; - this._unsortedItems.add(item); + return ( + source + + "\n" + + `var parentHotUpdateCallback = ${globalObject}[${JSON.stringify( + hotUpdateFunction + )}];\n` + + `${globalObject}[${JSON.stringify(hotUpdateFunction)}] = ` + + Template.getFunctionContent( + __webpack_require__(72337) + ) + .replace(/\/\/\$semicolon/g, ";") + .replace(/\$require\$/g, mainTemplate.requireFn) + .replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename) + .replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename) + .replace(/\$hash\$/g, JSON.stringify(hash)) + ); + } + ); + mainTemplate.hooks.hash.tap("WebWorkerMainTemplatePlugin", hash => { + hash.update("webworker"); + hash.update("4"); + }); } +} +module.exports = WebWorkerMainTemplatePlugin; - /** - * @param {K} key key of item - * @param {T} item the item - * @returns {void} - */ - _addInternal(key, item) { - let entry = this._map.get(key); - if (entry === undefined) { - entry = this._leaf - ? new SortableSet(undefined, this._innerArgs[0]) - : new /** @type {any} */ (LazyBucketSortedSet)(...this._innerArgs); - this._keys.add(key); - this._map.set(key, entry); - } - entry.add(item); - } - /** - * @param {T} item an item - * @returns {void} - */ - delete(item) { - this.size--; - if (this._unsortedItems.has(item)) { - this._unsortedItems.delete(item); - return; - } - const key = this._getKey(item); - const entry = this._map.get(key); - entry.delete(item); - if (entry.size === 0) { - this._deleteKey(key); - } - } +/***/ }), - /** - * @param {K} key key to be removed - * @returns {void} - */ - _deleteKey(key) { - this._keys.delete(key); - this._map.delete(key); - } +/***/ 21328: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - /** - * @returns {T | undefined} an item - */ - popFirst() { - if (this.size === 0) return undefined; - this.size--; - if (this._unsortedItems.size > 0) { - for (const item of this._unsortedItems) { - const key = this._getKey(item); - this._addInternal(key, item); - } - this._unsortedItems.clear(); - } - this._keys.sort(); - const key = this._keys.values().next().value; - const entry = this._map.get(key); - if (this._leaf) { - const leafEntry = /** @type {SortableSet} */ (entry); - leafEntry.sort(); - const item = leafEntry.values().next().value; - leafEntry.delete(item); - if (leafEntry.size === 0) { - this._deleteKey(key); - } - return item; - } else { - const nodeEntry = /** @type {LazyBucketSortedSet} */ (entry); - const item = nodeEntry.popFirst(); - if (nodeEntry.size === 0) { - this._deleteKey(key); - } - return item; - } - } +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ - /** - * @param {T} item to be updated item - * @returns {function(true=): void} finish update - */ - startUpdate(item) { - if (this._unsortedItems.has(item)) { - return remove => { - if (remove) { - this._unsortedItems.delete(item); - this.size--; - return; - } - }; - } - const key = this._getKey(item); - if (this._leaf) { - const oldEntry = /** @type {SortableSet} */ (this._map.get(key)); - return remove => { - if (remove) { - this.size--; - oldEntry.delete(item); - if (oldEntry.size === 0) { - this._deleteKey(key); - } - return; - } - const newKey = this._getKey(item); - if (key === newKey) { - // This flags the sortable set as unordered - oldEntry.add(item); - } else { - oldEntry.delete(item); - if (oldEntry.size === 0) { - this._deleteKey(key); - } - this._addInternal(newKey, item); - } - }; - } else { - const oldEntry = /** @type {LazyBucketSortedSet} */ (this._map.get( - key - )); - const finishUpdate = oldEntry.startUpdate(item); - return remove => { - if (remove) { - this.size--; - finishUpdate(true); - if (oldEntry.size === 0) { - this._deleteKey(key); - } - return; - } - const newKey = this._getKey(item); - if (key === newKey) { - finishUpdate(); - } else { - finishUpdate(true); - if (oldEntry.size === 0) { - this._deleteKey(key); - } - this._addInternal(newKey, item); - } - }; - } - } - /** - * @param {Iterator[]} iterators list of iterators to append to - * @returns {void} - */ - _appendIterators(iterators) { - if (this._unsortedItems.size > 0) - iterators.push(this._unsortedItems[Symbol.iterator]()); - for (const key of this._keys) { - const entry = this._map.get(key); - if (this._leaf) { - const leafEntry = /** @type {SortableSet} */ (entry); - const iterator = leafEntry[Symbol.iterator](); - iterators.push(iterator); - } else { - const nodeEntry = /** @type {LazyBucketSortedSet} */ (entry); - nodeEntry._appendIterators(iterators); - } - } - } +const WebWorkerMainTemplatePlugin = __webpack_require__(20482); +const WebWorkerChunkTemplatePlugin = __webpack_require__(37919); +const WebWorkerHotUpdateChunkTemplatePlugin = __webpack_require__(45493); - /** - * @returns {Iterator} the iterator - */ - [Symbol.iterator]() { - const iterators = []; - this._appendIterators(iterators); - iterators.reverse(); - let currentIterator = iterators.pop(); - return { - next: () => { - const res = currentIterator.next(); - if (res.done) { - if (iterators.length === 0) return res; - currentIterator = iterators.pop(); - return currentIterator.next(); - } - return res; +class WebWorkerTemplatePlugin { + apply(compiler) { + compiler.hooks.thisCompilation.tap( + "WebWorkerTemplatePlugin", + compilation => { + new WebWorkerMainTemplatePlugin().apply(compilation.mainTemplate); + new WebWorkerChunkTemplatePlugin().apply(compilation.chunkTemplate); + new WebWorkerHotUpdateChunkTemplatePlugin().apply( + compilation.hotUpdateChunkTemplate + ); } - }; + ); } } - -module.exports = LazyBucketSortedSet; +module.exports = WebWorkerTemplatePlugin; /***/ }), -/***/ 38637: -/***/ (function(module) { +/***/ 77087: +/***/ (function(__unused_webpack_module, exports) { -"use strict"; +(function (global, factory) { + true ? factory(exports) : + 0; +}(this, function (exports) { 'use strict'; + // Reserved word lists for various dialects of the language -/** - * @template T - */ -class Queue { - /** - * @param {Iterable=} items The initial elements. - */ - constructor(items) { - /** @private @type {Set} */ - this.set = new Set(items); - /** @private @type {Iterator} */ - this.iterator = this.set[Symbol.iterator](); - } + var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" + }; - /** - * Returns the number of elements in this queue. - * @returns {number} The number of elements in this queue. - */ - get length() { - return this.set.size; - } + // And the keywords - /** - * Appends the specified element to this queue. - * @param {T} item The element to add. - * @returns {void} - */ - enqueue(item) { - this.set.add(item); - } + var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; - /** - * Retrieves and removes the head of this queue. - * @returns {T | undefined} The head of the queue of `undefined` if this queue is empty. - */ - dequeue() { - const result = this.iterator.next(); - if (result.done) return undefined; - this.set.delete(result.value); - return result.value; - } -} + var keywords = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" + }; -module.exports = Queue; + var keywordRelationalOperator = /^in(stanceof)?$/; + // ## Character categories -/***/ }), + // Big ugly regular expressions that match characters in the + // whitespace, identifier, and identifier-start categories. These + // are only applied when a character is found to actually have a + // code point above 128. + // Generated by `bin/generate-identifier-regex.js`. + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -/***/ 33349: -/***/ (function(module) { + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + // These are a run-length and offset encoded representation of the + // >0xffff code points that are a valid part of identifiers. The + // offset starts at 0x10000, and each pair of numbers represents an + // offset to the next range, and then a size of the range. They were + // generated by bin/generate-identifier-regex.js -class Semaphore { - /** - * Creates an instance of Semaphore. - * - * @param {number} available the amount available number of "tasks" - * in the Semaphore - */ - constructor(available) { - this.available = available; - /** @type {(function(): void)[]} */ - this.waiters = []; - /** @private */ - this._continue = this._continue.bind(this); - } + // eslint-disable-next-line comma-spacing + var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]; - /** - * @param {function(): void} callback function block to capture and run - * @returns {void} - */ - acquire(callback) { - if (this.available > 0) { - this.available--; - callback(); - } else { - this.waiters.push(callback); - } - } + // eslint-disable-next-line comma-spacing + var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239]; - release() { - this.available++; - if (this.waiters.length > 0) { - process.nextTick(this._continue); - } - } + // This has a complexity linear to the value of the code. The + // assumption is that looking up astral identifier characters is + // rare. + function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } + } + } - _continue() { - if (this.available > 0) { - if (this.waiters.length > 0) { - this.available--; - const callback = this.waiters.pop(); - callback(); - } - } - } -} + // Test whether a given character code starts an identifier. -module.exports = Semaphore; + function isIdentifierStart(code, astral) { + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) + } + // Test whether a given character is part of an identifier. -/***/ }), + function isIdentifierChar(code, astral) { + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) + } -/***/ 54262: -/***/ (function(__unused_webpack_module, exports) { + // ## Token types -"use strict"; + // The assignment of fine-grained, information-carrying type objects + // allows the tokenizer to store the information it has about a + // token in a way that is very cheap for the parser to look up. + // All token type variables start with an underscore, to make them + // easy to recognize. -/** - * intersect creates Set containing the intersection of elements between all sets - * @param {Set[]} sets an array of sets being checked for shared elements - * @returns {Set} returns a new Set containing the intersecting items - */ -const intersect = sets => { - if (sets.length === 0) return new Set(); - if (sets.length === 1) return new Set(sets[0]); - let minSize = Infinity; - let minIndex = -1; - for (let i = 0; i < sets.length; i++) { - const size = sets[i].size; - if (size < minSize) { - minIndex = i; - minSize = size; - } - } - const current = new Set(sets[minIndex]); - for (let i = 0; i < sets.length; i++) { - if (i === minIndex) continue; - const set = sets[i]; - for (const item of current) { - if (!set.has(item)) { - current.delete(item); - } - } - } - return current; -}; + // The `beforeExpr` property is used to disambiguate between regular + // expressions and divisions. It is set on all token types that can + // be followed by an expression (thus, a slash after them would be a + // regular expression). + // + // The `startsExpr` property is used to check if the token ends a + // `yield` expression. It is set on all token types that either can + // directly start an expression (like a quotation mark) or can + // continue an expression (like the body of a string). + // + // `isLoop` marks a keyword as starting a loop, which is important + // to know when parsing a label, in order to allow or disallow + // continue jumps to that label. -/** - * Checks if a set is the subset of another set - * @param {Set} bigSet a Set which contains the original elements to compare against - * @param {Set} smallSet the set whos elements might be contained inside of bigSet - * @returns {boolean} returns true if smallSet contains all elements inside of the bigSet - */ -const isSubset = (bigSet, smallSet) => { - if (bigSet.size < smallSet.size) return false; - for (const item of smallSet) { - if (!bigSet.has(item)) return false; - } - return true; -}; + var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; -exports.intersect = intersect; -exports.isSubset = isSubset; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; + }; + function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) + } + var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; -/***/ }), + // Map keyword names to token types. -/***/ 50071: -/***/ (function(module) { + var keywords$1 = {}; + + // Succinct definitions of keyword token types + function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name; + return keywords$1[name] = new TokenType(name, options) + } + + var types = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. -"use strict"; + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) + }; -/** - * A subset of Set that offers sorting functionality - * @template T item type in set - * @extends {Set} - */ -class SortableSet extends Set { - /** - * Create a new sortable set - * @param {Iterable=} initialIterable The initial iterable value - * @typedef {function(T, T): number} SortFunction - * @param {SortFunction=} defaultSort Default sorting function - */ - constructor(initialIterable, defaultSort) { - super(initialIterable); - /** @private @type {function(T, T): number}} */ - this._sortFn = defaultSort; - /** @private @type {function(T, T): number} | null} */ - this._lastActiveSortFn = null; - /** @private @type {Map | undefined} */ - this._cache = undefined; - /** @private @type {Map | undefined} */ - this._cacheOrderIndependent = undefined; - } + // Matches a whole line break (where CRLF is considered a single + // line break). Used to count lines. - /** - * @param {T} value value to add to set - * @returns {this} returns itself - */ - add(value) { - this._lastActiveSortFn = null; - this._invalidateCache(); - this._invalidateOrderedCache(); - super.add(value); - return this; - } + var lineBreak = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG = new RegExp(lineBreak.source, "g"); - /** - * @param {T} value value to delete - * @returns {boolean} true if value existed in set, false otherwise - */ - delete(value) { - this._invalidateCache(); - this._invalidateOrderedCache(); - return super.delete(value); - } + function isNewLine(code, ecma2019String) { + return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) + } - /** - * @returns {void} - */ - clear() { - this._invalidateCache(); - this._invalidateOrderedCache(); - return super.clear(); - } + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; - /** - * Sort with a comparer function - * @param {SortFunction} sortFn Sorting comparer function - * @returns {void} - */ - sortWith(sortFn) { - if (this.size <= 1 || sortFn === this._lastActiveSortFn) { - // already sorted - nothing to do - return; - } + var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; - const sortedArray = Array.from(this).sort(sortFn); - super.clear(); - for (let i = 0; i < sortedArray.length; i += 1) { - super.add(sortedArray[i]); - } - this._lastActiveSortFn = sortFn; - this._invalidateCache(); - } + var ref = Object.prototype; + var hasOwnProperty = ref.hasOwnProperty; + var toString = ref.toString; - sort() { - this.sortWith(this._sortFn); - } + // Checks if an object has a property. - /** - * Get data from cache - * @param {function(SortableSet): T[]} fn function to calculate value - * @returns {T[]} returns result of fn(this), cached until set changes - */ - getFromCache(fn) { - if (this._cache === undefined) { - this._cache = new Map(); - } else { - const data = this._cache.get(fn); - if (data !== undefined) { - return data; - } - } - const newData = fn(this); - this._cache.set(fn, newData); - return newData; - } + function has(obj, propName) { + return hasOwnProperty.call(obj, propName) + } - /** - * @param {function(SortableSet): string|number|T[]} fn function to calculate value - * @returns {any} returns result of fn(this), cached until set changes - */ - getFromUnorderedCache(fn) { - if (this._cacheOrderIndependent === undefined) { - this._cacheOrderIndependent = new Map(); - } else { - const data = this._cacheOrderIndependent.get(fn); - if (data !== undefined) { - return data; - } - } - const newData = fn(this); - this._cacheOrderIndependent.set(fn, newData); - return newData; - } + var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" + ); }); - /** - * @private - * @returns {void} - */ - _invalidateCache() { - if (this._cache !== undefined) { - this._cache.clear(); - } - } + function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") + } - /** - * @private - * @returns {void} - */ - _invalidateOrderedCache() { - if (this._cacheOrderIndependent !== undefined) { - this._cacheOrderIndependent.clear(); - } - } -} + // These are used when `options.locations` is on, for the + // `startLoc` and `endLoc` properties. -module.exports = SortableSet; + var Position = function Position(line, col) { + this.line = line; + this.column = col; + }; + Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) + }; -/***/ }), + var SourceLocation = function SourceLocation(p, start, end) { + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } + }; -/***/ 92251: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // The `getLineInfo` function is mostly useful when the + // `locations` option is off (for performance reasons) and you + // want to find the line/column position for a given character + // offset. `input` should be the code string that the offset refers + // into. -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur) + } + } + } + // A second optional argument can be given to further configure + // the parser process. These options are recognized: -const util = __webpack_require__(31669); + var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 + // (2019). This influences support for strict mode, the set of + // reserved words, and support for new syntax features. The default + // is 9. + ecmaVersion: 9, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // the position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, await identifiers are allowed to appear at the top-level scope, + // but they are still not allowed in non-async functions. + allowAwaitOutsideFunction: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false + }; -const TOMBSTONE = {}; -const UNDEFINED_MARKER = {}; + // Interpret and default an options object -class StackedSetMap { - constructor(parentStack) { - this.stack = parentStack === undefined ? [] : parentStack.slice(); - this.map = new Map(); - this.stack.push(this.map); - } + function getOptions(opts) { + var options = {}; - add(item) { - this.map.set(item, true); - } + for (var opt in defaultOptions) + { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } - set(item, value) { - this.map.set(item, value === undefined ? UNDEFINED_MARKER : value); - } + if (options.ecmaVersion >= 2015) + { options.ecmaVersion -= 2009; } - delete(item) { - if (this.stack.length > 1) { - this.map.set(item, TOMBSTONE); - } else { - this.map.delete(item); - } - } + if (options.allowReserved == null) + { options.allowReserved = options.ecmaVersion < 5; } - has(item) { - const topValue = this.map.get(item); - if (topValue !== undefined) return topValue !== TOMBSTONE; - if (this.stack.length > 1) { - for (var i = this.stack.length - 2; i >= 0; i--) { - const value = this.stack[i].get(item); - if (value !== undefined) { - this.map.set(item, value); - return value !== TOMBSTONE; - } - } - this.map.set(item, TOMBSTONE); - } - return false; - } + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; + } + if (isArray(options.onComment)) + { options.onComment = pushComment(options, options.onComment); } - get(item) { - const topValue = this.map.get(item); - if (topValue !== undefined) { - return topValue === TOMBSTONE || topValue === UNDEFINED_MARKER - ? undefined - : topValue; - } - if (this.stack.length > 1) { - for (var i = this.stack.length - 2; i >= 0; i--) { - const value = this.stack[i].get(item); - if (value !== undefined) { - this.map.set(item, value); - return value === TOMBSTONE || value === UNDEFINED_MARKER - ? undefined - : value; - } - } - this.map.set(item, TOMBSTONE); - } - return undefined; - } + return options + } - _compress() { - if (this.stack.length === 1) return; - this.map = new Map(); - for (const data of this.stack) { - for (const pair of data) { - if (pair[1] === TOMBSTONE) { - this.map.delete(pair[0]); - } else { - this.map.set(pair[0], pair[1]); - } - } - } - this.stack = [this.map]; - } + function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start, + end: end + }; + if (options.locations) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } + if (options.ranges) + { comment.range = [start, end]; } + array.push(comment); + } + } - asArray() { - this._compress(); - return Array.from(this.map.entries(), pair => pair[0]); - } + // Each scope gets a bitset that may contain these flags + var + SCOPE_TOP = 1, + SCOPE_FUNCTION = 2, + SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION, + SCOPE_ASYNC = 4, + SCOPE_GENERATOR = 8, + SCOPE_ARROW = 16, + SCOPE_SIMPLE_CATCH = 32, + SCOPE_SUPER = 64, + SCOPE_DIRECT_SUPER = 128; - asSet() { - return new Set(this.asArray()); - } + function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) + } - asPairArray() { - this._compress(); - return Array.from(this.map.entries(), pair => - /** @type {[TODO, TODO]} */ (pair[1] === UNDEFINED_MARKER - ? [pair[0], undefined] - : pair) - ); - } + // Used in checkLVal and declareName to determine the type of a binding + var + BIND_NONE = 0, // Not a binding + BIND_VAR = 1, // Var-style binding + BIND_LEXICAL = 2, // Let- or const-style binding + BIND_FUNCTION = 3, // Function declaration + BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding + BIND_OUTSIDE = 5; // Special case for function names as bound inside the function - asMap() { - return new Map(this.asPairArray()); - } + var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + for (var v = options.ecmaVersion;; v--) + { if (reserved = reservedWords[v]) { break } } + if (options.sourceType === "module") { reserved += " await"; } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); - get size() { - this._compress(); - return this.map.size; - } + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false; - createChild() { - return new StackedSetMap(this.stack); - } + // Set up token state - get length() { - throw new Error("This is no longer an Array"); - } + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } - set length(value) { - throw new Error("This is no longer an Array"); - } -} + // Properties of the current token: + // Its type + this.type = types.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); -// TODO remove in webpack 5 -StackedSetMap.prototype.push = util.deprecate( - /** - * @deprecated - * @this {StackedSetMap} - * @param {any} item Item to add - * @returns {void} - */ - function(item) { - this.add(item); - }, - "This is no longer an Array: Use add instead." -); + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; -module.exports = StackedSetMap; + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + // Figure out if it's a module code. + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); -/***/ }), + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; -/***/ 67916: -/***/ (function(__unused_webpack_module, exports) { + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + // Labels in scope. + this.labels = []; + // Thus-far undefined exports. + this.undefinedExports = {}; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + // For RegExp validation + this.regexpState = null; + }; -const mergeCache = new WeakMap(); + var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } }; -/** - * Merges two given objects and caches the result to avoid computation if same objects passed as arguments again. - * @example - * // performs cleverMerge(first, second), stores the result in WeakMap and returns result - * cachedCleverMerge({a: 1}, {a: 2}) - * {a: 2} - * // when same arguments passed, gets the result from WeakMap and returns it. - * cachedCleverMerge({a: 1}, {a: 2}) - * {a: 2} - * @param {object} first first object - * @param {object} second second object - * @returns {object} merged object of first and second object - */ -const cachedCleverMerge = (first, second) => { - let innerCache = mergeCache.get(first); - if (innerCache === undefined) { - innerCache = new WeakMap(); - mergeCache.set(first, innerCache); - } - const prevMerge = innerCache.get(second); - if (prevMerge !== undefined) return prevMerge; - const newMerge = cleverMerge(first, second); - innerCache.set(second, newMerge); - return newMerge; -}; + Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) + }; -/** - * Merges two objects. Objects are not deeply merged. - * TODO webpack 5: merge objects deeply clever. - * Arrays might reference the old value with "..." - * @param {object} first first object - * @param {object} second second object - * @returns {object} merged object of first and second object - */ -const cleverMerge = (first, second) => { - const newObject = Object.assign({}, first); - for (const key of Object.keys(second)) { - if (!(key in newObject)) { - newObject[key] = second[key]; - continue; - } - const secondValue = second[key]; - if (!Array.isArray(secondValue)) { - newObject[key] = secondValue; - continue; - } - const firstValue = newObject[key]; - if (Array.isArray(firstValue)) { - const newArray = []; - for (const item of secondValue) { - if (item === "...") { - for (const item of firstValue) { - newArray.push(item); - } - } else { - newArray.push(item); - } - } - newObject[key] = newArray; - } else { - newObject[key] = secondValue; - } - } - return newObject; -}; + prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; + prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; -exports.cachedCleverMerge = cachedCleverMerge; -exports.cleverMerge = cleverMerge; + // Switch to a getter for 7.0.0. + Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; + Parser.extend = function extend () { + var plugins = [], len = arguments.length; + while ( len-- ) plugins[ len ] = arguments[ len ]; -/***/ }), + var cls = this; + for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } + return cls + }; -/***/ 15660: -/***/ (function(module, exports, __webpack_require__) { + Parser.parse = function parse (input, options) { + return new this(options, input).parse() + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression() + }; + Parser.tokenizer = function tokenizer (input, options) { + return new this(options, input) + }; -const AbstractMethodError = __webpack_require__(36104); + Object.defineProperties( Parser.prototype, prototypeAccessors ); -const BULK_SIZE = 1000; + var pp = Parser.prototype; -class Hash { - /** - * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} - * @param {string|Buffer} data data - * @param {string=} inputEncoding data encoding - * @returns {this} updated hash - */ - update(data, inputEncoding) { - throw new AbstractMethodError(); - } + // ## Parser utilities - /** - * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} - * @param {string=} encoding encoding of the return value - * @returns {string|Buffer} digest - */ - digest(encoding) { - throw new AbstractMethodError(); - } -} + var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)")/; + pp.strictDirective = function(start) { + for (;;) { + // Try to find string literal. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + var match = literal.exec(this.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) === "use strict") { return true } + start += match[0].length; -exports.Hash = Hash; -/** @typedef {typeof Hash} HashConstructor */ + // Skip semicolon, if any. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start] === ";") + { start++; } + } + }; -class BulkUpdateDecorator extends Hash { - /** - * @param {Hash} hash hash - */ - constructor(hash) { - super(); - this.hash = hash; - this.buffer = ""; - } + // Predicate that tests whether the next token is of the given + // type, and if yes, consumes it as a side effect. - /** - * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} - * @param {string|Buffer} data data - * @param {string=} inputEncoding data encoding - * @returns {this} updated hash - */ - update(data, inputEncoding) { - if ( - inputEncoding !== undefined || - typeof data !== "string" || - data.length > BULK_SIZE - ) { - if (this.buffer.length > 0) { - this.hash.update(this.buffer); - this.buffer = ""; - } - this.hash.update(data, inputEncoding); - } else { - this.buffer += data; - if (this.buffer.length > BULK_SIZE) { - this.hash.update(this.buffer); - this.buffer = ""; - } - } - return this; - } + pp.eat = function(type) { + if (this.type === type) { + this.next(); + return true + } else { + return false + } + }; - /** - * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} - * @param {string=} encoding encoding of the return value - * @returns {string|Buffer} digest - */ - digest(encoding) { - if (this.buffer.length > 0) { - this.hash.update(this.buffer); - } - var digestResult = this.hash.digest(encoding); - return typeof digestResult === "string" - ? digestResult - : digestResult.toString(); - } -} + // Tests whether parsed token is a contextual keyword. -/** - * istanbul ignore next - */ -class DebugHash extends Hash { - constructor() { - super(); - this.string = ""; - } + pp.isContextual = function(name) { + return this.type === types.name && this.value === name && !this.containsEsc + }; - /** - * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} - * @param {string|Buffer} data data - * @param {string=} inputEncoding data encoding - * @returns {this} updated hash - */ - update(data, inputEncoding) { - if (typeof data !== "string") data = data.toString("utf-8"); - this.string += data; - return this; - } + // Consumes contextual keyword if possible. - /** - * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} - * @param {string=} encoding encoding of the return value - * @returns {string|Buffer} digest - */ - digest(encoding) { - return this.string.replace(/[^a-z0-9]+/gi, m => - Buffer.from(m).toString("hex") - ); - } -} + pp.eatContextual = function(name) { + if (!this.isContextual(name)) { return false } + this.next(); + return true + }; -/** - * Creates a hash by name or function - * @param {string | HashConstructor} algorithm the algorithm name or a constructor creating a hash - * @returns {Hash} the hash - */ -module.exports = algorithm => { - if (typeof algorithm === "function") { - return new BulkUpdateDecorator(new algorithm()); - } - switch (algorithm) { - // TODO add non-cryptographic algorithm here - case "debug": - return new DebugHash(); - default: - return new BulkUpdateDecorator(__webpack_require__(76417).createHash(algorithm)); - } -}; + // Asserts that following token is given contextual keyword. + pp.expectContextual = function(name) { + if (!this.eatContextual(name)) { this.unexpected(); } + }; -/***/ }), + // Test whether a semicolon can be inserted at the current position. -/***/ 30815: -/***/ (function(module) { + pp.canInsertSemicolon = function() { + return this.type === types.eof || + this.type === types.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; -"use strict"; + pp.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } + return true + } + }; + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. -// Simulations show these probabilities for a single change -// 93.1% that one group is invalidated -// 4.8% that two groups are invalidated -// 1.1% that 3 groups are invalidated -// 0.1% that 4 or more groups are invalidated -// -// And these for removing/adding 10 lexically adjacent files -// 64.5% that one group is invalidated -// 24.8% that two groups are invalidated -// 7.8% that 3 groups are invalidated -// 2.7% that 4 or more groups are invalidated -// -// And these for removing/adding 3 random files -// 0% that one group is invalidated -// 3.7% that two groups are invalidated -// 80.8% that 3 groups are invalidated -// 12.3% that 4 groups are invalidated -// 3.2% that 5 or more groups are invalidated + pp.semicolon = function() { + if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } + }; -/** - * - * @param {string} a key - * @param {string} b key - * @returns {number} the similarity as number - */ -const similarity = (a, b) => { - const l = Math.min(a.length, b.length); - let dist = 0; - for (let i = 0; i < l; i++) { - const ca = a.charCodeAt(i); - const cb = b.charCodeAt(i); - dist += Math.max(0, 10 - Math.abs(ca - cb)); - } - return dist; -}; + pp.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } + if (!notNext) + { this.next(); } + return true + } + }; -/** - * @param {string} a key - * @param {string} b key - * @returns {string} the common part and a single char for the difference - */ -const getName = (a, b) => { - const l = Math.min(a.length, b.length); - let r = ""; - for (let i = 0; i < l; i++) { - const ca = a.charAt(i); - const cb = b.charAt(i); - r += ca; - if (ca === cb) { - continue; - } - return r; - } - return a; -}; + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error. -/** - * @template T - */ -class Node { - /** - * @param {T} item item - * @param {string} key key - * @param {number} size size - */ - constructor(item, key, size) { - this.item = item; - this.key = key; - this.size = size; - } -} + pp.expect = function(type) { + this.eat(type) || this.unexpected(); + }; -/** - * @template T - */ -class Group { - /** - * @param {Node[]} nodes nodes - * @param {number[]} similarities similarities between the nodes (length = nodes.length - 1) - */ - constructor(nodes, similarities) { - this.nodes = nodes; - this.similarities = similarities; - this.size = nodes.reduce((size, node) => size + node.size, 0); - /** @type {string} */ - this.key = undefined; - } -} + // Raise an unexpected token error. -/** - * @template T - * @typedef {Object} GroupedItems - * @property {string} key - * @property {T[]} items - * @property {number} size - */ + pp.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; -/** - * @template T - * @typedef {Object} Options - * @property {number} maxSize maximum size of a group - * @property {number} minSize minimum size of a group (preferred over maximum size) - * @property {Iterable} items a list of items - * @property {function(T): number} getSize function to get size of an item - * @property {function(T): string} getKey function to get the key of an item - */ + function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; + } -/** - * @template T - * @param {Options} options options object - * @returns {GroupedItems[]} grouped items - */ -module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { - /** @type {Group[]} */ - const result = []; + pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } + }; - const nodes = Array.from( - items, - item => new Node(item, getKey(item), getSize(item)) - ); + pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } + }; - /** @type {Node[]} */ - const initialNodes = []; + pp.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } + if (this.awaitPos) + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } + }; - // lexically ordering of keys - nodes.sort((a, b) => { - if (a.key < b.key) return -1; - if (a.key > b.key) return 1; - return 0; - }); + pp.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" + }; - // return nodes bigger than maxSize directly as group - for (const node of nodes) { - if (node.size >= maxSize) { - result.push(new Group([node], [])); - } else { - initialNodes.push(node); - } - } + var pp$1 = Parser.prototype; - if (initialNodes.length > 0) { - // calculate similarities between lexically adjacent nodes - /** @type {number[]} */ - const similarities = []; - for (let i = 1; i < initialNodes.length; i++) { - const a = initialNodes[i - 1]; - const b = initialNodes[i]; - similarities.push(similarity(a.key, b.key)); - } + // ### Statement parsing - const initialGroup = new Group(initialNodes, similarities); + // Parse a program. Initializes the parser, reads any number of + // statements, and wraps them in a Program node. Optionally takes a + // `program` argument. If present, the statements will be appended + // to its body instead of creating a new node. - if (initialGroup.size < minSize) { - // We hit an edgecase where the working set is already smaller than minSize - // We merge it with the smallest result node to keep minSize intact - if (result.length > 0) { - const smallestGroup = result.reduce((min, group) => - min.size > group.size ? group : min - ); - for (const node of initialGroup.nodes) smallestGroup.nodes.push(node); - smallestGroup.nodes.sort((a, b) => { - if (a.key < b.key) return -1; - if (a.key > b.key) return 1; - return 0; - }); - } else { - // There are no other nodes - // We use all nodes and have to accept that it's smaller than minSize - result.push(initialGroup); - } - } else { - const queue = [initialGroup]; + pp$1.parseTopLevel = function(node) { + var exports = {}; + if (!node.body) { node.body = []; } + while (this.type !== types.eof) { + var stmt = this.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) + { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) + { + var name = list[i]; - while (queue.length) { - const group = queue.pop(); - // only groups bigger than maxSize need to be splitted - if (group.size < maxSize) { - result.push(group); - continue; - } + this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); + } } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program") + }; - // find unsplittable area from left and right - // going minSize from left and right - // at least one node need to be included otherwise we get stuck - let left = 0; - let leftSize = 0; - while (leftSize <= minSize) { - leftSize += group.nodes[left].size; - left++; - } - let right = group.nodes.length - 1; - let rightSize = 0; - while (rightSize <= minSize) { - rightSize += group.nodes[right].size; - right--; - } + var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; - if (left - 1 > right) { - // can't split group while holding minSize - // because minSize is preferred of maxSize we return - // the group here even while it's too big - // To avoid this make sure maxSize > minSize * 3 - result.push(group); - continue; - } - if (left <= right) { - // when there is a area between left and right - // we look for best split point - // we split at the minimum similarity - // here key space is separated the most - let best = left - 1; - let bestSimilarity = group.similarities[best]; - for (let i = left; i <= right; i++) { - const similarity = group.similarities[i]; - if (similarity < bestSimilarity) { - best = i; - bestSimilarity = similarity; - } - } - left = best + 1; - right = best; - } + pp$1.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + // For ambiguous cases, determine if a LexicalDeclaration (or only a + // Statement) is allowed here. If context is not empty then only a Statement + // is allowed. However, `let [` is an explicit negative lookahead for + // ExpressionStatement, so special-case it first. + if (nextCh === 91) { return true } // '[' + if (context) { return false } - // create two new groups for left and right area - // and queue them up - const rightNodes = [group.nodes[right + 1]]; - /** @type {number[]} */ - const rightSimilaries = []; - for (let i = right + 2; i < group.nodes.length; i++) { - rightSimilaries.push(group.similarities[i - 1]); - rightNodes.push(group.nodes[i]); - } - queue.push(new Group(rightNodes, rightSimilaries)); + if (nextCh === 123) { return true } // '{' + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } + } + return false + }; - const leftNodes = [group.nodes[0]]; - /** @type {number[]} */ - const leftSimilaries = []; - for (let i = 1; i < left; i++) { - leftSimilaries.push(group.similarities[i - 1]); - leftNodes.push(group.nodes[i]); - } - queue.push(new Group(leftNodes, leftSimilaries)); - } - } - } + // check 'async [no LineTerminator here] function' + // - 'async /*foo*/ function' is OK. + // - 'async /*\n*/ function' is invalid. + pp$1.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } - // lexically ordering - result.sort((a, b) => { - if (a.nodes[0].key < b.nodes[0].key) return -1; - if (a.nodes[0].key > b.nodes[0].key) return 1; - return 0; - }); + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length; + return !lineBreak.test(this.input.slice(this.pos, next)) && + this.input.slice(next, next + 8) === "function" && + (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) + }; - // give every group a name - for (let i = 0; i < result.length; i++) { - const group = result[i]; - const first = group.nodes[0]; - const last = group.nodes[group.nodes.length - 1]; - let name = getName(first.key, last.key); - group.key = name; - } + // Parse a single statement. + // + // If expecting a statement and finding a slash operator, parse a + // regular expression literal. This is to handle cases like + // `if (foo) /blah/.exec(foo)`, where looking at the previous token + // does not help. - // return the results - return result.map(group => { - /** @type {GroupedItems} */ - return { - key: group.key, - items: group.nodes.map(node => node.item), - size: group.size - }; - }); -}; + pp$1.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + if (this.isLet(context)) { + starttype = types._var; + kind = "let"; + } -/***/ }), + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. -/***/ 94658: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + switch (starttype) { + case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types._debugger: return this.parseDebuggerStatement(node) + case types._do: return this.parseDoStatement(node) + case types._for: return this.parseForStatement(node) + case types._function: + // Function as sole body of either an if statement or a labeled statement + // works, but not when it is part of a labeled statement that is the sole + // body of an if statement. + if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false, !context) + case types._class: + if (context) { this.unexpected(); } + return this.parseClass(node, true) + case types._if: return this.parseIfStatement(node) + case types._return: return this.parseReturnStatement(node) + case types._switch: return this.parseSwitchStatement(node) + case types._throw: return this.parseThrowStatement(node) + case types._try: return this.parseTryStatement(node) + case types._const: case types._var: + kind = kind || this.value; + if (context && kind !== "var") { this.unexpected(); } + return this.parseVarStatement(node, kind) + case types._while: return this.parseWhileStatement(node) + case types._with: return this.parseWithStatement(node) + case types.braceL: return this.parseBlock(true, node) + case types.semi: return this.parseEmptyStatement(node) + case types._export: + case types._import: + if (this.options.ecmaVersion > 10 && starttype === types._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40) // '(' + { return this.parseExpressionStatement(node, this.parseExpression()) } + } -"use strict"; + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } + if (!this.inModule) + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } + } + return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) -const path = __webpack_require__(85622); + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + if (this.isAsyncFunction()) { + if (context) { this.unexpected(); } + this.next(); + return this.parseFunctionStatement(node, true, !context) + } -/** - * @param {string} context context for relative path - * @param {string} relativePath path - * @returns {string} absolute path - */ -const requestToAbsolute = (context, relativePath) => { - if (relativePath.startsWith("./") || relativePath.startsWith("../")) - return path.join(context, relativePath); - return relativePath; -}; + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + { return this.parseLabeledStatement(node, maybeName, expr, context) } + else { return this.parseExpressionStatement(node, expr) } + } + }; -/** - * @typedef {Object} MakeRelativePathsCache - * @property {Map>=} relativePaths - */ + pp$1.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types.name) { this.unexpected(); } + else { + node.label = this.parseIdent(); + this.semicolon(); + } -/** - * - * @param {string} maybeAbsolutePath path to check - * @returns {boolean} returns true if path is "Absolute Path"-like - */ -const looksLikeAbsolutePath = maybeAbsolutePath => { - if (/^\/.*\/$/.test(maybeAbsolutePath)) { - // this 'path' is actually a regexp generated by dynamic requires. - // Don't treat it as an absolute path. - return false; - } - return /^(?:[a-z]:\\|\/)/i.test(maybeAbsolutePath); -}; + // Verify that there is an actual destination to break or + // continue to. + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } + } + } + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") + }; -/** - * - * @param {string} p path to normalize - * @returns {string} normalized version of path - */ -const normalizePathSeparator = p => p.replace(/\\/g, "/"); + pp$1.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement") + }; -/** - * - * @param {string} context context for relative path - * @param {string} identifier identifier for path - * @returns {string} a converted relative path - */ -const _makePathsRelative = (context, identifier) => { - return identifier - .split(/([|! ])/) - .map(str => - looksLikeAbsolutePath(str) - ? normalizePathSeparator(path.relative(context, str)) - : str - ) - .join(""); -}; + pp$1.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) + { this.eat(types.semi); } + else + { this.semicolon(); } + return this.finishNode(node, "DoWhileStatement") + }; -/** - * - * @param {string} context context used to create relative path - * @param {string} identifier identifier used to create relative path - * @param {MakeRelativePathsCache=} cache the cache object being set - * @returns {string} the returned relative path - */ -exports.makePathsRelative = (context, identifier, cache) => { - if (!cache) return _makePathsRelative(context, identifier); + // Disambiguating between a `for` and a `for`/`in` or `for`/`of` + // loop is non-trivial. Basically, we have to parse the init `var` + // statement or expression, disallowing the `in` operator (see + // the second parameter to `parseExpression`), and then check + // whether the next token is `in` or `of`. When there is no init + // part (semicolon immediately after the opening parenthesis), it + // is a regular `for` loop. - const relativePaths = - cache.relativePaths || (cache.relativePaths = new Map()); + pp$1.parseForStatement = function(node) { + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types.parenL); + if (this.type === types.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types._var || this.type === types._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + return this.parseForIn(node, init$1) + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init$1) + } + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLVal(init); + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init) + }; - let cachedResult; - let contextCache = relativePaths.get(context); - if (contextCache === undefined) { - relativePaths.set(context, (contextCache = new Map())); - } else { - cachedResult = contextCache.get(identifier); - } + pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) + }; - if (cachedResult !== undefined) { - return cachedResult; - } else { - const relativePath = _makePathsRelative(context, identifier); - contextCache.set(identifier, relativePath); - return relativePath; - } -}; + pp$1.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement") + }; -/** - * @param {string} context absolute context path - * @param {string} request any request string may containing absolute paths, query string, etc. - * @returns {string} a new request string avoiding absolute paths when possible - */ -exports.contextify = (context, request) => { - return request - .split("!") - .map(r => { - const splitPath = r.split("?", 2); - if (/^[a-zA-Z]:\\/.test(splitPath[0])) { - splitPath[0] = path.win32.relative(context, splitPath[0]); - if (!/^[a-zA-Z]:\\/.test(splitPath[0])) { - splitPath[0] = splitPath[0].replace(/\\/g, "/"); - } - } - if (/^\//.test(splitPath[0])) { - splitPath[0] = path.posix.relative(context, splitPath[0]); - } - if (!/^(\.\.\/|\/|[a-zA-Z]:\\)/.test(splitPath[0])) { - splitPath[0] = "./" + splitPath[0]; - } - return splitPath.join("?"); - }) - .join("!"); -}; + pp$1.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + { this.raise(this.start, "'return' outside of function"); } + this.next(); -/** - * @param {string} context absolute context path - * @param {string} request any request string - * @returns {string} a new request string using absolute paths when possible - */ -const _absolutify = (context, request) => { - return request - .split("!") - .map(r => requestToAbsolute(context, r)) - .join("!"); -}; + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. -exports.absolutify = _absolutify; + if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } + return this.finishNode(node, "ReturnStatement") + }; + pp$1.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types.braceL); + this.labels.push(switchLabel); + this.enterScope(0); -/***/ }), + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. -/***/ 1111: -/***/ (function(module) { + var cur; + for (var sawDefault = false; this.type !== types.braceR;) { + if (this.type === types._case || this.type === types._default) { + var isCase = this.type === types._case; + if (cur) { this.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; + } + this.expect(types.colon); + } else { + if (!cur) { this.unexpected(); } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement") + }; -/** - * convert an object into its 2D array equivalent to be turned - * into an ES6 map - * - * @param {object} obj any object type that works with Object.keys() - * @returns {Map} an ES6 Map of KV pairs - */ -module.exports = function objectToMap(obj) { - return new Map( - Object.keys(obj).map(key => { - /** @type {[string, string]} */ - const pair = [key, obj[key]]; - return pair; - }) - ); -}; + pp$1.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement") + }; + // Reused empty array added for node fields that are always empty. -/***/ }), + var empty = []; -/***/ 68935: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + pp$1.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types.parenR); + } else { + if (this.options.ecmaVersion < 10) { this.unexpected(); } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) + { this.raise(node.start, "Missing catch or finally clause"); } + return this.finishNode(node, "TryStatement") + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Gajus Kuizinas @gajus -*/ + pp$1.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration") + }; + pp$1.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement") + }; -const Ajv = __webpack_require__(21414); -const ajv = new Ajv({ - errorDataPath: "configuration", - allErrors: true, - verbose: true -}); -__webpack_require__(82133)(ajv, ["instanceof"]); -__webpack_require__(51613)(ajv); + pp$1.parseWithStatement = function(node) { + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement") + }; -const validateSchema = (schema, options) => { - if (Array.isArray(options)) { - const errors = options.map(options => validateObject(schema, options)); - errors.forEach((list, idx) => { - const applyPrefix = err => { - err.dataPath = `[${idx}]${err.dataPath}`; - if (err.children) { - err.children.forEach(applyPrefix); - } - }; - list.forEach(applyPrefix); - }); - return errors.reduce((arr, items) => { - return arr.concat(items); - }, []); - } else { - return validateObject(schema, options); - } -}; + pp$1.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement") + }; -const validateObject = (schema, options) => { - const validate = ajv.compile(schema); - const valid = validate(options); - return valid ? [] : filterErrors(validate.errors); -}; + pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; -const filterErrors = errors => { - let newErrors = []; - for (const err of errors) { - const dataPath = err.dataPath; - let children = []; - newErrors = newErrors.filter(oldError => { - if (oldError.dataPath.includes(dataPath)) { - if (oldError.children) { - children = children.concat(oldError.children.slice(0)); - } - oldError.children = undefined; - children.push(oldError); - return false; - } - return true; - }); - if (children.length) { - err.children = children; - } - newErrors.push(err); - } + if (label.name === maybeName) + { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this.labels[i]; + if (label$1.statementStart === node.start) { + // Update information about previous labels on this node + label$1.statementStart = this.start; + label$1.kind = kind; + } else { break } + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement") + }; - return newErrors; -}; + pp$1.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement") + }; -module.exports = validateSchema; + // Parse a semicolon-enclosed block of statements, handling `"use + // strict"` declarations when `allowStrict` is true (used for + // function bodies). + pp$1.parseBlock = function(createNewLexicalScope, node) { + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + if ( node === void 0 ) node = this.startNode(); -/***/ }), + node.body = []; + this.expect(types.braceL); + if (createNewLexicalScope) { this.enterScope(0); } + while (!this.eat(types.braceR)) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (createNewLexicalScope) { this.exitScope(); } + return this.finishNode(node, "BlockStatement") + }; -/***/ 43101: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php -*/ + pp$1.parseFor = function(node, init) { + node.init = init; + this.expect(types.semi); + node.test = this.type === types.semi ? null : this.parseExpression(); + this.expect(types.semi); + node.update = this.type === types.parenR ? null : this.parseExpression(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement") + }; + // Parse a `for`/`in` and `for`/`of` loop, which are almost + // same from parser's perspective. -const WebpackError = __webpack_require__(97391); + pp$1.parseForIn = function(node, init) { + var isForIn = this.type === types._in; + this.next(); -module.exports = class UnsupportedWebAssemblyFeatureError extends WebpackError { - /** @param {string} message Error message */ - constructor(message) { - super(message); - this.name = "UnsupportedWebAssemblyFeatureError"; - this.hideStack = true; + if ( + init.type === "VariableDeclaration" && + init.declarations[0].init != null && + ( + !isForIn || + this.options.ecmaVersion < 8 || + this.strict || + init.kind !== "var" || + init.declarations[0].id.type !== "Identifier" + ) + ) { + this.raise( + init.start, + ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") + ); + } else if (init.type === "AssignmentPattern") { + this.raise(init.start, "Invalid left-hand side in for-loop"); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") + }; - Error.captureStackTrace(this, this.constructor); - } -}; + // Parse a list of variable declarations. + pp$1.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (;;) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types.comma)) { break } + } + return node + }; -/***/ }), + pp$1.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + }; -/***/ 10557: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ + // Parse a function declaration or literal (depending on the + // `statement & FUNC_STATEMENT`). + // Remove `allowExpressionBody` for 7.0.0, as it is only called with false + pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + { this.unexpected(); } + node.generator = this.eat(types.star); + } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } -const UnsupportedWebAssemblyFeatureError = __webpack_require__(43101); + if (statement & FUNC_STATEMENT) { + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + // If it is a regular function declaration in sloppy mode, then it is + // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding + // mode depends on properties of the current scope (see + // treatFunctionsAsVar). + { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } + } -class WasmFinalizeExportsPlugin { - apply(compiler) { - compiler.hooks.compilation.tap("WasmFinalizeExportsPlugin", compilation => { - compilation.hooks.finishModules.tap( - "WasmFinalizeExportsPlugin", - modules => { - for (const module of modules) { - // 1. if a WebAssembly module - if (module.type.startsWith("webassembly") === true) { - const jsIncompatibleExports = - module.buildMeta.jsIncompatibleExports; + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); - if (jsIncompatibleExports === undefined) { - continue; - } + if (!(statement & FUNC_STATEMENT)) + { node.id = this.type === types.name ? this.parseIdent() : null; } - for (const reason of module.reasons) { - // 2. is referenced by a non-WebAssembly module - if (reason.module.type.startsWith("webassembly") === false) { - const ref = compilation.getDependencyReference( - reason.module, - reason.dependency - ); + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false); - if (!ref) continue; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") + }; - const importedNames = ref.importedNames; + pp$1.parseFunctionParams = function(node) { + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; - if (Array.isArray(importedNames)) { - importedNames.forEach(name => { - // 3. and uses a func with an incompatible JS signature - if ( - Object.prototype.hasOwnProperty.call( - jsIncompatibleExports, - name - ) - ) { - // 4. error - /** @type {any} */ - const error = new UnsupportedWebAssemblyFeatureError( - `Export "${name}" with ${jsIncompatibleExports[name]} can only be used for direct wasm to wasm dependencies` - ); - error.module = module; - error.origin = reason.module; - error.originLoc = reason.dependency.loc; - error.dependencies = [reason.dependency]; - compilation.errors.push(error); - } - }); - } - } - } - } - } - } - ); - }); - } -} + // Parse a class declaration or literal (depending on the + // `isStatement` parameter). -module.exports = WasmFinalizeExportsPlugin; + pp$1.parseClass = function(node, isStatement) { + this.next(); + // ecma-262 14.6 Class Definitions + // A class definition is always strict mode code. + var oldStrict = this.strict; + this.strict = true; -/***/ }), + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } + } + } + node.body = this.finishNode(classBody, "ClassBody"); + this.strict = oldStrict; + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") + }; -/***/ 65331: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + pp$1.parseClassElement = function(constructorAllowsSuper) { + var this$1 = this; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + if (this.eat(types.semi)) { return null } + + var method = this.startNode(); + var tryContextual = function (k, noLineBreak) { + if ( noLineBreak === void 0 ) noLineBreak = false; + + var start = this$1.start, startLoc = this$1.startLoc; + if (!this$1.eatContextual(k)) { return false } + if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } + if (method.key) { this$1.unexpected(); } + method.computed = false; + method.key = this$1.startNodeAt(start, startLoc); + method.key.name = k; + this$1.finishNode(method.key, "Identifier"); + return false + }; + method.kind = "method"; + method.static = tryContextual("static"); + var isGenerator = this.eat(types.star); + var isAsync = false; + if (!isGenerator) { + if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + } else if (tryContextual("get")) { + method.kind = "get"; + } else if (tryContextual("set")) { + method.kind = "set"; + } + } + if (!method.key) { this.parsePropertyName(method); } + var key = method.key; + var allowsDirectSuper = false; + if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + method.kind = "constructor"; + allowsDirectSuper = constructorAllowsSuper; + } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && method.value.params.length !== 0) + { this.raiseRecoverable(method.value.start, "getter should have no params"); } + if (method.kind === "set" && method.value.params.length !== 1) + { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } + return method + }; -const Template = __webpack_require__(96066); -const WebAssemblyUtils = __webpack_require__(52136); + pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + return this.finishNode(method, "MethodDefinition") + }; -/** @typedef {import("../Module")} Module */ -/** @typedef {import("../MainTemplate")} MainTemplate */ + pp$1.parseClassId = function(node, isStatement) { + if (this.type === types.name) { + node.id = this.parseIdent(); + if (isStatement) + { this.checkLVal(node.id, BIND_LEXICAL, false); } + } else { + if (isStatement === true) + { this.unexpected(); } + node.id = null; + } + }; -// Get all wasm modules -const getAllWasmModules = chunk => { - const wasmModules = chunk.getAllAsyncChunks(); - const array = []; - for (const chunk of wasmModules) { - for (const m of chunk.modulesIterable) { - if (m.type.startsWith("webassembly")) { - array.push(m); - } - } - } + pp$1.parseClassSuper = function(node) { + node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; + }; - return array; -}; + // Parses module export declaration. -/** - * generates the import object function for a module - * @param {Module} module the module - * @param {boolean} mangle mangle imports - * @returns {string} source code - */ -const generateImportObject = (module, mangle) => { - const waitForInstances = new Map(); - const properties = []; - const usedWasmDependencies = WebAssemblyUtils.getUsedDependencies( - module, - mangle - ); - for (const usedDep of usedWasmDependencies) { - const dep = usedDep.dependency; - const importedModule = dep.module; - const exportName = dep.name; - const usedName = importedModule && importedModule.isUsed(exportName); - const description = dep.description; - const direct = dep.onlyDirectImport; + pp$1.parseExport = function(node, exports) { + this.next(); + // export * from '...' + if (this.eat(types.star)) { + this.expectContextual("from"); + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(types._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") + { this.checkVariableExport(exports, node.declaration.declarations); } + else + { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + node.specifiers = []; + node.source = null; + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + } else { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + // check for keywords used as local names + var spec = list[i]; - const module = usedDep.module; - const name = usedDep.name; + this.checkUnreserved(spec.local); + // check if export is defined + this.checkLocalExport(spec.local); + } - if (direct) { - const instanceVar = `m${waitForInstances.size}`; - waitForInstances.set(instanceVar, importedModule.id); - properties.push({ - module, - name, - value: `${instanceVar}[${JSON.stringify(usedName)}]` - }); - } else { - const params = description.signature.params.map( - (param, k) => "p" + k + param.valtype - ); + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration") + }; - const mod = `installedModules[${JSON.stringify(importedModule.id)}]`; - const func = `${mod}.exports[${JSON.stringify(usedName)}]`; + pp$1.checkExport = function(exports, name, pos) { + if (!exports) { return } + if (has(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; + }; - properties.push({ - module, - name, - value: Template.asString([ - (importedModule.type.startsWith("webassembly") - ? `${mod} ? ${func} : ` - : "") + `function(${params}) {`, - Template.indent([`return ${func}(${params});`]), - "}" - ]) - }); - } - } + pp$1.checkPatternExport = function(exports, pat) { + var type = pat.type; + if (type === "Identifier") + { this.checkExport(exports, pat.name, pat.start); } + else if (type === "ObjectPattern") + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; - let importObject; - if (mangle) { - importObject = [ - "return {", - Template.indent([ - properties.map(p => `${JSON.stringify(p.name)}: ${p.value}`).join(",\n") - ]), - "};" - ]; - } else { - const propertiesByModule = new Map(); - for (const p of properties) { - let list = propertiesByModule.get(p.module); - if (list === undefined) { - propertiesByModule.set(p.module, (list = [])); - } - list.push(p); - } - importObject = [ - "return {", - Template.indent([ - Array.from(propertiesByModule, ([module, list]) => { - return Template.asString([ - `${JSON.stringify(module)}: {`, - Template.indent([ - list.map(p => `${JSON.stringify(p.name)}: ${p.value}`).join(",\n") - ]), - "}" - ]); - }).join(",\n") - ]), - "};" - ]; - } + this.checkPatternExport(exports, prop); + } } + else if (type === "ArrayPattern") + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; - if (waitForInstances.size === 1) { - const moduleId = Array.from(waitForInstances.values())[0]; - const promise = `installedWasmModules[${JSON.stringify(moduleId)}]`; - const variable = Array.from(waitForInstances.keys())[0]; - return Template.asString([ - `${JSON.stringify(module.id)}: function() {`, - Template.indent([ - `return promiseResolve().then(function() { return ${promise}; }).then(function(${variable}) {`, - Template.indent(importObject), - "});" - ]), - "}," - ]); - } else if (waitForInstances.size > 0) { - const promises = Array.from( - waitForInstances.values(), - id => `installedWasmModules[${JSON.stringify(id)}]` - ).join(", "); - const variables = Array.from( - waitForInstances.keys(), - (name, i) => `${name} = array[${i}]` - ).join(", "); - return Template.asString([ - `${JSON.stringify(module.id)}: function() {`, - Template.indent([ - `return promiseResolve().then(function() { return Promise.all([${promises}]); }).then(function(array) {`, - Template.indent([`var ${variables};`, ...importObject]), - "});" - ]), - "}," - ]); - } else { - return Template.asString([ - `${JSON.stringify(module.id)}: function() {`, - Template.indent(importObject), - "}," - ]); - } -}; + if (elt) { this.checkPatternExport(exports, elt); } + } } + else if (type === "Property") + { this.checkPatternExport(exports, pat.value); } + else if (type === "AssignmentPattern") + { this.checkPatternExport(exports, pat.left); } + else if (type === "RestElement") + { this.checkPatternExport(exports, pat.argument); } + else if (type === "ParenthesizedExpression") + { this.checkPatternExport(exports, pat.expression); } + }; -class WasmMainTemplatePlugin { - constructor({ generateLoadBinaryCode, supportsStreaming, mangleImports }) { - this.generateLoadBinaryCode = generateLoadBinaryCode; - this.supportsStreaming = supportsStreaming; - this.mangleImports = mangleImports; - } + pp$1.checkVariableExport = function(exports, decls) { + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; - /** - * @param {MainTemplate} mainTemplate main template - * @returns {void} - */ - apply(mainTemplate) { - mainTemplate.hooks.localVars.tap( - "WasmMainTemplatePlugin", - (source, chunk) => { - const wasmModules = getAllWasmModules(chunk); - if (wasmModules.length === 0) return source; - const importObjects = wasmModules.map(module => { - return generateImportObject(module, this.mangleImports); - }); - return Template.asString([ - source, - "", - "// object to store loaded and loading wasm modules", - "var installedWasmModules = {};", - "", - // This function is used to delay reading the installed wasm module promises - // by a microtask. Sorting them doesn't help because there are egdecases where - // sorting is not possible (modules splitted into different chunks). - // So we not even trying and solve this by a microtask delay. - "function promiseResolve() { return Promise.resolve(); }", - "", - "var wasmImportObjects = {", - Template.indent(importObjects), - "};" - ]); - } - ); - mainTemplate.hooks.requireEnsure.tap( - "WasmMainTemplatePlugin", - (source, chunk, hash) => { - const webassemblyModuleFilename = - mainTemplate.outputOptions.webassemblyModuleFilename; + this.checkPatternExport(exports, decl.id); + } + }; - const chunkModuleMaps = chunk.getChunkModuleMaps(m => - m.type.startsWith("webassembly") - ); - if (Object.keys(chunkModuleMaps.id).length === 0) return source; - const wasmModuleSrcPath = mainTemplate.getAssetPath( - JSON.stringify(webassemblyModuleFilename), - { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, - module: { - id: '" + wasmModuleId + "', - hash: `" + ${JSON.stringify( - chunkModuleMaps.hash - )}[wasmModuleId] + "`, - hashWithLength(length) { - const shortChunkHashMap = Object.create(null); - for (const wasmModuleId of Object.keys(chunkModuleMaps.hash)) { - if (typeof chunkModuleMaps.hash[wasmModuleId] === "string") { - shortChunkHashMap[wasmModuleId] = chunkModuleMaps.hash[ - wasmModuleId - ].substr(0, length); - } - } - return `" + ${JSON.stringify( - shortChunkHashMap - )}[wasmModuleId] + "`; - } - } - } - ); - const createImportObject = content => - this.mangleImports - ? `{ ${JSON.stringify( - WebAssemblyUtils.MANGLED_MODULE - )}: ${content} }` - : content; - return Template.asString([ - source, - "", - "// Fetch + compile chunk loading for webassembly", - "", - `var wasmModules = ${JSON.stringify( - chunkModuleMaps.id - )}[chunkId] || [];`, - "", - "wasmModules.forEach(function(wasmModuleId) {", - Template.indent([ - "var installedWasmModuleData = installedWasmModules[wasmModuleId];", - "", - '// a Promise means "currently loading" or "already loaded".', - "if(installedWasmModuleData)", - Template.indent(["promises.push(installedWasmModuleData);"]), - "else {", - Template.indent([ - `var importObject = wasmImportObjects[wasmModuleId]();`, - `var req = ${this.generateLoadBinaryCode(wasmModuleSrcPath)};`, - "var promise;", - this.supportsStreaming - ? Template.asString([ - "if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') {", - Template.indent([ - "promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {", - Template.indent([ - `return WebAssembly.instantiate(items[0], ${createImportObject( - "items[1]" - )});` - ]), - "});" - ]), - "} else if(typeof WebAssembly.instantiateStreaming === 'function') {", - Template.indent([ - `promise = WebAssembly.instantiateStreaming(req, ${createImportObject( - "importObject" - )});` - ]) - ]) - : Template.asString([ - "if(importObject instanceof Promise) {", - Template.indent([ - "var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });", - "promise = Promise.all([", - Template.indent([ - "bytesPromise.then(function(bytes) { return WebAssembly.compile(bytes); }),", - "importObject" - ]), - "]).then(function(items) {", - Template.indent([ - `return WebAssembly.instantiate(items[0], ${createImportObject( - "items[1]" - )});` - ]), - "});" - ]) - ]), - "} else {", - Template.indent([ - "var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });", - "promise = bytesPromise.then(function(bytes) {", - Template.indent([ - `return WebAssembly.instantiate(bytes, ${createImportObject( - "importObject" - )});` - ]), - "});" - ]), - "}", - "promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {", - Template.indent([ - `return ${mainTemplate.requireFn}.w[wasmModuleId] = (res.instance || res).exports;` - ]), - "}));" - ]), - "}" - ]), - "});" - ]); - } - ); - mainTemplate.hooks.requireExtensions.tap( - "WasmMainTemplatePlugin", - (source, chunk) => { - if (!chunk.hasModuleInGraph(m => m.type.startsWith("webassembly"))) { - return source; - } - return Template.asString([ - source, - "", - "// object with all WebAssembly.instance exports", - `${mainTemplate.requireFn}.w = {};` - ]); - } - ); - mainTemplate.hooks.hash.tap("WasmMainTemplatePlugin", hash => { - hash.update("WasmMainTemplatePlugin"); - hash.update("2"); - }); - } -} + pp$1.shouldParseExportStatement = function() { + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() + }; -module.exports = WasmMainTemplatePlugin; + // Parses a comma-separated list of module exports. + pp$1.parseExportSpecifiers = function(exports) { + var nodes = [], first = true; + // export { x, y as z } [from '...'] + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } -/***/ }), + var node = this.startNode(); + node.local = this.parseIdent(true); + node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; + this.checkExport(exports, node.exported.name, node.exported.start); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes + }; -/***/ 13099: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Parses import declaration. -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + pp$1.parseImport = function(node) { + this.next(); + // import '...' + if (this.type === types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration") + }; + // Parses a comma-separated list of module imports. -const Generator = __webpack_require__(39172); -const Template = __webpack_require__(96066); -const WebAssemblyUtils = __webpack_require__(52136); -const { RawSource } = __webpack_require__(53665); + pp$1.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types.comma)) { return nodes } + } + if (this.type === types.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLVal(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes + } + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } -const { editWithAST, addWithAST } = __webpack_require__(65584); -const { decode } = __webpack_require__(8062); -const t = __webpack_require__(98688); -const { - moduleContextFromModuleAST -} = __webpack_require__(71234); + var node$2 = this.startNode(); + node$2.imported = this.parseIdent(true); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLVal(node$2.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes + }; -const WebAssemblyExportImportedDependency = __webpack_require__(18925); + // Set `ExpressionStatement#directive` property for directive prologues. + pp$1.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } + }; + pp$1.isDirectiveCandidate = function(statement) { + return ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) + }; -/** @typedef {import("../Module")} Module */ -/** @typedef {import("./WebAssemblyUtils").UsedWasmDependency} UsedWasmDependency */ -/** @typedef {import("../NormalModule")} NormalModule */ -/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("../Dependency").DependencyTemplate} DependencyTemplate */ + var pp$2 = Parser.prototype; -/** - * @typedef {(ArrayBuffer) => ArrayBuffer} ArrayBufferTransform - */ + // Convert existing expression atom to assignable pattern + // if possible. -/** - * @template T - * @param {Function[]} fns transforms - * @returns {Function} composed transform - */ -const compose = (...fns) => { - return fns.reduce( - (prevFn, nextFn) => { - return value => nextFn(prevFn(value)); - }, - value => value - ); -}; + pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") + { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } + break -// TODO replace with @callback + case "ObjectPattern": + case "ArrayPattern": + case "RestElement": + break -/** - * Removes the start instruction - * - * @param {Object} state unused state - * @returns {ArrayBufferTransform} transform - */ -const removeStartFunc = state => bin => { - return editWithAST(state.ast, bin, { - Start(path) { - path.remove(); - } - }); -}; + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; -/** - * Get imported globals - * - * @param {Object} ast Module's AST - * @returns {Array} - nodes - */ -const getImportedGlobals = ast => { - const importedGlobals = []; + this.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break - t.traverse(ast, { - ModuleImport({ node }) { - if (t.isGlobalType(node.descr)) { - importedGlobals.push(node); - } - } - }); + case "Property": + // AssignmentProperty has type === "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break - return importedGlobals; -}; + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break -/** - * Get the count for imported func - * - * @param {Object} ast Module's AST - * @returns {Number} - count - */ -const getCountImportedFunc = ast => { - let count = 0; + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } + break - t.traverse(ast, { - ModuleImport({ node }) { - if (t.isFuncImportDescr(node.descr)) { - count++; - } - } - }); + case "AssignmentExpression": + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + // falls through to AssignmentPattern - return count; -}; + case "AssignmentPattern": + break -/** - * Get next type index - * - * @param {Object} ast Module's AST - * @returns {t.Index} - index - */ -const getNextTypeIndex = ast => { - const typeSectionMetadata = t.getSectionMetadata(ast, "type"); + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break - if (typeSectionMetadata === undefined) { - return t.indexLiteral(0); - } + case "MemberExpression": + if (!isBinding) { break } - return t.indexLiteral(typeSectionMetadata.vectorOfSize.value); -}; + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + return node + }; -/** - * Get next func index - * - * The Func section metadata provide informations for implemented funcs - * in order to have the correct index we shift the index by number of external - * functions. - * - * @param {Object} ast Module's AST - * @param {Number} countImportedFunc number of imported funcs - * @returns {t.Index} - index - */ -const getNextFuncIndex = (ast, countImportedFunc) => { - const funcSectionMetadata = t.getSectionMetadata(ast, "func"); + // Convert list of expression atoms to binding list. - if (funcSectionMetadata === undefined) { - return t.indexLiteral(0 + countImportedFunc); - } + pp$2.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { this.toAssignable(elt, isBinding); } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } + } + return exprList + }; - const vectorOfSize = funcSectionMetadata.vectorOfSize.value; + // Parses spread element. - return t.indexLiteral(vectorOfSize + countImportedFunc); -}; + pp$2.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement") + }; -/** - * Creates an init instruction for a global type - * @param {t.GlobalType} globalType the global type - * @returns {t.Instruction} init expression - */ -const createDefaultInitForGlobal = globalType => { - if (globalType.valtype[0] === "i") { - // create NumberLiteral global initializer - return t.objectInstruction("const", globalType.valtype, [ - t.numberLiteralFromRaw(66) - ]); - } else if (globalType.valtype[0] === "f") { - // create FloatLiteral global initializer - return t.objectInstruction("const", globalType.valtype, [ - t.floatLiteral(66, false, false, "66") - ]); - } else { - throw new Error("unknown type: " + globalType.valtype); - } -}; + pp$2.parseRestBinding = function() { + var node = this.startNode(); + this.next(); -/** - * Rewrite the import globals: - * - removes the ModuleImport instruction - * - injects at the same offset a mutable global of the same type - * - * Since the imported globals are before the other global declarations, our - * indices will be preserved. - * - * Note that globals will become mutable. - * - * @param {Object} state unused state - * @returns {ArrayBufferTransform} transform - */ -const rewriteImportedGlobals = state => bin => { - const additionalInitCode = state.additionalInitCode; - const newGlobals = []; + // RestElement inside of a function parameter must be an identifier + if (this.options.ecmaVersion === 6 && this.type !== types.name) + { this.unexpected(); } - bin = editWithAST(state.ast, bin, { - ModuleImport(path) { - if (t.isGlobalType(path.node.descr)) { - const globalType = path.node.descr; + node.argument = this.parseBindingAtom(); - globalType.mutability = "var"; + return this.finishNode(node, "RestElement") + }; - const init = [ - createDefaultInitForGlobal(globalType), - t.instruction("end") - ]; + // Parses lvalue (assignable) atom. - newGlobals.push(t.global(globalType, init)); + pp$2.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") - path.remove(); - } - }, + case types.braceL: + return this.parseObj(true) + } + } + return this.parseIdent() + }; - // in order to preserve non-imported global's order we need to re-inject - // those as well - Global(path) { - const { node } = path; - const [init] = node.init; + pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { first = false; } + else { this.expect(types.comma); } + if (allowEmpty && this.type === types.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break + } else if (this.type === types.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + this.expect(close); + break + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts + }; - if (init.id === "get_global") { - node.globalType.mutability = "var"; + pp$2.parseBindingListItem = function(param) { + return param + }; - const initialGlobalidx = init.args[0]; + // Parses assignment pattern around given atom if possible. - node.init = [ - createDefaultInitForGlobal(node.globalType), - t.instruction("end") - ]; + pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern") + }; - additionalInitCode.push( - /** - * get_global in global initializer only works for imported globals. - * They have the same indices as the init params, so use the - * same index. - */ - t.instruction("get_local", [initialGlobalidx]), - t.instruction("set_global", [t.indexLiteral(newGlobals.length)]) - ); - } + // Verify that a node is an lval — something that can be assigned + // to. + // bindingType can be either: + // 'var' indicating that the lval creates a 'var' binding + // 'let' indicating that the lval creates a lexical ('let' or 'const') binding + // 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references - newGlobals.push(node); + pp$2.checkLVal = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; - path.remove(); - } - }); + switch (expr.type) { + case "Identifier": + if (bindingType === BIND_LEXICAL && expr.name === "let") + { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (checkClashes) { + if (has(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } + break - // Add global declaration instructions - return addWithAST(state.ast, bin, newGlobals); -}; + case "MemberExpression": + if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break -/** - * Rewrite the export names - * @param {Object} state state - * @param {Object} state.ast Module's ast - * @param {Module} state.module Module - * @param {Set} state.externalExports Module - * @returns {ArrayBufferTransform} transform - */ -const rewriteExportNames = ({ ast, module, externalExports }) => bin => { - return editWithAST(ast, bin, { - ModuleExport(path) { - const isExternal = externalExports.has(path.node.name); - if (isExternal) { - path.remove(); - return; - } - const usedName = module.isUsed(path.node.name); - if (!usedName) { - path.remove(); - return; - } - path.node.name = usedName; - } - }); -}; + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) + { + var prop = list[i]; -/** - * Mangle import names and modules - * @param {Object} state state - * @param {Object} state.ast Module's ast - * @param {Map} state.usedDependencyMap mappings to mangle names - * @returns {ArrayBufferTransform} transform - */ -const rewriteImports = ({ ast, usedDependencyMap }) => bin => { - return editWithAST(ast, bin, { - ModuleImport(path) { - const result = usedDependencyMap.get( - path.node.module + ":" + path.node.name - ); + this.checkLVal(prop, bindingType, checkClashes); + } + break - if (result !== undefined) { - path.node.module = result.module; - path.node.name = result.name; - } - } - }); -}; + case "Property": + // AssignmentProperty has type === "Property" + this.checkLVal(expr.value, bindingType, checkClashes); + break -/** - * Add an init function. - * - * The init function fills the globals given input arguments. - * - * @param {Object} state transformation state - * @param {Object} state.ast Module's ast - * @param {t.Identifier} state.initFuncId identifier of the init function - * @param {t.Index} state.startAtFuncOffset index of the start function - * @param {t.ModuleImport[]} state.importedGlobals list of imported globals - * @param {t.Instruction[]} state.additionalInitCode list of addition instructions for the init function - * @param {t.Index} state.nextFuncIndex index of the next function - * @param {t.Index} state.nextTypeIndex index of the next type - * @returns {ArrayBufferTransform} transform - */ -const addInitFunction = ({ - ast, - initFuncId, - startAtFuncOffset, - importedGlobals, - additionalInitCode, - nextFuncIndex, - nextTypeIndex -}) => bin => { - const funcParams = importedGlobals.map(importedGlobal => { - // used for debugging - const id = t.identifier(`${importedGlobal.module}.${importedGlobal.name}`); + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; - return t.funcParam(importedGlobal.descr.valtype, id); - }); + if (elem) { this.checkLVal(elem, bindingType, checkClashes); } + } + break - const funcBody = importedGlobals.reduce((acc, importedGlobal, index) => { - const args = [t.indexLiteral(index)]; - const body = [ - t.instruction("get_local", args), - t.instruction("set_global", args) - ]; + case "AssignmentPattern": + this.checkLVal(expr.left, bindingType, checkClashes); + break - return [...acc, ...body]; - }, []); + case "RestElement": + this.checkLVal(expr.argument, bindingType, checkClashes); + break - if (typeof startAtFuncOffset === "number") { - funcBody.push(t.callInstruction(t.numberLiteralFromRaw(startAtFuncOffset))); - } + case "ParenthesizedExpression": + this.checkLVal(expr.expression, bindingType, checkClashes); + break - for (const instr of additionalInitCode) { - funcBody.push(instr); - } + default: + this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); + } + }; - funcBody.push(t.instruction("end")); + // A recursive descent parser operates by defining functions for all - const funcResults = []; + var pp$3 = Parser.prototype; - // Code section - const funcSignature = t.signature(funcParams, funcResults); - const func = t.func(initFuncId, funcSignature, funcBody); + // Check if property name clashes with already added. + // Object/class getters and setters are not allowed to clash — + // either with each other or with an init property — and in + // strict mode, init properties are also not allowed to be repeated. - // Type section - const functype = t.typeInstruction(undefined, funcSignature); + pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + { return } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } + // Backwards-compat kludge. Can be removed in version 6.0 + else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + } + propHash.proto = true; + } + return + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; + }; - // Func section - const funcindex = t.indexInFuncSection(nextTypeIndex); + // ### Expression parsing - // Export section - const moduleExport = t.moduleExport( - initFuncId.value, - t.moduleExportDescr("Func", nextFuncIndex) - ); + // These nest, from the most general expression type at the top to + // 'atomic', nondivisible expression types at the bottom. Most of + // the functions will simply let the function(s) below them parse, + // and, *if* the syntactic construct they handle is present, wrap + // the AST node that the inner parser gave them in another node. - return addWithAST(ast, bin, [func, moduleExport, funcindex, functype]); -}; + // Parse a full expression. The optional arguments are used to + // forbid the `in` operator (in for loops initalization expressions) + // and provide reference for storing '=' operator inside shorthand + // property assignment in contexts where both object expression + // and object pattern might appear (so it's possible to raise + // delayed syntax error at correct position). -/** - * Extract mangle mappings from module - * @param {Module} module current module - * @param {boolean} mangle mangle imports - * @returns {Map} mappings to mangled names - */ -const getUsedDependencyMap = (module, mangle) => { - /** @type {Map} */ - const map = new Map(); - for (const usedDep of WebAssemblyUtils.getUsedDependencies(module, mangle)) { - const dep = usedDep.dependency; - const request = dep.request; - const exportName = dep.name; - map.set(request + ":" + exportName, usedDep); - } - return map; -}; + pp$3.parseExpression = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); } + return this.finishNode(node, "SequenceExpression") + } + return expr + }; -class WebAssemblyGenerator extends Generator { - constructor(options) { - super(); - this.options = options; - } + // Parse an assignment expression. This includes applications of + // operators like `+=`. - /** - * @param {NormalModule} module module for which the code should be generated - * @param {Map} dependencyTemplates mapping from dependencies to templates - * @param {RuntimeTemplate} runtimeTemplate the runtime template - * @param {string} type which kind of code should be generated - * @returns {Source} generated code - */ - generate(module, dependencyTemplates, runtimeTemplate, type) { - let bin = module.originalSource().source(); + pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { return this.parseYield(noIn) } + // The tokenizer will assume an expression is allowed after + // `yield`, but this isn't that kind of yield + else { this.exprAllowed = false; } + } - const initFuncId = t.identifier( - Array.isArray(module.usedExports) - ? Template.numberToIdentifer(module.usedExports.length) - : "__webpack_init__" - ); + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldShorthandAssign = refDestructuringErrors.shorthandAssign; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; + } - // parse it - const ast = decode(bin, { - ignoreDataSection: true, - ignoreCodeSection: true, - ignoreCustomNameSection: true - }); + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types.parenL || this.type === types.name) + { this.potentialArrowAt = this.start; } + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); } + refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; } + return left + }; - const moduleContext = moduleContextFromModuleAST(ast.body[0]); + // Parse a ternary conditional (`?:`) operator. - const importedGlobals = getImportedGlobals(ast); - const countImportedFunc = getCountImportedFunc(ast); - const startAtFuncOffset = moduleContext.getStart(); - const nextFuncIndex = getNextFuncIndex(ast, countImportedFunc); - const nextTypeIndex = getNextTypeIndex(ast); + pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression") + } + return expr + }; - const usedDependencyMap = getUsedDependencyMap( - module, - this.options.mangleImports - ); - const externalExports = new Set( - module.dependencies - .filter(d => d instanceof WebAssemblyExportImportedDependency) - .map(d => { - const wasmDep = /** @type {WebAssemblyExportImportedDependency} */ (d); - return wasmDep.exportName; - }) - ); + // Start the precedence parser. - /** @type {t.Instruction[]} */ - const additionalInitCode = []; + pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) + }; - const transform = compose( - rewriteExportNames({ - ast, - module, - externalExports - }), + // Parse binary operators with the operator precedence parsing + // algorithm. `left` is the left-hand side of the operator. + // `minPrec` provides context that allows the function to stop and + // defer further parser to one of its callers when it encounters an + // operator that has a lower precedence than the set it is parsing. - removeStartFunc({ ast }), + pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== types._in)) { + if (prec > minPrec) { + var logical = this.type === types.logicalOR || this.type === types.logicalAND; + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + } + } + return left + }; - rewriteImportedGlobals({ ast, additionalInitCode }), + pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") + }; - rewriteImports({ - ast, - usedDependencyMap - }), + // Parse unary operators, both prefix and postfix. - addInitFunction({ - ast, - initFuncId, - importedGlobals, - additionalInitCode, - startAtFuncOffset, - nextFuncIndex, - nextTypeIndex - }) - ); + pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { + expr = this.parseAwait(); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLVal(node.argument); } + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else { + expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLVal(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } - const newBin = transform(bin); + if (!sawUnary && this.eat(types.starstar)) + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } + else + { return expr } + }; - return new RawSource(newBin); - } -} + // Parse call, dot, and `[]`-subscript expressions. -module.exports = WebAssemblyGenerator; + pp$3.parseExprSubscripts = function(refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; + if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + } + return result + }; + pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; + while (true) { + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow); + if (element === base || element.type === "ArrowFunctionExpression") { return element } + base = element; + } + }; -/***/ }), + pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) { + var computed = this.eat(types.bracketL); + if (computed || this.eat(types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); + node.computed = !!computed; + if (computed) { this.expect(types.bracketR); } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && base.type !== "Import", false, refDestructuringErrors); + if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) + { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + if (node$1.callee.type === "Import") { + if (node$1.arguments.length !== 1) { + this.raise(node$1.start, "import() requires exactly one argument"); + } -/***/ 45283: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + var importArg = node$1.arguments[0]; + if (importArg && importArg.type === "SpreadElement") { + this.raise(importArg.start, "... is not allowed in import()"); + } + } + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types.backQuote) { + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({isTagged: true}); + base = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php -*/ + // Parse an atomic expression — either a single token that is an + // expression, an expression started by a keyword like `function` or + // `new`, or an expression wrapped in punctuation like `()`, `[]`, + // or `{}`. + pp$3.parseExprAtom = function(refDestructuringErrors) { + // If a division operator appears in an expression position, the + // tokenizer got confused, and we force it to read a regexp instead. + if (this.type === types.slash) { this.readRegexp(); } -const WebpackError = __webpack_require__(97391); + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types._super: + if (!this.allowSuper) + { this.raise(this.start, "'super' keyword outside a method"); } + node = this.startNode(); + this.next(); + if (this.type === types.parenL && !this.allowDirectSuper) + { this.raise(node.start, "super() call outside constructor of a subclass"); } + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super Arguments + if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") -/** @typedef {import("../Module")} Module */ -/** @typedef {import("../RequestShortener")} RequestShortener */ + case types._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") -/** - * @param {Module} module module to get chains from - * @param {RequestShortener} requestShortener to make readable identifiers - * @returns {string[]} all chains to the module - */ -const getInitialModuleChains = (module, requestShortener) => { - const queue = [ - { head: module, message: module.readableIdentifier(requestShortener) } - ]; - /** @type {Set} */ - const results = new Set(); - /** @type {Set} */ - const incompleteResults = new Set(); - /** @type {Set} */ - const visitedModules = new Set(); + case types.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) + { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types.arrow)) + { this.unexpected(); } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + } + } + return id - for (const chain of queue) { - const { head, message } = chain; - let final = true; - /** @type {Set} */ - const alreadyReferencedModules = new Set(); - for (const reason of head.reasons) { - const newHead = reason.module; - if (newHead) { - if (!newHead.getChunks().some(c => c.canBeInitial())) continue; - final = false; - if (alreadyReferencedModules.has(newHead)) continue; - alreadyReferencedModules.add(newHead); - const moduleName = newHead.readableIdentifier(requestShortener); - const detail = reason.explanation ? ` (${reason.explanation})` : ""; - const newMessage = `${moduleName}${detail} --> ${message}`; - if (visitedModules.has(newHead)) { - incompleteResults.add(`... --> ${newMessage}`); - continue; - } - visitedModules.add(newHead); - queue.push({ - head: newHead, - message: newMessage - }); - } else { - final = false; - const newMessage = reason.explanation - ? `(${reason.explanation}) --> ${message}` - : message; - results.add(newMessage); - } - } - if (final) { - results.add(message); - } - } - for (const result of incompleteResults) { - results.add(result); - } - return Array.from(results); -}; + case types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; + return node -module.exports = class WebAssemblyInInitialChunkError extends WebpackError { - /** - * @param {Module} module WASM module - * @param {RequestShortener} requestShortener request shortener - */ - constructor(module, requestShortener) { - const moduleChains = getInitialModuleChains(module, requestShortener); - const message = `WebAssembly module is included in initial chunk. -This is not allowed, because WebAssembly download and compilation must happen asynchronous. -Add an async splitpoint (i. e. import()) somewhere between your entrypoint and the WebAssembly module: -${moduleChains.map(s => `* ${s}`).join("\n")}`; + case types.num: case types.string: + return this.parseLiteral(this.value) - super(message); - this.name = "WebAssemblyInInitialChunkError"; - this.hideStack = true; - this.module = module; + case types._null: case types._true: case types._false: + node = this.startNode(); + node.value = this.type === types._null ? null : this.type === types._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal") - Error.captureStackTrace(this, this.constructor); - } -}; + case types.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr + case types.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression") -/***/ }), + case types.braceL: + return this.parseObj(false, refDestructuringErrors) -/***/ 13411: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + case types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0) -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + case types._class: + return this.parseClass(this.startNode(), false) + case types._new: + return this.parseNew() -const Generator = __webpack_require__(39172); -const Template = __webpack_require__(96066); -const { RawSource } = __webpack_require__(53665); -const WebAssemblyImportDependency = __webpack_require__(52959); -const WebAssemblyExportImportedDependency = __webpack_require__(18925); + case types.backQuote: + return this.parseTemplate() -/** @typedef {import("../NormalModule")} NormalModule */ -/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ -/** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("../Dependency").DependencyTemplate} DependencyTemplate */ + case types._import: + if (this.options.ecmaVersion > 10) { + return this.parseDynamicImport() + } else { + return this.unexpected() + } -class WebAssemblyJavascriptGenerator extends Generator { - /** - * @param {NormalModule} module module for which the code should be generated - * @param {Map} dependencyTemplates mapping from dependencies to templates - * @param {RuntimeTemplate} runtimeTemplate the runtime template - * @param {string} type which kind of code should be generated - * @returns {Source} generated code - */ - generate(module, dependencyTemplates, runtimeTemplate, type) { - const initIdentifer = Array.isArray(module.usedExports) - ? Template.numberToIdentifer(module.usedExports.length) - : "__webpack_init__"; + default: + this.unexpected(); + } + }; - let needExportsCopy = false; - const importedModules = new Map(); - const initParams = []; - let index = 0; - for (const dep of module.dependencies) { - const depAsAny = /** @type {any} */ (dep); - if (dep.module) { - let importData = importedModules.get(dep.module); - if (importData === undefined) { - importedModules.set( - dep.module, - (importData = { - importVar: `m${index}`, - index, - request: - "userRequest" in depAsAny ? depAsAny.userRequest : undefined, - names: new Set(), - reexports: [] - }) - ); - index++; - } - if (dep instanceof WebAssemblyImportDependency) { - importData.names.add(dep.name); - if (dep.description.type === "GlobalType") { - const exportName = dep.name; - const usedName = dep.module && dep.module.isUsed(exportName); + pp$3.parseDynamicImport = function() { + var node = this.startNode(); + this.next(); + if (this.type !== types.parenL) { + this.unexpected(); + } + return this.finishNode(node, "Import") + }; - if (dep.module) { - if (usedName) { - initParams.push( - runtimeTemplate.exportFromImport({ - module: dep.module, - request: dep.request, - importVar: importData.importVar, - originModule: module, - exportName: dep.name, - asiSafe: true, - isCall: false, - callContext: null - }) - ); - } - } - } - } - if (dep instanceof WebAssemblyExportImportedDependency) { - importData.names.add(dep.name); - const usedName = module.isUsed(dep.exportName); - if (usedName) { - const exportProp = `${module.exportsArgument}[${JSON.stringify( - usedName - )}]`; - const defineStatement = Template.asString([ - `${exportProp} = ${runtimeTemplate.exportFromImport({ - module: dep.module, - request: dep.request, - importVar: importData.importVar, - originModule: module, - exportName: dep.name, - asiSafe: true, - isCall: false, - callContext: null - })};`, - `if(WebAssembly.Global) ${exportProp} = ` + - `new WebAssembly.Global({ value: ${JSON.stringify( - dep.valueType - )} }, ${exportProp});` - ]); - importData.reexports.push(defineStatement); - needExportsCopy = true; - } - } - } - } - const importsCode = Template.asString( - Array.from( - importedModules, - ([module, { importVar, request, reexports }]) => { - const importStatement = runtimeTemplate.importStatement({ - module, - request, - importVar, - originModule: module - }); - return importStatement + reexports.join("\n"); - } - ) - ); + pp$3.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1); } + this.next(); + return this.finishNode(node, "Literal") + }; - // create source - const source = new RawSource( - [ - '"use strict";', - "// Instantiate WebAssembly module", - "var wasmExports = __webpack_require__.w[module.i];", + pp$3.parseParenExpression = function() { + this.expect(types.parenL); + var val = this.parseExpression(); + this.expect(types.parenR); + return val + }; - !Array.isArray(module.usedExports) - ? `__webpack_require__.r(${module.exportsArgument});` - : "", + pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); - // this must be before import for circular dependencies - "// export exports from WebAssembly module", - Array.isArray(module.usedExports) && !needExportsCopy - ? `${module.moduleArgument}.exports = wasmExports;` - : "for(var name in wasmExports) " + - `if(name != ${JSON.stringify(initIdentifer)}) ` + - `${module.exportsArgument}[name] = wasmExports[name];`, - "// exec imports from WebAssembly module (for esm order)", - importsCode, - "", - "// exec wasm module", - `wasmExports[${JSON.stringify(initIdentifer)}](${initParams.join( - ", " - )})` - ].join("\n") - ); - return source; - } -} + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + // Do not save awaitIdentPos to allow checking awaits nested in parameters + while (this.type !== types.parenR) { + first ? first = false : this.expect(types.comma); + if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { + lastIsComma = true; + break + } else if (this.type === types.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + break + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.start, innerEndLoc = this.startLoc; + this.expect(types.parenR); -module.exports = WebAssemblyJavascriptGenerator; + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList) + } + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; -/***/ }), + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } -/***/ 99510: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val + } + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + pp$3.parseParenItem = function(item) { + return item + }; + pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) + }; -const Generator = __webpack_require__(39172); -const WebAssemblyExportImportedDependency = __webpack_require__(18925); -const WebAssemblyImportDependency = __webpack_require__(52959); -const WebAssemblyInInitialChunkError = __webpack_require__(45283); + // New's precedence is slightly tricky. It must allow its argument to + // be a `[]` or dot subscript expression, but not a call — at least, + // not without wrapping it in parentheses. Thus, it uses the noCalls + // argument to parseSubscripts to prevent it from consuming the + // argument list. -/** @typedef {import("../Compiler")} Compiler */ + var empty$1 = []; -let WebAssemblyGenerator; -let WebAssemblyJavascriptGenerator; -let WebAssemblyParser; + pp$3.parseNew = function() { + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target" || containsEsc) + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); } + if (!this.inNonArrowFunction()) + { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (this.options.ecmaVersion > 10 && node.callee.type === "Import") { + this.raise(node.callee.start, "Cannot use new with import(...)"); + } + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && node.callee.type !== "Import", false); } + else { node.arguments = empty$1; } + return this.finishNode(node, "NewExpression") + }; -class WebAssemblyModulesPlugin { - constructor(options) { - this.options = options; - } + // Parse template expression. - /** - * @param {Compiler} compiler compiler - * @returns {void} - */ - apply(compiler) { - compiler.hooks.compilation.tap( - "WebAssemblyModulesPlugin", - (compilation, { normalModuleFactory }) => { - compilation.dependencyFactories.set( - WebAssemblyImportDependency, - normalModuleFactory - ); + pp$3.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; - compilation.dependencyFactories.set( - WebAssemblyExportImportedDependency, - normalModuleFactory - ); + var elem = this.startNode(); + if (this.type === types.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types.backQuote; + return this.finishNode(elem, "TemplateElement") + }; - normalModuleFactory.hooks.createParser - .for("webassembly/experimental") - .tap("WebAssemblyModulesPlugin", () => { - if (WebAssemblyParser === undefined) { - WebAssemblyParser = __webpack_require__(77703); - } - return new WebAssemblyParser(); - }); + pp$3.parseTemplate = function(ref) { + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; - normalModuleFactory.hooks.createGenerator - .for("webassembly/experimental") - .tap("WebAssemblyModulesPlugin", () => { - if (WebAssemblyGenerator === undefined) { - WebAssemblyGenerator = __webpack_require__(13099); - } - if (WebAssemblyJavascriptGenerator === undefined) { - WebAssemblyJavascriptGenerator = __webpack_require__(13411); - } - return Generator.byType({ - javascript: new WebAssemblyJavascriptGenerator(), - webassembly: new WebAssemblyGenerator(this.options) - }); - }); + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types.braceR); + node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); + } + this.next(); + return this.finishNode(node, "TemplateLiteral") + }; - compilation.chunkTemplate.hooks.renderManifest.tap( - "WebAssemblyModulesPlugin", - (result, options) => { - const chunk = options.chunk; - const outputOptions = options.outputOptions; - const moduleTemplates = options.moduleTemplates; - const dependencyTemplates = options.dependencyTemplates; + pp$3.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; - for (const module of chunk.modulesIterable) { - if (module.type && module.type.startsWith("webassembly")) { - const filenameTemplate = - outputOptions.webassemblyModuleFilename; + // Parse an object literal or binding pattern. - result.push({ - render: () => - this.renderWebAssembly( - module, - moduleTemplates.webassembly, - dependencyTemplates - ), - filenameTemplate, - pathOptions: { - module - }, - identifier: `webassemblyModule${module.id}`, - hash: module.hash - }); - } - } + pp$3.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } - return result; - } - ); + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") + }; - compilation.hooks.afterChunks.tap("WebAssemblyModulesPlugin", () => { - const initialWasmModules = new Set(); - for (const chunk of compilation.chunks) { - if (chunk.canBeInitial()) { - for (const module of chunk.modulesIterable) { - if (module.type.startsWith("webassembly")) { - initialWasmModules.add(module); - } - } - } - } - for (const module of initialWasmModules) { - compilation.errors.push( - new WebAssemblyInInitialChunkError( - module, - compilation.requestShortener - ) - ); - } - }); - } - ); - } + pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // To disallow parenthesized identifier via `this.toAssignable()`. + if (this.type === types.parenL && refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0) { + refDestructuringErrors.parenthesizedAssign = this.start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = this.start; + } + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") + }; - renderWebAssembly(module, moduleTemplate, dependencyTemplates) { - return moduleTemplate.render(module, dependencyTemplates, {}); - } -} + pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types.colon) + { this.unexpected(); } -module.exports = WebAssemblyModulesPlugin; + if (this.eat(types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type !== types.comma && this.type !== types.braceR)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") + { this.raiseRecoverable(start, "getter should have no params"); } + else + { this.raiseRecoverable(start, "setter should have exactly one param"); } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { this.unexpected(); } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = startPos; } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === types.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else { + prop.value = prop.key; + } + prop.shorthand = true; + } else { this.unexpected(); } + }; + pp$3.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types.bracketR); + return prop.key + } else { + prop.computed = false; + } + } + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + }; -/***/ }), + // Initialize empty function node. -/***/ 77703: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + pp$3.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } + if (this.options.ecmaVersion >= 8) { node.async = false; } + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // Parse object or class method. + pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; -const t = __webpack_require__(98688); -const { decode } = __webpack_require__(8062); -const { - moduleContextFromModuleAST -} = __webpack_require__(71234); + this.initFunction(node); + if (this.options.ecmaVersion >= 6) + { node.generator = isGenerator; } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } -const { Tapable } = __webpack_require__(92402); -const WebAssemblyImportDependency = __webpack_require__(52959); -const WebAssemblyExportImportedDependency = __webpack_require__(18925); + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); -/** @typedef {import("../Module")} Module */ + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true); -const JS_COMPAT_TYPES = new Set(["i32", "f32", "f64"]); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression") + }; -/** - * @param {t.Signature} signature the func signature - * @returns {null | string} the type incompatible with js types - */ -const getJsIncompatibleType = signature => { - for (const param of signature.params) { - if (!JS_COMPAT_TYPES.has(param.valtype)) { - return `${param.valtype} as parameter`; - } - } - for (const type of signature.results) { - if (!JS_COMPAT_TYPES.has(type)) return `${type} as result`; - } - return null; -}; + // Parse arrow function expression with given parameters. -/** - * TODO why are there two different Signature types? - * @param {t.FuncSignature} signature the func signature - * @returns {null | string} the type incompatible with js types - */ -const getJsIncompatibleTypeOfFuncSignature = signature => { - for (const param of signature.args) { - if (!JS_COMPAT_TYPES.has(param)) { - return `${param} as parameter`; - } - } - for (const type of signature.result) { - if (!JS_COMPAT_TYPES.has(type)) return `${type} as result`; - } - return null; -}; + pp$3.parseArrowExpression = function(node, params, isAsync) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; -const decoderOpts = { - ignoreCodeSection: true, - ignoreDataSection: true, + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - // this will avoid having to lookup with identifiers in the ModuleContext - ignoreCustomNameSection: true -}; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; -class WebAssemblyParser extends Tapable { - constructor(options) { - super(); - this.hooks = {}; - this.options = options; - } + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false); - parse(binary, state) { - // flag it as ESM - state.module.buildMeta.exportsType = "namespace"; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression") + }; - // parse it - const program = decode(binary, decoderOpts); - const module = program.body[0]; + // Parse function body and check parameters. - const moduleContext = moduleContextFromModuleAST(module); + pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { + var isExpression = isArrowFunction && this.type !== types.braceL; + var oldStrict = this.strict, useStrict = false; - // extract imports and exports - const exports = (state.module.buildMeta.providedExports = []); - const jsIncompatibleExports = (state.module.buildMeta.jsIncompatibleExports = []); + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } - const importedGlobals = []; - t.traverse(module, { - ModuleExport({ node }) { - const descriptor = node.descr; + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + node.body = this.parseBlock(false); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); - if (descriptor.exportType === "Func") { - const funcidx = descriptor.id.value; + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } + this.strict = oldStrict; + }; - /** @type {t.FuncSignature} */ - const funcSignature = moduleContext.getFunction(funcidx); + pp$3.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; - const incompatibleType = getJsIncompatibleTypeOfFuncSignature( - funcSignature - ); + if (param.type !== "Identifier") { return false + } } + return true + }; - if (incompatibleType) { - jsIncompatibleExports[node.name] = incompatibleType; - } - } + // Checks function params for various disallowed patterns such as using "eval" + // or "arguments" and duplicate parameters. - exports.push(node.name); + pp$3.checkParams = function(node, allowDuplicates) { + var nameHash = {}; + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; - if (node.descr && node.descr.exportType === "Global") { - const refNode = importedGlobals[node.descr.id.value]; - if (refNode) { - const dep = new WebAssemblyExportImportedDependency( - node.name, - refNode.module, - refNode.name, - refNode.descr.valtype - ); + this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); + } + }; - state.module.addDependency(dep); - } - } - }, + // Parses a comma-separated list of expressions, and returns them as + // an array. `close` is the token type that ends the list, and + // `allowEmpty` can be turned on to allow subsequent commas with + // nothing in between them to be parsed as `null` (which is needed + // for array literals). - Global({ node }) { - const init = node.init[0]; + pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { break } + } else { first = false; } - let importNode = null; + var elt = (void 0); + if (allowEmpty && this.type === types.comma) + { elt = null; } + else if (this.type === types.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this.start; } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts + }; - if (init.id === "get_global") { - const globalIdx = init.args[0].value; + pp$3.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; - if (globalIdx < importedGlobals.length) { - importNode = importedGlobals[globalIdx]; - } - } + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } + if (this.keywords.test(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") !== -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + } + }; - importedGlobals.push(importNode); - }, + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. - ModuleImport({ node }) { - /** @type {false | string} */ - let onlyDirectImport = false; + pp$3.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; - if (t.isMemory(node.descr) === true) { - onlyDirectImport = "Memory"; - } else if (t.isTable(node.descr) === true) { - onlyDirectImport = "Table"; - } else if (t.isFuncImportDescr(node.descr) === true) { - const incompatibleType = getJsIncompatibleType(node.descr.signature); - if (incompatibleType) { - onlyDirectImport = `Non-JS-compatible Func Sigurature (${incompatibleType})`; - } - } else if (t.isGlobalType(node.descr) === true) { - const type = node.descr.valtype; - if (!JS_COMPAT_TYPES.has(type)) { - onlyDirectImport = `Non-JS-compatible Global Type (${type})`; - } - } + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = node.start; } + } + return node + }; - const dep = new WebAssemblyImportDependency( - node.module, - node.name, - node.descr, - onlyDirectImport - ); + // Parses yield expression inside generator. - state.module.addDependency(dep); + pp$3.parseYield = function(noIn) { + if (!this.yieldPos) { this.yieldPos = this.start; } - if (t.isGlobalType(node.descr)) { - importedGlobals.push(node); - } - } - }); + var node = this.startNode(); + this.next(); + if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types.star); + node.argument = this.parseMaybeAssign(noIn); + } + return this.finishNode(node, "YieldExpression") + }; - return state; - } -} + pp$3.parseAwait = function() { + if (!this.awaitPos) { this.awaitPos = this.start; } -module.exports = WebAssemblyParser; + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + return this.finishNode(node, "AwaitExpression") + }; + var pp$4 = Parser.prototype; -/***/ }), + // This function is used to raise exceptions on parse errors. It + // takes an offset integer (into the current `input`) to indicate + // the location of the error, attaches the position to the end + // of the error message, and then raises a `SyntaxError` with that + // message. -/***/ 52136: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; + throw err + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + pp$4.raiseRecoverable = pp$4.raise; + pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) + } + }; -const Template = __webpack_require__(96066); -const WebAssemblyImportDependency = __webpack_require__(52959); + var pp$5 = Parser.prototype; -/** @typedef {import("../Module")} Module */ + var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; + // A list of lexically-declared FunctionDeclaration names in the current lexical scope + this.functions = []; + }; -/** @typedef {Object} UsedWasmDependency - * @property {WebAssemblyImportDependency} dependency the dependency - * @property {string} name the export name - * @property {string} module the module name - */ + // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. -const MANGLED_MODULE = "a"; + pp$5.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); + }; -/** - * @param {Module} module the module - * @param {boolean} mangle mangle module and export names - * @returns {UsedWasmDependency[]} used dependencies and (mangled) name - */ -const getUsedDependencies = (module, mangle) => { - /** @type {UsedWasmDependency[]} */ - const array = []; - let importIndex = 0; - for (const dep of module.dependencies) { - if (dep instanceof WebAssemblyImportDependency) { - if (dep.description.type === "GlobalType" || dep.module === null) { - continue; - } + pp$5.exitScope = function() { + this.scopeStack.pop(); + }; - const exportName = dep.name; - // TODO add the following 3 lines when removing of ModuleExport is possible - // const importedModule = dep.module; - // const usedName = importedModule && importedModule.isUsed(exportName); - // if (usedName !== false) { - if (mangle) { - array.push({ - dependency: dep, - name: Template.numberToIdentifer(importIndex++), - module: MANGLED_MODULE - }); - } else { - array.push({ - dependency: dep, - name: exportName, - module: dep.request - }); - } - } - } - return array; -}; + // The spec says: + // > At the top level of a function, or script, function declarations are + // > treated like var declarations rather than like lexical declarations. + pp$5.treatFunctionsAsVarInScope = function(scope) { + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) + }; -exports.getUsedDependencies = getUsedDependencies; -exports.MANGLED_MODULE = MANGLED_MODULE; + pp$5.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && (scope.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) + { redeclared = scope$2.lexical.indexOf(name) > -1; } + else + { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } + scope$2.functions.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || + !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break + } + scope$3.var.push(name); + if (this.inModule && (scope$3.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + if (scope$3.flags & SCOPE_VAR) { break } + } + } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } + }; + pp$5.checkLocalExport = function(id) { + // scope.functions must be empty as Module code is always strict. + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && + this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; -/***/ }), + pp$5.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] + }; -/***/ 52669: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + pp$5.currentVarScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. + pp$5.currentThisScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + } + }; + var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } + }; -const WasmMainTemplatePlugin = __webpack_require__(65331); + // Start an AST node, attaching a start offset. -class FetchCompileWasmTemplatePlugin { - constructor(options) { - this.options = options || {}; - } + var pp$6 = Parser.prototype; - apply(compiler) { - compiler.hooks.thisCompilation.tap( - "FetchCompileWasmTemplatePlugin", - compilation => { - const mainTemplate = compilation.mainTemplate; - const generateLoadBinaryCode = path => - `fetch(${mainTemplate.requireFn}.p + ${path})`; + pp$6.startNode = function() { + return new Node(this, this.start, this.startLoc) + }; - const plugin = new WasmMainTemplatePlugin( - Object.assign( - { - generateLoadBinaryCode, - supportsStreaming: true - }, - this.options - ) - ); - plugin.apply(mainTemplate); - } - ); - } -} + pp$6.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) + }; -module.exports = FetchCompileWasmTemplatePlugin; + // Finish an AST node, adding `type` and `end` properties. + function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node + } -/***/ }), + pp$6.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) + }; -/***/ 31898: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Finish node at given position -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + pp$6.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) + }; + // The algorithm used to determine whether a regexp can appear at a -const { ConcatSource } = __webpack_require__(53665); + var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; -/** @typedef {import("../ChunkTemplate")} ChunkTemplate */ + var types$1 = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) + }; -const getEntryInfo = chunk => { - return [chunk.entryModule].filter(Boolean).map(m => - [m.id].concat( - Array.from(chunk.groupsIterable)[0] - .chunks.filter(c => c !== chunk) - .map(c => c.id) - ) - ); -}; + var pp$7 = Parser.prototype; -class JsonpChunkTemplatePlugin { - /** - * @param {ChunkTemplate} chunkTemplate the chunk template - * @returns {void} - */ - apply(chunkTemplate) { - chunkTemplate.hooks.render.tap( - "JsonpChunkTemplatePlugin", - (modules, chunk) => { - const jsonpFunction = chunkTemplate.outputOptions.jsonpFunction; - const globalObject = chunkTemplate.outputOptions.globalObject; - const source = new ConcatSource(); - const prefetchChunks = chunk.getChildIdsByOrders().prefetch; - source.add( - `(${globalObject}[${JSON.stringify( - jsonpFunction - )}] = ${globalObject}[${JSON.stringify( - jsonpFunction - )}] || []).push([${JSON.stringify(chunk.ids)},` - ); - source.add(modules); - const entries = getEntryInfo(chunk); - if (entries.length > 0) { - source.add(`,${JSON.stringify(entries)}`); - } else if (prefetchChunks && prefetchChunks.length) { - source.add(`,0`); - } + pp$7.initialContext = function() { + return [types$1.b_stat] + }; - if (prefetchChunks && prefetchChunks.length) { - source.add(`,${JSON.stringify(prefetchChunks)}`); - } - source.add("])"); - return source; - } - ); - chunkTemplate.hooks.hash.tap("JsonpChunkTemplatePlugin", hash => { - hash.update("JsonpChunkTemplatePlugin"); - hash.update("4"); - hash.update(`${chunkTemplate.outputOptions.jsonpFunction}`); - hash.update(`${chunkTemplate.outputOptions.globalObject}`); - }); - chunkTemplate.hooks.hashForChunk.tap( - "JsonpChunkTemplatePlugin", - (hash, chunk) => { - hash.update(JSON.stringify(getEntryInfo(chunk))); - hash.update(JSON.stringify(chunk.getChildIdsByOrders().prefetch) || ""); - } - ); - } -} -module.exports = JsonpChunkTemplatePlugin; + pp$7.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types$1.f_expr || parent === types$1.f_stat) + { return true } + if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + { return !parent.isExpr } + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types._return || prevType === types.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) + { return true } + if (prevType === types.braceL) + { return parent === types$1.b_stat } + if (prevType === types._var || prevType === types._const || prevType === types.name) + { return false } + return !this.exprAllowed + }; -/***/ }), + pp$7.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") + { return context.generator } + } + return false + }; -/***/ 13732: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + pp$7.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // Token-specific context update code + types.parenR.updateContext = types.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return + } + var out = this.context.pop(); + if (out === types$1.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; -const { ConcatSource } = __webpack_require__(53665); + types.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + this.exprAllowed = true; + }; -class JsonpExportMainTemplatePlugin { - /** - * @param {string} name jsonp function name - */ - constructor(name) { - this.name = name; - } + types.dollarBraceL.updateContext = function() { + this.context.push(types$1.b_tmpl); + this.exprAllowed = true; + }; - apply(compilation) { - const { mainTemplate, chunkTemplate } = compilation; + types.parenL.updateContext = function(prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + this.exprAllowed = true; + }; - const onRenderWithEntry = (source, chunk, hash) => { - const name = mainTemplate.getAssetPath(this.name || "", { - hash, - chunk - }); - return new ConcatSource(`${name}(`, source, ");"); - }; + types.incDec.updateContext = function() { + // tokExprAllowed stays unchanged + }; - for (const template of [mainTemplate, chunkTemplate]) { - template.hooks.renderWithEntry.tap( - "JsonpExportMainTemplatePlugin", - onRenderWithEntry - ); - } + types._function.updateContext = types._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && + !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) + { this.context.push(types$1.f_expr); } + else + { this.context.push(types$1.f_stat); } + this.exprAllowed = false; + }; - mainTemplate.hooks.globalHashPaths.tap( - "JsonpExportMainTemplatePlugin", - paths => { - if (this.name) paths.push(this.name); - return paths; - } - ); + types.backQuote.updateContext = function() { + if (this.curContext() === types$1.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types$1.q_tmpl); } + this.exprAllowed = false; + }; - mainTemplate.hooks.hash.tap("JsonpExportMainTemplatePlugin", hash => { - hash.update("jsonp export"); - hash.update(`${this.name}`); - }); - } -} + types.star.updateContext = function(prevType) { + if (prevType === types._function) { + var index = this.context.length - 1; + if (this.context[index] === types$1.f_expr) + { this.context[index] = types$1.f_expr_gen; } + else + { this.context[index] = types$1.f_gen; } + } + this.exprAllowed = true; + }; -module.exports = JsonpExportMainTemplatePlugin; + types.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; + }; + // This file contains Unicode properties extracted from the ECMAScript + // specification. The lists are extracted like so: + // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) -/***/ }), + // #table-binary-unicode-properties + var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; + var ecma11BinaryProperties = ecma10BinaryProperties; + var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties + }; -/***/ 44458: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // #table-unicode-general-category-values + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // #table-unicode-script-values + var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues + }; + var data = {}; + function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; -const { ConcatSource } = __webpack_require__(53665); + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } + buildUnicodeData(9); + buildUnicodeData(10); + buildUnicodeData(11); -class JsonpHotUpdateChunkTemplatePlugin { - apply(hotUpdateChunkTemplate) { - hotUpdateChunkTemplate.hooks.render.tap( - "JsonpHotUpdateChunkTemplatePlugin", - (modulesSource, modules, removedModules, hash, id) => { - const source = new ConcatSource(); - source.add( - `${ - hotUpdateChunkTemplate.outputOptions.hotUpdateFunction - }(${JSON.stringify(id)},` - ); - source.add(modulesSource); - source.add(")"); - return source; - } - ); - hotUpdateChunkTemplate.hooks.hash.tap( - "JsonpHotUpdateChunkTemplatePlugin", - hash => { - hash.update("JsonpHotUpdateChunkTemplatePlugin"); - hash.update("3"); - hash.update( - `${hotUpdateChunkTemplate.outputOptions.hotUpdateFunction}` - ); - hash.update(`${hotUpdateChunkTemplate.outputOptions.library}`); - } - ); - } -} + var pp$8 = Parser.prototype; -module.exports = JsonpHotUpdateChunkTemplatePlugin; + var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + }; -/***/ }), + RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); + }; -/***/ 24916: -/***/ (function(module) { + // If u flag is given, this returns the code point at the index (it combines a surrogate pair). + // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). + RegExpValidationState.prototype.at = function at (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c + } + var next = s.charCodeAt(i + 1); + return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c + }; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// eslint-disable-next-line no-unused-vars -var hotAddUpdateChunk = undefined; -var parentHotUpdateCallback = undefined; -var $require$ = undefined; -var $hotMainFilename$ = undefined; -var $hotChunkFilename$ = undefined; -var $crossOriginLoading$ = undefined; + RegExpValidationState.prototype.nextIndex = function nextIndex (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i), next; + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || + (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { + return i + 1 + } + return i + 2 + }; -module.exports = function() { - // eslint-disable-next-line no-unused-vars - function webpackHotUpdateCallback(chunkId, moreModules) { - hotAddUpdateChunk(chunkId, moreModules); - if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); - } //$semicolon + RegExpValidationState.prototype.current = function current () { + return this.at(this.pos) + }; - // eslint-disable-next-line no-unused-vars - function hotDownloadUpdateChunk(chunkId) { - var script = document.createElement("script"); - script.charset = "utf-8"; - script.src = $require$.p + $hotChunkFilename$; - if ($crossOriginLoading$) script.crossOrigin = $crossOriginLoading$; - document.head.appendChild(script); - } + RegExpValidationState.prototype.lookahead = function lookahead () { + return this.at(this.nextIndex(this.pos)) + }; - // eslint-disable-next-line no-unused-vars - function hotDownloadManifest(requestTimeout) { - requestTimeout = requestTimeout || 10000; - return new Promise(function(resolve, reject) { - if (typeof XMLHttpRequest === "undefined") { - return reject(new Error("No browser support")); - } - try { - var request = new XMLHttpRequest(); - var requestPath = $require$.p + $hotMainFilename$; - request.open("GET", requestPath, true); - request.timeout = requestTimeout; - request.send(null); - } catch (err) { - return reject(err); - } - request.onreadystatechange = function() { - if (request.readyState !== 4) return; - if (request.status === 0) { - // timeout - reject( - new Error("Manifest request to " + requestPath + " timed out.") - ); - } else if (request.status === 404) { - // no update available - resolve(); - } else if (request.status !== 200 && request.status !== 304) { - // other failure - reject(new Error("Manifest request to " + requestPath + " failed.")); - } else { - // success - try { - var update = JSON.parse(request.responseText); - } catch (e) { - reject(e); - return; - } - resolve(update); - } - }; - }); - } -}; + RegExpValidationState.prototype.advance = function advance () { + this.pos = this.nextIndex(this.pos); + }; + RegExpValidationState.prototype.eat = function eat (ch) { + if (this.current() === ch) { + this.advance(); + return true + } + return false + }; -/***/ }), + function codePointToString(ch) { + if (ch <= 0xFFFF) { return String.fromCharCode(ch) } + ch -= 0x10000; + return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) + } -/***/ 38017: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$8.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } + }; + /** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$8.validateRegExpPattern = function(state) { + this.regexp_pattern(state); -const { SyncWaterfallHook } = __webpack_require__(92402); -const Template = __webpack_require__(96066); + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; -class JsonpMainTemplatePlugin { - apply(mainTemplate) { - const needChunkOnDemandLoadingCode = chunk => { - for (const chunkGroup of chunk.groupsIterable) { - if (chunkGroup.getNumberOfChildren() > 0) return true; - } - return false; - }; - const needChunkLoadingCode = chunk => { - for (const chunkGroup of chunk.groupsIterable) { - if (chunkGroup.chunks.length > 1) return true; - if (chunkGroup.getNumberOfChildren() > 0) return true; - } - return false; - }; - const needEntryDeferringCode = chunk => { - for (const chunkGroup of chunk.groupsIterable) { - if (chunkGroup.chunks.length > 1) return true; - } - return false; - }; - const needPrefetchingCode = chunk => { - const allPrefetchChunks = chunk.getChildIdsByOrdersMap(true).prefetch; - return allPrefetchChunks && Object.keys(allPrefetchChunks).length; - }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern + pp$8.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; - // TODO webpack 5, no adding to .hooks, use WeakMap and static methods - ["jsonpScript", "linkPreload", "linkPrefetch"].forEach(hook => { - if (!mainTemplate.hooks[hook]) { - mainTemplate.hooks[hook] = new SyncWaterfallHook([ - "source", - "chunk", - "hash" - ]); - } - }); + this.regexp_disjunction(state); - const getScriptSrcPath = (hash, chunk, chunkIdExpression) => { - const chunkFilename = mainTemplate.outputOptions.chunkFilename; - const chunkMaps = chunk.getChunkMaps(); - return mainTemplate.getAssetPath(JSON.stringify(chunkFilename), { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, - chunk: { - id: `" + ${chunkIdExpression} + "`, - hash: `" + ${JSON.stringify( - chunkMaps.hash - )}[${chunkIdExpression}] + "`, - hashWithLength(length) { - const shortChunkHashMap = Object.create(null); - for (const chunkId of Object.keys(chunkMaps.hash)) { - if (typeof chunkMaps.hash[chunkId] === "string") { - shortChunkHashMap[chunkId] = chunkMaps.hash[chunkId].substr( - 0, - length - ); - } - } - return `" + ${JSON.stringify( - shortChunkHashMap - )}[${chunkIdExpression}] + "`; - }, - name: `" + (${JSON.stringify( - chunkMaps.name - )}[${chunkIdExpression}]||${chunkIdExpression}) + "`, - contentHash: { - javascript: `" + ${JSON.stringify( - chunkMaps.contentHash.javascript - )}[${chunkIdExpression}] + "` - }, - contentHashWithLength: { - javascript: length => { - const shortContentHashMap = {}; - const contentHash = chunkMaps.contentHash.javascript; - for (const chunkId of Object.keys(contentHash)) { - if (typeof contentHash[chunkId] === "string") { - shortContentHashMap[chunkId] = contentHash[chunkId].substr( - 0, - length - ); - } - } - return `" + ${JSON.stringify( - shortContentHashMap - )}[${chunkIdExpression}] + "`; - } - } - }, - contentHashType: "javascript" - }); - }; - mainTemplate.hooks.localVars.tap( - "JsonpMainTemplatePlugin", - (source, chunk, hash) => { - const extraCode = []; - if (needChunkLoadingCode(chunk)) { - extraCode.push( - "", - "// object to store loaded and loading chunks", - "// undefined = chunk not loaded, null = chunk preloaded/prefetched", - "// Promise = chunk loading, 0 = chunk loaded", - "var installedChunks = {", - Template.indent( - chunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(",\n") - ), - "};", - "", - needEntryDeferringCode(chunk) - ? needPrefetchingCode(chunk) - ? "var deferredModules = [], deferredPrefetch = [];" - : "var deferredModules = [];" - : "" - ); - } - if (needChunkOnDemandLoadingCode(chunk)) { - extraCode.push( - "", - "// script path function", - "function jsonpScriptSrc(chunkId) {", - Template.indent([ - `return ${mainTemplate.requireFn}.p + ${getScriptSrcPath( - hash, - chunk, - "chunkId" - )}` - ]), - "}" - ); - } - if (extraCode.length === 0) return source; - return Template.asString([source, ...extraCode]); - } - ); + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; - mainTemplate.hooks.jsonpScript.tap( - "JsonpMainTemplatePlugin", - (_, chunk, hash) => { - const crossOriginLoading = - mainTemplate.outputOptions.crossOriginLoading; - const chunkLoadTimeout = mainTemplate.outputOptions.chunkLoadTimeout; - const jsonpScriptType = mainTemplate.outputOptions.jsonpScriptType; + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; - return Template.asString([ - "var script = document.createElement('script');", - "var onScriptComplete;", - jsonpScriptType - ? `script.type = ${JSON.stringify(jsonpScriptType)};` - : "", - "script.charset = 'utf-8';", - `script.timeout = ${chunkLoadTimeout / 1000};`, - `if (${mainTemplate.requireFn}.nc) {`, - Template.indent( - `script.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` - ), - "}", - "script.src = jsonpScriptSrc(chunkId);", - crossOriginLoading - ? Template.asString([ - "if (script.src.indexOf(window.location.origin + '/') !== 0) {", - Template.indent( - `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` - ), - "}" - ]) - : "", - "// create error before stack unwound to get useful stacktrace later", - "var error = new Error();", - "onScriptComplete = function (event) {", - Template.indent([ - "// avoid mem leaks in IE.", - "script.onerror = script.onload = null;", - "clearTimeout(timeout);", - "var chunk = installedChunks[chunkId];", - "if(chunk !== 0) {", - Template.indent([ - "if(chunk) {", - Template.indent([ - "var errorType = event && (event.type === 'load' ? 'missing' : event.type);", - "var realSrc = event && event.target && event.target.src;", - "error.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';", - "error.name = 'ChunkLoadError';", - "error.type = errorType;", - "error.request = realSrc;", - "chunk[1](error);" - ]), - "}", - "installedChunks[chunkId] = undefined;" - ]), - "}" - ]), - "};", - "var timeout = setTimeout(function(){", - Template.indent([ - "onScriptComplete({ type: 'timeout', target: script });" - ]), - `}, ${chunkLoadTimeout});`, - "script.onerror = script.onload = onScriptComplete;" - ]); - } - ); - mainTemplate.hooks.linkPreload.tap( - "JsonpMainTemplatePlugin", - (_, chunk, hash) => { - const crossOriginLoading = - mainTemplate.outputOptions.crossOriginLoading; - const jsonpScriptType = mainTemplate.outputOptions.jsonpScriptType; + // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction + pp$8.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this.regexp_alternative(state); + } - return Template.asString([ - "var link = document.createElement('link');", - jsonpScriptType - ? `link.type = ${JSON.stringify(jsonpScriptType)};` - : "", - "link.charset = 'utf-8';", - `if (${mainTemplate.requireFn}.nc) {`, - Template.indent( - `link.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` - ), - "}", - 'link.rel = "preload";', - 'link.as = "script";', - "link.href = jsonpScriptSrc(chunkId);", - crossOriginLoading - ? Template.asString([ - "if (link.href.indexOf(window.location.origin + '/') !== 0) {", - Template.indent( - `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` - ), - "}" - ]) - : "" - ]); - } - ); - mainTemplate.hooks.linkPrefetch.tap( - "JsonpMainTemplatePlugin", - (_, chunk, hash) => { - const crossOriginLoading = - mainTemplate.outputOptions.crossOriginLoading; + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); + } + }; - return Template.asString([ - "var link = document.createElement('link');", - crossOriginLoading - ? `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` - : "", - `if (${mainTemplate.requireFn}.nc) {`, - Template.indent( - `link.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` - ), - "}", - 'link.rel = "prefetch";', - 'link.as = "script";', - "link.href = jsonpScriptSrc(chunkId);" - ]); - } - ); - mainTemplate.hooks.requireEnsure.tap( - "JsonpMainTemplatePlugin load", - (source, chunk, hash) => { - return Template.asString([ - source, - "", - "// JSONP chunk loading for javascript", - "", - "var installedChunkData = installedChunks[chunkId];", - 'if(installedChunkData !== 0) { // 0 means "already installed".', - Template.indent([ - "", - '// a Promise means "currently loading".', - "if(installedChunkData) {", - Template.indent(["promises.push(installedChunkData[2]);"]), - "} else {", - Template.indent([ - "// setup Promise in chunk cache", - "var promise = new Promise(function(resolve, reject) {", - Template.indent([ - "installedChunkData = installedChunks[chunkId] = [resolve, reject];" - ]), - "});", - "promises.push(installedChunkData[2] = promise);", - "", - "// start chunk loading", - mainTemplate.hooks.jsonpScript.call("", chunk, hash), - "document.head.appendChild(script);" - ]), - "}" - ]), - "}" - ]); - } - ); - mainTemplate.hooks.requireEnsure.tap( - { - name: "JsonpMainTemplatePlugin preload", - stage: 10 - }, - (source, chunk, hash) => { - const chunkMap = chunk.getChildIdsByOrdersMap().preload; - if (!chunkMap || Object.keys(chunkMap).length === 0) return source; - return Template.asString([ - source, - "", - "// chunk preloadng for javascript", - "", - `var chunkPreloadMap = ${JSON.stringify(chunkMap, null, "\t")};`, - "", - "var chunkPreloadData = chunkPreloadMap[chunkId];", - "if(chunkPreloadData) {", - Template.indent([ - "chunkPreloadData.forEach(function(chunkId) {", - Template.indent([ - "if(installedChunks[chunkId] === undefined) {", - Template.indent([ - "installedChunks[chunkId] = null;", - mainTemplate.hooks.linkPreload.call("", chunk, hash), - "document.head.appendChild(link);" - ]), - "}" - ]), - "});" - ]), - "}" - ]); - } - ); - mainTemplate.hooks.requireExtensions.tap( - "JsonpMainTemplatePlugin", - (source, chunk) => { - if (!needChunkOnDemandLoadingCode(chunk)) return source; + // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative + pp$8.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term + pp$8.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } - return Template.asString([ - source, - "", - "// on error function for async loading", - `${mainTemplate.requireFn}.oe = function(err) { console.error(err); throw err; };` - ]); - } - ); - mainTemplate.hooks.bootstrap.tap( - "JsonpMainTemplatePlugin", - (source, chunk, hash) => { - if (needChunkLoadingCode(chunk)) { - const withDefer = needEntryDeferringCode(chunk); - const withPrefetch = needPrefetchingCode(chunk); - return Template.asString([ - source, - "", - "// install a JSONP callback for chunk loading", - "function webpackJsonpCallback(data) {", - Template.indent([ - "var chunkIds = data[0];", - "var moreModules = data[1];", - withDefer ? "var executeModules = data[2];" : "", - withPrefetch ? "var prefetchChunks = data[3] || [];" : "", - '// add "moreModules" to the modules object,', - '// then flag all "chunkIds" as loaded and fire callback', - "var moduleId, chunkId, i = 0, resolves = [];", - "for(;i < chunkIds.length; i++) {", - Template.indent([ - "chunkId = chunkIds[i];", - "if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {", - Template.indent("resolves.push(installedChunks[chunkId][0]);"), - "}", - "installedChunks[chunkId] = 0;" - ]), - "}", - "for(moduleId in moreModules) {", - Template.indent([ - "if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {", - Template.indent( - mainTemplate.renderAddModule( - hash, - chunk, - "moduleId", - "moreModules[moduleId]" - ) - ), - "}" - ]), - "}", - "if(parentJsonpFunction) parentJsonpFunction(data);", - withPrefetch - ? withDefer - ? "deferredPrefetch.push.apply(deferredPrefetch, prefetchChunks);" - : Template.asString([ - "// chunk prefetching for javascript", - "prefetchChunks.forEach(function(chunkId) {", - Template.indent([ - "if(installedChunks[chunkId] === undefined) {", - Template.indent([ - "installedChunks[chunkId] = null;", - mainTemplate.hooks.linkPrefetch.call("", chunk, hash), - "document.head.appendChild(link);" - ]), - "}" - ]), - "});" - ]) - : "", - "while(resolves.length) {", - Template.indent("resolves.shift()();"), - "}", - withDefer - ? Template.asString([ - "", - "// add entry modules from loaded chunk to deferred list", - "deferredModules.push.apply(deferredModules, executeModules || []);", - "", - "// run deferred modules when all chunks ready", - "return checkDeferredModules();" - ]) - : "" - ]), - "};", - withDefer - ? Template.asString([ - "function checkDeferredModules() {", - Template.indent([ - "var result;", - "for(var i = 0; i < deferredModules.length; i++) {", - Template.indent([ - "var deferredModule = deferredModules[i];", - "var fulfilled = true;", - "for(var j = 1; j < deferredModule.length; j++) {", - Template.indent([ - "var depId = deferredModule[j];", - "if(installedChunks[depId] !== 0) fulfilled = false;" - ]), - "}", - "if(fulfilled) {", - Template.indent([ - "deferredModules.splice(i--, 1);", - "result = " + - mainTemplate.requireFn + - "(" + - mainTemplate.requireFn + - ".s = deferredModule[0]);" - ]), - "}" - ]), - "}", - withPrefetch - ? Template.asString([ - "if(deferredModules.length === 0) {", - Template.indent([ - "// chunk prefetching for javascript", - "deferredPrefetch.forEach(function(chunkId) {", - Template.indent([ - "if(installedChunks[chunkId] === undefined) {", - Template.indent([ - "installedChunks[chunkId] = null;", - mainTemplate.hooks.linkPrefetch.call( - "", - chunk, - hash - ), - "document.head.appendChild(link);" - ]), - "}" - ]), - "});", - "deferredPrefetch.length = 0;" - ]), - "}" - ]) - : "", - "return result;" - ]), - "}" - ]) - : "" - ]); - } - return source; - } - ); - mainTemplate.hooks.beforeStartup.tap( - "JsonpMainTemplatePlugin", - (source, chunk, hash) => { - if (needChunkLoadingCode(chunk)) { - var jsonpFunction = mainTemplate.outputOptions.jsonpFunction; - var globalObject = mainTemplate.outputOptions.globalObject; - return Template.asString([ - `var jsonpArray = ${globalObject}[${JSON.stringify( - jsonpFunction - )}] = ${globalObject}[${JSON.stringify(jsonpFunction)}] || [];`, - "var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);", - "jsonpArray.push = webpackJsonpCallback;", - "jsonpArray = jsonpArray.slice();", - "for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);", - "var parentJsonpFunction = oldJsonpFunction;", - "", - source - ]); - } - return source; - } - ); - mainTemplate.hooks.afterStartup.tap( - "JsonpMainTemplatePlugin", - (source, chunk, hash) => { - const prefetchChunks = chunk.getChildIdsByOrders().prefetch; - if ( - needChunkLoadingCode(chunk) && - prefetchChunks && - prefetchChunks.length - ) { - return Template.asString([ - source, - `webpackJsonpCallback([[], {}, 0, ${JSON.stringify( - prefetchChunks - )}]);` - ]); - } - return source; - } - ); - mainTemplate.hooks.startup.tap( - "JsonpMainTemplatePlugin", - (source, chunk, hash) => { - if (needEntryDeferringCode(chunk)) { - if (chunk.hasEntryModule()) { - const entries = [chunk.entryModule].filter(Boolean).map(m => - [m.id].concat( - Array.from(chunk.groupsIterable)[0] - .chunks.filter(c => c !== chunk) - .map(c => c.id) - ) - ); - return Template.asString([ - "// add entry module to deferred list", - `deferredModules.push(${entries - .map(e => JSON.stringify(e)) - .join(", ")});`, - "// run deferred modules when ready", - "return checkDeferredModules();" - ]); - } else { - return Template.asString([ - "// run deferred modules from other chunks", - "checkDeferredModules();" - ]); - } - } - return source; - } - ); - mainTemplate.hooks.hotBootstrap.tap( - "JsonpMainTemplatePlugin", - (source, chunk, hash) => { - const globalObject = mainTemplate.outputOptions.globalObject; - const hotUpdateChunkFilename = - mainTemplate.outputOptions.hotUpdateChunkFilename; - const hotUpdateMainFilename = - mainTemplate.outputOptions.hotUpdateMainFilename; - const crossOriginLoading = - mainTemplate.outputOptions.crossOriginLoading; - const hotUpdateFunction = mainTemplate.outputOptions.hotUpdateFunction; - const currentHotUpdateChunkFilename = mainTemplate.getAssetPath( - JSON.stringify(hotUpdateChunkFilename), - { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, - chunk: { - id: '" + chunkId + "' - } - } - ); - const currentHotUpdateMainFilename = mainTemplate.getAssetPath( - JSON.stringify(hotUpdateMainFilename), - { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "` - } - ); - const runtimeSource = Template.getFunctionContent( - __webpack_require__(24916) - ) - .replace(/\/\/\$semicolon/g, ";") - .replace(/\$require\$/g, mainTemplate.requireFn) - .replace( - /\$crossOriginLoading\$/g, - crossOriginLoading ? JSON.stringify(crossOriginLoading) : "null" - ) - .replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename) - .replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename) - .replace(/\$hash\$/g, JSON.stringify(hash)); - return `${source} -function hotDisposeChunk(chunkId) { - delete installedChunks[chunkId]; -} -var parentHotUpdateCallback = ${globalObject}[${JSON.stringify( - hotUpdateFunction - )}]; -${globalObject}[${JSON.stringify(hotUpdateFunction)}] = ${runtimeSource}`; - } - ); - mainTemplate.hooks.hash.tap("JsonpMainTemplatePlugin", hash => { - hash.update("jsonp"); - hash.update("6"); - }); - } -} -module.exports = JsonpMainTemplatePlugin; + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } + return false + }; -/***/ }), + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion + pp$8.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; -/***/ 92764: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true + } + } -const JsonpMainTemplatePlugin = __webpack_require__(38017); -const JsonpChunkTemplatePlugin = __webpack_require__(31898); -const JsonpHotUpdateChunkTemplatePlugin = __webpack_require__(44458); + state.pos = start; + return false + }; -class JsonpTemplatePlugin { - apply(compiler) { - compiler.hooks.thisCompilation.tap("JsonpTemplatePlugin", compilation => { - new JsonpMainTemplatePlugin().apply(compilation.mainTemplate); - new JsonpChunkTemplatePlugin().apply(compilation.chunkTemplate); - new JsonpHotUpdateChunkTemplatePlugin().apply( - compilation.hotUpdateChunkTemplate - ); - }); - } -} + // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier + pp$8.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; -module.exports = JsonpTemplatePlugin; + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix + pp$8.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) + }; + pp$8.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false + }; -/***/ }), + // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom + pp$8.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) + }; + pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); + } + return false + }; -/***/ 92929: -/***/ (function(module, exports, __webpack_require__) { + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom + pp$8.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier + pp$8.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter + pp$8.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; + function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter + // But eat eager. + pp$8.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter + pp$8.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false + }; + + // GroupSpecifier[U] :: + // [empty] + // `?` GroupName[?U] + pp$8.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } + }; -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // GroupName[U] :: + // `<` RegExpIdentifierName[?U] `>` + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$8.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false + }; + // RegExpIdentifierName[U] :: + // RegExpIdentifierStart[?U] + // RegExpIdentifierName[?U] RegExpIdentifierPart[?U] + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$8.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true + } + return false + }; -const Compiler = __webpack_require__(58705); -const MultiCompiler = __webpack_require__(10238); -const NodeEnvironmentPlugin = __webpack_require__(52520); -const WebpackOptionsApply = __webpack_require__(2779); -const WebpackOptionsDefaulter = __webpack_require__(60016); -const validateSchema = __webpack_require__(68935); -const WebpackOptionsValidationError = __webpack_require__(285); -const webpackOptionsSchema = __webpack_require__(37863); -const RemovedPluginError = __webpack_require__(15377); -const version = __webpack_require__(71618)/* .version */ .i8; + // RegExpIdentifierStart[U] :: + // UnicodeIDStart + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[?U] + pp$8.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); -/** @typedef {import("../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } -/** - * @param {WebpackOptions} options options object - * @param {function(Error=, Stats=): void=} callback callback - * @returns {Compiler | MultiCompiler} the compiler object - */ -const webpack = (options, callback) => { - const webpackOptionsValidationErrors = validateSchema( - webpackOptionsSchema, - options - ); - if (webpackOptionsValidationErrors.length) { - throw new WebpackOptionsValidationError(webpackOptionsValidationErrors); - } - let compiler; - if (Array.isArray(options)) { - compiler = new MultiCompiler( - Array.from(options).map(options => webpack(options)) - ); - } else if (typeof options === "object") { - options = new WebpackOptionsDefaulter().process(options); + state.pos = start; + return false + }; + function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ + } - compiler = new Compiler(options.context); - compiler.options = options; - new NodeEnvironmentPlugin({ - infrastructureLogging: options.infrastructureLogging - }).apply(compiler); - if (options.plugins && Array.isArray(options.plugins)) { - for (const plugin of options.plugins) { - if (typeof plugin === "function") { - plugin.call(compiler, compiler); - } else { - plugin.apply(compiler); - } - } - } - compiler.hooks.environment.call(); - compiler.hooks.afterEnvironment.call(); - compiler.options = new WebpackOptionsApply().process(options, compiler); - } else { - throw new Error("Invalid argument: options"); - } - if (callback) { - if (typeof callback !== "function") { - throw new Error("Invalid argument: callback"); - } - if ( - options.watch === true || - (Array.isArray(options) && options.some(o => o.watch)) - ) { - const watchOptions = Array.isArray(options) - ? options.map(o => o.watchOptions || {}) - : options.watchOptions || {}; - return compiler.watch(watchOptions, callback); - } - compiler.run(callback); - } - return compiler; -}; + // RegExpIdentifierPart[U] :: + // UnicodeIDContinue + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[?U] + // + // + pp$8.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); -exports = module.exports = webpack; -exports.version = version; + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } -webpack.WebpackOptionsDefaulter = WebpackOptionsDefaulter; -webpack.WebpackOptionsApply = WebpackOptionsApply; -webpack.Compiler = Compiler; -webpack.MultiCompiler = MultiCompiler; -webpack.NodeEnvironmentPlugin = NodeEnvironmentPlugin; -// @ts-ignore Global @this directive is not supported -webpack.validate = validateSchema.bind(this, webpackOptionsSchema); -webpack.validateSchema = validateSchema; -webpack.WebpackOptionsValidationError = WebpackOptionsValidationError; + state.pos = start; + return false + }; + function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ + } -const exportPlugins = (obj, mappings) => { - for (const name of Object.keys(mappings)) { - Object.defineProperty(obj, name, { - configurable: false, - enumerable: true, - get: mappings[name] - }); - } -}; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape + pp$8.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true + } + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false + }; + pp$8.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false + }; -exportPlugins(exports, { - AutomaticPrefetchPlugin: () => __webpack_require__(51596), - BannerPlugin: () => __webpack_require__(4009), - CachePlugin: () => __webpack_require__(6465), - ContextExclusionPlugin: () => __webpack_require__(10706), - ContextReplacementPlugin: () => __webpack_require__(27295), - DefinePlugin: () => __webpack_require__(97374), - Dependency: () => __webpack_require__(57282), - DllPlugin: () => __webpack_require__(45255), - DllReferencePlugin: () => __webpack_require__(86231), - EnvironmentPlugin: () => __webpack_require__(6098), - EvalDevToolModulePlugin: () => __webpack_require__(65200), - EvalSourceMapDevToolPlugin: () => __webpack_require__(99994), - ExtendedAPIPlugin: () => __webpack_require__(17270), - ExternalsPlugin: () => __webpack_require__(75705), - HashedModuleIdsPlugin: () => __webpack_require__(50268), - HotModuleReplacementPlugin: () => __webpack_require__(69575), - IgnorePlugin: () => __webpack_require__(41364), - LibraryTemplatePlugin: () => __webpack_require__(65237), - LoaderOptionsPlugin: () => __webpack_require__(48775), - LoaderTargetPlugin: () => __webpack_require__(95154), - MemoryOutputFileSystem: () => __webpack_require__(50332), - Module: () => __webpack_require__(75993), - ModuleFilenameHelpers: () => __webpack_require__(71474), - NamedChunksPlugin: () => __webpack_require__(70419), - NamedModulesPlugin: () => __webpack_require__(86707), - NoEmitOnErrorsPlugin: () => __webpack_require__(22615), - NormalModuleReplacementPlugin: () => - __webpack_require__(73253), - PrefetchPlugin: () => __webpack_require__(27850), - ProgressPlugin: () => __webpack_require__(63123), - ProvidePlugin: () => __webpack_require__(72861), - SetVarMainTemplatePlugin: () => __webpack_require__(37098), - SingleEntryPlugin: () => __webpack_require__(19070), - SourceMapDevToolPlugin: () => __webpack_require__(11851), - Stats: () => __webpack_require__(99977), - Template: () => __webpack_require__(96066), - UmdMainTemplatePlugin: () => __webpack_require__(75374), - WatchIgnorePlugin: () => __webpack_require__(88015) -}); -exportPlugins((exports.dependencies = {}), { - DependencyReference: () => __webpack_require__(71722) -}); -exportPlugins((exports.optimize = {}), { - AggressiveMergingPlugin: () => __webpack_require__(88197), - AggressiveSplittingPlugin: () => - __webpack_require__(26688), - ChunkModuleIdRangePlugin: () => - __webpack_require__(30346), - LimitChunkCountPlugin: () => __webpack_require__(3846), - MinChunkSizePlugin: () => __webpack_require__(55607), - ModuleConcatenationPlugin: () => - __webpack_require__(45184), - OccurrenceOrderPlugin: () => __webpack_require__(67340), - OccurrenceModuleOrderPlugin: () => - __webpack_require__(62000), - OccurrenceChunkOrderPlugin: () => - __webpack_require__(83741), - RuntimeChunkPlugin: () => __webpack_require__(76894), - SideEffectsFlagPlugin: () => __webpack_require__(83654), - SplitChunksPlugin: () => __webpack_require__(60474) -}); -exportPlugins((exports.web = {}), { - FetchCompileWasmTemplatePlugin: () => - __webpack_require__(52669), - JsonpTemplatePlugin: () => __webpack_require__(92764) -}); -exportPlugins((exports.webworker = {}), { - WebWorkerTemplatePlugin: () => __webpack_require__(21328) -}); -exportPlugins((exports.node = {}), { - NodeTemplatePlugin: () => __webpack_require__(90010), - ReadFileCompileWasmTemplatePlugin: () => - __webpack_require__(73839) -}); -exportPlugins((exports.debug = {}), { - ProfilingPlugin: () => __webpack_require__(72890) -}); -exportPlugins((exports.util = {}), { - createHash: () => __webpack_require__(15660) -}); + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape + pp$8.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) + }; + pp$8.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false + }; -const defineMissingPluginError = (namespace, pluginName, errorMessage) => { - Object.defineProperty(namespace, pluginName, { - configurable: false, - enumerable: true, - get() { - throw new RemovedPluginError(errorMessage); - } - }); -}; + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape + pp$8.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false + }; -// TODO remove in webpack 5 -defineMissingPluginError( - exports.optimize, - "UglifyJsPlugin", - "webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead." -); + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter + pp$8.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) + } -// TODO remove in webpack 5 -defineMissingPluginError( - exports.optimize, - "CommonsChunkPlugin", - "webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead." -); + // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence + pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true + } + if ( + state.switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (state.switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } -/***/ }), + return false + }; + function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF + } -/***/ 37919: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape + pp$8.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; -const { ConcatSource } = __webpack_require__(53665); + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape + pp$8.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false + }; -class WebWorkerChunkTemplatePlugin { - apply(chunkTemplate) { - chunkTemplate.hooks.render.tap( - "WebWorkerChunkTemplatePlugin", - (modules, chunk) => { - const chunkCallbackName = chunkTemplate.outputOptions.chunkCallbackName; - const globalObject = chunkTemplate.outputOptions.globalObject; - const source = new ConcatSource(); - source.add( - `${globalObject}[${JSON.stringify( - chunkCallbackName - )}](${JSON.stringify(chunk.ids)},` - ); - source.add(modules); - source.add(")"); - return source; - } - ); - chunkTemplate.hooks.hash.tap("WebWorkerChunkTemplatePlugin", hash => { - hash.update("webworker"); - hash.update("3"); - hash.update(`${chunkTemplate.outputOptions.chunkCallbackName}`); - hash.update(`${chunkTemplate.outputOptions.globalObject}`); - }); - } -} -module.exports = WebWorkerChunkTemplatePlugin; + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape + pp$8.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true + } -/***/ }), + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } -/***/ 45493: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + return false + }; + function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + // UnicodePropertyValueExpression :: + // UnicodePropertyName `=` UnicodePropertyValue + // LoneUnicodePropertyNameOrValue + pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; -const { ConcatSource } = __webpack_require__(53665); + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; -class WebWorkerHotUpdateChunkTemplatePlugin { - apply(hotUpdateChunkTemplate) { - hotUpdateChunkTemplate.hooks.render.tap( - "WebWorkerHotUpdateChunkTemplatePlugin", - (modulesSource, modules, removedModules, hash, id) => { - const hotUpdateFunction = - hotUpdateChunkTemplate.outputOptions.hotUpdateFunction; - const globalObject = hotUpdateChunkTemplate.outputOptions.globalObject; - const source = new ConcatSource(); - source.add( - `${globalObject}[${JSON.stringify( - hotUpdateFunction - )}](${JSON.stringify(id)},` - ); - source.add(modulesSource); - source.add(")"); - return source; - } - ); - hotUpdateChunkTemplate.hooks.hash.tap( - "WebWorkerHotUpdateChunkTemplatePlugin", - hash => { - hash.update("WebWorkerHotUpdateChunkTemplatePlugin"); - hash.update("3"); - hash.update( - hotUpdateChunkTemplate.outputOptions.hotUpdateFunction + "" - ); - hash.update(hotUpdateChunkTemplate.outputOptions.globalObject + ""); - } - ); - } -} -module.exports = WebWorkerHotUpdateChunkTemplatePlugin; + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true + } + return false + }; + pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!has(state.unicodeProperties.nonBinary, name)) + { state.raise("Invalid property name"); } + if (!state.unicodeProperties.nonBinary[name].test(value)) + { state.raise("Invalid property value"); } + }; + pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) + { state.raise("Invalid property name"); } + }; + // UnicodePropertyName :: + // UnicodePropertyNameCharacters + pp$8.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ + } -/***/ }), + // UnicodePropertyValue :: + // UnicodePropertyValueCharacters + pp$8.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) + } -/***/ 72337: -/***/ (function(module) { + // LoneUnicodePropertyNameOrValue :: + // UnicodePropertyValueCharacters + pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) + }; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// eslint-disable-next-line no-unused-vars -var hotAddUpdateChunk = undefined; -var parentHotUpdateCallback = undefined; -var $require$ = undefined; -var $hotChunkFilename$ = undefined; -var $hotMainFilename$ = undefined; -var installedChunks = undefined; -var importScripts = undefined; + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass + pp$8.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* [ */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); + } + return false + }; -module.exports = function() { - // eslint-disable-next-line no-unused-vars - function webpackHotUpdateCallback(chunkId, moreModules) { - hotAddUpdateChunk(chunkId, moreModules); - if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); - } //$semicolon + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash + pp$8.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; - // eslint-disable-next-line no-unused-vars - function hotDownloadUpdateChunk(chunkId) { - importScripts($require$.p + $hotChunkFilename$); - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash + pp$8.regexp_eatClassAtom = function(state) { + var start = state.pos; - // eslint-disable-next-line no-unused-vars - function hotDownloadManifest(requestTimeout) { - requestTimeout = requestTimeout || 10000; - return new Promise(function(resolve, reject) { - if (typeof XMLHttpRequest === "undefined") { - return reject(new Error("No browser support")); - } - try { - var request = new XMLHttpRequest(); - var requestPath = $require$.p + $hotMainFilename$; - request.open("GET", requestPath, true); - request.timeout = requestTimeout; - request.send(null); - } catch (err) { - return reject(err); - } - request.onreadystatechange = function() { - if (request.readyState !== 4) return; - if (request.status === 0) { - // timeout - reject( - new Error("Manifest request to " + requestPath + " timed out.") - ); - } else if (request.status === 404) { - // no update available - resolve(); - } else if (request.status !== 200 && request.status !== 304) { - // other failure - reject(new Error("Manifest request to " + requestPath + " failed.")); - } else { - // success - try { - var update = JSON.parse(request.responseText); - } catch (e) { - reject(e); - return; - } - resolve(update); - } - }; - }); - } + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } - //eslint-disable-next-line no-unused-vars - function hotDisposeChunk(chunkId) { - delete installedChunks[chunkId]; - } -}; + var ch = state.current(); + if (ch !== 0x5D /* [ */) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; -/***/ }), + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape + pp$8.regexp_eatClassEscape = function(state) { + var start = state.pos; -/***/ 20482: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } -const Template = __webpack_require__(96066); + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) + }; -class WebWorkerMainTemplatePlugin { - apply(mainTemplate) { - const needChunkOnDemandLoadingCode = chunk => { - for (const chunkGroup of chunk.groupsIterable) { - if (chunkGroup.getNumberOfChildren() > 0) return true; - } - return false; - }; - mainTemplate.hooks.localVars.tap( - "WebWorkerMainTemplatePlugin", - (source, chunk) => { - if (needChunkOnDemandLoadingCode(chunk)) { - return Template.asString([ - source, - "", - "// object to store loaded chunks", - '// "1" means "already loaded"', - "var installedChunks = {", - Template.indent( - chunk.ids.map(id => `${JSON.stringify(id)}: 1`).join(",\n") - ), - "};" - ]); - } - return source; - } - ); - mainTemplate.hooks.requireEnsure.tap( - "WebWorkerMainTemplatePlugin", - (_, chunk, hash) => { - const chunkFilename = mainTemplate.outputOptions.chunkFilename; - const chunkMaps = chunk.getChunkMaps(); - return Template.asString([ - "promises.push(Promise.resolve().then(function() {", - Template.indent([ - '// "1" is the signal for "already loaded"', - "if(!installedChunks[chunkId]) {", - Template.indent([ - "importScripts(" + - "__webpack_require__.p + " + - mainTemplate.getAssetPath(JSON.stringify(chunkFilename), { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode( - hash, - length - )} + "`, - chunk: { - id: '" + chunkId + "', - hash: `" + ${JSON.stringify(chunkMaps.hash)}[chunkId] + "`, - hashWithLength(length) { - const shortChunkHashMap = Object.create(null); - for (const chunkId of Object.keys(chunkMaps.hash)) { - if (typeof chunkMaps.hash[chunkId] === "string") { - shortChunkHashMap[chunkId] = chunkMaps.hash[ - chunkId - ].substr(0, length); - } - } - return `" + ${JSON.stringify( - shortChunkHashMap - )}[chunkId] + "`; - }, - contentHash: { - javascript: `" + ${JSON.stringify( - chunkMaps.contentHash.javascript - )}[chunkId] + "` - }, - contentHashWithLength: { - javascript: length => { - const shortContentHashMap = {}; - const contentHash = chunkMaps.contentHash.javascript; - for (const chunkId of Object.keys(contentHash)) { - if (typeof contentHash[chunkId] === "string") { - shortContentHashMap[chunkId] = contentHash[ - chunkId - ].substr(0, length); - } - } - return `" + ${JSON.stringify( - shortContentHashMap - )}[chunkId] + "`; - } - }, - name: `" + (${JSON.stringify( - chunkMaps.name - )}[chunkId]||chunkId) + "` - }, - contentHashType: "javascript" - }) + - ");" - ]), - "}" - ]), - "}));" - ]); - } - ); - mainTemplate.hooks.bootstrap.tap( - "WebWorkerMainTemplatePlugin", - (source, chunk, hash) => { - if (needChunkOnDemandLoadingCode(chunk)) { - const chunkCallbackName = - mainTemplate.outputOptions.chunkCallbackName; - const globalObject = mainTemplate.outputOptions.globalObject; - return Template.asString([ - source, - `${globalObject}[${JSON.stringify( - chunkCallbackName - )}] = function webpackChunkCallback(chunkIds, moreModules) {`, - Template.indent([ - "for(var moduleId in moreModules) {", - Template.indent( - mainTemplate.renderAddModule( - hash, - chunk, - "moduleId", - "moreModules[moduleId]" - ) - ), - "}", - "while(chunkIds.length)", - Template.indent("installedChunks[chunkIds.pop()] = 1;") - ]), - "};" - ]); - } - return source; - } - ); - mainTemplate.hooks.hotBootstrap.tap( - "WebWorkerMainTemplatePlugin", - (source, chunk, hash) => { - const hotUpdateChunkFilename = - mainTemplate.outputOptions.hotUpdateChunkFilename; - const hotUpdateMainFilename = - mainTemplate.outputOptions.hotUpdateMainFilename; - const hotUpdateFunction = mainTemplate.outputOptions.hotUpdateFunction; - const globalObject = mainTemplate.outputOptions.globalObject; - const currentHotUpdateChunkFilename = mainTemplate.getAssetPath( - JSON.stringify(hotUpdateChunkFilename), - { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`, - chunk: { - id: '" + chunkId + "' - } - } - ); - const currentHotUpdateMainFilename = mainTemplate.getAssetPath( - JSON.stringify(hotUpdateMainFilename), - { - hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`, - hashWithLength: length => - `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "` - } - ); + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter + pp$8.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$8.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits + pp$8.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start + }; + function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits + pp$8.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start + }; + function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) + } + function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ + } - return ( - source + - "\n" + - `var parentHotUpdateCallback = ${globalObject}[${JSON.stringify( - hotUpdateFunction - )}];\n` + - `${globalObject}[${JSON.stringify(hotUpdateFunction)}] = ` + - Template.getFunctionContent( - __webpack_require__(72337) - ) - .replace(/\/\/\$semicolon/g, ";") - .replace(/\$require\$/g, mainTemplate.requireFn) - .replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename) - .replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename) - .replace(/\$hash\$/g, JSON.stringify(hash)) - ); - } - ); - mainTemplate.hooks.hash.tap("WebWorkerMainTemplatePlugin", hash => { - hash.update("webworker"); - hash.update("4"); - }); - } -} -module.exports = WebWorkerMainTemplatePlugin; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence + // Allows only 0-377(octal) i.e. 0-255(decimal). + pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit + pp$8.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false + }; + function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ + } -/***/ }), + // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit + // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$8.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true + }; -/***/ 21328: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + // Object type used to represent tokens. Note that normally, tokens + // simply exist as properties on the parser object. This is only + // used for the onToken callback and the external tokenizer. -"use strict"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } + }; + // ## Tokenizer -const WebWorkerMainTemplatePlugin = __webpack_require__(20482); -const WebWorkerChunkTemplatePlugin = __webpack_require__(37919); -const WebWorkerHotUpdateChunkTemplatePlugin = __webpack_require__(45493); + var pp$9 = Parser.prototype; -class WebWorkerTemplatePlugin { - apply(compiler) { - compiler.hooks.thisCompilation.tap( - "WebWorkerTemplatePlugin", - compilation => { - new WebWorkerMainTemplatePlugin().apply(compilation.mainTemplate); - new WebWorkerChunkTemplatePlugin().apply(compilation.chunkTemplate); - new WebWorkerHotUpdateChunkTemplatePlugin().apply( - compilation.hotUpdateChunkTemplate - ); - } - ); - } -} -module.exports = WebWorkerTemplatePlugin; + // Move to the next token + pp$9.next = function() { + if (this.options.onToken) + { this.options.onToken(new Token(this)); } -/***/ }), + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; -/***/ 77087: -/***/ (function(__unused_webpack_module, exports) { + pp$9.getToken = function() { + this.next(); + return new Token(this) + }; -(function (global, factory) { - true ? factory(exports) : - 0; -}(this, function (exports) { 'use strict'; + // If we're in an ES6 environment, make parsers iterable + if (typeof Symbol !== "undefined") + { pp$9[Symbol.iterator] = function() { + var this$1 = this; - // Reserved word lists for various dialects of the language + return { + next: function () { + var token = this$1.getToken(); + return { + done: token.type === types.eof, + value: token + } + } + } + }; } - var reservedWords = { - 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", - 5: "class enum extends super const export import", - 6: "enum", - strict: "implements interface let package private protected public static yield", - strictBind: "eval arguments" + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + pp$9.curContext = function() { + return this.context[this.context.length - 1] }; - // And the keywords + // Read a single token, updating the parser object's token-related + // properties. - var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + pp$9.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } - var keywords = { - 5: ecma5AndLessKeywords, - "5module": ecma5AndLessKeywords + " export import", - 6: ecma5AndLessKeywords + " const class extends export import super" + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } }; - var keywordRelationalOperator = /^in(stanceof)?$/; + pp$9.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } - // ## Character categories + return this.getTokenFromCode(code) + }; - // Big ugly regular expressions that match characters in the - // whitespace, identifier, and identifier-start categories. These - // are only applied when a character is found to actually have a - // code point above 128. - // Generated by `bin/generate-identifier-regex.js`. - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; - var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + pp$9.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return (code << 10) + next - 0x35fdc00 + }; - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + pp$9.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + lineBreakG.lastIndex = start; + var match; + while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this.curLine; + this.lineStart = match.index + match[0].length; + } + } + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } + }; - nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + pp$9.skipLineComment = function(startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } + }; - // These are a run-length and offset encoded representation of the - // >0xffff code points that are a valid part of identifiers. The - // offset starts at 0x10000, and each pair of numbers represents an - // offset to the next range, and then a size of the range. They were - // generated by bin/generate-identifier-regex.js + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. - // eslint-disable-next-line comma-spacing - var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]; + pp$9.skipSpace = function() { + loop: while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this.pos; + break + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: case 8232: case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break + case 47: // '/' + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: // '*' + this.skipBlockComment(); + break + case 47: + this.skipLineComment(2); + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop + } + } + } + }; - // eslint-disable-next-line comma-spacing - var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239]; + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. - // This has a complexity linear to the value of the code. The - // assumption is that looking up astral identifier characters is - // rare. - function isInAstralSet(code, set) { - var pos = 0x10000; - for (var i = 0; i < set.length; i += 2) { - pos += set[i]; - if (pos > code) { return false } - pos += set[i + 1]; - if (pos >= code) { return true } + pp$9.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); + }; + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + pp$9.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types.ellipsis) + } else { + ++this.pos; + return this.finishToken(types.dot) } - } + }; - // Test whether a given character code starts an identifier. + pp$9.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.slash, 1) + }; - function isIdentifierStart(code, astral) { - if (code < 65) { return code === 36 } - if (code < 91) { return true } - if (code < 97) { return code === 95 } - if (code < 123) { return true } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } - if (astral === false) { return false } - return isInAstralSet(code, astralIdentifierStartCodes) - } + pp$9.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types.star : types.modulo; - // Test whether a given character is part of an identifier. + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types.starstar; + next = this.input.charCodeAt(this.pos + 2); + } - function isIdentifierChar(code, astral) { - if (code < 48) { return code === 36 } - if (code < 58) { return true } - if (code < 65) { return false } - if (code < 91) { return true } - if (code < 97) { return code === 95 } - if (code < 123) { return true } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } - if (astral === false) { return false } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) - } + if (next === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(tokentype, size) + }; - // ## Token types + pp$9.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + }; - // The assignment of fine-grained, information-carrying type objects - // allows the tokenizer to store the information it has about a - // token in a way that is very cheap for the parser to look up. + pp$9.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.bitwiseXOR, 1) + }; - // All token type variables start with an underscore, to make them - // easy to recognize. + pp$9.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) + }; - // The `beforeExpr` property is used to disambiguate between regular - // expressions and divisions. It is set on all token types that can - // be followed by an expression (thus, a slash after them would be a - // regular expression). - // - // The `startsExpr` property is used to check if the token ends a - // `yield` expression. It is set on all token types that either can - // directly start an expression (like a quotation mark) or can - // continue an expression (like the body of a string). - // - // `isLoop` marks a keyword as starting a loop, which is important - // to know when parsing a label, in order to allow or disallow - // continue jumps to that label. + pp$9.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types.incDec, 2) + __isNodejsScope() { + return this.__options.nodejsScope; } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) - }; - pp$9.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) + isModule() { + return this.__options.sourceType === "module"; } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `