diff --git a/.eslintrc.js b/.eslintrc.js index 1a5243ab..9d9e8f1a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,63 +1,65 @@ module.exports = { - 'env': { - 'browser': true, - 'es6': true + env: { + browser: true, + es6: true, }, - 'extends': [ - 'eslint:recommended' - ], + extends: ['eslint:recommended'], - 'plugins': [ - 'import', - 'no-unsanitized' - ], + plugins: ['import', 'no-unsanitized'], - 'globals': { - 'Atomics': 'readonly', - 'SharedArrayBuffer': 'readonly' + globals: { + Atomics: 'readonly', + SharedArrayBuffer: 'readonly', }, - 'parserOptions': { - 'ecmaVersion': 2018, - 'sourceType': 'module' + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', }, - 'rules': { - 'complexity': [ 'error', { max: 10 } ], - 'indent': [ 'error', 'tab', { 'SwitchCase': 1 } ], - 'linebreak-style': [ 'error', 'unix' ], - 'max-depth': [ 'error', 4 ], - 'max-len': [ 'error', {'code': 150 } ], - 'max-lines': [ 'error', { max: 300, skipBlankLines: true, skipComments: true, } ], - 'max-lines-per-function': [ 'warn', { max: 50, skipBlankLines: true, skipComments: true, }], - 'max-params': [ 'warn', { max: 4 } ], - 'no-shadow': [ 'error', { 'builtinGlobals': true } ], - 'quotes': [ 'error', 'single' ], - 'semi': [ 'error', 'always'], - - 'no-restricted-imports': [ + rules: { + complexity: ['error', { max: 10 }], + indent: ['error', 'tab', { SwitchCase: 1 }], + 'linebreak-style': ['error', 'unix'], + 'max-depth': ['error', 4], + 'max-len': ['error', { code: 150 }], + 'max-lines': [ + 'error', + { max: 300, skipBlankLines: true, skipComments: true }, + ], + 'max-lines-per-function': [ + 'warn', + { max: 50, skipBlankLines: true, skipComments: true }, + ], + 'max-params': ['warn', { max: 4 }], + 'no-shadow': ['error', { builtinGlobals: true }], + semi: ['error', 'always'], + + 'no-restricted-imports': [ 'error', { paths: [ { name: 'lodash', - message: 'Please do not import lodash as a whole: import individual lodash functions instead.' - } - ] - } + message: + 'Please do not import lodash as a whole: import individual lodash functions instead.', + }, + ], + }, ], - 'no-unsanitized/property': [ 'error', { escape: { methods: ['escapeHTML'] } } ], - 'no-unsanitized/method': [ 'error' ], - + 'no-unsanitized/property': [ + 'error', + { escape: { methods: ['escapeHTML'] } }, + ], + 'no-unsanitized/method': ['error'], - 'import/no-restricted-paths': [ 'error', + 'import/no-restricted-paths': [ + 'error', { - 'zones': [ - { 'target': './src/parser', 'from': './src/renderer' }, - ] - } + zones: [{ target: './src/parser', from: './src/renderer' }], + }, ], - } + }, }; diff --git a/.idea/prettier.xml b/.idea/prettier.xml new file mode 100644 index 00000000..9c8fc053 --- /dev/null +++ b/.idea/prettier.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..145ce011 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +coverage +CHANGELOG.md +lib +package.json +package-lock.json +SLOC diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..c742e225 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "endOfLine": "lf", + "semi": true, + "singleQuote": true, + "tabWidth": 4, + "trailingComma": "es5", + "useTabs": true +} diff --git a/README.md b/README.md index 783f3baf..41c0adaa 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,6 @@ The best way to write chords charts Finally chords charts that are: -- easy to write -- complete and accurate, with bar information + +- easy to write +- complete and accurate, with bar information diff --git a/SLOC b/SLOC index fad69e9b..86c25575 100644 --- a/SLOC +++ b/SLOC @@ -2,17 +2,17 @@ Source code: ---------- Result ------------ - Physical : 1352 - Source : 900 - Comment : 235 - Single-line comment : 15 - Block comment : 220 + Physical : 1556 + Source : 1088 + Comment : 253 + Single-line comment : 16 + Block comment : 237 Mixed : 14 Empty block comment : 0 - Empty : 231 + Empty : 229 To Do : 0 -Number of files read : 49 +Number of files read : 52 ---------------------------- @@ -20,17 +20,17 @@ Tests: ---------- Result ------------ - Physical : 3027 - Source : 2554 + Physical : 4261 + Source : 3851 Comment : 13 Single-line comment : 13 Block comment : 0 Mixed : 12 Empty block comment : 0 - Empty : 472 + Empty : 409 To Do : 0 -Number of files read : 37 +Number of files read : 39 ---------------------------- @@ -38,17 +38,17 @@ Total: ---------- Result ------------ - Physical : 4379 - Source : 3454 - Comment : 248 - Single-line comment : 28 - Block comment : 220 + Physical : 5817 + Source : 4939 + Comment : 266 + Single-line comment : 29 + Block comment : 237 Mixed : 26 Empty block comment : 0 - Empty : 703 + Empty : 638 To Do : 0 -Number of files read : 86 +Number of files read : 91 ---------------------------- diff --git a/jest.config.js b/jest.config.js index f3a801bc..226d5b5f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,22 +1,19 @@ /* eslint-env node */ module.exports = { testEnvironment: 'jsdom', - + collectCoverage: true, - collectCoverageFrom: [ - 'src/**/*.js', - '!**/node_modules/**' - ], + collectCoverageFrom: ['src/**/*.js', '!**/node_modules/**'], coverageDirectory: '/coverage', coveragePathIgnorePatterns: ['node_modules'], coverageReporters: ['json', 'lcov', 'text', 'clover'], coverageThreshold: { - 'global': { - 'branches': 99, - 'functions': 100, - 'lines': 100, - 'statements': 0 - } + global: { + branches: 99, + functions: 100, + lines: 100, + statements: 0, + }, }, transform: { @@ -25,7 +22,6 @@ module.exports = { }, moduleNameMapper: { - '\\.(css|scss)$': '/scss/__mocks__/styleMock.js' - } - + '\\.(css|scss)$': '/scss/__mocks__/styleMock.js', + }, }; diff --git a/lib/chord-mark.js b/lib/chord-mark.js index 2bdb8c2b..486687aa 100644 --- a/lib/chord-mark.js +++ b/lib/chord-mark.js @@ -12061,6 +12061,7 @@ var callWithSafeIterationClosing = __webpack_require__(3411); var isArrayIteratorMethod = __webpack_require__(7659); var toLength = __webpack_require__(7466); var createProperty = __webpack_require__(6135); +var getIterator = __webpack_require__(8554); var getIteratorMethod = __webpack_require__(1246); // `Array.from` method implementation @@ -12077,7 +12078,7 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { - iterator = iteratorMethod.call(O); + iterator = getIterator(O, iteratorMethod); next = iterator.next; result = new C(); for (;!(step = next.call(iterator)).done; index++) { @@ -12149,14 +12150,14 @@ var arraySpeciesCreate = __webpack_require__(5417); var push = [].push; -// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation +// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation var createMethod = function (TYPE) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; - var IS_FILTER_OUT = TYPE == 7; + var IS_FILTER_REJECT = TYPE == 7; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject($this); @@ -12165,7 +12166,7 @@ var createMethod = function (TYPE) { var length = toLength(self.length); var index = 0; var create = specificCreate || arraySpeciesCreate; - var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined; + var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; @@ -12179,7 +12180,7 @@ var createMethod = function (TYPE) { case 2: push.call(target, value); // filter } else switch (TYPE) { case 4: return false; // every - case 7: push.call(target, value); // filterOut + case 7: push.call(target, value); // filterReject } } } @@ -12209,9 +12210,9 @@ module.exports = { // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findIndex findIndex: createMethod(6), - // `Array.prototype.filterOut` method + // `Array.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering - filterOut: createMethod(7) + filterReject: createMethod(7) }; @@ -12261,7 +12262,7 @@ module.exports = function (METHOD_NAME, argument) { /***/ }), -/***/ 5417: +/***/ 7475: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(111); @@ -12270,9 +12271,9 @@ var wellKnownSymbol = __webpack_require__(5112); var SPECIES = wellKnownSymbol('species'); -// `ArraySpeciesCreate` abstract operation +// a part of `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate -module.exports = function (originalArray, length) { +module.exports = function (originalArray) { var C; if (isArray(originalArray)) { C = originalArray.constructor; @@ -12282,7 +12283,21 @@ module.exports = function (originalArray, length) { C = C[SPECIES]; if (C === null) C = undefined; } - } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); + } return C === undefined ? Array : C; +}; + + +/***/ }), + +/***/ 5417: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arraySpeciesConstructor = __webpack_require__(7475); + +// `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray, length) { + return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; @@ -12299,8 +12314,7 @@ module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); } catch (error) { - iteratorClose(iterator); - throw error; + iteratorClose(iterator, 'throw', error); } }; @@ -12663,7 +12677,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { if (REPLACE) { // create collection constructor Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); - InternalMetadataModule.REQUIRED = true; + InternalMetadataModule.enable(); } else if (isForced(CONSTRUCTOR_NAME, true)) { var instance = new Constructor(); // early implementations not supports chaining @@ -12815,12 +12829,12 @@ module.exports = function (bitmap, value) { "use strict"; -var toPrimitive = __webpack_require__(7593); +var toPropertyKey = __webpack_require__(4948); var definePropertyModule = __webpack_require__(3070); var createPropertyDescriptor = __webpack_require__(9114); module.exports = function (object, key, value) { - var propertyKey = toPrimitive(key); + var propertyKey = toPropertyKey(key); if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); else object[propertyKey] = value; }; @@ -13034,7 +13048,8 @@ var global = __webpack_require__(7854); var userAgent = __webpack_require__(8113); var process = global.process; -var versions = process && process.versions; +var Deno = global.Deno; +var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; @@ -13308,7 +13323,6 @@ module.exports = Function.bind || function bind(that /* , ...args */) { /***/ 5005: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var path = __webpack_require__(857); var global = __webpack_require__(7854); var aFunction = function (variable) { @@ -13316,8 +13330,7 @@ var aFunction = function (variable) { }; module.exports = function (namespace, method) { - return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) - : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; + return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; }; @@ -13339,6 +13352,22 @@ module.exports = function (it) { }; +/***/ }), + +/***/ 8554: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var anObject = __webpack_require__(9670); +var getIteratorMethod = __webpack_require__(1246); + +module.exports = function (it, usingIterator) { + var iteratorMethod = arguments.length < 2 ? getIteratorMethod(it) : usingIterator; + if (typeof iteratorMethod != 'function') { + throw TypeError(String(it) + ' is not iterable'); + } return anObject(iteratorMethod.call(it)); +}; + + /***/ }), /***/ 647: @@ -13526,13 +13555,17 @@ module.exports = store.inspectSource; /***/ 2423: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var $ = __webpack_require__(2109); var hiddenKeys = __webpack_require__(3501); var isObject = __webpack_require__(111); var has = __webpack_require__(6656); var defineProperty = __webpack_require__(3070).f; +var getOwnPropertyNamesModule = __webpack_require__(8006); +var getOwnPropertyNamesExternalModule = __webpack_require__(1156); var uid = __webpack_require__(9711); var FREEZING = __webpack_require__(6677); +var REQUIRED = false; var METADATA = uid('meta'); var id = 0; @@ -13576,12 +13609,38 @@ var getWeakData = function (it, create) { // add metadata on freeze-family methods calling var onFreeze = function (it) { - if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it); + if (FREEZING && REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it); return it; }; +var enable = function () { + meta.enable = function () { /* empty */ }; + REQUIRED = true; + var getOwnPropertyNames = getOwnPropertyNamesModule.f; + var splice = [].splice; + var test = {}; + test[METADATA] = 1; + + // prevent exposing of metadata key + if (getOwnPropertyNames(test).length) { + getOwnPropertyNamesModule.f = function (it) { + var result = getOwnPropertyNames(it); + for (var i = 0, length = result.length; i < length; i++) { + if (result[i] === METADATA) { + splice.call(result, i, 1); + break; + } + } return result; + }; + + $({ target: 'Object', stat: true, forced: true }, { + getOwnPropertyNames: getOwnPropertyNamesExternalModule.f + }); + } +}; + var meta = module.exports = { - REQUIRED: false, + enable: enable, fastKey: fastKey, getWeakData: getWeakData, onFreeze: onFreeze @@ -13761,6 +13820,22 @@ module.exports = function (it) { }; +/***/ }), + +/***/ 2190: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getBuiltIn = __webpack_require__(5005); +var USE_SYMBOL_AS_UID = __webpack_require__(3307); + +module.exports = USE_SYMBOL_AS_UID ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + var $Symbol = getBuiltIn('Symbol'); + return typeof $Symbol == 'function' && Object(it) instanceof $Symbol; +}; + + /***/ }), /***/ 408: @@ -13770,6 +13845,7 @@ var anObject = __webpack_require__(9670); var isArrayIteratorMethod = __webpack_require__(7659); var toLength = __webpack_require__(7466); var bind = __webpack_require__(9974); +var getIterator = __webpack_require__(8554); var getIteratorMethod = __webpack_require__(1246); var iteratorClose = __webpack_require__(9212); @@ -13787,7 +13863,7 @@ module.exports = function (iterable, unboundFunction, options) { var iterator, iterFn, index, length, result, next, step; var stop = function (condition) { - if (iterator) iteratorClose(iterator); + if (iterator) iteratorClose(iterator, 'return', condition); return new Result(true, condition); }; @@ -13810,7 +13886,7 @@ module.exports = function (iterable, unboundFunction, options) { if (result && result instanceof Result) return result; } return new Result(false); } - iterator = iterFn.call(iterable); + iterator = getIterator(iterable, iterFn); } next = iterator.next; @@ -13818,8 +13894,7 @@ module.exports = function (iterable, unboundFunction, options) { try { result = callFn(step.value); } catch (error) { - iteratorClose(iterator); - throw error; + iteratorClose(iterator, 'throw', error); } if (typeof result == 'object' && result && result instanceof Result) return result; } return new Result(false); @@ -13833,11 +13908,24 @@ module.exports = function (iterable, unboundFunction, options) { var anObject = __webpack_require__(9670); -module.exports = function (iterator) { - var returnMethod = iterator['return']; - if (returnMethod !== undefined) { - return anObject(returnMethod.call(iterator)).value; +module.exports = function (iterator, kind, value) { + var innerResult, innerError; + anObject(iterator); + try { + innerResult = iterator['return']; + if (innerResult === undefined) { + if (kind === 'throw') throw value; + return value; + } + innerResult = innerResult.call(iterator); + } catch (error) { + innerError = true; + innerResult = error; } + if (kind === 'throw') throw value; + if (innerError) throw innerResult; + anObject(innerResult); + return value; }; @@ -13942,6 +14030,7 @@ module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSour /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(7854); +var toString = __webpack_require__(1340); var trim = __webpack_require__(3111).trim; var whitespaces = __webpack_require__(1361); @@ -13952,7 +14041,7 @@ var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x1 // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix module.exports = FORCED ? function parseInt(string, radix) { - var S = trim(String(string)); + var S = trim(toString(string)); return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10)); } : $parseInt; @@ -13962,6 +14051,7 @@ module.exports = FORCED ? function parseInt(string, radix) { /***/ 30: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/* global ActiveXObject -- old IE, WSH */ var anObject = __webpack_require__(9670); var defineProperties = __webpack_require__(6048); var enumBugKeys = __webpack_require__(748); @@ -14016,10 +14106,13 @@ var NullProtoObjectViaIFrame = function () { var activeXDocument; var NullProtoObject = function () { try { - /* global ActiveXObject -- old IE */ - activeXDocument = document.domain && new ActiveXObject('htmlfile'); + activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } - NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); + NullProtoObject = typeof document != 'undefined' + ? document.domain && activeXDocument + ? NullProtoObjectViaActiveX(activeXDocument) // old IE + : NullProtoObjectViaIFrame() + : NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); @@ -14074,7 +14167,7 @@ module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperti var DESCRIPTORS = __webpack_require__(9781); var IE8_DOM_DEFINE = __webpack_require__(4664); var anObject = __webpack_require__(9670); -var toPrimitive = __webpack_require__(7593); +var toPropertyKey = __webpack_require__(4948); // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; @@ -14083,7 +14176,7 @@ var $defineProperty = Object.defineProperty; // https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); - P = toPrimitive(P, true); + P = toPropertyKey(P); anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); @@ -14103,7 +14196,7 @@ var DESCRIPTORS = __webpack_require__(9781); var propertyIsEnumerableModule = __webpack_require__(5296); var createPropertyDescriptor = __webpack_require__(9114); var toIndexedObject = __webpack_require__(5656); -var toPrimitive = __webpack_require__(7593); +var toPropertyKey = __webpack_require__(4948); var has = __webpack_require__(6656); var IE8_DOM_DEFINE = __webpack_require__(4664); @@ -14114,7 +14207,7 @@ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); - P = toPrimitive(P, true); + P = toPropertyKey(P); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } @@ -14316,6 +14409,24 @@ module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { }; +/***/ }), + +/***/ 2140: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isObject = __webpack_require__(111); + +// `OrdinaryToPrimitive` abstract operation +// https://tc39.es/ecma262/#sec-ordinarytoprimitive +module.exports = function (input, pref) { + var fn, val; + if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; + if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + /***/ }), /***/ 3887: @@ -14440,8 +14551,9 @@ module.exports = function (R, S) { "use strict"; -/* eslint-disable regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ +/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ /* eslint-disable regexp/no-useless-quantifier -- testing */ +var toString = __webpack_require__(1340); var regexpFlags = __webpack_require__(7066); var stickyHelpers = __webpack_require__(2999); var shared = __webpack_require__(2309); @@ -14472,9 +14584,10 @@ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPP if (PATCH) { // eslint-disable-next-line max-statements -- TODO - patchedExec = function exec(str) { + patchedExec = function exec(string) { var re = this; var state = getInternalState(re); + var str = toString(string); var raw = state.raw; var result, reCopy, lastIndex, match, i, object, group; @@ -14498,9 +14611,9 @@ if (PATCH) { flags += 'g'; } - strCopy = String(str).slice(re.lastIndex); + strCopy = str.slice(re.lastIndex); // Support anchored sticky behavior. - if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) { + if (re.lastIndex > 0 && (!re.multiline || re.multiline && str.charAt(re.lastIndex - 1) !== '\n')) { source = '(?: ' + source + ')'; strCopy = ' ' + strCopy; charsAdded++; @@ -14582,21 +14695,20 @@ module.exports = function () { /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var fails = __webpack_require__(7293); +var global = __webpack_require__(7854); -// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError, -var RE = function (s, f) { - return RegExp(s, f); -}; +// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError +var $RegExp = global.RegExp; exports.UNSUPPORTED_Y = fails(function () { - var re = RE('a', 'y'); + var re = $RegExp('a', 'y'); re.lastIndex = 2; return re.exec('abcd') != null; }); exports.BROKEN_CARET = fails(function () { // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 - var re = RE('^r', 'gy'); + var re = $RegExp('^r', 'gy'); re.lastIndex = 2; return re.exec('str') != null; }); @@ -14608,10 +14720,13 @@ exports.BROKEN_CARET = fails(function () { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7293); +var global = __webpack_require__(7854); + +// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError +var $RegExp = global.RegExp; module.exports = fails(function () { - // babel-minify transpiles RegExp('.', 's') -> /./s and it causes SyntaxError - var re = RegExp('.', (typeof '').charAt(0)); + var re = $RegExp('.', 's'); return !(re.dotAll && re.exec('\n') && re.flags === 's'); }); @@ -14622,10 +14737,13 @@ module.exports = fails(function () { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7293); +var global = __webpack_require__(7854); + +// babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError +var $RegExp = global.RegExp; module.exports = fails(function () { - // babel-minify transpiles RegExp('.', 'g') -> /./g and it causes SyntaxError - var re = RegExp('(?b)', (typeof '').charAt(5)); + var re = $RegExp('(?b)', 'g'); return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$c') !== 'bc'; }); @@ -14650,11 +14768,11 @@ module.exports = function (it) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(7854); -var createNonEnumerableProperty = __webpack_require__(8880); module.exports = function (key, value) { try { - createNonEnumerableProperty(global, key, value); + // eslint-disable-next-line es/no-object-defineproperty -- safe + Object.defineProperty(global, key, { value: value, configurable: true, writable: true }); } catch (error) { global[key] = value; } return value; @@ -14746,7 +14864,7 @@ var store = __webpack_require__(5465); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.15.2', + version: '3.16.4', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2021 Denis Pushkarev (zloirock.ru)' }); @@ -14778,12 +14896,13 @@ module.exports = function (O, defaultConstructor) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toInteger = __webpack_require__(9958); +var toString = __webpack_require__(1340); var requireObjectCoercible = __webpack_require__(4488); -// `String.prototype.{ codePointAt, at }` methods implementation +// `String.prototype.codePointAt` methods implementation var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { - var S = String(requireObjectCoercible($this)); + var S = toString(requireObjectCoercible($this)); var position = toInteger(pos); var size = S.length; var first, second; @@ -14814,12 +14933,13 @@ module.exports = { "use strict"; var toInteger = __webpack_require__(9958); +var toString = __webpack_require__(1340); var requireObjectCoercible = __webpack_require__(4488); // `String.prototype.repeat` method implementation // https://tc39.es/ecma262/#sec-string.prototype.repeat module.exports = function repeat(count) { - var str = String(requireObjectCoercible(this)); + var str = toString(requireObjectCoercible(this)); var result = ''; var n = toInteger(count); if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions'); @@ -14853,6 +14973,7 @@ module.exports = function (METHOD_NAME) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var requireObjectCoercible = __webpack_require__(4488); +var toString = __webpack_require__(1340); var whitespaces = __webpack_require__(1361); var whitespace = '[' + whitespaces + ']'; @@ -14862,7 +14983,7 @@ var rtrim = RegExp(whitespace + whitespace + '*$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation var createMethod = function (TYPE) { return function ($this) { - var string = String(requireObjectCoercible($this)); + var string = toString(requireObjectCoercible($this)); if (TYPE & 1) string = string.replace(ltrim, ''); if (TYPE & 2) string = string.replace(rtrim, ''); return string; @@ -14966,18 +15087,42 @@ module.exports = function (argument) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(111); +var isSymbol = __webpack_require__(2190); +var ordinaryToPrimitive = __webpack_require__(2140); +var wellKnownSymbol = __webpack_require__(5112); + +var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive -// instead of the ES6 spec version, we didn't implement @@toPrimitive case -// and the second argument - flag - preferred type is a string -module.exports = function (input, PREFERRED_STRING) { - if (!isObject(input)) return input; - var fn, val; - if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; - if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; - if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; - throw TypeError("Can't convert object to primitive value"); +module.exports = function (input, pref) { + if (!isObject(input) || isSymbol(input)) return input; + var exoticToPrim = input[TO_PRIMITIVE]; + var result; + if (exoticToPrim !== undefined) { + if (pref === undefined) pref = 'default'; + result = exoticToPrim.call(input, pref); + if (!isObject(result) || isSymbol(result)) return result; + throw TypeError("Can't convert object to primitive value"); + } + if (pref === undefined) pref = 'number'; + return ordinaryToPrimitive(input, pref); +}; + + +/***/ }), + +/***/ 4948: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var toPrimitive = __webpack_require__(7593); +var isSymbol = __webpack_require__(2190); + +// `ToPropertyKey` abstract operation +// https://tc39.es/ecma262/#sec-topropertykey +module.exports = function (argument) { + var key = toPrimitive(argument, 'string'); + return isSymbol(key) ? key : String(key); }; @@ -14996,6 +15141,19 @@ test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; +/***/ }), + +/***/ 1340: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isSymbol = __webpack_require__(2190); + +module.exports = function (argument) { + if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string'); + return String(argument); +}; + + /***/ }), /***/ 9711: @@ -15361,6 +15519,7 @@ var redefine = __webpack_require__(1320); var has = __webpack_require__(6656); var classof = __webpack_require__(4326); var inheritIfRequired = __webpack_require__(9587); +var isSymbol = __webpack_require__(2190); var toPrimitive = __webpack_require__(7593); var fails = __webpack_require__(7293); var create = __webpack_require__(30); @@ -15379,7 +15538,8 @@ var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER; // `ToNumber` abstract operation // https://tc39.es/ecma262/#sec-tonumber var toNumber = function (argument) { - var it = toPrimitive(argument, false); + if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a number'); + var it = toPrimitive(argument, 'number'); var first, third, radix, maxCode, digits, length, index, code; if (typeof it == 'string' && it.length > 2) { it = trim(it); @@ -15636,6 +15796,7 @@ var createNonEnumerableProperty = __webpack_require__(8880); var defineProperty = __webpack_require__(3070).f; var getOwnPropertyNames = __webpack_require__(8006).f; var isRegExp = __webpack_require__(7850); +var toString = __webpack_require__(1340); var getFlags = __webpack_require__(7066); var stickyHelpers = __webpack_require__(2999); var redefine = __webpack_require__(1320); @@ -15755,8 +15916,8 @@ if (isForced('RegExp', BASE_FORCED)) { if (flagsAreUndefined) flags = 'flags' in rawPattern ? rawPattern.flags : getFlags.call(rawPattern); } - pattern = pattern === undefined ? '' : String(pattern); - flags = flags === undefined ? '' : String(flags); + pattern = pattern === undefined ? '' : toString(pattern); + flags = flags === undefined ? '' : toString(flags); rawPattern = pattern; if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) { @@ -15844,6 +16005,7 @@ $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { var redefine = __webpack_require__(1320); var anObject = __webpack_require__(9670); +var $toString = __webpack_require__(1340); var fails = __webpack_require__(7293); var flags = __webpack_require__(7066); @@ -15860,9 +16022,9 @@ var INCORRECT_NAME = nativeToString.name != TO_STRING; if (NOT_GENERIC || INCORRECT_NAME) { redefine(RegExp.prototype, TO_STRING, function toString() { var R = anObject(this); - var p = String(R.source); + var p = $toString(R.source); var rf = R.flags; - var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); + var f = $toString(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); return '/' + p + '/' + f; }, { unsafe: true }); } @@ -15876,6 +16038,7 @@ if (NOT_GENERIC || INCORRECT_NAME) { "use strict"; var charAt = __webpack_require__(8710).charAt; +var toString = __webpack_require__(1340); var InternalStateModule = __webpack_require__(9909); var defineIterator = __webpack_require__(654); @@ -15888,7 +16051,7 @@ var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, - string: String(iterated), + string: toString(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method @@ -15915,6 +16078,7 @@ defineIterator(String, 'String', function (iterated) { var fixRegExpWellKnownSymbolLogic = __webpack_require__(7007); var anObject = __webpack_require__(9670); var toLength = __webpack_require__(7466); +var toString = __webpack_require__(1340); var requireObjectCoercible = __webpack_require__(4488); var advanceStringIndex = __webpack_require__(1530); var regExpExec = __webpack_require__(7651); @@ -15927,16 +16091,16 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa function match(regexp) { var O = requireObjectCoercible(this); var matcher = regexp == undefined ? undefined : regexp[MATCH]; - return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString(O)); }, // `RegExp.prototype[@@match]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@match function (string) { - var res = maybeCallNative(nativeMatch, this, string); - if (res.done) return res.value; - var rx = anObject(this); - var S = String(string); + var S = toString(string); + var res = maybeCallNative(nativeMatch, rx, S); + + if (res.done) return res.value; if (!rx.global) return regExpExec(rx, S); @@ -15946,7 +16110,7 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa var n = 0; var result; while ((result = regExpExec(rx, S)) !== null) { - var matchStr = String(result[0]); + var matchStr = toString(result[0]); A[n] = matchStr; if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); n++; @@ -15982,8 +16146,9 @@ $({ target: 'String', proto: true }, { var fixRegExpWellKnownSymbolLogic = __webpack_require__(7007); var fails = __webpack_require__(7293); var anObject = __webpack_require__(9670); -var toLength = __webpack_require__(7466); var toInteger = __webpack_require__(9958); +var toLength = __webpack_require__(7466); +var toString = __webpack_require__(1340); var requireObjectCoercible = __webpack_require__(4488); var advanceStringIndex = __webpack_require__(1530); var getSubstitution = __webpack_require__(647); @@ -16020,6 +16185,7 @@ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { result.groups = { a: '7' }; return result; }; + // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive return ''.replace(re, '$') !== '7'; }); @@ -16035,25 +16201,25 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; return replacer !== undefined ? replacer.call(searchValue, O, replaceValue) - : nativeReplace.call(String(O), searchValue, replaceValue); + : nativeReplace.call(toString(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function (string, replaceValue) { + var rx = anObject(this); + var S = toString(string); + if ( typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1 && replaceValue.indexOf('$<') === -1 ) { - var res = maybeCallNative(nativeReplace, this, string, replaceValue); + var res = maybeCallNative(nativeReplace, rx, S, replaceValue); if (res.done) return res.value; } - var rx = anObject(this); - var S = String(string); - var functionalReplace = typeof replaceValue === 'function'; - if (!functionalReplace) replaceValue = String(replaceValue); + if (!functionalReplace) replaceValue = toString(replaceValue); var global = rx.global; if (global) { @@ -16068,7 +16234,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa results.push(result); if (!global) break; - var matchStr = String(result[0]); + var matchStr = toString(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); } @@ -16077,7 +16243,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa for (var i = 0; i < results.length; i++) { result = results[i]; - var matched = String(result[0]); + var matched = toString(result[0]); var position = max(min(toInteger(result.index), S.length), 0); var captures = []; // NOTE: This is equivalent to @@ -16090,7 +16256,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa if (functionalReplace) { var replacerArgs = [matched].concat(captures, position, S); if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); - var replacement = String(replaceValue.apply(undefined, replacerArgs)); + var replacement = toString(replaceValue.apply(undefined, replacerArgs)); } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } @@ -16119,6 +16285,7 @@ var requireObjectCoercible = __webpack_require__(4488); var speciesConstructor = __webpack_require__(6707); var advanceStringIndex = __webpack_require__(1530); var toLength = __webpack_require__(7466); +var toString = __webpack_require__(1340); var callRegExpExec = __webpack_require__(7651); var regexpExec = __webpack_require__(2261); var stickyHelpers = __webpack_require__(2999); @@ -16149,13 +16316,13 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa 'test'.split(/(?:)/, -1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || - // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing + // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing '.'.split(/()()/).length > 1 || ''.split(/.?/).length ) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { - var string = String(requireObjectCoercible(this)); + var string = toString(requireObjectCoercible(this)); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (separator === undefined) return [string]; @@ -16203,7 +16370,7 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa var splitter = separator == undefined ? undefined : separator[SPLIT]; return splitter !== undefined ? splitter.call(separator, O, limit) - : internalSplit.call(String(O), separator, limit); + : internalSplit.call(toString(O), separator, limit); }, // `RegExp.prototype[@@split]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@split @@ -16211,11 +16378,12 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. function (string, limit) { - var res = maybeCallNative(internalSplit, this, string, limit, internalSplit !== nativeSplit); + var rx = anObject(this); + var S = toString(string); + var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit); + if (res.done) return res.value; - var rx = anObject(this); - var S = String(string); var C = speciesConstructor(rx, RegExp); var unicodeMatching = rx.unicode; @@ -16362,15 +16530,16 @@ var getBuiltIn = __webpack_require__(5005); var IS_PURE = __webpack_require__(1913); var DESCRIPTORS = __webpack_require__(9781); var NATIVE_SYMBOL = __webpack_require__(133); -var USE_SYMBOL_AS_UID = __webpack_require__(3307); var fails = __webpack_require__(7293); var has = __webpack_require__(6656); var isArray = __webpack_require__(3157); var isObject = __webpack_require__(111); +var isSymbol = __webpack_require__(2190); var anObject = __webpack_require__(9670); var toObject = __webpack_require__(7908); var toIndexedObject = __webpack_require__(5656); -var toPrimitive = __webpack_require__(7593); +var toPropertyKey = __webpack_require__(4948); +var $toString = __webpack_require__(1340); var createPropertyDescriptor = __webpack_require__(9114); var nativeObjectCreate = __webpack_require__(30); var objectKeys = __webpack_require__(1956); @@ -16440,16 +16609,10 @@ var wrap = function (tag, description) { return symbol; }; -var isSymbol = USE_SYMBOL_AS_UID ? function (it) { - return typeof it == 'symbol'; -} : function (it) { - return Object(it) instanceof $Symbol; -}; - var $defineProperty = function defineProperty(O, P, Attributes) { if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); anObject(O); - var key = toPrimitive(P, true); + var key = toPropertyKey(P); anObject(Attributes); if (has(AllSymbols, key)) { if (!Attributes.enumerable) { @@ -16477,7 +16640,7 @@ var $create = function create(O, Properties) { }; var $propertyIsEnumerable = function propertyIsEnumerable(V) { - var P = toPrimitive(V, true); + var P = toPropertyKey(V); var enumerable = nativePropertyIsEnumerable.call(this, P); if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; @@ -16485,7 +16648,7 @@ var $propertyIsEnumerable = function propertyIsEnumerable(V) { var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject(O); - var key = toPrimitive(P, true); + var key = toPropertyKey(P); if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; var descriptor = nativeGetOwnPropertyDescriptor(it, key); if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { @@ -16520,7 +16683,7 @@ var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { if (!NATIVE_SYMBOL) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); - var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); + var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]); var tag = uid(description); var setter = function (value) { if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value); @@ -16575,7 +16738,7 @@ $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { // `Symbol.for` method // https://tc39.es/ecma262/#sec-symbol.for 'for': function (key) { - var string = String(key); + var string = $toString(key); if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; var symbol = $Symbol(string); StringToSymbolRegistry[string] = symbol; @@ -16735,7 +16898,7 @@ for (var COLLECTION_NAME in DOMIterables) { /***/ 7856: /***/ (function(module) { -/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */ +/*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */ (function (global, factory) { true ? module.exports = factory() : @@ -16985,7 +17148,7 @@ for (var COLLECTION_NAME in DOMIterables) { * Version label, exposed for easier checks * if DOMPurify is up to date or not */ - DOMPurify.version = '2.2.9'; + DOMPurify.version = '2.3.1'; /** * Array of elements that DOMPurify removed during sanitation. @@ -17043,7 +17206,8 @@ for (var COLLECTION_NAME in DOMIterables) { var _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, - createDocumentFragment = _document.createDocumentFragment; + createDocumentFragment = _document.createDocumentFragment, + getElementsByTagName = _document.getElementsByTagName; var importNode = originalDocument.importNode; @@ -17150,7 +17314,8 @@ for (var COLLECTION_NAME in DOMIterables) { var USE_PROFILES = {}; /* Tags to ignore content of when KEEP_CONTENT is true */ - var FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']); + var FORBID_CONTENTS = null; + var DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']); /* Tags that are safe for data: URIs */ var DATA_URI_TAGS = null; @@ -17158,7 +17323,7 @@ for (var COLLECTION_NAME in DOMIterables) { /* Attributes safe for values like "javascript:" */ var URI_SAFE_ATTRIBUTES = null; - var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']); + var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']); var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; @@ -17199,6 +17364,7 @@ for (var COLLECTION_NAME in DOMIterables) { ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR; URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES; DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS; + FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS) : DEFAULT_FORBID_CONTENTS; FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {}; FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {}; USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false; @@ -17274,6 +17440,14 @@ for (var COLLECTION_NAME in DOMIterables) { addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR); } + if (cfg.FORBID_CONTENTS) { + if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { + FORBID_CONTENTS = clone(FORBID_CONTENTS); + } + + addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS); + } + /* Add #text in case KEEP_CONTENT is set to true */ if (KEEP_CONTENT) { ALLOWED_TAGS['#text'] = true; @@ -17505,6 +17679,10 @@ for (var COLLECTION_NAME in DOMIterables) { } /* Work on whole document or just its body */ + if (NAMESPACE === HTML_NAMESPACE) { + return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; + } + return WHOLE_DOCUMENT ? doc.documentElement : body; }; @@ -17607,6 +17785,12 @@ for (var COLLECTION_NAME in DOMIterables) { return true; } + /* Mitigate a problem with templates inside select */ + if (tagName === 'select' && regExpTest(/