sanitize-html 1.27.1 → 1.27.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1936,297 +1936,320 @@ function numberIsNaN (obj) {
1936
1936
 
1937
1937
  }).call(this,require("buffer").Buffer)
1938
1938
  },{"base64-js":1,"buffer":3,"ieee754":32}],4:[function(require,module,exports){
1939
- module.exports={
1940
- "elementNames" : {
1941
- "altglyph" : "altGlyph",
1942
- "altglyphdef" : "altGlyphDef",
1943
- "altglyphitem" : "altGlyphItem",
1944
- "animatecolor" : "animateColor",
1945
- "animatemotion" : "animateMotion",
1946
- "animatetransform" : "animateTransform",
1947
- "clippath" : "clipPath",
1948
- "feblend" : "feBlend",
1949
- "fecolormatrix" : "feColorMatrix",
1950
- "fecomponenttransfer" : "feComponentTransfer",
1951
- "fecomposite" : "feComposite",
1952
- "feconvolvematrix" : "feConvolveMatrix",
1953
- "fediffuselighting" : "feDiffuseLighting",
1954
- "fedisplacementmap" : "feDisplacementMap",
1955
- "fedistantlight" : "feDistantLight",
1956
- "fedropshadow" : "feDropShadow",
1957
- "feflood" : "feFlood",
1958
- "fefunca" : "feFuncA",
1959
- "fefuncb" : "feFuncB",
1960
- "fefuncg" : "feFuncG",
1961
- "fefuncr" : "feFuncR",
1962
- "fegaussianblur" : "feGaussianBlur",
1963
- "feimage" : "feImage",
1964
- "femerge" : "feMerge",
1965
- "femergenode" : "feMergeNode",
1966
- "femorphology" : "feMorphology",
1967
- "feoffset" : "feOffset",
1968
- "fepointlight" : "fePointLight",
1969
- "fespecularlighting" : "feSpecularLighting",
1970
- "fespotlight" : "feSpotLight",
1971
- "fetile" : "feTile",
1972
- "feturbulence" : "feTurbulence",
1973
- "foreignobject" : "foreignObject",
1974
- "glyphref" : "glyphRef",
1975
- "lineargradient" : "linearGradient",
1976
- "radialgradient" : "radialGradient",
1977
- "textpath" : "textPath"
1978
- },
1979
- "attributeNames" : {
1980
- "definitionurl" : "definitionURL",
1981
- "attributename" : "attributeName",
1982
- "attributetype" : "attributeType",
1983
- "basefrequency" : "baseFrequency",
1984
- "baseprofile" : "baseProfile",
1985
- "calcmode" : "calcMode",
1986
- "clippathunits" : "clipPathUnits",
1987
- "diffuseconstant" : "diffuseConstant",
1988
- "edgemode" : "edgeMode",
1989
- "filterunits" : "filterUnits",
1990
- "glyphref" : "glyphRef",
1991
- "gradienttransform" : "gradientTransform",
1992
- "gradientunits" : "gradientUnits",
1993
- "kernelmatrix" : "kernelMatrix",
1994
- "kernelunitlength" : "kernelUnitLength",
1995
- "keypoints" : "keyPoints",
1996
- "keysplines" : "keySplines",
1997
- "keytimes" : "keyTimes",
1998
- "lengthadjust" : "lengthAdjust",
1999
- "limitingconeangle" : "limitingConeAngle",
2000
- "markerheight" : "markerHeight",
2001
- "markerunits" : "markerUnits",
2002
- "markerwidth" : "markerWidth",
2003
- "maskcontentunits" : "maskContentUnits",
2004
- "maskunits" : "maskUnits",
2005
- "numoctaves" : "numOctaves",
2006
- "pathlength" : "pathLength",
2007
- "patterncontentunits" : "patternContentUnits",
2008
- "patterntransform" : "patternTransform",
2009
- "patternunits" : "patternUnits",
2010
- "pointsatx" : "pointsAtX",
2011
- "pointsaty" : "pointsAtY",
2012
- "pointsatz" : "pointsAtZ",
2013
- "preservealpha" : "preserveAlpha",
2014
- "preserveaspectratio" : "preserveAspectRatio",
2015
- "primitiveunits" : "primitiveUnits",
2016
- "refx" : "refX",
2017
- "refy" : "refY",
2018
- "repeatcount" : "repeatCount",
2019
- "repeatdur" : "repeatDur",
2020
- "requiredextensions" : "requiredExtensions",
2021
- "requiredfeatures" : "requiredFeatures",
2022
- "specularconstant" : "specularConstant",
2023
- "specularexponent" : "specularExponent",
2024
- "spreadmethod" : "spreadMethod",
2025
- "startoffset" : "startOffset",
2026
- "stddeviation" : "stdDeviation",
2027
- "stitchtiles" : "stitchTiles",
2028
- "surfacescale" : "surfaceScale",
2029
- "systemlanguage" : "systemLanguage",
2030
- "tablevalues" : "tableValues",
2031
- "targetx" : "targetX",
2032
- "targety" : "targetY",
2033
- "textlength" : "textLength",
2034
- "viewbox" : "viewBox",
2035
- "viewtarget" : "viewTarget",
2036
- "xchannelselector" : "xChannelSelector",
2037
- "ychannelselector" : "yChannelSelector",
2038
- "zoomandpan" : "zoomAndPan"
2039
- }
2040
- }
1939
+ "use strict";
1940
+ Object.defineProperty(exports, "__esModule", { value: true });
1941
+ exports.attributeNames = exports.elementNames = void 0;
1942
+ exports.elementNames = new Map([
1943
+ ["altglyph", "altGlyph"],
1944
+ ["altglyphdef", "altGlyphDef"],
1945
+ ["altglyphitem", "altGlyphItem"],
1946
+ ["animatecolor", "animateColor"],
1947
+ ["animatemotion", "animateMotion"],
1948
+ ["animatetransform", "animateTransform"],
1949
+ ["clippath", "clipPath"],
1950
+ ["feblend", "feBlend"],
1951
+ ["fecolormatrix", "feColorMatrix"],
1952
+ ["fecomponenttransfer", "feComponentTransfer"],
1953
+ ["fecomposite", "feComposite"],
1954
+ ["feconvolvematrix", "feConvolveMatrix"],
1955
+ ["fediffuselighting", "feDiffuseLighting"],
1956
+ ["fedisplacementmap", "feDisplacementMap"],
1957
+ ["fedistantlight", "feDistantLight"],
1958
+ ["fedropshadow", "feDropShadow"],
1959
+ ["feflood", "feFlood"],
1960
+ ["fefunca", "feFuncA"],
1961
+ ["fefuncb", "feFuncB"],
1962
+ ["fefuncg", "feFuncG"],
1963
+ ["fefuncr", "feFuncR"],
1964
+ ["fegaussianblur", "feGaussianBlur"],
1965
+ ["feimage", "feImage"],
1966
+ ["femerge", "feMerge"],
1967
+ ["femergenode", "feMergeNode"],
1968
+ ["femorphology", "feMorphology"],
1969
+ ["feoffset", "feOffset"],
1970
+ ["fepointlight", "fePointLight"],
1971
+ ["fespecularlighting", "feSpecularLighting"],
1972
+ ["fespotlight", "feSpotLight"],
1973
+ ["fetile", "feTile"],
1974
+ ["feturbulence", "feTurbulence"],
1975
+ ["foreignobject", "foreignObject"],
1976
+ ["glyphref", "glyphRef"],
1977
+ ["lineargradient", "linearGradient"],
1978
+ ["radialgradient", "radialGradient"],
1979
+ ["textpath", "textPath"],
1980
+ ]);
1981
+ exports.attributeNames = new Map([
1982
+ ["definitionurl", "definitionURL"],
1983
+ ["attributename", "attributeName"],
1984
+ ["attributetype", "attributeType"],
1985
+ ["basefrequency", "baseFrequency"],
1986
+ ["baseprofile", "baseProfile"],
1987
+ ["calcmode", "calcMode"],
1988
+ ["clippathunits", "clipPathUnits"],
1989
+ ["diffuseconstant", "diffuseConstant"],
1990
+ ["edgemode", "edgeMode"],
1991
+ ["filterunits", "filterUnits"],
1992
+ ["glyphref", "glyphRef"],
1993
+ ["gradienttransform", "gradientTransform"],
1994
+ ["gradientunits", "gradientUnits"],
1995
+ ["kernelmatrix", "kernelMatrix"],
1996
+ ["kernelunitlength", "kernelUnitLength"],
1997
+ ["keypoints", "keyPoints"],
1998
+ ["keysplines", "keySplines"],
1999
+ ["keytimes", "keyTimes"],
2000
+ ["lengthadjust", "lengthAdjust"],
2001
+ ["limitingconeangle", "limitingConeAngle"],
2002
+ ["markerheight", "markerHeight"],
2003
+ ["markerunits", "markerUnits"],
2004
+ ["markerwidth", "markerWidth"],
2005
+ ["maskcontentunits", "maskContentUnits"],
2006
+ ["maskunits", "maskUnits"],
2007
+ ["numoctaves", "numOctaves"],
2008
+ ["pathlength", "pathLength"],
2009
+ ["patterncontentunits", "patternContentUnits"],
2010
+ ["patterntransform", "patternTransform"],
2011
+ ["patternunits", "patternUnits"],
2012
+ ["pointsatx", "pointsAtX"],
2013
+ ["pointsaty", "pointsAtY"],
2014
+ ["pointsatz", "pointsAtZ"],
2015
+ ["preservealpha", "preserveAlpha"],
2016
+ ["preserveaspectratio", "preserveAspectRatio"],
2017
+ ["primitiveunits", "primitiveUnits"],
2018
+ ["refx", "refX"],
2019
+ ["refy", "refY"],
2020
+ ["repeatcount", "repeatCount"],
2021
+ ["repeatdur", "repeatDur"],
2022
+ ["requiredextensions", "requiredExtensions"],
2023
+ ["requiredfeatures", "requiredFeatures"],
2024
+ ["specularconstant", "specularConstant"],
2025
+ ["specularexponent", "specularExponent"],
2026
+ ["spreadmethod", "spreadMethod"],
2027
+ ["startoffset", "startOffset"],
2028
+ ["stddeviation", "stdDeviation"],
2029
+ ["stitchtiles", "stitchTiles"],
2030
+ ["surfacescale", "surfaceScale"],
2031
+ ["systemlanguage", "systemLanguage"],
2032
+ ["tablevalues", "tableValues"],
2033
+ ["targetx", "targetX"],
2034
+ ["targety", "targetY"],
2035
+ ["textlength", "textLength"],
2036
+ ["viewbox", "viewBox"],
2037
+ ["viewtarget", "viewTarget"],
2038
+ ["xchannelselector", "xChannelSelector"],
2039
+ ["ychannelselector", "yChannelSelector"],
2040
+ ["zoomandpan", "zoomAndPan"],
2041
+ ]);
2041
2042
 
2042
2043
  },{}],5:[function(require,module,exports){
2043
- /*
2044
- Module dependencies
2045
- */
2046
- var ElementType = require('domelementtype');
2047
- var entities = require('entities');
2048
-
2049
- /* mixed-case SVG and MathML tags & attributes
2050
- recognized by the HTML parser, see
2051
- https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
2052
- */
2053
- var foreignNames = require('./foreignNames.json');
2054
- foreignNames.elementNames.__proto__ = null; /* use as a simple dictionary */
2055
- foreignNames.attributeNames.__proto__ = null;
2056
-
2057
- var unencodedElements = {
2058
- __proto__: null,
2059
- style: true,
2060
- script: true,
2061
- xmp: true,
2062
- iframe: true,
2063
- noembed: true,
2064
- noframes: true,
2065
- plaintext: true,
2066
- noscript: true
2044
+ "use strict";
2045
+ var __assign = (this && this.__assign) || function () {
2046
+ __assign = Object.assign || function(t) {
2047
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2048
+ s = arguments[i];
2049
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2050
+ t[p] = s[p];
2051
+ }
2052
+ return t;
2053
+ };
2054
+ return __assign.apply(this, arguments);
2067
2055
  };
2068
-
2056
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2057
+ if (k2 === undefined) k2 = k;
2058
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2059
+ }) : (function(o, m, k, k2) {
2060
+ if (k2 === undefined) k2 = k;
2061
+ o[k2] = m[k];
2062
+ }));
2063
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
2064
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
2065
+ }) : function(o, v) {
2066
+ o["default"] = v;
2067
+ });
2068
+ var __importStar = (this && this.__importStar) || function (mod) {
2069
+ if (mod && mod.__esModule) return mod;
2070
+ var result = {};
2071
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
2072
+ __setModuleDefault(result, mod);
2073
+ return result;
2074
+ };
2075
+ Object.defineProperty(exports, "__esModule", { value: true });
2069
2076
  /*
2070
- Format attributes
2071
- */
2072
- function formatAttrs(attributes, opts) {
2073
- if (!attributes) return;
2074
-
2075
- var output = '';
2076
- var value;
2077
-
2078
- // Loop through the attributes
2079
- for (var key in attributes) {
2080
- value = attributes[key];
2081
- if (output) {
2082
- output += ' ';
2083
- }
2084
-
2085
- if (opts.xmlMode === 'foreign') {
2086
- /* fix up mixed-case attribute names */
2087
- key = foreignNames.attributeNames[key] || key;
2077
+ * Module dependencies
2078
+ */
2079
+ var ElementType = __importStar(require("domelementtype"));
2080
+ var entities_1 = require("entities");
2081
+ /*
2082
+ * Mixed-case SVG and MathML tags & attributes
2083
+ * recognized by the HTML parser, see
2084
+ * https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
2085
+ */
2086
+ var foreignNames_1 = require("./foreignNames");
2087
+ var unencodedElements = new Set([
2088
+ "style",
2089
+ "script",
2090
+ "xmp",
2091
+ "iframe",
2092
+ "noembed",
2093
+ "noframes",
2094
+ "plaintext",
2095
+ "noscript",
2096
+ ]);
2097
+ /**
2098
+ * Format attributes
2099
+ */
2100
+ function formatAttributes(attributes, opts) {
2101
+ if (!attributes)
2102
+ return;
2103
+ return Object.keys(attributes)
2104
+ .map(function (key) {
2105
+ var _a, _b;
2106
+ var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
2107
+ if (opts.xmlMode === "foreign") {
2108
+ /* Fix up mixed-case attribute names */
2109
+ key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
2110
+ }
2111
+ if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
2112
+ return key;
2113
+ }
2114
+ return key + "=\"" + (opts.decodeEntities ? entities_1.encodeXML(value) : value.replace(/"/g, "&quot;")) + "\"";
2115
+ })
2116
+ .join(" ");
2117
+ }
2118
+ /**
2119
+ * Self-enclosing tags
2120
+ */
2121
+ var singleTag = new Set([
2122
+ "area",
2123
+ "base",
2124
+ "basefont",
2125
+ "br",
2126
+ "col",
2127
+ "command",
2128
+ "embed",
2129
+ "frame",
2130
+ "hr",
2131
+ "img",
2132
+ "input",
2133
+ "isindex",
2134
+ "keygen",
2135
+ "link",
2136
+ "meta",
2137
+ "param",
2138
+ "source",
2139
+ "track",
2140
+ "wbr",
2141
+ ]);
2142
+ /**
2143
+ * Renders a DOM node or an array of DOM nodes to a string.
2144
+ *
2145
+ * Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
2146
+ *
2147
+ * @param node Node to be rendered.
2148
+ * @param options Changes serialization behavior
2149
+ */
2150
+ function render(node, options) {
2151
+ if (options === void 0) { options = {}; }
2152
+ // TODO: This is a bit hacky.
2153
+ var nodes = Array.isArray(node) || node.cheerio ? node : [node];
2154
+ var output = "";
2155
+ for (var i = 0; i < nodes.length; i++) {
2156
+ output += renderNode(nodes[i], options);
2088
2157
  }
2089
- output += key;
2090
- if ((value !== null && value !== '') || opts.xmlMode) {
2091
- output +=
2092
- '="' +
2093
- (opts.decodeEntities
2094
- ? entities.encodeXML(value)
2095
- : value.replace(/\"/g, '&quot;')) +
2096
- '"';
2158
+ return output;
2159
+ }
2160
+ exports.default = render;
2161
+ function renderNode(node, options) {
2162
+ switch (node.type) {
2163
+ case "root":
2164
+ return render(node.children, options);
2165
+ case ElementType.Directive:
2166
+ return renderDirective(node);
2167
+ case ElementType.Comment:
2168
+ return renderComment(node);
2169
+ case ElementType.CDATA:
2170
+ return renderCdata(node);
2171
+ default:
2172
+ return ElementType.isTag(node)
2173
+ ? renderTag(node, options)
2174
+ : renderText(node, options);
2097
2175
  }
2098
- }
2099
-
2100
- return output;
2101
2176
  }
2102
-
2103
- /*
2104
- Self-enclosing tags (stolen from node-htmlparser)
2105
- */
2106
- var singleTag = {
2107
- __proto__: null,
2108
- area: true,
2109
- base: true,
2110
- basefont: true,
2111
- br: true,
2112
- col: true,
2113
- command: true,
2114
- embed: true,
2115
- frame: true,
2116
- hr: true,
2117
- img: true,
2118
- input: true,
2119
- isindex: true,
2120
- keygen: true,
2121
- link: true,
2122
- meta: true,
2123
- param: true,
2124
- source: true,
2125
- track: true,
2126
- wbr: true
2127
- };
2128
-
2129
- var render = (module.exports = function(dom, opts) {
2130
- if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
2131
- opts = opts || {};
2132
-
2133
- var output = '';
2134
-
2135
- for (var i = 0; i < dom.length; i++) {
2136
- var elem = dom[i];
2137
-
2138
- if (elem.type === 'root') output += render(elem.children, opts);
2139
- else if (ElementType.isTag(elem)) output += renderTag(elem, opts);
2140
- else if (elem.type === ElementType.Directive)
2141
- output += renderDirective(elem);
2142
- else if (elem.type === ElementType.Comment) output += renderComment(elem);
2143
- else if (elem.type === ElementType.CDATA) output += renderCdata(elem);
2144
- else output += renderText(elem, opts);
2145
- }
2146
-
2147
- return output;
2148
- });
2149
-
2150
- var foreignModeIntegrationPoints = [
2151
- 'mi',
2152
- 'mo',
2153
- 'mn',
2154
- 'ms',
2155
- 'mtext',
2156
- 'annotation-xml',
2157
- 'foreignObject',
2158
- 'desc',
2159
- 'title'
2160
- ];
2161
-
2177
+ var foreignModeIntegrationPoints = new Set([
2178
+ "mi",
2179
+ "mo",
2180
+ "mn",
2181
+ "ms",
2182
+ "mtext",
2183
+ "annotation-xml",
2184
+ "foreignObject",
2185
+ "desc",
2186
+ "title",
2187
+ ]);
2188
+ var foreignElements = new Set(["svg", "math"]);
2162
2189
  function renderTag(elem, opts) {
2163
- // Handle SVG / MathML in HTML
2164
- if (opts.xmlMode === 'foreign') {
2165
- /* fix up mixed-case element names */
2166
- elem.name = foreignNames.elementNames[elem.name] || elem.name;
2167
- /* exit foreign mode at integration points */
2168
- if (
2169
- elem.parent &&
2170
- foreignModeIntegrationPoints.indexOf(elem.parent.name) >= 0
2171
- )
2172
- opts = Object.assign({}, opts, { xmlMode: false });
2173
- }
2174
- if (!opts.xmlMode && ['svg', 'math'].indexOf(elem.name) >= 0) {
2175
- opts = Object.assign({}, opts, { xmlMode: 'foreign' });
2176
- }
2177
-
2178
- var tag = '<' + elem.name;
2179
- var attribs = formatAttrs(elem.attribs, opts);
2180
-
2181
- if (attribs) {
2182
- tag += ' ' + attribs;
2183
- }
2184
-
2185
- if (opts.xmlMode && (!elem.children || elem.children.length === 0)) {
2186
- tag += '/>';
2187
- } else {
2188
- tag += '>';
2189
- if (elem.children) {
2190
- tag += render(elem.children, opts);
2190
+ var _a;
2191
+ // Handle SVG / MathML in HTML
2192
+ if (opts.xmlMode === "foreign") {
2193
+ /* Fix up mixed-case element names */
2194
+ elem.name = (_a = foreignNames_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
2195
+ /* Exit foreign mode at integration points */
2196
+ if (elem.parent &&
2197
+ foreignModeIntegrationPoints.has(elem.parent.name)) {
2198
+ opts = __assign(__assign({}, opts), { xmlMode: false });
2199
+ }
2191
2200
  }
2192
-
2193
- if (!singleTag[elem.name] || opts.xmlMode) {
2194
- tag += '</' + elem.name + '>';
2201
+ if (!opts.xmlMode && foreignElements.has(elem.name)) {
2202
+ opts = __assign(__assign({}, opts), { xmlMode: "foreign" });
2195
2203
  }
2196
- }
2197
-
2198
- return tag;
2204
+ var tag = "<" + elem.name;
2205
+ var attribs = formatAttributes(elem.attribs, opts);
2206
+ if (attribs) {
2207
+ tag += " " + attribs;
2208
+ }
2209
+ if (elem.children.length === 0 &&
2210
+ (opts.xmlMode
2211
+ ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
2212
+ opts.selfClosingTags !== false
2213
+ : // User explicitly asked for self-closing tags, even in HTML mode
2214
+ opts.selfClosingTags && singleTag.has(elem.name))) {
2215
+ if (!opts.xmlMode)
2216
+ tag += " ";
2217
+ tag += "/>";
2218
+ }
2219
+ else {
2220
+ tag += ">";
2221
+ if (elem.children.length > 0) {
2222
+ tag += render(elem.children, opts);
2223
+ }
2224
+ if (opts.xmlMode || !singleTag.has(elem.name)) {
2225
+ tag += "</" + elem.name + ">";
2226
+ }
2227
+ }
2228
+ return tag;
2199
2229
  }
2200
-
2201
2230
  function renderDirective(elem) {
2202
- return '<' + elem.data + '>';
2231
+ return "<" + elem.data + ">";
2203
2232
  }
2204
-
2205
2233
  function renderText(elem, opts) {
2206
- var data = elem.data || '';
2207
-
2208
- // if entities weren't decoded, no need to encode them back
2209
- if (
2210
- opts.decodeEntities &&
2211
- !(elem.parent && elem.parent.name in unencodedElements)
2212
- ) {
2213
- data = entities.encodeXML(data);
2214
- }
2215
-
2216
- return data;
2234
+ var data = elem.data || "";
2235
+ // If entities weren't decoded, no need to encode them back
2236
+ if (opts.decodeEntities &&
2237
+ !(elem.parent && unencodedElements.has(elem.parent.name))) {
2238
+ data = entities_1.encodeXML(data);
2239
+ }
2240
+ return data;
2217
2241
  }
2218
-
2219
2242
  function renderCdata(elem) {
2220
- return '<![CDATA[' + elem.children[0].data + ']]>';
2243
+ return "<![CDATA[" + elem.children[0].data + "]]>";
2221
2244
  }
2222
-
2223
2245
  function renderComment(elem) {
2224
- return '<!--' + elem.data + '-->';
2246
+ return "<!--" + elem.data + "-->";
2225
2247
  }
2226
2248
 
2227
- },{"./foreignNames.json":4,"domelementtype":6,"entities":20}],6:[function(require,module,exports){
2249
+ },{"./foreignNames":4,"domelementtype":6,"entities":20}],6:[function(require,module,exports){
2228
2250
  "use strict";
2229
2251
  Object.defineProperty(exports, "__esModule", { value: true });
2252
+ exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.isTag = void 0;
2230
2253
  /**
2231
2254
  * Tests whether an element is a tag or not.
2232
2255
  *
@@ -2239,13 +2262,21 @@ function isTag(elem) {
2239
2262
  }
2240
2263
  exports.isTag = isTag;
2241
2264
  // Exports for backwards compatibility
2242
- exports.Text = "text" /* Text */; //Text
2243
- exports.Directive = "directive" /* Directive */; //<? ... ?>
2244
- exports.Comment = "comment" /* Comment */; //<!-- ... -->
2245
- exports.Script = "script" /* Script */; //<script> tags
2246
- exports.Style = "style" /* Style */; //<style> tags
2247
- exports.Tag = "tag" /* Tag */; //Any tag
2248
- exports.CDATA = "cdata" /* CDATA */; //<![CDATA[ ... ]]>
2265
+ /** Type for Text */
2266
+ exports.Text = "text" /* Text */;
2267
+ /** Type for <? ... ?> */
2268
+ exports.Directive = "directive" /* Directive */;
2269
+ /** Type for <!-- ... --> */
2270
+ exports.Comment = "comment" /* Comment */;
2271
+ /** Type for <script> tags */
2272
+ exports.Script = "script" /* Script */;
2273
+ /** Type for <style> tags */
2274
+ exports.Style = "style" /* Style */;
2275
+ /** Type for Any tag */
2276
+ exports.Tag = "tag" /* Tag */;
2277
+ /** Type for <![CDATA[ ... ]]> */
2278
+ exports.CDATA = "cdata" /* CDATA */;
2279
+ /** Type for <!doctype ...> */
2249
2280
  exports.Doctype = "doctype" /* Doctype */;
2250
2281
 
2251
2282
  },{}],7:[function(require,module,exports){
@@ -2618,6 +2649,7 @@ exports.Element = Element;
2618
2649
  },{}],9:[function(require,module,exports){
2619
2650
  "use strict";
2620
2651
  Object.defineProperty(exports, "__esModule", { value: true });
2652
+ exports.uniqueSort = exports.compareDocumentPosition = exports.removeSubsets = void 0;
2621
2653
  var tagtypes_1 = require("./tagtypes");
2622
2654
  /**
2623
2655
  * Given an array of nodes, remove any member that is contained by another.
@@ -2626,19 +2658,23 @@ var tagtypes_1 = require("./tagtypes");
2626
2658
  */
2627
2659
  function removeSubsets(nodes) {
2628
2660
  var idx = nodes.length;
2629
- // Check if each node (or one of its ancestors) is already contained in the
2630
- // array.
2661
+ /*
2662
+ * Check if each node (or one of its ancestors) is already contained in the
2663
+ * array.
2664
+ */
2631
2665
  while (--idx >= 0) {
2632
2666
  var node = nodes[idx];
2633
- // Remove the node if it is not unique.
2634
- // We are going through the array from the end, so we only
2635
- // have to check nodes that preceed the node under consideration in the array.
2667
+ /*
2668
+ * Remove the node if it is not unique.
2669
+ * We are going through the array from the end, so we only
2670
+ * have to check nodes that preceed the node under consideration in the array.
2671
+ */
2636
2672
  if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {
2637
2673
  nodes.splice(idx, 1);
2638
2674
  continue;
2639
2675
  }
2640
2676
  for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
2641
- if (nodes.indexOf(ancestor) > -1) {
2677
+ if (nodes.includes(ancestor)) {
2642
2678
  nodes.splice(idx, 1);
2643
2679
  break;
2644
2680
  }
@@ -2647,7 +2683,7 @@ function removeSubsets(nodes) {
2647
2683
  return nodes;
2648
2684
  }
2649
2685
  exports.removeSubsets = removeSubsets;
2650
- /***
2686
+ /**
2651
2687
  * Compare the position of one node against another node in any other document.
2652
2688
  * The return value is a bitmask with the following values:
2653
2689
  *
@@ -2688,8 +2724,9 @@ function compareDocumentPosition(nodeA, nodeB) {
2688
2724
  bParents.unshift(current);
2689
2725
  current = current.parent;
2690
2726
  }
2727
+ var maxIdx = Math.min(aParents.length, bParents.length);
2691
2728
  var idx = 0;
2692
- while (aParents[idx] === bParents[idx]) {
2729
+ while (idx < maxIdx && aParents[idx] === bParents[idx]) {
2693
2730
  idx++;
2694
2731
  }
2695
2732
  if (idx === 0) {
@@ -2705,15 +2742,13 @@ function compareDocumentPosition(nodeA, nodeB) {
2705
2742
  }
2706
2743
  return 4 /* FOLLOWING */;
2707
2744
  }
2708
- else {
2709
- if (sharedParent === nodeA) {
2710
- return 2 /* PRECEDING */ | 8 /* CONTAINS */;
2711
- }
2712
- return 2 /* PRECEDING */;
2745
+ if (sharedParent === nodeA) {
2746
+ return 2 /* PRECEDING */ | 8 /* CONTAINS */;
2713
2747
  }
2748
+ return 2 /* PRECEDING */;
2714
2749
  }
2715
2750
  exports.compareDocumentPosition = compareDocumentPosition;
2716
- /***
2751
+ /**
2717
2752
  * Sort an array of nodes based on their relative position in the document and
2718
2753
  * remove any duplicate nodes. If the array contains nodes that do not belong
2719
2754
  * to the same document, sort order is unspecified.
@@ -2739,27 +2774,34 @@ exports.uniqueSort = uniqueSort;
2739
2774
 
2740
2775
  },{"./tagtypes":15}],10:[function(require,module,exports){
2741
2776
  "use strict";
2742
- function __export(m) {
2743
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
2744
- }
2777
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2778
+ if (k2 === undefined) k2 = k;
2779
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2780
+ }) : (function(o, m, k, k2) {
2781
+ if (k2 === undefined) k2 = k;
2782
+ o[k2] = m[k];
2783
+ }));
2784
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
2785
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2786
+ };
2745
2787
  Object.defineProperty(exports, "__esModule", { value: true });
2746
- __export(require("./stringify"));
2747
- __export(require("./traversal"));
2748
- __export(require("./manipulation"));
2749
- __export(require("./querying"));
2750
- __export(require("./legacy"));
2751
- __export(require("./helpers"));
2752
- __export(require("./tagtypes"));
2788
+ __exportStar(require("./stringify"), exports);
2789
+ __exportStar(require("./traversal"), exports);
2790
+ __exportStar(require("./manipulation"), exports);
2791
+ __exportStar(require("./querying"), exports);
2792
+ __exportStar(require("./legacy"), exports);
2793
+ __exportStar(require("./helpers"), exports);
2794
+ __exportStar(require("./tagtypes"), exports);
2753
2795
 
2754
2796
  },{"./helpers":9,"./legacy":11,"./manipulation":12,"./querying":13,"./stringify":14,"./tagtypes":15,"./traversal":16}],11:[function(require,module,exports){
2755
2797
  "use strict";
2756
2798
  Object.defineProperty(exports, "__esModule", { value: true });
2799
+ exports.getElementsByTagType = exports.getElementsByTagName = exports.getElementById = exports.getElements = exports.testElement = void 0;
2757
2800
  var querying_1 = require("./querying");
2758
2801
  var tagtypes_1 = require("./tagtypes");
2759
2802
  function isTextNode(node) {
2760
2803
  return node.type === "text" /* Text */;
2761
2804
  }
2762
- /* eslint-disable @typescript-eslint/camelcase */
2763
2805
  var Checks = {
2764
2806
  tag_name: function (name) {
2765
2807
  if (typeof name === "function") {
@@ -2768,35 +2810,26 @@ var Checks = {
2768
2810
  else if (name === "*") {
2769
2811
  return tagtypes_1.isTag;
2770
2812
  }
2771
- else {
2772
- return function (elem) { return tagtypes_1.isTag(elem) && elem.name === name; };
2773
- }
2813
+ return function (elem) { return tagtypes_1.isTag(elem) && elem.name === name; };
2774
2814
  },
2775
2815
  tag_type: function (type) {
2776
2816
  if (typeof type === "function") {
2777
2817
  return function (elem) { return type(elem.type); };
2778
2818
  }
2779
- else {
2780
- return function (elem) { return elem.type === type; };
2781
- }
2819
+ return function (elem) { return elem.type === type; };
2782
2820
  },
2783
2821
  tag_contains: function (data) {
2784
2822
  if (typeof data === "function") {
2785
2823
  return function (elem) { return isTextNode(elem) && data(elem.data); };
2786
2824
  }
2787
- else {
2788
- return function (elem) { return isTextNode(elem) && elem.data === data; };
2789
- }
2825
+ return function (elem) { return isTextNode(elem) && elem.data === data; };
2790
2826
  },
2791
2827
  };
2792
- /* eslint-enable @typescript-eslint/camelcase */
2793
2828
  function getAttribCheck(attrib, value) {
2794
2829
  if (typeof value === "function") {
2795
2830
  return function (elem) { return tagtypes_1.isTag(elem) && value(elem.attribs[attrib]); };
2796
2831
  }
2797
- else {
2798
- return function (elem) { return tagtypes_1.isTag(elem) && elem.attribs[attrib] === value; };
2799
- }
2832
+ return function (elem) { return tagtypes_1.isTag(elem) && elem.attribs[attrib] === value; };
2800
2833
  }
2801
2834
  function combineFuncs(a, b) {
2802
2835
  return function (elem) { return a(elem) || b(elem); };
@@ -2843,7 +2876,8 @@ exports.getElementsByTagType = getElementsByTagType;
2843
2876
  },{"./querying":13,"./tagtypes":15}],12:[function(require,module,exports){
2844
2877
  "use strict";
2845
2878
  Object.defineProperty(exports, "__esModule", { value: true });
2846
- /***
2879
+ exports.prepend = exports.append = exports.appendChild = exports.replaceElement = exports.removeElement = void 0;
2880
+ /**
2847
2881
  * Remove an element from the dom
2848
2882
  *
2849
2883
  * @param elem The element to be removed
@@ -2859,7 +2893,7 @@ function removeElement(elem) {
2859
2893
  }
2860
2894
  }
2861
2895
  exports.removeElement = removeElement;
2862
- /***
2896
+ /**
2863
2897
  * Replace an element in the dom
2864
2898
  *
2865
2899
  * @param elem The element to be replaced
@@ -2881,13 +2915,14 @@ function replaceElement(elem, replacement) {
2881
2915
  }
2882
2916
  }
2883
2917
  exports.replaceElement = replaceElement;
2884
- /***
2918
+ /**
2885
2919
  * Append a child to an element
2886
2920
  *
2887
2921
  * @param elem The element to append to
2888
2922
  * @param child The element to be added as a child
2889
2923
  */
2890
2924
  function appendChild(elem, child) {
2925
+ removeElement(child);
2891
2926
  child.parent = elem;
2892
2927
  if (elem.children.push(child) !== 1) {
2893
2928
  var sibling = elem.children[elem.children.length - 2];
@@ -2897,13 +2932,14 @@ function appendChild(elem, child) {
2897
2932
  }
2898
2933
  }
2899
2934
  exports.appendChild = appendChild;
2900
- /***
2935
+ /**
2901
2936
  * Append an element after another
2902
2937
  *
2903
2938
  * @param elem The element to append to
2904
2939
  * @param next The element be added
2905
2940
  */
2906
2941
  function append(elem, next) {
2942
+ removeElement(next);
2907
2943
  var parent = elem.parent;
2908
2944
  var currNext = elem.next;
2909
2945
  next.next = currNext;
@@ -2922,7 +2958,7 @@ function append(elem, next) {
2922
2958
  }
2923
2959
  }
2924
2960
  exports.append = append;
2925
- /***
2961
+ /**
2926
2962
  * Prepend an element before another
2927
2963
  *
2928
2964
  * @param elem The element to append to
@@ -2947,6 +2983,7 @@ exports.prepend = prepend;
2947
2983
  },{}],13:[function(require,module,exports){
2948
2984
  "use strict";
2949
2985
  Object.defineProperty(exports, "__esModule", { value: true });
2986
+ exports.findAll = exports.existsOne = exports.findOne = exports.findOneChild = exports.find = exports.filter = void 0;
2950
2987
  var tagtypes_1 = require("./tagtypes");
2951
2988
  /**
2952
2989
  * Search a node and its children for nodes passing a test function.
@@ -3073,6 +3110,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3073
3110
  return (mod && mod.__esModule) ? mod : { "default": mod };
3074
3111
  };
3075
3112
  Object.defineProperty(exports, "__esModule", { value: true });
3113
+ exports.getText = exports.getInnerHTML = exports.getOuterHTML = void 0;
3076
3114
  var tagtypes_1 = require("./tagtypes");
3077
3115
  var dom_serializer_1 = __importDefault(require("dom-serializer"));
3078
3116
  function getOuterHTML(node, options) {
@@ -3101,6 +3139,7 @@ exports.getText = getText;
3101
3139
  },{"./tagtypes":15,"dom-serializer":5}],15:[function(require,module,exports){
3102
3140
  "use strict";
3103
3141
  Object.defineProperty(exports, "__esModule", { value: true });
3142
+ exports.hasChildren = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = void 0;
3104
3143
  var domelementtype_1 = require("domelementtype");
3105
3144
  function isTag(node) {
3106
3145
  return domelementtype_1.isTag(node);
@@ -3126,6 +3165,7 @@ exports.hasChildren = hasChildren;
3126
3165
  },{"domelementtype":6}],16:[function(require,module,exports){
3127
3166
  "use strict";
3128
3167
  Object.defineProperty(exports, "__esModule", { value: true });
3168
+ exports.nextElementSibling = exports.getName = exports.hasAttrib = exports.getAttributeValue = exports.getSiblings = exports.getParent = exports.getChildren = void 0;
3129
3169
  function getChildren(elem) {
3130
3170
  return elem.children || null;
3131
3171
  }
@@ -3150,7 +3190,7 @@ function hasAttrib(elem, name) {
3150
3190
  elem.attribs[name] != null);
3151
3191
  }
3152
3192
  exports.hasAttrib = hasAttrib;
3153
- /***
3193
+ /**
3154
3194
  * Returns the name property of an element
3155
3195
  *
3156
3196
  * @param elem The element to get the name for
@@ -3159,6 +3199,13 @@ function getName(elem) {
3159
3199
  return elem.name;
3160
3200
  }
3161
3201
  exports.getName = getName;
3202
+ function nextElementSibling(elem) {
3203
+ var node = elem.next;
3204
+ while (node !== null && node.type !== "tag")
3205
+ node = node.next;
3206
+ return node;
3207
+ }
3208
+ exports.nextElementSibling = nextElementSibling;
3162
3209
 
3163
3210
  },{}],17:[function(require,module,exports){
3164
3211
  "use strict";
@@ -3166,6 +3213,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3166
3213
  return (mod && mod.__esModule) ? mod : { "default": mod };
3167
3214
  };
3168
3215
  Object.defineProperty(exports, "__esModule", { value: true });
3216
+ exports.decodeHTML = exports.decodeHTMLStrict = exports.decodeXML = void 0;
3169
3217
  var entities_json_1 = __importDefault(require("./maps/entities.json"));
3170
3218
  var legacy_json_1 = __importDefault(require("./maps/legacy.json"));
3171
3219
  var xml_json_1 = __importDefault(require("./maps/xml.json"));
@@ -3247,6 +3295,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3247
3295
  return (mod && mod.__esModule) ? mod : { "default": mod };
3248
3296
  };
3249
3297
  Object.defineProperty(exports, "__esModule", { value: true });
3298
+ exports.escape = exports.encodeHTML = exports.encodeXML = void 0;
3250
3299
  var xml_json_1 = __importDefault(require("./maps/xml.json"));
3251
3300
  var inverseXML = getInverseObj(xml_json_1.default);
3252
3301
  var xmlReplacer = getInverseReplacer(inverseXML);
@@ -3295,7 +3344,7 @@ function getInverseReplacer(inverse) {
3295
3344
  multiple.unshift("[" + single.join("") + "]");
3296
3345
  return new RegExp(multiple.join("|"), "g");
3297
3346
  }
3298
- var reNonASCII = /[^\0-\x7F]/gu;
3347
+ var reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;
3299
3348
  function singleCharReplacer(c) {
3300
3349
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3301
3350
  return "&#x" + c.codePointAt(0).toString(16).toUpperCase() + ";";
@@ -3318,6 +3367,7 @@ exports.escape = escape;
3318
3367
  },{"./maps/entities.json":22,"./maps/xml.json":24}],20:[function(require,module,exports){
3319
3368
  "use strict";
3320
3369
  Object.defineProperty(exports, "__esModule", { value: true });
3370
+ exports.encode = exports.decodeStrict = exports.decode = void 0;
3321
3371
  var decode_1 = require("./decode");
3322
3372
  var encode_1 = require("./encode");
3323
3373
  /**
@@ -3351,22 +3401,22 @@ function encode(data, level) {
3351
3401
  }
3352
3402
  exports.encode = encode;
3353
3403
  var encode_2 = require("./encode");
3354
- exports.encodeXML = encode_2.encodeXML;
3355
- exports.encodeHTML = encode_2.encodeHTML;
3356
- exports.escape = encode_2.escape;
3404
+ Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return encode_2.encodeXML; } });
3405
+ Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
3406
+ Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return encode_2.escape; } });
3357
3407
  // Legacy aliases
3358
- exports.encodeHTML4 = encode_2.encodeHTML;
3359
- exports.encodeHTML5 = encode_2.encodeHTML;
3408
+ Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
3409
+ Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
3360
3410
  var decode_2 = require("./decode");
3361
- exports.decodeXML = decode_2.decodeXML;
3362
- exports.decodeHTML = decode_2.decodeHTML;
3363
- exports.decodeHTMLStrict = decode_2.decodeHTMLStrict;
3411
+ Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_2.decodeXML; } });
3412
+ Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
3413
+ Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
3364
3414
  // Legacy aliases
3365
- exports.decodeHTML4 = decode_2.decodeHTML;
3366
- exports.decodeHTML5 = decode_2.decodeHTML;
3367
- exports.decodeHTML4Strict = decode_2.decodeHTMLStrict;
3368
- exports.decodeHTML5Strict = decode_2.decodeHTMLStrict;
3369
- exports.decodeXMLStrict = decode_2.decodeXML;
3415
+ Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
3416
+ Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
3417
+ Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
3418
+ Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
3419
+ Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_2.decodeXML; } });
3370
3420
 
3371
3421
  },{"./decode":17,"./encode":19}],21:[function(require,module,exports){
3372
3422
  module.exports={
@@ -6136,7 +6186,8 @@ var Stack = require('./_Stack'),
6136
6186
  isMap = require('./isMap'),
6137
6187
  isObject = require('./isObject'),
6138
6188
  isSet = require('./isSet'),
6139
- keys = require('./keys');
6189
+ keys = require('./keys'),
6190
+ keysIn = require('./keysIn');
6140
6191
 
6141
6192
  /** Used to compose bitmasks for cloning. */
6142
6193
  var CLONE_DEEP_FLAG = 1,
@@ -6282,7 +6333,7 @@ function baseClone(value, bitmask, customizer, key, object, stack) {
6282
6333
 
6283
6334
  module.exports = baseClone;
6284
6335
 
6285
- },{"./_Stack":40,"./_arrayEach":45,"./_assignValue":51,"./_baseAssign":53,"./_baseAssignIn":54,"./_cloneBuffer":76,"./_copyArray":81,"./_copySymbols":83,"./_copySymbolsIn":84,"./_getAllKeys":90,"./_getAllKeysIn":91,"./_getTag":98,"./_initCloneArray":105,"./_initCloneByTag":106,"./_initCloneObject":107,"./isArray":146,"./isBuffer":149,"./isMap":152,"./isObject":153,"./isSet":156,"./keys":160}],57:[function(require,module,exports){
6336
+ },{"./_Stack":40,"./_arrayEach":45,"./_assignValue":51,"./_baseAssign":53,"./_baseAssignIn":54,"./_cloneBuffer":76,"./_copyArray":81,"./_copySymbols":83,"./_copySymbolsIn":84,"./_getAllKeys":90,"./_getAllKeysIn":91,"./_getTag":98,"./_initCloneArray":105,"./_initCloneByTag":106,"./_initCloneObject":107,"./isArray":146,"./isBuffer":149,"./isMap":152,"./isObject":153,"./isSet":156,"./keys":160,"./keysIn":161}],57:[function(require,module,exports){
6286
6337
  var isObject = require('./isObject');
6287
6338
 
6288
6339
  /** Built-in value references. */
@@ -9338,6 +9389,338 @@ function toString(value) {
9338
9389
  module.exports = toString;
9339
9390
 
9340
9391
  },{"./_baseToString":73}],167:[function(require,module,exports){
9392
+ /**
9393
+ * Srcset Parser
9394
+ *
9395
+ * By Alex Bell | MIT License
9396
+ *
9397
+ * JS Parser for the string value that appears in markup <img srcset="here">
9398
+ *
9399
+ * @returns Array [{url: _, d: _, w: _, h:_}, ...]
9400
+ *
9401
+ * Based super duper closely on the reference algorithm at:
9402
+ * https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-srcset-attribute
9403
+ *
9404
+ * Most comments are copied in directly from the spec
9405
+ * (except for comments in parens).
9406
+ */
9407
+
9408
+ (function (root, factory) {
9409
+ if (typeof define === 'function' && define.amd) {
9410
+ // AMD. Register as an anonymous module.
9411
+ define([], factory);
9412
+ } else if (typeof module === 'object' && module.exports) {
9413
+ // Node. Does not work with strict CommonJS, but
9414
+ // only CommonJS-like environments that support module.exports,
9415
+ // like Node.
9416
+ module.exports = factory();
9417
+ } else {
9418
+ // Browser globals (root is window)
9419
+ root.parseSrcset = factory();
9420
+ }
9421
+ }(this, function () {
9422
+
9423
+ // 1. Let input be the value passed to this algorithm.
9424
+ return function (input) {
9425
+
9426
+ // UTILITY FUNCTIONS
9427
+
9428
+ // Manual is faster than RegEx
9429
+ // http://bjorn.tipling.com/state-and-regular-expressions-in-javascript
9430
+ // http://jsperf.com/whitespace-character/5
9431
+ function isSpace(c) {
9432
+ return (c === "\u0020" || // space
9433
+ c === "\u0009" || // horizontal tab
9434
+ c === "\u000A" || // new line
9435
+ c === "\u000C" || // form feed
9436
+ c === "\u000D"); // carriage return
9437
+ }
9438
+
9439
+ function collectCharacters(regEx) {
9440
+ var chars,
9441
+ match = regEx.exec(input.substring(pos));
9442
+ if (match) {
9443
+ chars = match[ 0 ];
9444
+ pos += chars.length;
9445
+ return chars;
9446
+ }
9447
+ }
9448
+
9449
+ var inputLength = input.length,
9450
+
9451
+ // (Don't use \s, to avoid matching non-breaking space)
9452
+ regexLeadingSpaces = /^[ \t\n\r\u000c]+/,
9453
+ regexLeadingCommasOrSpaces = /^[, \t\n\r\u000c]+/,
9454
+ regexLeadingNotSpaces = /^[^ \t\n\r\u000c]+/,
9455
+ regexTrailingCommas = /[,]+$/,
9456
+ regexNonNegativeInteger = /^\d+$/,
9457
+
9458
+ // ( Positive or negative or unsigned integers or decimals, without or without exponents.
9459
+ // Must include at least one digit.
9460
+ // According to spec tests any decimal point must be followed by a digit.
9461
+ // No leading plus sign is allowed.)
9462
+ // https://html.spec.whatwg.org/multipage/infrastructure.html#valid-floating-point-number
9463
+ regexFloatingPoint = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,
9464
+
9465
+ url,
9466
+ descriptors,
9467
+ currentDescriptor,
9468
+ state,
9469
+ c,
9470
+
9471
+ // 2. Let position be a pointer into input, initially pointing at the start
9472
+ // of the string.
9473
+ pos = 0,
9474
+
9475
+ // 3. Let candidates be an initially empty source set.
9476
+ candidates = [];
9477
+
9478
+ // 4. Splitting loop: Collect a sequence of characters that are space
9479
+ // characters or U+002C COMMA characters. If any U+002C COMMA characters
9480
+ // were collected, that is a parse error.
9481
+ while (true) {
9482
+ collectCharacters(regexLeadingCommasOrSpaces);
9483
+
9484
+ // 5. If position is past the end of input, return candidates and abort these steps.
9485
+ if (pos >= inputLength) {
9486
+ return candidates; // (we're done, this is the sole return path)
9487
+ }
9488
+
9489
+ // 6. Collect a sequence of characters that are not space characters,
9490
+ // and let that be url.
9491
+ url = collectCharacters(regexLeadingNotSpaces);
9492
+
9493
+ // 7. Let descriptors be a new empty list.
9494
+ descriptors = [];
9495
+
9496
+ // 8. If url ends with a U+002C COMMA character (,), follow these substeps:
9497
+ // (1). Remove all trailing U+002C COMMA characters from url. If this removed
9498
+ // more than one character, that is a parse error.
9499
+ if (url.slice(-1) === ",") {
9500
+ url = url.replace(regexTrailingCommas, "");
9501
+ // (Jump ahead to step 9 to skip tokenization and just push the candidate).
9502
+ parseDescriptors();
9503
+
9504
+ // Otherwise, follow these substeps:
9505
+ } else {
9506
+ tokenize();
9507
+ } // (close else of step 8)
9508
+
9509
+ // 16. Return to the step labeled splitting loop.
9510
+ } // (Close of big while loop.)
9511
+
9512
+ /**
9513
+ * Tokenizes descriptor properties prior to parsing
9514
+ * Returns undefined.
9515
+ */
9516
+ function tokenize() {
9517
+
9518
+ // 8.1. Descriptor tokeniser: Skip whitespace
9519
+ collectCharacters(regexLeadingSpaces);
9520
+
9521
+ // 8.2. Let current descriptor be the empty string.
9522
+ currentDescriptor = "";
9523
+
9524
+ // 8.3. Let state be in descriptor.
9525
+ state = "in descriptor";
9526
+
9527
+ while (true) {
9528
+
9529
+ // 8.4. Let c be the character at position.
9530
+ c = input.charAt(pos);
9531
+
9532
+ // Do the following depending on the value of state.
9533
+ // For the purpose of this step, "EOF" is a special character representing
9534
+ // that position is past the end of input.
9535
+
9536
+ // In descriptor
9537
+ if (state === "in descriptor") {
9538
+ // Do the following, depending on the value of c:
9539
+
9540
+ // Space character
9541
+ // If current descriptor is not empty, append current descriptor to
9542
+ // descriptors and let current descriptor be the empty string.
9543
+ // Set state to after descriptor.
9544
+ if (isSpace(c)) {
9545
+ if (currentDescriptor) {
9546
+ descriptors.push(currentDescriptor);
9547
+ currentDescriptor = "";
9548
+ state = "after descriptor";
9549
+ }
9550
+
9551
+ // U+002C COMMA (,)
9552
+ // Advance position to the next character in input. If current descriptor
9553
+ // is not empty, append current descriptor to descriptors. Jump to the step
9554
+ // labeled descriptor parser.
9555
+ } else if (c === ",") {
9556
+ pos += 1;
9557
+ if (currentDescriptor) {
9558
+ descriptors.push(currentDescriptor);
9559
+ }
9560
+ parseDescriptors();
9561
+ return;
9562
+
9563
+ // U+0028 LEFT PARENTHESIS (()
9564
+ // Append c to current descriptor. Set state to in parens.
9565
+ } else if (c === "\u0028") {
9566
+ currentDescriptor = currentDescriptor + c;
9567
+ state = "in parens";
9568
+
9569
+ // EOF
9570
+ // If current descriptor is not empty, append current descriptor to
9571
+ // descriptors. Jump to the step labeled descriptor parser.
9572
+ } else if (c === "") {
9573
+ if (currentDescriptor) {
9574
+ descriptors.push(currentDescriptor);
9575
+ }
9576
+ parseDescriptors();
9577
+ return;
9578
+
9579
+ // Anything else
9580
+ // Append c to current descriptor.
9581
+ } else {
9582
+ currentDescriptor = currentDescriptor + c;
9583
+ }
9584
+ // (end "in descriptor"
9585
+
9586
+ // In parens
9587
+ } else if (state === "in parens") {
9588
+
9589
+ // U+0029 RIGHT PARENTHESIS ())
9590
+ // Append c to current descriptor. Set state to in descriptor.
9591
+ if (c === ")") {
9592
+ currentDescriptor = currentDescriptor + c;
9593
+ state = "in descriptor";
9594
+
9595
+ // EOF
9596
+ // Append current descriptor to descriptors. Jump to the step labeled
9597
+ // descriptor parser.
9598
+ } else if (c === "") {
9599
+ descriptors.push(currentDescriptor);
9600
+ parseDescriptors();
9601
+ return;
9602
+
9603
+ // Anything else
9604
+ // Append c to current descriptor.
9605
+ } else {
9606
+ currentDescriptor = currentDescriptor + c;
9607
+ }
9608
+
9609
+ // After descriptor
9610
+ } else if (state === "after descriptor") {
9611
+
9612
+ // Do the following, depending on the value of c:
9613
+ // Space character: Stay in this state.
9614
+ if (isSpace(c)) {
9615
+
9616
+ // EOF: Jump to the step labeled descriptor parser.
9617
+ } else if (c === "") {
9618
+ parseDescriptors();
9619
+ return;
9620
+
9621
+ // Anything else
9622
+ // Set state to in descriptor. Set position to the previous character in input.
9623
+ } else {
9624
+ state = "in descriptor";
9625
+ pos -= 1;
9626
+
9627
+ }
9628
+ }
9629
+
9630
+ // Advance position to the next character in input.
9631
+ pos += 1;
9632
+
9633
+ // Repeat this step.
9634
+ } // (close while true loop)
9635
+ }
9636
+
9637
+ /**
9638
+ * Adds descriptor properties to a candidate, pushes to the candidates array
9639
+ * @return undefined
9640
+ */
9641
+ // Declared outside of the while loop so that it's only created once.
9642
+ function parseDescriptors() {
9643
+
9644
+ // 9. Descriptor parser: Let error be no.
9645
+ var pError = false,
9646
+
9647
+ // 10. Let width be absent.
9648
+ // 11. Let density be absent.
9649
+ // 12. Let future-compat-h be absent. (We're implementing it now as h)
9650
+ w, d, h, i,
9651
+ candidate = {},
9652
+ desc, lastChar, value, intVal, floatVal;
9653
+
9654
+ // 13. For each descriptor in descriptors, run the appropriate set of steps
9655
+ // from the following list:
9656
+ for (i = 0 ; i < descriptors.length; i++) {
9657
+ desc = descriptors[ i ];
9658
+
9659
+ lastChar = desc[ desc.length - 1 ];
9660
+ value = desc.substring(0, desc.length - 1);
9661
+ intVal = parseInt(value, 10);
9662
+ floatVal = parseFloat(value);
9663
+
9664
+ // If the descriptor consists of a valid non-negative integer followed by
9665
+ // a U+0077 LATIN SMALL LETTER W character
9666
+ if (regexNonNegativeInteger.test(value) && (lastChar === "w")) {
9667
+
9668
+ // If width and density are not both absent, then let error be yes.
9669
+ if (w || d) {pError = true;}
9670
+
9671
+ // Apply the rules for parsing non-negative integers to the descriptor.
9672
+ // If the result is zero, let error be yes.
9673
+ // Otherwise, let width be the result.
9674
+ if (intVal === 0) {pError = true;} else {w = intVal;}
9675
+
9676
+ // If the descriptor consists of a valid floating-point number followed by
9677
+ // a U+0078 LATIN SMALL LETTER X character
9678
+ } else if (regexFloatingPoint.test(value) && (lastChar === "x")) {
9679
+
9680
+ // If width, density and future-compat-h are not all absent, then let error
9681
+ // be yes.
9682
+ if (w || d || h) {pError = true;}
9683
+
9684
+ // Apply the rules for parsing floating-point number values to the descriptor.
9685
+ // If the result is less than zero, let error be yes. Otherwise, let density
9686
+ // be the result.
9687
+ if (floatVal < 0) {pError = true;} else {d = floatVal;}
9688
+
9689
+ // If the descriptor consists of a valid non-negative integer followed by
9690
+ // a U+0068 LATIN SMALL LETTER H character
9691
+ } else if (regexNonNegativeInteger.test(value) && (lastChar === "h")) {
9692
+
9693
+ // If height and density are not both absent, then let error be yes.
9694
+ if (h || d) {pError = true;}
9695
+
9696
+ // Apply the rules for parsing non-negative integers to the descriptor.
9697
+ // If the result is zero, let error be yes. Otherwise, let future-compat-h
9698
+ // be the result.
9699
+ if (intVal === 0) {pError = true;} else {h = intVal;}
9700
+
9701
+ // Anything else, Let error be yes.
9702
+ } else {pError = true;}
9703
+ } // (close step 13 for loop)
9704
+
9705
+ // 15. If error is still no, then append a new image source to candidates whose
9706
+ // URL is url, associated with a width width if not absent and a pixel
9707
+ // density density if not absent. Otherwise, there is a parse error.
9708
+ if (!pError) {
9709
+ candidate.url = url;
9710
+ if (w) { candidate.w = w;}
9711
+ if (d) { candidate.d = d;}
9712
+ if (h) { candidate.h = h;}
9713
+ candidates.push(candidate);
9714
+ } else if (console && console.log) {
9715
+ console.log("Invalid srcset descriptor found in '" +
9716
+ input + "' at '" + desc + "'.");
9717
+ }
9718
+ } // (close parseDescriptors fn)
9719
+
9720
+ }
9721
+ }));
9722
+
9723
+ },{}],168:[function(require,module,exports){
9341
9724
  (function (process){
9342
9725
  // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
9343
9726
  // backported and transplited with Babel, with backwards-compat fixes
@@ -9643,7 +10026,7 @@ var substr = 'ab'.substr(-1) === 'b'
9643
10026
  ;
9644
10027
 
9645
10028
  }).call(this,require('_process'))
9646
- },{"_process":192}],168:[function(require,module,exports){
10029
+ },{"_process":193}],169:[function(require,module,exports){
9647
10030
  "use strict";
9648
10031
 
9649
10032
  exports.__esModule = true;
@@ -9673,9 +10056,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
9673
10056
  * const media = root.last
9674
10057
  * media.nodes //=> []
9675
10058
  */
9676
- var AtRule =
9677
- /*#__PURE__*/
9678
- function (_Container) {
10059
+ var AtRule = /*#__PURE__*/function (_Container) {
9679
10060
  _inheritsLoose(AtRule, _Container);
9680
10061
 
9681
10062
  function AtRule(defaults) {
@@ -9774,7 +10155,7 @@ exports.default = _default;
9774
10155
  module.exports = exports.default;
9775
10156
 
9776
10157
 
9777
- },{"./container":170}],169:[function(require,module,exports){
10158
+ },{"./container":171}],170:[function(require,module,exports){
9778
10159
  "use strict";
9779
10160
 
9780
10161
  exports.__esModule = true;
@@ -9794,9 +10175,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
9794
10175
  *
9795
10176
  * @extends Node
9796
10177
  */
9797
- var Comment =
9798
- /*#__PURE__*/
9799
- function (_Node) {
10178
+ var Comment = /*#__PURE__*/function (_Node) {
9800
10179
  _inheritsLoose(Comment, _Node);
9801
10180
 
9802
10181
  function Comment(defaults) {
@@ -9833,7 +10212,7 @@ exports.default = _default;
9833
10212
  module.exports = exports.default;
9834
10213
 
9835
10214
 
9836
- },{"./node":177}],170:[function(require,module,exports){
10215
+ },{"./node":178}],171:[function(require,module,exports){
9837
10216
  "use strict";
9838
10217
 
9839
10218
  exports.__esModule = true;
@@ -9847,6 +10226,12 @@ var _node = _interopRequireDefault(require("./node"));
9847
10226
 
9848
10227
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9849
10228
 
10229
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
10230
+
10231
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10232
+
10233
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10234
+
9850
10235
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
9851
10236
 
9852
10237
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
@@ -9872,9 +10257,7 @@ function cleanSource(nodes) {
9872
10257
  */
9873
10258
 
9874
10259
 
9875
- var Container =
9876
- /*#__PURE__*/
9877
- function (_Node) {
10260
+ var Container = /*#__PURE__*/function (_Node) {
9878
10261
  _inheritsLoose(Container, _Node);
9879
10262
 
9880
10263
  function Container() {
@@ -10203,19 +10586,8 @@ function (_Node) {
10203
10586
  var child = _children[_i];
10204
10587
  var nodes = this.normalize(child, this.last);
10205
10588
 
10206
- for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
10207
- var _ref;
10208
-
10209
- if (_isArray) {
10210
- if (_i2 >= _iterator.length) break;
10211
- _ref = _iterator[_i2++];
10212
- } else {
10213
- _i2 = _iterator.next();
10214
- if (_i2.done) break;
10215
- _ref = _i2.value;
10216
- }
10217
-
10218
- var node = _ref;
10589
+ for (var _iterator = _createForOfIteratorHelperLoose(nodes), _step; !(_step = _iterator()).done;) {
10590
+ var node = _step.value;
10219
10591
  this.nodes.push(node);
10220
10592
  }
10221
10593
  }
@@ -10251,34 +10623,12 @@ function (_Node) {
10251
10623
 
10252
10624
  children = children.reverse();
10253
10625
 
10254
- for (var _iterator2 = children, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
10255
- var _ref2;
10256
-
10257
- if (_isArray2) {
10258
- if (_i3 >= _iterator2.length) break;
10259
- _ref2 = _iterator2[_i3++];
10260
- } else {
10261
- _i3 = _iterator2.next();
10262
- if (_i3.done) break;
10263
- _ref2 = _i3.value;
10264
- }
10265
-
10266
- var child = _ref2;
10626
+ for (var _iterator2 = _createForOfIteratorHelperLoose(children), _step2; !(_step2 = _iterator2()).done;) {
10627
+ var child = _step2.value;
10267
10628
  var nodes = this.normalize(child, this.first, 'prepend').reverse();
10268
10629
 
10269
- for (var _iterator3 = nodes, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
10270
- var _ref3;
10271
-
10272
- if (_isArray3) {
10273
- if (_i4 >= _iterator3.length) break;
10274
- _ref3 = _iterator3[_i4++];
10275
- } else {
10276
- _i4 = _iterator3.next();
10277
- if (_i4.done) break;
10278
- _ref3 = _i4.value;
10279
- }
10280
-
10281
- var node = _ref3;
10630
+ for (var _iterator3 = _createForOfIteratorHelperLoose(nodes), _step3; !(_step3 = _iterator3()).done;) {
10631
+ var node = _step3.value;
10282
10632
  this.nodes.unshift(node);
10283
10633
  }
10284
10634
 
@@ -10294,19 +10644,8 @@ function (_Node) {
10294
10644
  _Node.prototype.cleanRaws.call(this, keepBetween);
10295
10645
 
10296
10646
  if (this.nodes) {
10297
- for (var _iterator4 = this.nodes, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
10298
- var _ref4;
10299
-
10300
- if (_isArray4) {
10301
- if (_i5 >= _iterator4.length) break;
10302
- _ref4 = _iterator4[_i5++];
10303
- } else {
10304
- _i5 = _iterator4.next();
10305
- if (_i5.done) break;
10306
- _ref4 = _i5.value;
10307
- }
10308
-
10309
- var node = _ref4;
10647
+ for (var _iterator4 = _createForOfIteratorHelperLoose(this.nodes), _step4; !(_step4 = _iterator4()).done;) {
10648
+ var node = _step4.value;
10310
10649
  node.cleanRaws(keepBetween);
10311
10650
  }
10312
10651
  }
@@ -10329,19 +10668,8 @@ function (_Node) {
10329
10668
  var type = exist === 0 ? 'prepend' : false;
10330
10669
  var nodes = this.normalize(add, this.nodes[exist], type).reverse();
10331
10670
 
10332
- for (var _iterator5 = nodes, _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
10333
- var _ref5;
10334
-
10335
- if (_isArray5) {
10336
- if (_i6 >= _iterator5.length) break;
10337
- _ref5 = _iterator5[_i6++];
10338
- } else {
10339
- _i6 = _iterator5.next();
10340
- if (_i6.done) break;
10341
- _ref5 = _i6.value;
10342
- }
10343
-
10344
- var node = _ref5;
10671
+ for (var _iterator5 = _createForOfIteratorHelperLoose(nodes), _step5; !(_step5 = _iterator5()).done;) {
10672
+ var node = _step5.value;
10345
10673
  this.nodes.splice(exist, 0, node);
10346
10674
  }
10347
10675
 
@@ -10371,19 +10699,8 @@ function (_Node) {
10371
10699
  exist = this.index(exist);
10372
10700
  var nodes = this.normalize(add, this.nodes[exist]).reverse();
10373
10701
 
10374
- for (var _iterator6 = nodes, _isArray6 = Array.isArray(_iterator6), _i7 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
10375
- var _ref6;
10376
-
10377
- if (_isArray6) {
10378
- if (_i7 >= _iterator6.length) break;
10379
- _ref6 = _iterator6[_i7++];
10380
- } else {
10381
- _i7 = _iterator6.next();
10382
- if (_i7.done) break;
10383
- _ref6 = _i7.value;
10384
- }
10385
-
10386
- var node = _ref6;
10702
+ for (var _iterator6 = _createForOfIteratorHelperLoose(nodes), _step6; !(_step6 = _iterator6()).done;) {
10703
+ var node = _step6.value;
10387
10704
  this.nodes.splice(exist + 1, 0, node);
10388
10705
  }
10389
10706
 
@@ -10444,19 +10761,8 @@ function (_Node) {
10444
10761
  ;
10445
10762
 
10446
10763
  _proto.removeAll = function removeAll() {
10447
- for (var _iterator7 = this.nodes, _isArray7 = Array.isArray(_iterator7), _i8 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
10448
- var _ref7;
10449
-
10450
- if (_isArray7) {
10451
- if (_i8 >= _iterator7.length) break;
10452
- _ref7 = _iterator7[_i8++];
10453
- } else {
10454
- _i8 = _iterator7.next();
10455
- if (_i8.done) break;
10456
- _ref7 = _i8.value;
10457
- }
10458
-
10459
- var node = _ref7;
10764
+ for (var _iterator7 = _createForOfIteratorHelperLoose(this.nodes), _step7; !(_step7 = _iterator7()).done;) {
10765
+ var node = _step7.value;
10460
10766
  node.parent = undefined;
10461
10767
  }
10462
10768
 
@@ -10575,38 +10881,16 @@ function (_Node) {
10575
10881
  } else if (Array.isArray(nodes)) {
10576
10882
  nodes = nodes.slice(0);
10577
10883
 
10578
- for (var _iterator8 = nodes, _isArray8 = Array.isArray(_iterator8), _i9 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
10579
- var _ref8;
10580
-
10581
- if (_isArray8) {
10582
- if (_i9 >= _iterator8.length) break;
10583
- _ref8 = _iterator8[_i9++];
10584
- } else {
10585
- _i9 = _iterator8.next();
10586
- if (_i9.done) break;
10587
- _ref8 = _i9.value;
10588
- }
10589
-
10590
- var i = _ref8;
10884
+ for (var _iterator8 = _createForOfIteratorHelperLoose(nodes), _step8; !(_step8 = _iterator8()).done;) {
10885
+ var i = _step8.value;
10591
10886
  if (i.parent) i.parent.removeChild(i, 'ignore');
10592
10887
  }
10593
10888
  } else if (nodes.type === 'root') {
10594
10889
  nodes = nodes.nodes.slice(0);
10595
10890
 
10596
- for (var _iterator9 = nodes, _isArray9 = Array.isArray(_iterator9), _i10 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
10597
- var _ref9;
10598
-
10599
- if (_isArray9) {
10600
- if (_i10 >= _iterator9.length) break;
10601
- _ref9 = _iterator9[_i10++];
10602
- } else {
10603
- _i10 = _iterator9.next();
10604
- if (_i10.done) break;
10605
- _ref9 = _i10.value;
10606
- }
10607
-
10608
- var _i11 = _ref9;
10609
- if (_i11.parent) _i11.parent.removeChild(_i11, 'ignore');
10891
+ for (var _iterator9 = _createForOfIteratorHelperLoose(nodes), _step9; !(_step9 = _iterator9()).done;) {
10892
+ var _i2 = _step9.value;
10893
+ if (_i2.parent) _i2.parent.removeChild(_i2, 'ignore');
10610
10894
  }
10611
10895
  } else if (nodes.type) {
10612
10896
  nodes = [nodes];
@@ -10704,7 +10988,7 @@ exports.default = _default;
10704
10988
  module.exports = exports.default;
10705
10989
 
10706
10990
 
10707
- },{"./at-rule":168,"./comment":169,"./declaration":172,"./node":177,"./parse":178,"./rule":185}],171:[function(require,module,exports){
10991
+ },{"./at-rule":169,"./comment":170,"./declaration":173,"./node":178,"./parse":179,"./rule":186}],172:[function(require,module,exports){
10708
10992
  "use strict";
10709
10993
 
10710
10994
  exports.__esModule = true;
@@ -10724,9 +11008,9 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
10724
11008
 
10725
11009
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
10726
11010
 
10727
- 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; } }
11011
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
10728
11012
 
10729
- function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
11013
+ 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; } }
10730
11014
 
10731
11015
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
10732
11016
 
@@ -10761,9 +11045,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
10761
11045
  * // Raising error from plugin
10762
11046
  * throw node.error('Unknown variable', { plugin: 'postcss-vars' })
10763
11047
  */
10764
- var CssSyntaxError =
10765
- /*#__PURE__*/
10766
- function (_Error) {
11048
+ var CssSyntaxError = /*#__PURE__*/function (_Error) {
10767
11049
  _inheritsLoose(CssSyntaxError, _Error);
10768
11050
 
10769
11051
  /**
@@ -10999,14 +11281,14 @@ function (_Error) {
10999
11281
  ;
11000
11282
 
11001
11283
  return CssSyntaxError;
11002
- }(_wrapNativeSuper(Error));
11284
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
11003
11285
 
11004
11286
  var _default = CssSyntaxError;
11005
11287
  exports.default = _default;
11006
11288
  module.exports = exports.default;
11007
11289
 
11008
11290
 
11009
- },{"./terminal-highlight":2,"chalk":2,"supports-color":2}],172:[function(require,module,exports){
11291
+ },{"./terminal-highlight":2,"chalk":2,"supports-color":2}],173:[function(require,module,exports){
11010
11292
  "use strict";
11011
11293
 
11012
11294
  exports.__esModule = true;
@@ -11029,9 +11311,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
11029
11311
  * decl.type //=> 'decl'
11030
11312
  * decl.toString() //=> ' color: black'
11031
11313
  */
11032
- var Declaration =
11033
- /*#__PURE__*/
11034
- function (_Node) {
11314
+ var Declaration = /*#__PURE__*/function (_Node) {
11035
11315
  _inheritsLoose(Declaration, _Node);
11036
11316
 
11037
11317
  function Declaration(defaults) {
@@ -11106,7 +11386,7 @@ exports.default = _default;
11106
11386
  module.exports = exports.default;
11107
11387
 
11108
11388
 
11109
- },{"./node":177}],173:[function(require,module,exports){
11389
+ },{"./node":178}],174:[function(require,module,exports){
11110
11390
  "use strict";
11111
11391
 
11112
11392
  exports.__esModule = true;
@@ -11133,9 +11413,7 @@ var sequence = 0;
11133
11413
  * const input = root.source.input
11134
11414
  */
11135
11415
 
11136
- var Input =
11137
- /*#__PURE__*/
11138
- function () {
11416
+ var Input = /*#__PURE__*/function () {
11139
11417
  /**
11140
11418
  * @param {string} css Input CSS source.
11141
11419
  * @param {object} [opts] {@link Processor#process} options.
@@ -11145,7 +11423,7 @@ function () {
11145
11423
  opts = {};
11146
11424
  }
11147
11425
 
11148
- if (css === null || typeof css === 'object' && !css.toString) {
11426
+ if (css === null || typeof css === 'undefined' || typeof css === 'object' && !css.toString) {
11149
11427
  throw new Error("PostCSS received " + css + " instead of CSS string");
11150
11428
  }
11151
11429
  /**
@@ -11324,7 +11602,7 @@ exports.default = _default;
11324
11602
  module.exports = exports.default;
11325
11603
 
11326
11604
 
11327
- },{"./css-syntax-error":171,"./previous-map":181,"path":167}],174:[function(require,module,exports){
11605
+ },{"./css-syntax-error":172,"./previous-map":182,"path":168}],175:[function(require,module,exports){
11328
11606
  (function (process){
11329
11607
  "use strict";
11330
11608
 
@@ -11343,6 +11621,12 @@ var _parse = _interopRequireDefault(require("./parse"));
11343
11621
 
11344
11622
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11345
11623
 
11624
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
11625
+
11626
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11627
+
11628
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11629
+
11346
11630
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
11347
11631
 
11348
11632
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
@@ -11360,9 +11644,7 @@ function isPromise(obj) {
11360
11644
  */
11361
11645
 
11362
11646
 
11363
- var LazyResult =
11364
- /*#__PURE__*/
11365
- function () {
11647
+ var LazyResult = /*#__PURE__*/function () {
11366
11648
  function LazyResult(processor, css, opts) {
11367
11649
  this.stringified = false;
11368
11650
  this.processed = false;
@@ -11593,19 +11875,8 @@ function () {
11593
11875
 
11594
11876
  if (this.error) throw this.error;
11595
11877
 
11596
- for (var _iterator = this.result.processor.plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
11597
- var _ref;
11598
-
11599
- if (_isArray) {
11600
- if (_i >= _iterator.length) break;
11601
- _ref = _iterator[_i++];
11602
- } else {
11603
- _i = _iterator.next();
11604
- if (_i.done) break;
11605
- _ref = _i.value;
11606
- }
11607
-
11608
- var plugin = _ref;
11878
+ for (var _iterator = _createForOfIteratorHelperLoose(this.result.processor.plugins), _step; !(_step = _iterator()).done;) {
11879
+ var plugin = _step.value;
11609
11880
  var promise = this.run(plugin);
11610
11881
 
11611
11882
  if (isPromise(promise)) {
@@ -11772,7 +12043,7 @@ module.exports = exports.default;
11772
12043
 
11773
12044
 
11774
12045
  }).call(this,require('_process'))
11775
- },{"./map-generator":176,"./parse":178,"./result":183,"./stringify":187,"./warn-once":190,"_process":192}],175:[function(require,module,exports){
12046
+ },{"./map-generator":177,"./parse":179,"./result":184,"./stringify":188,"./warn-once":191,"_process":193}],176:[function(require,module,exports){
11776
12047
  "use strict";
11777
12048
 
11778
12049
  exports.__esModule = true;
@@ -11867,7 +12138,7 @@ exports.default = _default;
11867
12138
  module.exports = exports.default;
11868
12139
 
11869
12140
 
11870
- },{}],176:[function(require,module,exports){
12141
+ },{}],177:[function(require,module,exports){
11871
12142
  (function (Buffer){
11872
12143
  "use strict";
11873
12144
 
@@ -11880,9 +12151,13 @@ var _path = _interopRequireDefault(require("path"));
11880
12151
 
11881
12152
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11882
12153
 
11883
- var MapGenerator =
11884
- /*#__PURE__*/
11885
- function () {
12154
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
12155
+
12156
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12157
+
12158
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12159
+
12160
+ var MapGenerator = /*#__PURE__*/function () {
11886
12161
  function MapGenerator(stringify, root, opts) {
11887
12162
  this.stringify = stringify;
11888
12163
  this.mapOpts = opts.map || {};
@@ -11987,19 +12262,8 @@ function () {
11987
12262
  };
11988
12263
 
11989
12264
  _proto.applyPrevMaps = function applyPrevMaps() {
11990
- for (var _iterator = this.previous(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
11991
- var _ref;
11992
-
11993
- if (_isArray) {
11994
- if (_i >= _iterator.length) break;
11995
- _ref = _iterator[_i++];
11996
- } else {
11997
- _i = _iterator.next();
11998
- if (_i.done) break;
11999
- _ref = _i.value;
12000
- }
12001
-
12002
- var prev = _ref;
12265
+ for (var _iterator = _createForOfIteratorHelperLoose(this.previous()), _step; !(_step = _iterator()).done;) {
12266
+ var prev = _step.value;
12003
12267
  var from = this.relative(prev.file);
12004
12268
 
12005
12269
  var root = prev.root || _path.default.dirname(prev.file);
@@ -12225,7 +12489,7 @@ module.exports = exports.default;
12225
12489
 
12226
12490
 
12227
12491
  }).call(this,require("buffer").Buffer)
12228
- },{"buffer":3,"path":167,"source-map":207}],177:[function(require,module,exports){
12492
+ },{"buffer":3,"path":168,"source-map":208}],178:[function(require,module,exports){
12229
12493
  (function (process){
12230
12494
  "use strict";
12231
12495
 
@@ -12271,9 +12535,7 @@ function cloneNode(obj, parent) {
12271
12535
  */
12272
12536
 
12273
12537
 
12274
- var Node =
12275
- /*#__PURE__*/
12276
- function () {
12538
+ var Node = /*#__PURE__*/function () {
12277
12539
  /**
12278
12540
  * @param {object} [defaults] Value for node properties.
12279
12541
  */
@@ -12837,7 +13099,7 @@ module.exports = exports.default;
12837
13099
 
12838
13100
 
12839
13101
  }).call(this,require('_process'))
12840
- },{"./css-syntax-error":171,"./stringifier":186,"./stringify":187,"_process":192}],178:[function(require,module,exports){
13102
+ },{"./css-syntax-error":172,"./stringifier":187,"./stringify":188,"_process":193}],179:[function(require,module,exports){
12841
13103
  (function (process){
12842
13104
  "use strict";
12843
13105
 
@@ -12881,7 +13143,7 @@ module.exports = exports.default;
12881
13143
 
12882
13144
 
12883
13145
  }).call(this,require('_process'))
12884
- },{"./input":173,"./parser":179,"_process":192}],179:[function(require,module,exports){
13146
+ },{"./input":174,"./parser":180,"_process":193}],180:[function(require,module,exports){
12885
13147
  "use strict";
12886
13148
 
12887
13149
  exports.__esModule = true;
@@ -12901,9 +13163,7 @@ var _rule = _interopRequireDefault(require("./rule"));
12901
13163
 
12902
13164
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12903
13165
 
12904
- var Parser =
12905
- /*#__PURE__*/
12906
- function () {
13166
+ var Parser = /*#__PURE__*/function () {
12907
13167
  function Parser(input) {
12908
13168
  this.input = input;
12909
13169
  this.root = new _root.default();
@@ -13494,7 +13754,7 @@ exports.default = Parser;
13494
13754
  module.exports = exports.default;
13495
13755
 
13496
13756
 
13497
- },{"./at-rule":168,"./comment":169,"./declaration":172,"./root":184,"./rule":185,"./tokenize":188}],180:[function(require,module,exports){
13757
+ },{"./at-rule":169,"./comment":170,"./declaration":173,"./root":185,"./rule":186,"./tokenize":189}],181:[function(require,module,exports){
13498
13758
  "use strict";
13499
13759
 
13500
13760
  exports.__esModule = true;
@@ -13781,7 +14041,7 @@ exports.default = _default;
13781
14041
  module.exports = exports.default;
13782
14042
 
13783
14043
 
13784
- },{"./at-rule":168,"./comment":169,"./declaration":172,"./list":175,"./parse":178,"./processor":182,"./root":184,"./rule":185,"./stringify":187,"./vendor":189}],181:[function(require,module,exports){
14044
+ },{"./at-rule":169,"./comment":170,"./declaration":173,"./list":176,"./parse":179,"./processor":183,"./root":185,"./rule":186,"./stringify":188,"./vendor":190}],182:[function(require,module,exports){
13785
14045
  (function (Buffer){
13786
14046
  "use strict";
13787
14047
 
@@ -13816,9 +14076,7 @@ function fromBase64(str) {
13816
14076
  */
13817
14077
 
13818
14078
 
13819
- var PreviousMap =
13820
- /*#__PURE__*/
13821
- function () {
14079
+ var PreviousMap = /*#__PURE__*/function () {
13822
14080
  /**
13823
14081
  * @param {string} css Input CSS source.
13824
14082
  * @param {processOptions} [opts] {@link Processor#process} options.
@@ -13959,7 +14217,7 @@ module.exports = exports.default;
13959
14217
 
13960
14218
 
13961
14219
  }).call(this,require("buffer").Buffer)
13962
- },{"buffer":3,"fs":2,"path":167,"source-map":207}],182:[function(require,module,exports){
14220
+ },{"buffer":3,"fs":2,"path":168,"source-map":208}],183:[function(require,module,exports){
13963
14221
  (function (process){
13964
14222
  "use strict";
13965
14223
 
@@ -13970,6 +14228,12 @@ var _lazyResult = _interopRequireDefault(require("./lazy-result"));
13970
14228
 
13971
14229
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13972
14230
 
14231
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
14232
+
14233
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14234
+
14235
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14236
+
13973
14237
  /**
13974
14238
  * Contains plugins to process CSS. Create one `Processor` instance,
13975
14239
  * initialize its plugins, and then use that instance on numerous CSS files.
@@ -13979,9 +14243,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13979
14243
  * processor.process(css1).then(result => console.log(result.css))
13980
14244
  * processor.process(css2).then(result => console.log(result.css))
13981
14245
  */
13982
- var Processor =
13983
- /*#__PURE__*/
13984
- function () {
14246
+ var Processor = /*#__PURE__*/function () {
13985
14247
  /**
13986
14248
  * @param {Array.<Plugin|pluginFunction>|Processor} plugins PostCSS plugins.
13987
14249
  * See {@link Processor#use} for plugin format.
@@ -14001,7 +14263,7 @@ function () {
14001
14263
  * throw new Error('This plugin works only with PostCSS 6')
14002
14264
  * }
14003
14265
  */
14004
- this.version = '7.0.31';
14266
+ this.version = '7.0.34';
14005
14267
  /**
14006
14268
  * Plugins added to this processor.
14007
14269
  *
@@ -14104,19 +14366,14 @@ function () {
14104
14366
  _proto.normalize = function normalize(plugins) {
14105
14367
  var normalized = [];
14106
14368
 
14107
- for (var _iterator = plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
14108
- var _ref;
14369
+ for (var _iterator = _createForOfIteratorHelperLoose(plugins), _step; !(_step = _iterator()).done;) {
14370
+ var i = _step.value;
14109
14371
 
14110
- if (_isArray) {
14111
- if (_i >= _iterator.length) break;
14112
- _ref = _iterator[_i++];
14113
- } else {
14114
- _i = _iterator.next();
14115
- if (_i.done) break;
14116
- _ref = _i.value;
14372
+ if (i.postcss === true) {
14373
+ var plugin = i();
14374
+ throw new Error('PostCSS plugin ' + plugin.postcssPlugin + ' requires PostCSS 8. Update PostCSS or downgrade this plugin.');
14117
14375
  }
14118
14376
 
14119
- var i = _ref;
14120
14377
  if (i.postcss) i = i.postcss;
14121
14378
 
14122
14379
  if (typeof i === 'object' && Array.isArray(i.plugins)) {
@@ -14127,6 +14384,8 @@ function () {
14127
14384
  if (process.env.NODE_ENV !== 'production') {
14128
14385
  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.');
14129
14386
  }
14387
+ } else if (typeof i === 'object' && i.postcssPlugin) {
14388
+ throw new Error('PostCSS plugin ' + i.postcssPlugin + ' requires PostCSS 8. Update PostCSS or downgrade this plugin.');
14130
14389
  } else {
14131
14390
  throw new Error(i + ' is not a PostCSS plugin');
14132
14391
  }
@@ -14226,7 +14485,7 @@ module.exports = exports.default;
14226
14485
 
14227
14486
 
14228
14487
  }).call(this,require('_process'))
14229
- },{"./lazy-result":174,"_process":192}],183:[function(require,module,exports){
14488
+ },{"./lazy-result":175,"_process":193}],184:[function(require,module,exports){
14230
14489
  "use strict";
14231
14490
 
14232
14491
  exports.__esModule = true;
@@ -14254,9 +14513,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
14254
14513
  * @example
14255
14514
  * const result2 = postcss.parse(css).toResult()
14256
14515
  */
14257
- var Result =
14258
- /*#__PURE__*/
14259
- function () {
14516
+ var Result = /*#__PURE__*/function () {
14260
14517
  /**
14261
14518
  * @param {Processor} processor Processor used for this transformation.
14262
14519
  * @param {Root} root Root node after all transformations.
@@ -14443,7 +14700,7 @@ exports.default = _default;
14443
14700
  module.exports = exports.default;
14444
14701
 
14445
14702
 
14446
- },{"./warning":191}],184:[function(require,module,exports){
14703
+ },{"./warning":192}],185:[function(require,module,exports){
14447
14704
  "use strict";
14448
14705
 
14449
14706
  exports.__esModule = true;
@@ -14453,6 +14710,12 @@ var _container = _interopRequireDefault(require("./container"));
14453
14710
 
14454
14711
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14455
14712
 
14713
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
14714
+
14715
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14716
+
14717
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14718
+
14456
14719
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
14457
14720
 
14458
14721
  /**
@@ -14465,9 +14728,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
14465
14728
  * root.type //=> 'root'
14466
14729
  * root.nodes.length //=> 2
14467
14730
  */
14468
- var Root =
14469
- /*#__PURE__*/
14470
- function (_Container) {
14731
+ var Root = /*#__PURE__*/function (_Container) {
14471
14732
  _inheritsLoose(Root, _Container);
14472
14733
 
14473
14734
  function Root(defaults) {
@@ -14502,19 +14763,8 @@ function (_Container) {
14502
14763
  delete sample.raws.before;
14503
14764
  }
14504
14765
  } else if (this.first !== sample) {
14505
- for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
14506
- var _ref;
14507
-
14508
- if (_isArray) {
14509
- if (_i >= _iterator.length) break;
14510
- _ref = _iterator[_i++];
14511
- } else {
14512
- _i = _iterator.next();
14513
- if (_i.done) break;
14514
- _ref = _i.value;
14515
- }
14516
-
14517
- var node = _ref;
14766
+ for (var _iterator = _createForOfIteratorHelperLoose(nodes), _step; !(_step = _iterator()).done;) {
14767
+ var node = _step.value;
14518
14768
  node.raws.before = sample.raws.before;
14519
14769
  }
14520
14770
  }
@@ -14574,7 +14824,7 @@ exports.default = _default;
14574
14824
  module.exports = exports.default;
14575
14825
 
14576
14826
 
14577
- },{"./container":170,"./lazy-result":174,"./processor":182}],185:[function(require,module,exports){
14827
+ },{"./container":171,"./lazy-result":175,"./processor":183}],186:[function(require,module,exports){
14578
14828
  "use strict";
14579
14829
 
14580
14830
  exports.__esModule = true;
@@ -14603,9 +14853,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
14603
14853
  * rule.type //=> 'rule'
14604
14854
  * rule.toString() //=> 'a{}'
14605
14855
  */
14606
- var Rule =
14607
- /*#__PURE__*/
14608
- function (_Container) {
14856
+ var Rule = /*#__PURE__*/function (_Container) {
14609
14857
  _inheritsLoose(Rule, _Container);
14610
14858
 
14611
14859
  function Rule(defaults) {
@@ -14694,7 +14942,7 @@ exports.default = _default;
14694
14942
  module.exports = exports.default;
14695
14943
 
14696
14944
 
14697
- },{"./container":170,"./list":175}],186:[function(require,module,exports){
14945
+ },{"./container":171,"./list":176}],187:[function(require,module,exports){
14698
14946
  "use strict";
14699
14947
 
14700
14948
  exports.__esModule = true;
@@ -14718,9 +14966,7 @@ function capitalize(str) {
14718
14966
  return str[0].toUpperCase() + str.slice(1);
14719
14967
  }
14720
14968
 
14721
- var Stringifier =
14722
- /*#__PURE__*/
14723
- function () {
14969
+ var Stringifier = /*#__PURE__*/function () {
14724
14970
  function Stringifier(builder) {
14725
14971
  this.builder = builder;
14726
14972
  }
@@ -15060,7 +15306,7 @@ exports.default = _default;
15060
15306
  module.exports = exports.default;
15061
15307
 
15062
15308
 
15063
- },{}],187:[function(require,module,exports){
15309
+ },{}],188:[function(require,module,exports){
15064
15310
  "use strict";
15065
15311
 
15066
15312
  exports.__esModule = true;
@@ -15080,7 +15326,7 @@ exports.default = _default;
15080
15326
  module.exports = exports.default;
15081
15327
 
15082
15328
 
15083
- },{"./stringifier":186}],188:[function(require,module,exports){
15329
+ },{"./stringifier":187}],189:[function(require,module,exports){
15084
15330
  "use strict";
15085
15331
 
15086
15332
  exports.__esModule = true;
@@ -15377,7 +15623,7 @@ function tokenizer(input, options) {
15377
15623
  module.exports = exports.default;
15378
15624
 
15379
15625
 
15380
- },{}],189:[function(require,module,exports){
15626
+ },{}],190:[function(require,module,exports){
15381
15627
  "use strict";
15382
15628
 
15383
15629
  exports.__esModule = true;
@@ -15432,7 +15678,7 @@ exports.default = _default;
15432
15678
  module.exports = exports.default;
15433
15679
 
15434
15680
 
15435
- },{}],190:[function(require,module,exports){
15681
+ },{}],191:[function(require,module,exports){
15436
15682
  "use strict";
15437
15683
 
15438
15684
  exports.__esModule = true;
@@ -15451,7 +15697,7 @@ function warnOnce(message) {
15451
15697
  module.exports = exports.default;
15452
15698
 
15453
15699
 
15454
- },{}],191:[function(require,module,exports){
15700
+ },{}],192:[function(require,module,exports){
15455
15701
  "use strict";
15456
15702
 
15457
15703
  exports.__esModule = true;
@@ -15465,9 +15711,7 @@ exports.default = void 0;
15465
15711
  * decl.warn(result, 'Avoid !important', { word: '!important' })
15466
15712
  * }
15467
15713
  */
15468
- var Warning =
15469
- /*#__PURE__*/
15470
- function () {
15714
+ var Warning = /*#__PURE__*/function () {
15471
15715
  /**
15472
15716
  * @param {string} text Warning message.
15473
15717
  * @param {Object} [opts] Warning options.
@@ -15586,7 +15830,7 @@ exports.default = _default;
15586
15830
  module.exports = exports.default;
15587
15831
 
15588
15832
 
15589
- },{}],192:[function(require,module,exports){
15833
+ },{}],193:[function(require,module,exports){
15590
15834
  // shim for using process in browser
15591
15835
  var process = module.exports = {};
15592
15836
 
@@ -15772,7 +16016,7 @@ process.chdir = function (dir) {
15772
16016
  };
15773
16017
  process.umask = function() { return 0; };
15774
16018
 
15775
- },{}],193:[function(require,module,exports){
16019
+ },{}],194:[function(require,module,exports){
15776
16020
  (function (global){
15777
16021
  /*! https://mths.be/punycode v1.4.1 by @mathias */
15778
16022
  ;(function(root) {
@@ -16309,7 +16553,7 @@ process.umask = function() { return 0; };
16309
16553
  }(this));
16310
16554
 
16311
16555
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
16312
- },{}],194:[function(require,module,exports){
16556
+ },{}],195:[function(require,module,exports){
16313
16557
  // Copyright Joyent, Inc. and other Node contributors.
16314
16558
  //
16315
16559
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -16395,7 +16639,7 @@ var isArray = Array.isArray || function (xs) {
16395
16639
  return Object.prototype.toString.call(xs) === '[object Array]';
16396
16640
  };
16397
16641
 
16398
- },{}],195:[function(require,module,exports){
16642
+ },{}],196:[function(require,module,exports){
16399
16643
  // Copyright Joyent, Inc. and other Node contributors.
16400
16644
  //
16401
16645
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -16482,13 +16726,13 @@ var objectKeys = Object.keys || function (obj) {
16482
16726
  return res;
16483
16727
  };
16484
16728
 
16485
- },{}],196:[function(require,module,exports){
16729
+ },{}],197:[function(require,module,exports){
16486
16730
  'use strict';
16487
16731
 
16488
16732
  exports.decode = exports.parse = require('./decode');
16489
16733
  exports.encode = exports.stringify = require('./encode');
16490
16734
 
16491
- },{"./decode":194,"./encode":195}],197:[function(require,module,exports){
16735
+ },{"./decode":195,"./encode":196}],198:[function(require,module,exports){
16492
16736
  /* -*- Mode: js; js-indent-level: 2; -*- */
16493
16737
  /*
16494
16738
  * Copyright 2011 Mozilla Foundation and contributors
@@ -16611,7 +16855,7 @@ ArraySet.prototype.toArray = function ArraySet_toArray() {
16611
16855
 
16612
16856
  exports.ArraySet = ArraySet;
16613
16857
 
16614
- },{"./util":206}],198:[function(require,module,exports){
16858
+ },{"./util":207}],199:[function(require,module,exports){
16615
16859
  /* -*- Mode: js; js-indent-level: 2; -*- */
16616
16860
  /*
16617
16861
  * Copyright 2011 Mozilla Foundation and contributors
@@ -16753,7 +16997,7 @@ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
16753
16997
  aOutParam.rest = aIndex;
16754
16998
  };
16755
16999
 
16756
- },{"./base64":199}],199:[function(require,module,exports){
17000
+ },{"./base64":200}],200:[function(require,module,exports){
16757
17001
  /* -*- Mode: js; js-indent-level: 2; -*- */
16758
17002
  /*
16759
17003
  * Copyright 2011 Mozilla Foundation and contributors
@@ -16822,7 +17066,7 @@ exports.decode = function (charCode) {
16822
17066
  return -1;
16823
17067
  };
16824
17068
 
16825
- },{}],200:[function(require,module,exports){
17069
+ },{}],201:[function(require,module,exports){
16826
17070
  /* -*- Mode: js; js-indent-level: 2; -*- */
16827
17071
  /*
16828
17072
  * Copyright 2011 Mozilla Foundation and contributors
@@ -16935,7 +17179,7 @@ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
16935
17179
  return index;
16936
17180
  };
16937
17181
 
16938
- },{}],201:[function(require,module,exports){
17182
+ },{}],202:[function(require,module,exports){
16939
17183
  /* -*- Mode: js; js-indent-level: 2; -*- */
16940
17184
  /*
16941
17185
  * Copyright 2014 Mozilla Foundation and contributors
@@ -17016,7 +17260,7 @@ MappingList.prototype.toArray = function MappingList_toArray() {
17016
17260
 
17017
17261
  exports.MappingList = MappingList;
17018
17262
 
17019
- },{"./util":206}],202:[function(require,module,exports){
17263
+ },{"./util":207}],203:[function(require,module,exports){
17020
17264
  /* -*- Mode: js; js-indent-level: 2; -*- */
17021
17265
  /*
17022
17266
  * Copyright 2011 Mozilla Foundation and contributors
@@ -17132,7 +17376,7 @@ exports.quickSort = function (ary, comparator) {
17132
17376
  doQuickSort(ary, comparator, 0, ary.length - 1);
17133
17377
  };
17134
17378
 
17135
- },{}],203:[function(require,module,exports){
17379
+ },{}],204:[function(require,module,exports){
17136
17380
  /* -*- Mode: js; js-indent-level: 2; -*- */
17137
17381
  /*
17138
17382
  * Copyright 2011 Mozilla Foundation and contributors
@@ -18279,7 +18523,7 @@ IndexedSourceMapConsumer.prototype._parseMappings =
18279
18523
 
18280
18524
  exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
18281
18525
 
18282
- },{"./array-set":197,"./base64-vlq":198,"./binary-search":200,"./quick-sort":202,"./util":206}],204:[function(require,module,exports){
18526
+ },{"./array-set":198,"./base64-vlq":199,"./binary-search":201,"./quick-sort":203,"./util":207}],205:[function(require,module,exports){
18283
18527
  /* -*- Mode: js; js-indent-level: 2; -*- */
18284
18528
  /*
18285
18529
  * Copyright 2011 Mozilla Foundation and contributors
@@ -18706,7 +18950,7 @@ SourceMapGenerator.prototype.toString =
18706
18950
 
18707
18951
  exports.SourceMapGenerator = SourceMapGenerator;
18708
18952
 
18709
- },{"./array-set":197,"./base64-vlq":198,"./mapping-list":201,"./util":206}],205:[function(require,module,exports){
18953
+ },{"./array-set":198,"./base64-vlq":199,"./mapping-list":202,"./util":207}],206:[function(require,module,exports){
18710
18954
  /* -*- Mode: js; js-indent-level: 2; -*- */
18711
18955
  /*
18712
18956
  * Copyright 2011 Mozilla Foundation and contributors
@@ -19121,7 +19365,7 @@ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSou
19121
19365
 
19122
19366
  exports.SourceNode = SourceNode;
19123
19367
 
19124
- },{"./source-map-generator":204,"./util":206}],206:[function(require,module,exports){
19368
+ },{"./source-map-generator":205,"./util":207}],207:[function(require,module,exports){
19125
19369
  /* -*- Mode: js; js-indent-level: 2; -*- */
19126
19370
  /*
19127
19371
  * Copyright 2011 Mozilla Foundation and contributors
@@ -19611,7 +19855,7 @@ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
19611
19855
  }
19612
19856
  exports.computeSourceURL = computeSourceURL;
19613
19857
 
19614
- },{}],207:[function(require,module,exports){
19858
+ },{}],208:[function(require,module,exports){
19615
19859
  /*
19616
19860
  * Copyright 2009-2011 Mozilla Foundation and contributors
19617
19861
  * Licensed under the New BSD license. See LICENSE.txt or:
@@ -19621,79 +19865,7 @@ exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGene
19621
19865
  exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
19622
19866
  exports.SourceNode = require('./lib/source-node').SourceNode;
19623
19867
 
19624
- },{"./lib/source-map-consumer":203,"./lib/source-map-generator":204,"./lib/source-node":205}],208:[function(require,module,exports){
19625
- 'use strict';
19626
-
19627
- const integerRegex = /^\d+$/;
19628
-
19629
- function deepUnique(array) {
19630
- return array.sort().filter((element, index) => {
19631
- return JSON.stringify(element) !== JSON.stringify(array[index - 1]);
19632
- });
19633
- }
19634
-
19635
- exports.parse = string => {
19636
- return deepUnique(
19637
- string.split(',').map(part => {
19638
- const result = {};
19639
-
19640
- part
19641
- .trim()
19642
- .split(/\s+/)
19643
- .forEach((element, index) => {
19644
- if (index === 0) {
19645
- result.url = element;
19646
- return;
19647
- }
19648
-
19649
- const value = element.slice(0, element.length - 1);
19650
- const postfix = element[element.length - 1];
19651
- const integerValue = parseInt(value, 10);
19652
- const floatValue = parseFloat(value);
19653
-
19654
- if (postfix === 'w' && integerRegex.test(value)) {
19655
- result.width = integerValue;
19656
- } else if (postfix === 'h' && integerRegex.test(value)) {
19657
- result.height = integerValue;
19658
- } else if (postfix === 'x' && !Number.isNaN(floatValue)) {
19659
- result.density = floatValue;
19660
- } else {
19661
- throw new Error(`Invalid srcset descriptor: ${element}`);
19662
- }
19663
- });
19664
-
19665
- return result;
19666
- })
19667
- );
19668
- };
19669
-
19670
- exports.stringify = array => {
19671
- return [...new Set(
19672
- array.map(element => {
19673
- if (!element.url) {
19674
- throw new Error('URL is required');
19675
- }
19676
-
19677
- const result = [element.url];
19678
-
19679
- if (element.width) {
19680
- result.push(`${element.width}w`);
19681
- }
19682
-
19683
- if (element.height) {
19684
- result.push(`${element.height}h`);
19685
- }
19686
-
19687
- if (element.density) {
19688
- result.push(`${element.density}x`);
19689
- }
19690
-
19691
- return result.join(' ');
19692
- })
19693
- )].join(', ');
19694
- };
19695
-
19696
- },{}],209:[function(require,module,exports){
19868
+ },{"./lib/source-map-consumer":204,"./lib/source-map-generator":205,"./lib/source-node":206}],209:[function(require,module,exports){
19697
19869
  // Copyright Joyent, Inc. and other Node contributors.
19698
19870
  //
19699
19871
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -20427,7 +20599,7 @@ Url.prototype.parseHost = function() {
20427
20599
  if (host) this.hostname = host;
20428
20600
  };
20429
20601
 
20430
- },{"./util":210,"punycode":193,"querystring":196}],210:[function(require,module,exports){
20602
+ },{"./util":210,"punycode":194,"querystring":197}],210:[function(require,module,exports){
20431
20603
  'use strict';
20432
20604
 
20433
20605
  module.exports = {
@@ -20453,7 +20625,7 @@ var cloneDeep = require('lodash/cloneDeep');
20453
20625
  var mergeWith = require('lodash/mergeWith');
20454
20626
  var isString = require('lodash/isString');
20455
20627
  var isPlainObject = require('lodash/isPlainObject');
20456
- var srcset = require('srcset');
20628
+ var parseSrcset = require('parse-srcset');
20457
20629
  var postcss = require('postcss');
20458
20630
  var url = require('url');
20459
20631
  // Tags that can conceivably represent stand-alone media.
@@ -20497,6 +20669,21 @@ function isEmptyObject(obj) {
20497
20669
  return true;
20498
20670
  }
20499
20671
 
20672
+ function stringifySrcset(parsedSrcset) {
20673
+ return parsedSrcset.map(function(part) {
20674
+ if (!part.url) {
20675
+ throw new Error('URL missing');
20676
+ }
20677
+
20678
+ return (
20679
+ part.url +
20680
+ (part.w ? ` ${part.w}w` : '') +
20681
+ (part.h ? ` ${part.h}h` : '') +
20682
+ (part.d ? ` ${part.d}x` : '')
20683
+ );
20684
+ }).join(', ');
20685
+ }
20686
+
20500
20687
  module.exports = sanitizeHtml;
20501
20688
 
20502
20689
  // A valid attribute name.
@@ -20537,7 +20724,7 @@ function sanitizeHtml(html, options, _recursing) {
20537
20724
  };
20538
20725
 
20539
20726
  this.updateParentNodeMediaChildren = function() {
20540
- if (stack.length && mediaTags.includes(this.tag)) {
20727
+ if (stack.length && mediaTags.indexOf(this.tag) > -1) {
20541
20728
  var parentFrame = stack[stack.length - 1];
20542
20729
  parentFrame.mediaChildren.push(this.tag);
20543
20730
  }
@@ -20558,7 +20745,7 @@ function sanitizeHtml(html, options, _recursing) {
20558
20745
  // vulnerableTags
20559
20746
  vulnerableTags.forEach(function (tag) {
20560
20747
  if (
20561
- options.allowedTags && options.allowedTags.includes(tag) &&
20748
+ options.allowedTags && options.allowedTags.indexOf(tag) > -1 &&
20562
20749
  !options.allowVulnerableTags
20563
20750
  ) {
20564
20751
  // eslint-disable-next-line no-console
@@ -20613,7 +20800,7 @@ function sanitizeHtml(html, options, _recursing) {
20613
20800
  var transFun;
20614
20801
  if (typeof transform === 'function') {
20615
20802
  transFun = transform;
20616
- } else if (typeof transform === "string") {
20803
+ } else if (typeof transform === 'string') {
20617
20804
  transFun = sanitizeHtml.simpleTransform(transform);
20618
20805
  }
20619
20806
  if (tag === '*') {
@@ -20629,6 +20816,7 @@ function sanitizeHtml(html, options, _recursing) {
20629
20816
  var transformMap;
20630
20817
  var skipText;
20631
20818
  var skipTextDepth;
20819
+ var addedText = false;
20632
20820
 
20633
20821
  initializeState();
20634
20822
 
@@ -20749,13 +20937,14 @@ function sanitizeHtml(html, options, _recursing) {
20749
20937
  var allowed = true;
20750
20938
  try {
20751
20939
  // naughtyHref is in charge of whether protocol relative URLs
20752
- // are cool. We should just accept them
20940
+ // are cool. We should just accept them.
20941
+ // eslint-disable-next-line node/no-deprecated-api
20753
20942
  parsed = url.parse(value, false, true);
20754
20943
  var isRelativeUrl = parsed && parsed.host === null && parsed.protocol === null;
20755
20944
  if (isRelativeUrl) {
20756
20945
  // default value of allowIframeRelativeUrls is true
20757
20946
  // unless allowedIframeHostnames or allowedIframeDomains specified
20758
- allowed = has(options, "allowIframeRelativeUrls")
20947
+ allowed = has(options, 'allowIframeRelativeUrls')
20759
20948
  ? options.allowIframeRelativeUrls
20760
20949
  : (!options.allowedIframeHostnames && !options.allowedIframeDomains);
20761
20950
  } else if (options.allowedIframeHostnames || options.allowedIframeDomains) {
@@ -20778,7 +20967,7 @@ function sanitizeHtml(html, options, _recursing) {
20778
20967
  }
20779
20968
  if (a === 'srcset') {
20780
20969
  try {
20781
- parsed = srcset.parse(value);
20970
+ parsed = parseSrcset(value);
20782
20971
  each(parsed, function(value) {
20783
20972
  if (naughtyHref('srcset', value.url)) {
20784
20973
  value.evil = true;
@@ -20791,7 +20980,7 @@ function sanitizeHtml(html, options, _recursing) {
20791
20980
  delete frame.attribs[a];
20792
20981
  return;
20793
20982
  } else {
20794
- value = srcset.stringify(filter(parsed, function(v) {
20983
+ value = stringifySrcset(filter(parsed, function(v) {
20795
20984
  return !v.evil;
20796
20985
  }));
20797
20986
  frame.attribs[a] = value;
@@ -20811,7 +21000,7 @@ function sanitizeHtml(html, options, _recursing) {
20811
21000
  }
20812
21001
  if (a === 'style') {
20813
21002
  try {
20814
- var abstractSyntaxTree = postcss.parse(name + " {" + value + "}");
21003
+ var abstractSyntaxTree = postcss.parse(name + ' {' + value + '}');
20815
21004
  var filteredAST = filterCss(abstractSyntaxTree, options.allowedStyles);
20816
21005
 
20817
21006
  value = stringifyStyleAttributes(filteredAST);
@@ -20835,11 +21024,12 @@ function sanitizeHtml(html, options, _recursing) {
20835
21024
  });
20836
21025
  }
20837
21026
  if (options.selfClosing.indexOf(name) !== -1) {
20838
- result += " />";
21027
+ result += ' />';
20839
21028
  } else {
20840
- result += ">";
21029
+ result += '>';
20841
21030
  if (frame.innerText && !hasText && !options.textFilter) {
20842
21031
  result += frame.innerText;
21032
+ addedText = true;
20843
21033
  }
20844
21034
  }
20845
21035
  if (skip) {
@@ -20868,9 +21058,9 @@ function sanitizeHtml(html, options, _recursing) {
20868
21058
  result += text;
20869
21059
  } else {
20870
21060
  var escaped = escapeHtml(text, false);
20871
- if (options.textFilter) {
21061
+ if (options.textFilter && !addedText) {
20872
21062
  result += options.textFilter(escaped, tag);
20873
- } else {
21063
+ } else if (!addedText) {
20874
21064
  result += escaped;
20875
21065
  }
20876
21066
  }
@@ -20930,7 +21120,7 @@ function sanitizeHtml(html, options, _recursing) {
20930
21120
  return;
20931
21121
  }
20932
21122
 
20933
- result += "</" + name + ">";
21123
+ result += '</' + name + '>';
20934
21124
  if (skip) {
20935
21125
  result = tempResult + escapeHtml(result);
20936
21126
  tempResult = '';
@@ -21078,7 +21268,7 @@ function sanitizeHtml(html, options, _recursing) {
21078
21268
  function filterDeclarations(selectedRule) {
21079
21269
  return function (allowedDeclarationsList, attributeObject) {
21080
21270
  // If this property is whitelisted...
21081
- if (selectedRule.hasOwnProperty(attributeObject.prop)) {
21271
+ if (has(selectedRule, attributeObject.prop)) {
21082
21272
  var matchesRegex = selectedRule[attributeObject.prop].some(function(regularExpression) {
21083
21273
  return regularExpression.test(attributeObject.value);
21084
21274
  });
@@ -21152,5 +21342,5 @@ sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) {
21152
21342
  };
21153
21343
  };
21154
21344
 
21155
- },{"htmlparser2":31,"lodash/cloneDeep":140,"lodash/escapeRegExp":143,"lodash/isPlainObject":155,"lodash/isString":157,"lodash/mergeWith":162,"postcss":180,"srcset":208,"url":209}]},{},[211])(211)
21345
+ },{"htmlparser2":31,"lodash/cloneDeep":140,"lodash/escapeRegExp":143,"lodash/isPlainObject":155,"lodash/isString":157,"lodash/mergeWith":162,"parse-srcset":167,"postcss":181,"url":209}]},{},[211])(211)
21156
21346
  });