From 3ea3c6921fe27257dc35820060ea9b8adcce5832 Mon Sep 17 00:00:00 2001 From: Derek Date: Mon, 25 Apr 2022 14:18:00 -0500 Subject: [PATCH] fix: wrap document.querySelectorAll in try/catch. replace escapeValue with CSS.escape ala cssesc --- dist/optimal-select.js | 639 ++++++++++++++++++++------------- dist/optimal-select.min.js | 2 +- dist/optimal-select.min.js.map | 2 +- package.json | 1 + src/optimize.js | 69 +++- src/utilities.js | 5 +- 6 files changed, 451 insertions(+), 267 deletions(-) diff --git a/dist/optimal-select.js b/dist/optimal-select.js index 7bfc617..a42296b 100644 --- a/dist/optimal-select.js +++ b/dist/optimal-select.js @@ -16,9 +16,9 @@ return /******/ (function(modules) { // webpackBootstrap /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) +/******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; -/******/ +/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, @@ -78,7 +78,7 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ([ /* 0 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -94,6 +94,8 @@ exports.escapeValue = escapeValue; * Convenience helpers. */ +var cssesc = __webpack_require__(5); + /** * Create an array with the DOM nodes of the list * @@ -119,12 +121,12 @@ function convertNodeList(nodes) { * @return {String} - [description] */ function escapeValue(value) { - return value && value.replace(/['"`\\/:\?&!#$%^()[\]{|}*+;,.<=>@~]/g, '\\$&').replace(/\n/g, '\A'); + return value && cssesc(value); } -/***/ }, +/***/ }), /* 1 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -243,43 +245,41 @@ function getCommonProperties(elements) { // ~ attributes if (commonAttributes !== undefined) { - (function () { - var elementAttributes = element.attributes; - var attributes = Object.keys(elementAttributes).reduce(function (attributes, key) { - var attribute = elementAttributes[key]; - var attributeName = attribute.name; - // NOTE: workaround detection for non-standard phantomjs NamedNodeMap behaviour - // (issue: https://github.com/ariya/phantomjs/issues/14634) - if (attribute && attributeName !== 'class') { - attributes[attributeName] = attribute.value; - } - return attributes; - }, {}); + var elementAttributes = element.attributes; + var attributes = Object.keys(elementAttributes).reduce(function (attributes, key) { + var attribute = elementAttributes[key]; + var attributeName = attribute.name; + // NOTE: workaround detection for non-standard phantomjs NamedNodeMap behaviour + // (issue: https://github.com/ariya/phantomjs/issues/14634) + if (attribute && attributeName !== 'class') { + attributes[attributeName] = attribute.value; + } + return attributes; + }, {}); - var attributesNames = Object.keys(attributes); - var commonAttributesNames = Object.keys(commonAttributes); + var attributesNames = Object.keys(attributes); + var commonAttributesNames = Object.keys(commonAttributes); - if (attributesNames.length) { - if (!commonAttributesNames.length) { - commonProperties.attributes = attributes; - } else { - commonAttributes = commonAttributesNames.reduce(function (nextCommonAttributes, name) { - var value = commonAttributes[name]; - if (value === attributes[name]) { - nextCommonAttributes[name] = value; - } - return nextCommonAttributes; - }, {}); - if (Object.keys(commonAttributes).length) { - commonProperties.attributes = commonAttributes; - } else { - delete commonProperties.attributes; + if (attributesNames.length) { + if (!commonAttributesNames.length) { + commonProperties.attributes = attributes; + } else { + commonAttributes = commonAttributesNames.reduce(function (nextCommonAttributes, name) { + var value = commonAttributes[name]; + if (value === attributes[name]) { + nextCommonAttributes[name] = value; } + return nextCommonAttributes; + }, {}); + if (Object.keys(commonAttributes).length) { + commonProperties.attributes = commonAttributes; + } else { + delete commonProperties.attributes; } - } else { - delete commonProperties.attributes; } - })(); + } else { + delete commonProperties.attributes; + } } // ~ tag @@ -296,9 +296,9 @@ function getCommonProperties(elements) { return commonProperties; } -/***/ }, +/***/ }), /* 2 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -362,7 +362,12 @@ function optimize(selector, elements) { var postPart = shortened.join(' '); var pattern = prePart + ' ' + postPart; - var matches = document.querySelectorAll(pattern); + var matches = []; + try { + matches = document.querySelectorAll(pattern); + } catch (err) { + // + } if (matches.length !== elements.length) { shortened.unshift(optimizePart(prePart, current, postPart, elements)); } @@ -398,12 +403,22 @@ function optimizePart(prePart, current, postPart, elements) { if (/\[*\]/.test(current)) { var key = current.replace(/=.*$/, ']'); var pattern = '' + prePart + key + postPart; - var matches = document.querySelectorAll(pattern); + var matches = []; + try { + matches = document.querySelectorAll(pattern); + } catch (err) { + // + } if (compareResults(matches, elements)) { current = key; } else { // robustness: replace specific key-value with base tag (heuristic) - var references = document.querySelectorAll('' + prePart + key); + var references = []; + try { + references = document.querySelectorAll('' + prePart + key); + } catch (err) { + // + } var _loop = function _loop() { var reference = references[i]; @@ -412,9 +427,14 @@ function optimizePart(prePart, current, postPart, elements) { })) { var description = reference.tagName.toLowerCase(); pattern = '' + prePart + description + postPart; - matches = document.querySelectorAll(pattern); - if (compareResults(matches, elements)) { + var _matches = []; + try { + _matches = document.querySelectorAll(pattern); + } catch (err) { + // + } + if (compareResults(_matches, elements)) { current = description; } return 'break'; @@ -423,7 +443,6 @@ function optimizePart(prePart, current, postPart, elements) { for (var i = 0, l = references.length; i < l; i++) { var pattern; - var matches; var _ret = _loop(); @@ -436,8 +455,13 @@ function optimizePart(prePart, current, postPart, elements) { if (/>/.test(current)) { var descendant = current.replace(/>/, ''); var pattern = '' + prePart + descendant + postPart; - var matches = document.querySelectorAll(pattern); - if (compareResults(matches, elements)) { + var _matches2 = []; + try { + _matches2 = document.querySelectorAll(pattern); + } catch (err) { + // + } + if (compareResults(_matches2, elements)) { current = descendant; } } @@ -447,8 +471,13 @@ function optimizePart(prePart, current, postPart, elements) { // TODO: consider complete coverage of 'nth-of-type' replacement var type = current.replace(/nth-child/g, 'nth-of-type'); var pattern = '' + prePart + type + postPart; - var matches = document.querySelectorAll(pattern); - if (compareResults(matches, elements)) { + var _matches3 = []; + try { + _matches3 = document.querySelectorAll(pattern); + } catch (err) { + // + } + if (compareResults(_matches3, elements)) { current = type; } } @@ -462,12 +491,21 @@ function optimizePart(prePart, current, postPart, elements) { }); while (names.length) { var partial = current.replace(names.shift(), '').trim(); + if (partial.charAt(0) === '>' || partial.charAt(partial.length - 1) === '>') { + break; + } var pattern = ('' + prePart + partial + postPart).trim(); if (!pattern.length || pattern.charAt(0) === '>' || pattern.charAt(pattern.length - 1) === '>') { break; } - var matches = document.querySelectorAll(pattern); - if (compareResults(matches, elements)) { + var _matches4 = []; + + try { + _matches4 = document.querySelectorAll(pattern); + } catch (err) { + // + } + if (compareResults(_matches4, elements)) { current = partial; } } @@ -475,7 +513,12 @@ function optimizePart(prePart, current, postPart, elements) { // robustness: degrade complex classname (heuristic) names = current && current.match(/\./g); if (names && names.length > 2) { - var _references = document.querySelectorAll('' + prePart + current); + var _references = []; + try { + _references = document.querySelectorAll('' + prePart + current); + } catch (err) { + // + } var _loop2 = function _loop2() { var reference = _references[i]; @@ -486,9 +529,14 @@ function optimizePart(prePart, current, postPart, elements) { // - check using attributes + regard excludes var description = reference.tagName.toLowerCase(); pattern = '' + prePart + description + postPart; - matches = document.querySelectorAll(pattern); - if (compareResults(matches, elements)) { + var _matches5 = []; + try { + _matches5 = document.querySelectorAll(pattern); + } catch (err) { + // + } + if (compareResults(_matches5, elements)) { current = description; } return 'break'; @@ -497,7 +545,6 @@ function optimizePart(prePart, current, postPart, elements) { for (var i = 0, l = _references.length; i < l; i++) { var pattern; - var matches; var _ret2 = _loop2(); @@ -530,9 +577,9 @@ function compareResults(matches, elements) { } module.exports = exports['default']; -/***/ }, +/***/ }), /* 3 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -541,8 +588,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); exports.default = adapt; @@ -719,147 +764,121 @@ function getInstructions(selectors) { var validate = null; var instruction = null; - (function () { - switch (true) { + switch (true) { - // child: '>' - case />/.test(type): - instruction = function checkParent(node) { - return function (validate) { - return validate(node.parent) && node.parent; - }; - }; - break; - - // class: '.' - case /^\./.test(type): - var names = type.substr(1).split('.'); - validate = function validate(node) { - var nodeClassName = node.attribs.class; - return nodeClassName && names.every(function (name) { - return nodeClassName.indexOf(name) > -1; - }); + // child: '>' + case />/.test(type): + instruction = function checkParent(node) { + return function (validate) { + return validate(node.parent) && node.parent; }; - instruction = function checkClass(node, root) { - if (discover) { - return node.getElementsByClassName(names.join(' ')); + }; + break; + + // class: '.' + case /^\./.test(type): + var names = type.substr(1).split('.'); + validate = function validate(node) { + var nodeClassName = node.attribs.class; + return nodeClassName && names.every(function (name) { + return nodeClassName.indexOf(name) > -1; + }); + }; + instruction = function checkClass(node, root) { + if (discover) { + return node.getElementsByClassName(names.join(' ')); + } + return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); + }; + break; + + // attribute: '[key="value"]' + case /^\[/.test(type): + var _type$replace$split = type.replace(/\[|\]|"/g, '').split('='), + _type$replace$split2 = _slicedToArray(_type$replace$split, 2), + attributeKey = _type$replace$split2[0], + attributeValue = _type$replace$split2[1]; + + validate = function validate(node) { + var hasAttribute = Object.keys(node.attribs).indexOf(attributeKey) > -1; + if (hasAttribute) { + // regard optional attributeValue + if (!attributeValue || node.attribs[attributeKey] === attributeValue) { + return true; } - return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); - }; - break; - - // attribute: '[key="value"]' - case /^\[/.test(type): - var _type$replace$split = type.replace(/\[|\]|"/g, '').split('='), - _type$replace$split2 = _slicedToArray(_type$replace$split, 2), - attributeKey = _type$replace$split2[0], - attributeValue = _type$replace$split2[1]; - - validate = function validate(node) { - var hasAttribute = Object.keys(node.attribs).indexOf(attributeKey) > -1; - if (hasAttribute) { - // regard optional attributeValue - if (!attributeValue || node.attribs[attributeKey] === attributeValue) { - return true; + } + return false; + }; + instruction = function checkAttribute(node, root) { + if (discover) { + var NodeList = []; + traverseDescendants([node], function (descendant) { + if (validate(descendant)) { + NodeList.push(descendant); } - } - return false; - }; - instruction = function checkAttribute(node, root) { - if (discover) { - var _ret2 = function () { - var NodeList = []; - traverseDescendants([node], function (descendant) { - if (validate(descendant)) { - NodeList.push(descendant); - } - }); - return { - v: NodeList - }; - }(); - - if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; - } - return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); - }; - break; + }); + return NodeList; + } + return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); + }; + break; - // id: '#' - case /^#/.test(type): - var id = type.substr(1); - validate = function validate(node) { - return node.attribs.id === id; - }; - instruction = function checkId(node, root) { - if (discover) { - var _ret3 = function () { - var NodeList = []; - traverseDescendants([node], function (descendant, done) { - if (validate(descendant)) { - NodeList.push(descendant); - done(); - } - }); - return { - v: NodeList - }; - }(); - - if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === "object") return _ret3.v; - } - return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); - }; - break; + // id: '#' + case /^#/.test(type): + var id = type.substr(1); + validate = function validate(node) { + return node.attribs.id === id; + }; + instruction = function checkId(node, root) { + if (discover) { + var NodeList = []; + traverseDescendants([node], function (descendant, done) { + if (validate(descendant)) { + NodeList.push(descendant); + done(); + } + }); + return NodeList; + } + return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); + }; + break; - // universal: '*' - case /\*/.test(type): - validate = function validate(node) { - return true; - }; - instruction = function checkUniversal(node, root) { - if (discover) { - var _ret4 = function () { - var NodeList = []; - traverseDescendants([node], function (descendant) { - return NodeList.push(descendant); - }); - return { - v: NodeList - }; - }(); - - if ((typeof _ret4 === 'undefined' ? 'undefined' : _typeof(_ret4)) === "object") return _ret4.v; - } - return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); - }; - break; + // universal: '*' + case /\*/.test(type): + validate = function validate(node) { + return true; + }; + instruction = function checkUniversal(node, root) { + if (discover) { + var NodeList = []; + traverseDescendants([node], function (descendant) { + return NodeList.push(descendant); + }); + return NodeList; + } + return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); + }; + break; - // tag: '...' - default: - validate = function validate(node) { - return node.name === type; - }; - instruction = function checkTag(node, root) { - if (discover) { - var _ret5 = function () { - var NodeList = []; - traverseDescendants([node], function (descendant) { - if (validate(descendant)) { - NodeList.push(descendant); - } - }); - return { - v: NodeList - }; - }(); - - if ((typeof _ret5 === 'undefined' ? 'undefined' : _typeof(_ret5)) === "object") return _ret5.v; - } - return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); - }; - } - })(); + // tag: '...' + default: + validate = function validate(node) { + return node.name === type; + }; + instruction = function checkTag(node, root) { + if (discover) { + var NodeList = []; + traverseDescendants([node], function (descendant) { + if (validate(descendant)) { + NodeList.push(descendant); + } + }); + return NodeList; + } + return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate); + }; + } if (!pseudo) { return instruction; @@ -940,9 +959,9 @@ function getAncestor(node, root, validate) { } module.exports = exports['default']; -/***/ }, +/***/ }), /* 4 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -966,7 +985,7 @@ var _adapt = __webpack_require__(3); var _adapt2 = _interopRequireDefault(_adapt); -var _match = __webpack_require__(5); +var _match = __webpack_require__(7); var _match2 = _interopRequireDefault(_match); @@ -1124,9 +1143,171 @@ function getQuerySelector(input) { return getSingleSelector(input, options); } -/***/ }, +/***/ }), /* 5 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! https://mths.be/cssesc v3.0.0 by @mathias */ + + +var object = {}; +var hasOwnProperty = object.hasOwnProperty; +var merge = function merge(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since + // only recognized option names are used. + result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; + } + return result; +}; + +var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; +var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; +var regexAlwaysEscape = /['"\\]/; +var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + +// https://mathiasbynens.be/notes/css-escapes#css +var cssesc = function cssesc(string, options) { + options = merge(options, cssesc.options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var isIdentifier = options.isIdentifier; + + var firstChar = string.charAt(0); + var output = ''; + var counter = 0; + var length = string.length; + while (counter < length) { + var character = string.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + // If it’s not a printable ASCII character… + if (codePoint < 0x20 || codePoint > 0x7E) { + if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { + // It’s a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // next character is low surrogate + codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000; + } else { + // It’s an unmatched surrogate; only append this code unit, in case + // the next code unit is the high surrogate of a surrogate pair. + counter--; + } + } + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = '\\' + character; + } else { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = '\\' + character; + } else { + value = character; + } + } + output += value; + } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } + + // Remove spaces after `\HEX` escapes that are not followed by a hex digit, + // since they’re redundant. Note that this is only possible if the escape + // sequence isn’t preceded by an odd number of backslashes. + output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { + if ($1 && $1.length % 2) { + // It’s not safe to remove the space, so don’t. + return $0; + } + // Strip the space. + return ($1 || '') + $2; + }); + + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; +}; + +// Expose default options (so they can be overridden globally). +cssesc.options = { + 'escapeEverything': false, + 'isIdentifier': false, + 'quotes': 'single', + 'wrap': false +}; + +cssesc.version = '3.0.0'; + +module.exports = cssesc; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.common = exports.optimize = exports.getMultiSelector = exports.getSingleSelector = exports.select = undefined; + +var _select2 = __webpack_require__(4); + +Object.defineProperty(exports, 'getSingleSelector', { + enumerable: true, + get: function get() { + return _select2.getSingleSelector; + } +}); +Object.defineProperty(exports, 'getMultiSelector', { + enumerable: true, + get: function get() { + return _select2.getMultiSelector; + } +}); + +var _select3 = _interopRequireDefault(_select2); + +var _optimize2 = __webpack_require__(2); + +var _optimize3 = _interopRequireDefault(_optimize2); + +var _common2 = __webpack_require__(1); + +var _common = _interopRequireWildcard(_common2); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.select = _select3.default; +exports.optimize = _optimize3.default; +exports.common = _common; +exports.default = _select3.default; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1210,12 +1391,10 @@ function match(node, options) { }); if (ignoreClass) { - (function () { - var ignoreAttribute = ignore.attribute; - ignore.attribute = function (name, value, defaultPredicate) { - return ignore.class(value) || ignoreAttribute && ignoreAttribute(name, value, defaultPredicate); - }; - })(); + var ignoreAttribute = ignore.attribute; + ignore.attribute = function (name, value, defaultPredicate) { + return ignore.class(value) || ignoreAttribute && ignoreAttribute(name, value, defaultPredicate); + }; } while (element !== root) { @@ -1429,53 +1608,7 @@ function checkIgnore(predicate, name, value, defaultPredicate) { } module.exports = exports['default']; -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.common = exports.optimize = exports.getMultiSelector = exports.getSingleSelector = exports.select = undefined; - -var _select2 = __webpack_require__(4); - -Object.defineProperty(exports, 'getSingleSelector', { - enumerable: true, - get: function get() { - return _select2.getSingleSelector; - } -}); -Object.defineProperty(exports, 'getMultiSelector', { - enumerable: true, - get: function get() { - return _select2.getMultiSelector; - } -}); - -var _select3 = _interopRequireDefault(_select2); - -var _optimize2 = __webpack_require__(2); - -var _optimize3 = _interopRequireDefault(_optimize2); - -var _common2 = __webpack_require__(1); - -var _common = _interopRequireWildcard(_common2); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.select = _select3.default; -exports.optimize = _optimize3.default; -exports.common = _common; -exports.default = _select3.default; - -/***/ } +/***/ }) /******/ ]); }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCA5M2VkNzA3Y2JlZmZjYTkzMzI2OSIsIndlYnBhY2s6Ly8vLi9zcmMvdXRpbGl0aWVzLmpzIiwid2VicGFjazovLy8uL3NyYy9jb21tb24uanMiLCJ3ZWJwYWNrOi8vLy4vc3JjL29wdGltaXplLmpzIiwid2VicGFjazovLy8uL3NyYy9hZGFwdC5qcyIsIndlYnBhY2s6Ly8vLi9zcmMvc2VsZWN0LmpzIiwid2VicGFjazovLy8uL3NyYy9tYXRjaC5qcyIsIndlYnBhY2s6Ly8vLi9zcmMvaW5kZXguanMiXSwibmFtZXMiOlsiY29udmVydE5vZGVMaXN0IiwiZXNjYXBlVmFsdWUiLCJub2RlcyIsImxlbmd0aCIsImFyciIsIkFycmF5IiwiaSIsInZhbHVlIiwicmVwbGFjZSIsImdldENvbW1vbkFuY2VzdG9yIiwiZ2V0Q29tbW9uUHJvcGVydGllcyIsImVsZW1lbnRzIiwib3B0aW9ucyIsInJvb3QiLCJkb2N1bWVudCIsImFuY2VzdG9ycyIsImZvckVhY2giLCJlbGVtZW50IiwiaW5kZXgiLCJwYXJlbnRzIiwicGFyZW50Tm9kZSIsInVuc2hpZnQiLCJzb3J0IiwiY3VyciIsIm5leHQiLCJzaGFsbG93QW5jZXN0b3IiLCJzaGlmdCIsImFuY2VzdG9yIiwicGFyZW50IiwibWlzc2luZyIsInNvbWUiLCJvdGhlclBhcmVudHMiLCJvdGhlclBhcmVudCIsImwiLCJjb21tb25Qcm9wZXJ0aWVzIiwiY2xhc3NlcyIsImF0dHJpYn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ICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGZhbHNlXG4gICAgICAgIH1cbiAgICAgICAgaW5zdHJ1Y3Rpb24gPSBmdW5jdGlvbiBjaGVja0F0dHJpYnV0ZSAobm9kZSwgcm9vdCkge1xuICAgICAgICAgIGlmIChkaXNjb3Zlcikge1xuICAgICAgICAgICAgY29uc3QgTm9kZUxpc3QgPSBbXVxuICAgICAgICAgICAgdHJhdmVyc2VEZXNjZW5kYW50cyhbbm9kZV0sIChkZXNjZW5kYW50KSA9PiB7XG4gICAgICAgICAgICAgIGlmICh2YWxpZGF0ZShkZXNjZW5kYW50KSkge1xuICAgICAgICAgICAgICAgIE5vZGVMaXN0LnB1c2goZGVzY2VuZGFudClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIHJldHVybiBOb2RlTGlzdFxuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gKHR5cGVvZiBub2RlID09PSAnZnVuY3Rpb24nKSA/IG5vZGUodmFsaWRhdGUpIDogZ2V0QW5jZXN0b3Iobm9kZSwgcm9vdCwgdmFsaWRhdGUpXG4gICAgICAgIH1cbiAgICAgICAgYnJlYWtcblxuICAgICAgLy8gaWQ6ICcjJ1xuICAgICAgY2FzZSAvXiMvLnRlc3QodHlwZSk6XG4gICAgICAgIGNvbnN0IGlkID0gdHlwZS5zdWJzdHIoMSlcbiAgICAgICAgdmFsaWRhdGUgPSAobm9kZSkgPT4ge1xuICAgICAgICAgIHJldHVybiBub2RlLmF0dHJpYnMuaWQgPT09IGlkXG4gICAgICAgIH1cbiAgICAgICAgaW5zdHJ1Y3Rpb24gPSBmdW5jdGlvbiBjaGVja0lkIChub2RlLCByb290KSB7XG4gICAgICAgICAgaWYgKGRpc2NvdmVyKSB7XG4gICAgICAgICAgICBjb25zdCBOb2RlTGlzdCA9IFtdXG4gICAgICAgICAgICB0cmF2ZXJzZURlc2NlbmRhbnRzKFtub2RlXSwgKGRlc2NlbmRhbnQsIGRvbmUpID0+IHtcbiAgICAgICAgICAgICAgaWYgKHZhbGlkYXRlKGRlc2NlbmRhbnQpKSB7XG4gICAgICAgICAgICAgICAgTm9kZUxpc3QucHVzaChkZXNjZW5kYW50KVxuICAgICAgICAgICAgICAgIGRvbmUoKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgcmV0dXJuIE5vZGVMaXN0XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiAodHlwZW9mIG5vZGUgPT09ICdmdW5jdGlvbicpID8gbm9kZSh2YWxpZGF0ZSkgOiBnZXRBbmNlc3Rvcihub2RlLCByb290LCB2YWxpZGF0ZSlcbiAgICAgICAgfVxuICAgICAgICBicmVha1xuXG4gICAgICAvLyB1bml2ZXJzYWw6ICcqJ1xuICAgICAgY2FzZSAvXFwqLy50ZXN0KHR5cGUpOlxuICAgICAgICB2YWxpZGF0ZSA9IChub2RlKSA9PiB0cnVlXG4gICAgICAgIGluc3RydWN0aW9uID0gZnVuY3Rpb24gY2hlY2tVbml2ZXJzYWwgKG5vZGUsIHJvb3QpIHtcbiAgICAgICAgICBpZiAoZGlzY292ZXIpIHtcbiAgICAgICAgICAgIGNvbnN0IE5vZGVMaXN0ID0gW11cbiAgICAgICAgICAgIHRyYXZlcnNlRGVzY2VuZGFudHMoW25vZGVdLCAoZGVzY2VuZGFudCkgPT4gTm9kZUxpc3QucHVzaChkZXNjZW5kYW50KSlcbiAgICAgICAgICAgIHJldHVybiBOb2RlTGlzdFxuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gKHR5cGVvZiBub2RlID09PSAnZnVuY3Rpb24nKSA/IG5vZGUodmFsaWRhdGUpIDogZ2V0QW5jZXN0b3Iobm9kZSwgcm9vdCwgdmFsaWRhdGUpXG4gICAgICAgIH1cbiAgICAgICAgYnJlYWtcblxuICAgICAgLy8gdGFnOiAnLi4uJ1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgdmFsaWRhdGUgPSAobm9kZSkgPT4ge1xuICAgICAgICAgIHJldHVybiBub2RlLm5hbWUgPT09IHR5cGVcbiAgICAgICAgfVxuICAgICAgICBpbnN0cnVjdGlvbiA9IGZ1bmN0aW9uIGNoZWNrVGFnIChub2RlLCByb290KSB7XG4gICAgICAgICAgaWYgKGRpc2NvdmVyKSB7XG4gICAgICAgICAgICBjb25zdCBOb2RlTGlzdCA9IFtdXG4gICAgICAgICAgICB0cmF2ZXJzZURlc2NlbmRhbnRzKFtub2RlXSwgKGRlc2NlbmRhbnQpID0+IHtcbiAgICAgICAgICAgICAgaWYgKHZhbGlkYXRlKGRlc2NlbmRhbnQpKSB7XG4gICAgICAgICAgICAgICAgTm9kZUxpc3QucHVzaChkZXNjZW5kYW50KVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgcmV0dXJuIE5vZGVMaXN0XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiAodHlwZW9mIG5vZGUgPT09ICdmdW5jdGlvbicpID8gbm9kZSh2YWxpZGF0ZSkgOiBnZXRBbmNlc3Rvcihub2RlLCByb290LCB2YWxpZGF0ZSlcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICghcHNldWRvKSB7XG4gICAgICByZXR1cm4gaW5zdHJ1Y3Rpb25cbiAgICB9XG5cbiAgICBjb25zdCBydWxlID0gcHNldWRvLm1hdGNoKC8tKGNoaWxkfHR5cGUpXFwoKFxcZCspXFwpJC8pXG4gICAgY29uc3Qga2luZCA9IHJ1bGVbMV1cbiAgICBjb25zdCBpbmRleCA9IHBhcnNlSW50KHJ1bGVbMl0sIDEwKSAtIDFcblxuICAgIGNvbnN0IHZhbGlkYXRlUHNldWRvID0gKG5vZGUpID0+IHtcbiAgICAgIGlmIChub2RlKSB7XG4gICAgICAgIHZhciBjb21wYXJlU2V0ID0gbm9kZS5wYXJlbnQuY2hpbGRUYWdzXG4gICAgICAgIGlmIChraW5kID09PSAndHlwZScpIHtcbiAgICAgICAg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xuICAgICAgICAgICAgICAgIE5vZGVMaXN0LnB1c2goZGVzY2VuZGFudClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIHJldHVybiBOb2RlTGlzdFxuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gKHR5cGVvZiBub2RlID09PSAnZnVuY3Rpb24nKSA/IG5vZGUodmFsaWRhdGUpIDogZ2V0QW5jZXN0b3Iobm9kZSwgcm9vdCwgdmFsaWRhdGUpXG4gICAgICAgIH1cbiAgICAgICAgYnJlYWtcblxuICAgICAgLy8gaWQ6ICcjJ1xuICAgICAgY2FzZSAvXiMvLnRlc3QodHlwZSk6XG4gICAgICAgIGNvbnN0IGlkID0gdHlwZS5zdWJzdHIoMSlcbiAgICAgICAgdmFsaWRhdGUgPSAobm9kZSkgPT4ge1xuICAgICAgICAgIHJldHVybiBub2RlLmF0dHJpYnMuaWQgPT09IGlkXG4gICAgICAgIH1cbiAgICAgICAgaW5zdHJ1Y3Rpb24gPSBmdW5jdGlvbiBjaGVja0lkIChub2RlLCByb290KSB7XG4gICAgICAgICAgaWYgKGRpc2NvdmVyKSB7XG4gICAgICAgICAgICBjb25zdCBOb2RlTGlzdCA9IFtdXG4gICAgICAgICAgICB0cmF2ZXJzZURlc2NlbmRhbnRzKFtub2RlXSwgKGRlc2NlbmRhbnQsIGRvbmUpID0+IHtcbiAgICAgICAgICAgICAgaWYgKHZhbGlkYXRlKGRlc2NlbmRhbnQpKSB7XG4gICAgICAgICAgICAgICAgTm9kZUxpc3QucHVzaChkZXNjZW5kYW50KVxuICAgICAgICAgICAgICAgIGRvbmUoKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgcmV0dXJuIE5vZGVMaXN0XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiAodHlwZW9mIG5vZGUgPT09ICdmdW5jdGlvbicpID8gbm9kZSh2YWxpZGF0ZSkgOiBnZXRBbmNlc3Rvc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RhbnQpKSB7XG4gICAgICAgICAgICAgICAgTm9kZUxpc3QucHVzaChkZXNjZW5kYW50KVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgcmV0dXJuIE5vZGVMaXN0XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiAodHlwZW9mIG5vZGUgPT09ICdmdW5jdGlvbicpID8gbm9kZSh2YWxpZGF0ZSkgOiBnZXRBbmNlc3Rvcihub2RlLCByb290LCB2YWxpZGF0ZSlcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICghcHNldWRvKSB7XG4gICAgICByZXR1cm4gaW5zdHJ1Y3Rpb25cbiAgICB9XG5cbiAgICBjb25zdCBydWxlID0gcHNldWRvLm1hdGNoKC8tKGNoaWxkfHR5cGUpXFwoKFxcZCspXFwpJC8pXG4gICAgY29uc3Qga2luZCA9IHJ1bGVbMV1cbiAgICBjb25zdCBpbmRleCA9IHBhcnNlSW50KHJ1bGVbMl0sIDEwKSAtIDFcblxuICAgIGNvbnN0IHZhbGlkYXRlUHNldWRvID0gKG5vZGUpID0+IHtcbiAgICAgIGlmIChub2RlKSB7XG4gICAgICAgIHZhciBjb21wYXJlU2V0ID0gbm9kZS5wYXJlbnQuY2hpbGRUYWdzXG4gICAgICAgIGlmIChraW5kID09PSAndHlwZScpIHtcbiAgICAgICAgICBjb21wYXJlU2V0ID0gY29tcGFyZVNldC5maWx0ZXIodmFsaWRhdGUpXG4gICAgICAgIH1cbiAgICAgICAgY29uc3Qgbm9kZUluZGV4ID0gY29tcGFyZVNldC5maW5kSW5kZXgoKGNoaWxkKSA9PiBjaGlsZCA9PT0gbm9kZSlcbiAgICAgICAgaWYgKG5vZGVJbmRleCA9PT0gaW5kZXgpIHtcbiAgICAgICAgICByZXR1cm4gdHJ1ZVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gZmFsc2VcbiAgICB9XG5cbiAgICByZXR1cm4gZnVuY3Rpb24gZW5oYW5jZ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Rpb24gY2hlY2tJZ25vcmUgKHByZWRpY2F0ZSwgbmFtZSwgdmFsdWUsIGRlZmF1bHRQcmVkaWNhdGUpIHtcbiAgaWYgKCF2YWx1ZSkge1xuICAgIHJldHVybiB0cnVlXG4gIH1cbiAgY29uc3QgY2hlY2sgPSBwcmVkaWNhdGUgfHwgZGVmYXVsdFByZWRpY2F0ZVxuICBpZiAoIWNoZWNrKSB7XG4gICAgcmV0dXJuIGZhbHNlXG4gIH1cbiAgcmV0dXJuIGNoZWNrKG5hbWUsIHZhbHVlLCBkZWZhdWx0UHJlZGljYXRlKVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vc3JjL21hdGNoLmpzIl0sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/dist/optimal-select.min.js b/dist/optimal-select.min.js index baf4430..e10f51c 100644 --- a/dist/optimal-select.min.js +++ b/dist/optimal-select.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OptimalSelect=t():e.OptimalSelect=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,r){"use strict";function n(e){for(var t=e.length,r=new Array(t),n=0;n@~]/g,"\\$&").replace(/\n/g,"A")}Object.defineProperty(t,"__esModule",{value:!0}),t.convertNodeList=n,t.escapeValue=o},function(e,t,r){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.root,n=void 0===r?document:r,o=[];e.forEach(function(e,t){for(var r=[];e!==n;)e=e.parentNode,r.unshift(e);o[t]=r}),o.sort(function(e,t){return e.length-t.length});for(var u=o.shift(),i=null,l=function(){var e=u[a],t=o.some(function(t){return!t.some(function(t){return t===e})});return t?"break":void(i=e)},a=0,c=u.length;a2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(t)||(t=t.length?(0,c.convertNodeList)(t):[t]),!t.length||t.some(function(e){return 1!==e.nodeType}))throw new Error('Invalid input - to compare HTMLElements its necessary to provide a reference of the selected node(s)! (missing "elements")');var n=(0,a.default)(t[0],r),o=e.replace(/> /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(o.length<2)return u("",e,"",t);for(var i=[o.pop()];o.length>1;){var l=o.pop(),f=o.join(" "),s=i.join(" "),d=f+" "+s,p=document.querySelectorAll(d);p.length!==t.length&&i.unshift(u(f,l,s,t))}return i.unshift(o[0]),o=i,o[0]=u("",o[0],o.slice(1).join(" "),t),o[o.length-1]=u(o.slice(0,-1).join(" "),o[o.length-1],"",t),n&&delete!0,o.join(" ").replace(/>/g,"> ").trim()}function u(e,t,r,n){if(e.length&&(e+=" "),r.length&&(r=" "+r),/\[*\]/.test(t)){var o=t.replace(/=.*$/,"]"),u=""+e+o+r,l=document.querySelectorAll(u);if(i(l,n))t=o;else for(var a=document.querySelectorAll(""+e+o),c=function(){var o=a[f];if(n.some(function(e){return o.contains(e)})){var c=o.tagName.toLowerCase();return u=""+e+c+r,l=document.querySelectorAll(u),i(l,n)&&(t=c),"break"}},f=0,s=a.length;f/.test(t)){var p=t.replace(/>/,""),u=""+e+p+r,l=document.querySelectorAll(u);i(l,n)&&(t=p)}if(/:nth-child/.test(t)){var v=t.replace(/nth-child/g,"nth-of-type"),u=""+e+v+r,l=document.querySelectorAll(u);i(l,n)&&(t=v)}if(/\.\S+\.\S+/.test(t)){for(var y=t.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});y.length;){var g=t.replace(y.shift(),"").trim(),u=(""+e+g+r).trim();if(!u.length||">"===u.charAt(0)||">"===u.charAt(u.length-1))break;var l=document.querySelectorAll(u);i(l,n)&&(t=g)}if(y=t&&t.match(/\./g),y&&y.length>2)for(var m=document.querySelectorAll(""+e+t),h=function(){var o=m[f];if(n.some(function(e){return o.contains(e)})){var a=o.tagName.toLowerCase();return u=""+e+a+r,l=document.querySelectorAll(u),i(l,n)&&(t=a),"break"}},f=0,s=m.length;f1&&void 0!==arguments[1]?arguments[1]:{};if(3===e.nodeType&&(e=e.parentNode),1!==e.nodeType)throw new Error('Invalid input - only HTMLElements or representations of them are supported! (not "'+("undefined"==typeof e?"undefined":a(e))+'")');var r=(0,f.default)(e,t),n=(0,d.default)(e,t),o=(0,v.default)(n,e,t);return r&&delete!0,o}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(e)||(e=(0,y.convertNodeList)(e)),e.some(function(e){return 1!==e.nodeType}))throw new Error("Invalid input - only an Array of HTMLElements or representations of them is supported!");var r=(0,f.default)(e[0],t),n=(0,g.getCommonAncestor)(e,t),u=o(n,t),l=i(e),a=l[0],c=(0,v.default)(u+" "+a,e,t),s=(0,y.convertNodeList)(document.querySelectorAll(c));return e.every(function(e){return s.some(function(t){return t===e})})?(r&&delete!0,c):console.warn("\n The selected elements can't be efficiently mapped.\n Its probably best to use multiple single selectors instead!\n ",e)}function i(e){var t=(0,g.getCommonProperties)(e),r=t.classes,n=t.attributes,o=t.tag,u=[];if(o&&u.push(o),r){var i=r.map(function(e){return"."+e}).join("");u.push(i)}if(n){var l=Object.keys(n).reduce(function(e,t){return e.push("["+t+'="'+n[t]+'"]'),e},[]).join("");u.push(l)}return u.length,[u.join("")]}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.length&&!e.name?u(e,t):o(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getSingleSelector=o,t.getMultiSelector=u,t.default=l;var c=r(3),f=n(c),s=r(5),d=n(s),p=r(2),v=n(p),y=r(0),g=r(1)},function(e,t,r){"use strict";function n(e,t){var r=t.root,n=void 0===r?document:r,u=t.skip,l=void 0===u?null:u,f=t.priority,d=void 0===f?["id","class","href","src"]:f,p=t.ignore,v=void 0===p?{}:p,y=[],g=e,m=y.length,h=!1,b=l&&(Array.isArray(l)?l:[l]).map(function(e){return"function"!=typeof e?function(t){return t===e}:e}),S=function(e){return l&&b.some(function(t){return t(e)})};for(Object.keys(v).forEach(function(e){"class"===e&&(h=!0);var t=v[e];"function"!=typeof t&&("number"==typeof t&&(t=t.toString()),"string"==typeof t&&(t=new RegExp((0,s.escapeValue)(t).replace(/\\/g,"\\\\"))),"boolean"==typeof t&&(t=t?/(?:)/:/.^/),v[e]=function(e,r){return t.test(r)})}),h&&!function(){var e=v.attribute;v.attribute=function(t,r,n){return v.class(r)||e&&e(t,r,n)}}();g!==n;){if(S(g)!==!0){if(o(d,g,v,y,n))break;if(i(g,v,y,n))break;o(d,g,v,y),y.length===m&&i(g,v,y),y.length===m&&a(d,g,v,y)}g=g.parentNode,m=y.length}if(g===n){var j=c(d,g,v);y.unshift(j)}return y.join(" ")}function o(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.parentNode,i=u(e,t,r);if(i){var l=o.querySelectorAll(i);if(1===l.length)return n.unshift(i),!0}return!1}function u(e,t,r){for(var n=t.attributes,o=Object.keys(n).sort(function(t,r){var o=e.indexOf(n[t].name),u=e.indexOf(n[r].name);return u===-1?o===-1?0:-1:o===-1?1:o-u}),u=0,i=o.length;u3&&void 0!==arguments[3]?arguments[3]:e.parentNode,o=l(e,t);if(o){var u=n.getElementsByTagName(o);if(1===u.length)return r.unshift(o),!0}return!1}function l(e,t){var r=e.tagName.toLowerCase();return f(t.tag,null,r)?null:r}function a(e,t,r,n){for(var o=t.parentNode,u=o.childTags||o.children,i=0,l=u.length;i-1}};e.exports=t.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.common=t.optimize=t.getMultiSelector=t.getSingleSelector=t.select=void 0;var u=r(4);Object.defineProperty(t,"getSingleSelector",{enumerable:!0,get:function(){return u.getSingleSelector}}),Object.defineProperty(t,"getMultiSelector",{enumerable:!0,get:function(){return u.getMultiSelector}});var i=o(u),l=r(2),a=o(l),c=r(1),f=n(c);t.select=i.default,t.optimize=a.default,t.common=f,t.default=i.default}])}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OptimalSelect=t():e.OptimalSelect=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,r){"use strict";function n(e){for(var t=e.length,r=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=t.root,n=void 0===r?document:r,o=[];e.forEach(function(e,t){for(var r=[];e!==n;)e=e.parentNode,r.unshift(e);o[t]=r}),o.sort(function(e,t){return e.length-t.length});for(var u=o.shift(),i=null,a=0,l=u.length;a2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(t)||(t=t.length?(0,l.convertNodeList)(t):[t]),!t.length||t.some(function(e){return 1!==e.nodeType}))throw new Error('Invalid input - to compare HTMLElements its necessary to provide a reference of the selected node(s)! (missing "elements")');var n=((0,a.default)(t[0],r),e.replace(/> /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/));if(n.length<2)return o("",e,"",t);for(var u=[n.pop()];n.length>1;){var i=n.pop(),c=n.join(" "),f=u.join(" "),s=c+" "+f,d=[];try{d=document.querySelectorAll(s)}catch(e){}d.length!==t.length&&u.unshift(o(c,i,f,t))}return u.unshift(n[0]),n=u,n[0]=o("",n[0],n.slice(1).join(" "),t),n[n.length-1]=o(n.slice(0,-1).join(" "),n[n.length-1],"",t),n.join(" ").replace(/>/g,"> ").trim()}function o(e,t,r,n){if(e.length&&(e+=" "),r.length&&(r=" "+r),/\[*\]/.test(t)){var o=t.replace(/=.*$/,"]"),i=""+e+o+r,a=[];try{a=document.querySelectorAll(i)}catch(e){}if(u(a,n))t=o;else{var l=[];try{l=document.querySelectorAll(""+e+o)}catch(e){}for(var c=0,f=l.length;c/.test(t)){var s=t.replace(/>/,""),i=""+e+s+r,d=[];try{d=document.querySelectorAll(i)}catch(e){}u(d,n)&&(t=s)}if(/:nth-child/.test(t)){var v=t.replace(/nth-child/g,"nth-of-type"),i=""+e+v+r,p=[];try{p=document.querySelectorAll(i)}catch(e){}u(p,n)&&(t=v)}if(/\.\S+\.\S+/.test(t)){for(var h=t.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});h.length;){var g=t.replace(h.shift(),"").trim();if(">"===g.charAt(0)||">"===g.charAt(g.length-1))break;var i=(""+e+g+r).trim();if(!i.length||">"===i.charAt(0)||">"===i.charAt(i.length-1))break;var y=[];try{y=document.querySelectorAll(i)}catch(e){}u(y,n)&&(t=g)}if((h=t&&t.match(/\./g))&&h.length>2){var m=[];try{m=document.querySelectorAll(""+e+t)}catch(e){}for(var c=0,f=m.length;c1&&void 0!==arguments[1]?arguments[1]:{};if(3===e.nodeType&&(e=e.parentNode),1!==e.nodeType)throw new Error('Invalid input - only HTMLElements or representations of them are supported! (not "'+(void 0===e?"undefined":l(e))+'")');var r=((0,f.default)(e,t),(0,d.default)(e,t));return(0,p.default)(r,e,t)}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(e)||(e=(0,h.convertNodeList)(e)),e.some(function(e){return 1!==e.nodeType}))throw new Error("Invalid input - only an Array of HTMLElements or representations of them is supported!");var r=((0,f.default)(e[0],t),(0,g.getCommonAncestor)(e,t)),n=o(r,t),u=i(e),a=u[0],l=(0,p.default)(n+" "+a,e,t),c=(0,h.convertNodeList)(document.querySelectorAll(l));return e.every(function(e){return c.some(function(t){return t===e})})?l:console.warn("\n The selected elements can't be efficiently mapped.\n Its probably best to use multiple single selectors instead!\n ",e)}function i(e){var t=(0,g.getCommonProperties)(e),r=t.classes,n=t.attributes,o=t.tag,u=[];if(o&&u.push(o),r){var i=r.map(function(e){return"."+e}).join("");u.push(i)}if(n){var a=Object.keys(n).reduce(function(e,t){return e.push("["+t+'="'+n[t]+'"]'),e},[]).join("");u.push(a)}return u.length,[u.join("")]}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.length&&!e.name?u(e,t):o(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getSingleSelector=o,t.getMultiSelector=u,t.default=a;var c=r(3),f=n(c),s=r(7),d=n(s),v=r(2),p=n(v),h=r(0),g=r(1)},function(e,t,r){"use strict";var n={},o=n.hasOwnProperty,u=function(e,t){if(!e)return t;var r={};for(var n in t)r[n]=o.call(e,n)?e[n]:t[n];return r},i=/[ -,\.\/:-@\[-\^`\{-~]/,a=/[ -,\.\/:-@\[\]\^`\{-~]/,l=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,c=function e(t,r){r=u(r,e.options),"single"!=r.quotes&&"double"!=r.quotes&&(r.quotes="single");for(var n="double"==r.quotes?'"':"'",o=r.isIdentifier,c=t.charAt(0),f="",s=0,d=t.length;s126){if(p>=55296&&p<=56319&&s4&&void 0!==arguments[4]?arguments[4]:t.parentNode,i=u(e,t,r);if(i){if(1===o.querySelectorAll(i).length)return n.unshift(i),!0}return!1}function u(e,t,r){for(var n=t.attributes,o=Object.keys(n).sort(function(t,r){var o=e.indexOf(n[t].name),u=e.indexOf(n[r].name);return-1===u?-1===o?0:-1:-1===o?1:o-u}),u=0,i=o.length;u3&&void 0!==arguments[3]?arguments[3]:e.parentNode,o=a(e,t);if(o){if(1===n.getElementsByTagName(o).length)return r.unshift(o),!0}return!1}function a(e,t){var r=e.tagName.toLowerCase();return f(t.tag,null,r)?null:r}function l(e,t,r,n){for(var o=t.parentNode,u=o.childTags||o.children,i=0,a=u.length;i-1}};e.exports=t.default}])}); //# sourceMappingURL=optimal-select.min.js.map \ No newline at end of file diff --git a/dist/optimal-select.min.js.map b/dist/optimal-select.min.js.map index ef873f5..4a9dd6c 100644 --- a/dist/optimal-select.min.js.map +++ b/dist/optimal-select.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///optimal-select.min.js","webpack:///webpack/bootstrap 7a14bf1294f51172b93a","webpack:///./src/utilities.js","webpack:///./src/common.js","webpack:///./src/optimize.js","webpack:///./src/adapt.js","webpack:///./src/select.js","webpack:///./src/match.js","webpack:///./src/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","convertNodeList","nodes","length","arr","Array","escapeValue","replace","getCommonAncestor","elements","options","arguments","undefined","_options$root","document","ancestors","forEach","element","index","parents","parentNode","unshift","sort","curr","next","shallowAncestor","shift","ancestor","_loop","parent","missing","some","otherParents","otherParent","_ret","getCommonProperties","commonProperties","classes","attributes","tag","commonClasses","commonAttributes","commonTag","getAttribute","trim","split","filter","entry","elementAttributes","keys","reduce","key","attribute","attributeName","attributesNames","commonAttributesNames","nextCommonAttributes","tagName","toLowerCase","_interopRequireDefault","obj","default","optimize","selector","isArray","_utilities","nodeType","Error","globalModified","_adapt2","path","optimizePart","shortened","pop","current","prePart","join","postPart","pattern","matches","querySelectorAll","slice","test","compareResults","references","reference","contains","description","descendant","type","names","map","partial","charAt","match","_loop2","_ret2","every","_adapt","adapt","Symbol","iterator","constructor","sliceIterator","_arr","_n","_d","_e","_s","_i","done","push","err","TypeError","getSingleSelector","_typeof","_match2","optimized","_optimize2","getMultiSelector","_common","ancestorSelector","commonSelectors","getCommonSelectors","descendantSelector","selectorMatches","console","warn","_getCommonProperties","selectorPath","classSelector","attributeSelector","parts","getQuerySelector","input","_match","_optimize","node","_options$skip","skip","_options$priority","priority","_options$ignore","ignore","ignoreClass","skipCompare","skipChecks","compare","predicate","toString","RegExp","ignoreAttribute","defaultPredicate","class","checkAttributes","checkTag","checkChilds","findPattern","findAttributesPattern","sortedKeys","currPos","indexOf","nextPos","attributeValue","currentIgnore","currentDefaultIgnore","defaultIgnore","checkIgnore","className","findTagPattern","getElementsByTagName","children","childTags","child","childPattern","check","_interopRequireWildcard","newObj","common","select","_select2","_select3","_optimize3","_common2"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,cAAAD,IAEAD,EAAA,cAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QA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C,OAAtB8H,GAAOpH,QAAUD,EAAYqH,EAElQ,QAAStH,GAAuBC,GAAO,MAAOA,IAAOA,EAAIlE,WAAakE,GAAQC,QAASD,GAhCvFxE,OAAOC,eAAepB,EAAS,cAC7Bc,OAAO,IAETd,EAAQ4F,QAAU5F,EAAQiN,OAASjN,EAAQ6F,SAAW7F,EAAQsJ,iBAAmBtJ,EAAQiJ,kBAAoBjJ,EAAQkN,OAASvK,MAE9H,IAAIwK,GAAW7M,EAAoB,EAEnCa,QAAOC,eAAepB,EAAS,qBAC7BsB,YAAY,EACZC,IAAK,WACH,MAAO4L,GQx6CMlE,qBR26CjB9H,OAAOC,eAAepB,EAAS,oBAC7BsB,YAAY,EACZC,IAAK,WACH,MAAO4L,GQ96CyB7D,mBRk7CpC,IAAI8D,GAAW1H,EAAuByH,GAElC9D,EAAa/I,EAAoB,GAEjC+M,EAAa3H,EAAuB2D,GAEpCiE,EAAWhN,EAAoB,GAE/BiJ,EAAUwD,EAAwBO,EAMtCtN,GQh8COkN,ORg8CUE,EAASxH,QAC1B5F,EQh8CO6F,SRg8CYwH,EAAWzH,QAC9B5F,EQh8CYiN,ORg8CK1D,EACjBvJ,EQ/7CO4F,QR+7CWwH,EAASxH","file":"optimal-select.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OptimalSelect\"] = factory();\n\telse\n\t\troot[\"OptimalSelect\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OptimalSelect\"] = factory();\n\telse\n\t\troot[\"OptimalSelect\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 6);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.convertNodeList = convertNodeList;\nexports.escapeValue = escapeValue;\n/**\n * # Utilities\n *\n * Convenience helpers.\n */\n\n/**\n * Create an array with the DOM nodes of the list\n *\n * @param {NodeList} nodes - [description]\n * @return {Array.} - [description]\n */\nfunction convertNodeList(nodes) {\n var length = nodes.length;\n\n var arr = new Array(length);\n for (var i = 0; i < length; i++) {\n arr[i] = nodes[i];\n }\n return arr;\n}\n\n/**\n * Escape special characters and line breaks as a simplified version of 'CSS.escape()'\n *\n * Description of valid characters: https://mathiasbynens.be/notes/css-escapes\n *\n * @param {String?} value - [description]\n * @return {String} - [description]\n */\nfunction escapeValue(value) {\n return value && value.replace(/['\"`\\\\/:\\?&!#$%^()[\\]{|}*+;,.<=>@~]/g, '\\\\$&').replace(/\\n/g, '\\A');\n}\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getCommonAncestor = getCommonAncestor;\nexports.getCommonProperties = getCommonProperties;\n/**\n * # Common\n *\n * Process collections for similarities.\n */\n\n/**\n * Find the last common ancestor of elements\n *\n * @param {Array.} elements - [description]\n * @return {HTMLElement} - [description]\n */\nfunction getCommonAncestor(elements) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _options$root = options.root,\n root = _options$root === undefined ? document : _options$root;\n\n\n var ancestors = [];\n\n elements.forEach(function (element, index) {\n var parents = [];\n while (element !== root) {\n element = element.parentNode;\n parents.unshift(element);\n }\n ancestors[index] = parents;\n });\n\n ancestors.sort(function (curr, next) {\n return curr.length - next.length;\n });\n\n var shallowAncestor = ancestors.shift();\n\n var ancestor = null;\n\n var _loop = function _loop() {\n var parent = shallowAncestor[i];\n var missing = ancestors.some(function (otherParents) {\n return !otherParents.some(function (otherParent) {\n return otherParent === parent;\n });\n });\n\n if (missing) {\n // TODO: find similar sub-parents, not the top root, e.g. sharing a class selector\n return 'break';\n }\n\n ancestor = parent;\n };\n\n for (var i = 0, l = shallowAncestor.length; i < l; i++) {\n var _ret = _loop();\n\n if (_ret === 'break') break;\n }\n\n return ancestor;\n}\n\n/**\n * Get a set of common properties of elements\n *\n * @param {Array.} elements - [description]\n * @return {Object} - [description]\n */\nfunction getCommonProperties(elements) {\n\n var commonProperties = {\n classes: [],\n attributes: {},\n tag: null\n };\n\n elements.forEach(function (element) {\n var commonClasses = commonProperties.classes,\n commonAttributes = commonProperties.attributes,\n commonTag = commonProperties.tag;\n\n // ~ classes\n\n if (commonClasses !== undefined) {\n var classes = element.getAttribute('class');\n if (classes) {\n classes = classes.trim().split(' ');\n if (!commonClasses.length) {\n commonProperties.classes = classes;\n } else {\n commonClasses = commonClasses.filter(function (entry) {\n return classes.some(function (name) {\n return name === entry;\n });\n });\n if (commonClasses.length) {\n commonProperties.classes = commonClasses;\n } else {\n delete commonProperties.classes;\n }\n }\n } else {\n // TODO: restructure removal as 2x set / 2x delete, instead of modify always replacing with new collection\n delete commonProperties.classes;\n }\n }\n\n // ~ attributes\n if (commonAttributes !== undefined) {\n (function () {\n var elementAttributes = element.attributes;\n var attributes = Object.keys(elementAttributes).reduce(function (attributes, key) {\n var attribute = elementAttributes[key];\n var attributeName = attribute.name;\n // NOTE: workaround detection for non-standard phantomjs NamedNodeMap behaviour\n // (issue: https://github.com/ariya/phantomjs/issues/14634)\n if (attribute && attributeName !== 'class') {\n attributes[attributeName] = attribute.value;\n }\n return attributes;\n }, {});\n\n var attributesNames = Object.keys(attributes);\n var commonAttributesNames = Object.keys(commonAttributes);\n\n if (attributesNames.length) {\n if (!commonAttributesNames.length) {\n commonProperties.attributes = attributes;\n } else {\n commonAttributes = commonAttributesNames.reduce(function (nextCommonAttributes, name) {\n var value = commonAttributes[name];\n if (value === attributes[name]) {\n nextCommonAttributes[name] = value;\n }\n return nextCommonAttributes;\n }, {});\n if (Object.keys(commonAttributes).length) {\n commonProperties.attributes = commonAttributes;\n } else {\n delete commonProperties.attributes;\n }\n }\n } else {\n delete commonProperties.attributes;\n }\n })();\n }\n\n // ~ tag\n if (commonTag !== undefined) {\n var tag = element.tagName.toLowerCase();\n if (!commonTag) {\n commonProperties.tag = tag;\n } else if (tag !== commonTag) {\n delete commonProperties.tag;\n }\n }\n });\n\n return commonProperties;\n}\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = optimize;\n\nvar _adapt = __webpack_require__(3);\n\nvar _adapt2 = _interopRequireDefault(_adapt);\n\nvar _utilities = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Apply different optimization techniques\n *\n * @param {string} selector - [description]\n * @param {HTMLElement|Array.} element - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\n/**\n * # Optimize\n *\n * 1.) Improve efficiency through shorter selectors by removing redundancy\n * 2.) Improve robustness through selector transformation\n */\n\nfunction optimize(selector, elements) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n\n // convert single entry and NodeList\n if (!Array.isArray(elements)) {\n elements = !elements.length ? [elements] : (0, _utilities.convertNodeList)(elements);\n }\n\n if (!elements.length || elements.some(function (element) {\n return element.nodeType !== 1;\n })) {\n throw new Error('Invalid input - to compare HTMLElements its necessary to provide a reference of the selected node(s)! (missing \"elements\")');\n }\n\n var globalModified = (0, _adapt2.default)(elements[0], options);\n\n // chunk parts outside of quotes (http://stackoverflow.com/a/25663729)\n var path = selector.replace(/> /g, '>').split(/\\s+(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/);\n\n if (path.length < 2) {\n return optimizePart('', selector, '', elements);\n }\n\n var shortened = [path.pop()];\n while (path.length > 1) {\n var current = path.pop();\n var prePart = path.join(' ');\n var postPart = shortened.join(' ');\n\n var pattern = prePart + ' ' + postPart;\n var matches = document.querySelectorAll(pattern);\n if (matches.length !== elements.length) {\n shortened.unshift(optimizePart(prePart, current, postPart, elements));\n }\n }\n shortened.unshift(path[0]);\n path = shortened;\n\n // optimize start + end\n path[0] = optimizePart('', path[0], path.slice(1).join(' '), elements);\n path[path.length - 1] = optimizePart(path.slice(0, -1).join(' '), path[path.length - 1], '', elements);\n\n if (globalModified) {\n delete true;\n }\n\n return path.join(' ').replace(/>/g, '> ').trim();\n}\n\n/**\n * Improve a chunk of the selector\n *\n * @param {string} prePart - [description]\n * @param {string} current - [description]\n * @param {string} postPart - [description]\n * @param {Array.} elements - [description]\n * @return {string} - [description]\n */\nfunction optimizePart(prePart, current, postPart, elements) {\n if (prePart.length) prePart = prePart + ' ';\n if (postPart.length) postPart = ' ' + postPart;\n\n // robustness: attribute without value (generalization)\n if (/\\[*\\]/.test(current)) {\n var key = current.replace(/=.*$/, ']');\n var pattern = '' + prePart + key + postPart;\n var matches = document.querySelectorAll(pattern);\n if (compareResults(matches, elements)) {\n current = key;\n } else {\n // robustness: replace specific key-value with base tag (heuristic)\n var references = document.querySelectorAll('' + prePart + key);\n\n var _loop = function _loop() {\n var reference = references[i];\n if (elements.some(function (element) {\n return reference.contains(element);\n })) {\n var description = reference.tagName.toLowerCase();\n pattern = '' + prePart + description + postPart;\n matches = document.querySelectorAll(pattern);\n\n if (compareResults(matches, elements)) {\n current = description;\n }\n return 'break';\n }\n };\n\n for (var i = 0, l = references.length; i < l; i++) {\n var pattern;\n var matches;\n\n var _ret = _loop();\n\n if (_ret === 'break') break;\n }\n }\n }\n\n // robustness: descendant instead child (heuristic)\n if (/>/.test(current)) {\n var descendant = current.replace(/>/, '');\n var pattern = '' + prePart + descendant + postPart;\n var matches = document.querySelectorAll(pattern);\n if (compareResults(matches, elements)) {\n current = descendant;\n }\n }\n\n // robustness: 'nth-of-type' instead 'nth-child' (heuristic)\n if (/:nth-child/.test(current)) {\n // TODO: consider complete coverage of 'nth-of-type' replacement\n var type = current.replace(/nth-child/g, 'nth-of-type');\n var pattern = '' + prePart + type + postPart;\n var matches = document.querySelectorAll(pattern);\n if (compareResults(matches, elements)) {\n current = type;\n }\n }\n\n // efficiency: combinations of classname (partial permutations)\n if (/\\.\\S+\\.\\S+/.test(current)) {\n var names = current.trim().split('.').slice(1).map(function (name) {\n return '.' + name;\n }).sort(function (curr, next) {\n return curr.length - next.length;\n });\n while (names.length) {\n var partial = current.replace(names.shift(), '').trim();\n var pattern = ('' + prePart + partial + postPart).trim();\n if (!pattern.length || pattern.charAt(0) === '>' || pattern.charAt(pattern.length - 1) === '>') {\n break;\n }\n var matches = document.querySelectorAll(pattern);\n if (compareResults(matches, elements)) {\n current = partial;\n }\n }\n\n // robustness: degrade complex classname (heuristic)\n names = current && current.match(/\\./g);\n if (names && names.length > 2) {\n var _references = document.querySelectorAll('' + prePart + current);\n\n var _loop2 = function _loop2() {\n var reference = _references[i];\n if (elements.some(function (element) {\n return reference.contains(element);\n })) {\n // TODO:\n // - check using attributes + regard excludes\n var description = reference.tagName.toLowerCase();\n pattern = '' + prePart + description + postPart;\n matches = document.querySelectorAll(pattern);\n\n if (compareResults(matches, elements)) {\n current = description;\n }\n return 'break';\n }\n };\n\n for (var i = 0, l = _references.length; i < l; i++) {\n var pattern;\n var matches;\n\n var _ret2 = _loop2();\n\n if (_ret2 === 'break') break;\n }\n }\n }\n\n return current;\n}\n\n/**\n * Evaluate matches with expected elements\n *\n * @param {Array.} matches - [description]\n * @param {Array.} elements - [description]\n * @return {Boolean} - [description]\n */\nfunction compareResults(matches, elements) {\n var length = matches.length;\n\n return length === elements.length && elements.every(function (element) {\n for (var i = 0; i < length; i++) {\n if (matches[i] === element) {\n return true;\n }\n }\n return false;\n });\n}\nmodule.exports = exports['default'];\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.default = adapt;\n/**\n * # Adapt\n *\n * Check and extend the environment for universal usage.\n */\n\n/**\n * Modify the context based on the environment\n *\n * @param {HTMLELement} element - [description]\n * @param {Object} options - [description]\n * @return {boolean} - [description]\n */\nfunction adapt(element, options) {\n\n // detect environment setup\n if (true) {\n return false;\n } else {\n global.document = options.context || function () {\n var root = element;\n while (root.parent) {\n root = root.parent;\n }\n return root;\n }();\n }\n\n // https://github.com/fb55/domhandler/blob/master/index.js#L75\n var ElementPrototype = Object.getPrototypeOf(true);\n\n // alternative descriptor to access elements with filtering invalid elements (e.g. textnodes)\n if (!Object.getOwnPropertyDescriptor(ElementPrototype, 'childTags')) {\n Object.defineProperty(ElementPrototype, 'childTags', {\n enumerable: true,\n get: function get() {\n return this.children.filter(function (node) {\n // https://github.com/fb55/domelementtype/blob/master/index.js#L12\n return node.type === 'tag' || node.type === 'script' || node.type === 'style';\n });\n }\n });\n }\n\n if (!Object.getOwnPropertyDescriptor(ElementPrototype, 'attributes')) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes\n // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap\n Object.defineProperty(ElementPrototype, 'attributes', {\n enumerable: true,\n get: function get() {\n var attribs = this.attribs;\n\n var attributesNames = Object.keys(attribs);\n var NamedNodeMap = attributesNames.reduce(function (attributes, attributeName, index) {\n attributes[index] = {\n name: attributeName,\n value: attribs[attributeName]\n };\n return attributes;\n }, {});\n Object.defineProperty(NamedNodeMap, 'length', {\n enumerable: false,\n configurable: false,\n value: attributesNames.length\n });\n return NamedNodeMap;\n }\n });\n }\n\n if (!ElementPrototype.getAttribute) {\n // https://docs.webplatform.org/wiki/dom/Element/getAttribute\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute\n ElementPrototype.getAttribute = function (name) {\n return this.attribs[name] || null;\n };\n }\n\n if (!ElementPrototype.getElementsByTagName) {\n // https://docs.webplatform.org/wiki/dom/Document/getElementsByTagName\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName\n ElementPrototype.getElementsByTagName = function (tagName) {\n var HTMLCollection = [];\n traverseDescendants(this.childTags, function (descendant) {\n if (descendant.name === tagName || tagName === '*') {\n HTMLCollection.push(descendant);\n }\n });\n return HTMLCollection;\n };\n }\n\n if (!ElementPrototype.getElementsByClassName) {\n // https://docs.webplatform.org/wiki/dom/Document/getElementsByClassName\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByClassName\n ElementPrototype.getElementsByClassName = function (className) {\n var names = className.trim().replace(/\\s+/g, ' ').split(' ');\n var HTMLCollection = [];\n traverseDescendants([this], function (descendant) {\n var descendantClassName = descendant.attribs.class;\n if (descendantClassName && names.every(function (name) {\n return descendantClassName.indexOf(name) > -1;\n })) {\n HTMLCollection.push(descendant);\n }\n });\n return HTMLCollection;\n };\n }\n\n if (!ElementPrototype.querySelectorAll) {\n // https://docs.webplatform.org/wiki/css/selectors_api/querySelectorAll\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelectorAll\n ElementPrototype.querySelectorAll = function (selectors) {\n var _this = this;\n\n selectors = selectors.replace(/(>)(\\S)/g, '$1 $2').trim(); // add space for '>' selector\n\n // using right to left execution => https://github.com/fb55/css-select#how-does-it-work\n var instructions = getInstructions(selectors);\n var discover = instructions.shift();\n\n var total = instructions.length;\n return discover(this).filter(function (node) {\n var step = 0;\n while (step < total) {\n node = instructions[step](node, _this);\n if (!node) {\n // hierarchy doesn't match\n return false;\n }\n step += 1;\n }\n return true;\n });\n };\n }\n\n if (!ElementPrototype.contains) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/contains\n ElementPrototype.contains = function (element) {\n var inclusive = false;\n traverseDescendants([this], function (descendant, done) {\n if (descendant === element) {\n inclusive = true;\n done();\n }\n });\n return inclusive;\n };\n }\n\n return true;\n}\n\n/**\n * Retrieve transformation steps\n *\n * @param {Array.} selectors - [description]\n * @return {Array.} - [description]\n */\nfunction getInstructions(selectors) {\n return selectors.split(' ').reverse().map(function (selector, step) {\n var discover = step === 0;\n\n var _selector$split = selector.split(':'),\n _selector$split2 = _slicedToArray(_selector$split, 2),\n type = _selector$split2[0],\n pseudo = _selector$split2[1];\n\n var validate = null;\n var instruction = null;\n\n (function () {\n switch (true) {\n\n // child: '>'\n case />/.test(type):\n instruction = function checkParent(node) {\n return function (validate) {\n return validate(node.parent) && node.parent;\n };\n };\n break;\n\n // class: '.'\n case /^\\./.test(type):\n var names = type.substr(1).split('.');\n validate = function validate(node) {\n var nodeClassName = node.attribs.class;\n return nodeClassName && names.every(function (name) {\n return nodeClassName.indexOf(name) > -1;\n });\n };\n instruction = function checkClass(node, root) {\n if (discover) {\n return node.getElementsByClassName(names.join(' '));\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n break;\n\n // attribute: '[key=\"value\"]'\n case /^\\[/.test(type):\n var _type$replace$split = type.replace(/\\[|\\]|\"/g, '').split('='),\n _type$replace$split2 = _slicedToArray(_type$replace$split, 2),\n attributeKey = _type$replace$split2[0],\n attributeValue = _type$replace$split2[1];\n\n validate = function validate(node) {\n var hasAttribute = Object.keys(node.attribs).indexOf(attributeKey) > -1;\n if (hasAttribute) {\n // regard optional attributeValue\n if (!attributeValue || node.attribs[attributeKey] === attributeValue) {\n return true;\n }\n }\n return false;\n };\n instruction = function checkAttribute(node, root) {\n if (discover) {\n var _ret2 = function () {\n var NodeList = [];\n traverseDescendants([node], function (descendant) {\n if (validate(descendant)) {\n NodeList.push(descendant);\n }\n });\n return {\n v: NodeList\n };\n }();\n\n if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === \"object\") return _ret2.v;\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n break;\n\n // id: '#'\n case /^#/.test(type):\n var id = type.substr(1);\n validate = function validate(node) {\n return node.attribs.id === id;\n };\n instruction = function checkId(node, root) {\n if (discover) {\n var _ret3 = function () {\n var NodeList = [];\n traverseDescendants([node], function (descendant, done) {\n if (validate(descendant)) {\n NodeList.push(descendant);\n done();\n }\n });\n return {\n v: NodeList\n };\n }();\n\n if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === \"object\") return _ret3.v;\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n break;\n\n // universal: '*'\n case /\\*/.test(type):\n validate = function validate(node) {\n return true;\n };\n instruction = function checkUniversal(node, root) {\n if (discover) {\n var _ret4 = function () {\n var NodeList = [];\n traverseDescendants([node], function (descendant) {\n return NodeList.push(descendant);\n });\n return {\n v: NodeList\n };\n }();\n\n if ((typeof _ret4 === 'undefined' ? 'undefined' : _typeof(_ret4)) === \"object\") return _ret4.v;\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n break;\n\n // tag: '...'\n default:\n validate = function validate(node) {\n return node.name === type;\n };\n instruction = function checkTag(node, root) {\n if (discover) {\n var _ret5 = function () {\n var NodeList = [];\n traverseDescendants([node], function (descendant) {\n if (validate(descendant)) {\n NodeList.push(descendant);\n }\n });\n return {\n v: NodeList\n };\n }();\n\n if ((typeof _ret5 === 'undefined' ? 'undefined' : _typeof(_ret5)) === \"object\") return _ret5.v;\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n }\n })();\n\n if (!pseudo) {\n return instruction;\n }\n\n var rule = pseudo.match(/-(child|type)\\((\\d+)\\)$/);\n var kind = rule[1];\n var index = parseInt(rule[2], 10) - 1;\n\n var validatePseudo = function validatePseudo(node) {\n if (node) {\n var compareSet = node.parent.childTags;\n if (kind === 'type') {\n compareSet = compareSet.filter(validate);\n }\n var nodeIndex = compareSet.findIndex(function (child) {\n return child === node;\n });\n if (nodeIndex === index) {\n return true;\n }\n }\n return false;\n };\n\n return function enhanceInstruction(node) {\n var match = instruction(node);\n if (discover) {\n return match.reduce(function (NodeList, matchedNode) {\n if (validatePseudo(matchedNode)) {\n NodeList.push(matchedNode);\n }\n return NodeList;\n }, []);\n }\n return validatePseudo(match) && match;\n };\n });\n}\n\n/**\n * Walking recursive to invoke callbacks\n *\n * @param {Array.} nodes - [description]\n * @param {Function} handler - [description]\n */\nfunction traverseDescendants(nodes, handler) {\n nodes.forEach(function (node) {\n var progress = true;\n handler(node, function () {\n return progress = false;\n });\n if (node.childTags && progress) {\n traverseDescendants(node.childTags, handler);\n }\n });\n}\n\n/**\n * Bubble up from bottom to top\n *\n * @param {HTMLELement} node - [description]\n * @param {HTMLELement} root - [description]\n * @param {Function} validate - [description]\n * @return {HTMLELement} - [description]\n */\nfunction getAncestor(node, root, validate) {\n while (node.parent) {\n node = node.parent;\n if (validate(node)) {\n return node;\n }\n if (node === root) {\n break;\n }\n }\n return null;\n}\nmodule.exports = exports['default'];\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; /**\n * # Select\n *\n * Construct a unique CSS query selector to access the selected DOM element(s).\n * For longevity it applies different matching and optimization strategies.\n */\n\nexports.getSingleSelector = getSingleSelector;\nexports.getMultiSelector = getMultiSelector;\nexports.default = getQuerySelector;\n\nvar _adapt = __webpack_require__(3);\n\nvar _adapt2 = _interopRequireDefault(_adapt);\n\nvar _match = __webpack_require__(5);\n\nvar _match2 = _interopRequireDefault(_match);\n\nvar _optimize = __webpack_require__(2);\n\nvar _optimize2 = _interopRequireDefault(_optimize);\n\nvar _utilities = __webpack_require__(0);\n\nvar _common = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Get a selector for the provided element\n *\n * @param {HTMLElement} element - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\nfunction getSingleSelector(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\n if (element.nodeType === 3) {\n element = element.parentNode;\n }\n\n if (element.nodeType !== 1) {\n throw new Error('Invalid input - only HTMLElements or representations of them are supported! (not \"' + (typeof element === 'undefined' ? 'undefined' : _typeof(element)) + '\")');\n }\n\n var globalModified = (0, _adapt2.default)(element, options);\n\n var selector = (0, _match2.default)(element, options);\n var optimized = (0, _optimize2.default)(selector, element, options);\n\n // debug\n // console.log(`\n // selector: ${selector}\n // optimized: ${optimized}\n // `)\n\n if (globalModified) {\n delete true;\n }\n\n return optimized;\n}\n\n/**\n * Get a selector to match multiple descendants from an ancestor\n *\n * @param {Array.|NodeList} elements - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\nfunction getMultiSelector(elements) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\n if (!Array.isArray(elements)) {\n elements = (0, _utilities.convertNodeList)(elements);\n }\n\n if (elements.some(function (element) {\n return element.nodeType !== 1;\n })) {\n throw new Error('Invalid input - only an Array of HTMLElements or representations of them is supported!');\n }\n\n var globalModified = (0, _adapt2.default)(elements[0], options);\n\n var ancestor = (0, _common.getCommonAncestor)(elements, options);\n var ancestorSelector = getSingleSelector(ancestor, options);\n\n // TODO: consider usage of multiple selectors + parent-child relation + check for part redundancy\n var commonSelectors = getCommonSelectors(elements);\n var descendantSelector = commonSelectors[0];\n\n var selector = (0, _optimize2.default)(ancestorSelector + ' ' + descendantSelector, elements, options);\n var selectorMatches = (0, _utilities.convertNodeList)(document.querySelectorAll(selector));\n\n if (!elements.every(function (element) {\n return selectorMatches.some(function (entry) {\n return entry === element;\n });\n })) {\n // TODO: cluster matches to split into similar groups for sub selections\n return console.warn('\\n The selected elements can\\'t be efficiently mapped.\\n Its probably best to use multiple single selectors instead!\\n ', elements);\n }\n\n if (globalModified) {\n delete true;\n }\n\n return selector;\n}\n\n/**\n * Get selectors to describe a set of elements\n *\n * @param {Array.} elements - [description]\n * @return {string} - [description]\n */\nfunction getCommonSelectors(elements) {\n var _getCommonProperties = (0, _common.getCommonProperties)(elements),\n classes = _getCommonProperties.classes,\n attributes = _getCommonProperties.attributes,\n tag = _getCommonProperties.tag;\n\n var selectorPath = [];\n\n if (tag) {\n selectorPath.push(tag);\n }\n\n if (classes) {\n var classSelector = classes.map(function (name) {\n return '.' + name;\n }).join('');\n selectorPath.push(classSelector);\n }\n\n if (attributes) {\n var attributeSelector = Object.keys(attributes).reduce(function (parts, name) {\n parts.push('[' + name + '=\"' + attributes[name] + '\"]');\n return parts;\n }, []).join('');\n selectorPath.push(attributeSelector);\n }\n\n if (selectorPath.length) {\n // TODO: check for parent-child relation\n }\n\n return [selectorPath.join('')];\n}\n\n/**\n * Choose action depending on the input (multiple/single)\n *\n * NOTE: extended detection is used for special cases like the element with \n *\n * @param {HTMLElement|NodeList|Array.} input - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\nexport default function getQuerySelector (input, options = {}) {\n if (input.length && !input.name) {\n return getMultiSelector(input, options)\n }\n return getSingleSelector(input, options)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/select.js","/**\n * # Match\n *\n * Retrieve selector for a node.\n */\n\nimport { escapeValue } from './utilities'\n\nconst defaultIgnore = {\n attribute (attributeName) {\n return [\n 'style',\n 'data-reactid',\n 'data-react-checksum'\n ].indexOf(attributeName) > -1\n }\n}\n\n/**\n * Get the path of the element\n *\n * @param {HTMLElement} node - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\nexport default function match (node, options) {\n\n const {\n root = document,\n skip = null,\n priority = ['id', 'class', 'href', 'src'],\n ignore = {}\n } = options\n\n const path = []\n var element = node\n var length = path.length\n var ignoreClass = false\n\n const skipCompare = skip && (Array.isArray(skip) ? skip : [skip]).map((entry) => {\n if (typeof entry !== 'function') {\n return (element) => element === entry\n }\n return entry\n })\n\n const skipChecks = (element) => {\n return skip && skipCompare.some((compare) => compare(element))\n }\n\n Object.keys(ignore).forEach((type) => {\n if (type === 'class') {\n ignoreClass = true\n }\n var predicate = ignore[type]\n if (typeof predicate === 'function') return\n if (typeof predicate === 'number') {\n predicate = predicate.toString()\n }\n if (typeof predicate === 'string') {\n predicate = new RegExp(escapeValue(predicate).replace(/\\\\/g, '\\\\\\\\'))\n }\n if (typeof predicate === 'boolean') {\n predicate = predicate ? /(?:)/ : /.^/\n }\n // check class-/attributename for regex\n ignore[type] = (name, value) => predicate.test(value)\n })\n\n if (ignoreClass) {\n const ignoreAttribute = ignore.attribute\n ignore.attribute = (name, value, defaultPredicate) => {\n return ignore.class(value) || ignoreAttribute && ignoreAttribute(name, value, defaultPredicate)\n }\n }\n\n while (element !== root) {\n if (skipChecks(element) !== true) {\n // ~ global\n if (checkAttributes(priority, element, ignore, path, root)) break\n if (checkTag(element, ignore, path, root)) break\n\n // ~ local\n checkAttributes(priority, element, ignore, path)\n if (path.length === length) {\n checkTag(element, ignore, path)\n }\n\n // define only one part each iteration\n if (path.length === length) {\n checkChilds(priority, element, ignore, path)\n }\n }\n\n element = element.parentNode\n length = path.length\n }\n\n if (element === root) {\n const pattern = findPattern(priority, element, ignore)\n path.unshift(pattern)\n }\n\n return path.join(' ')\n}\n\n/**\n * Extend path with attribute identifier\n *\n * @param {Array.} priority - [description]\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @param {Array.} path - [description]\n * @param {HTMLElement} parent - [description]\n * @return {boolean} - [description]\n */\nfunction checkAttributes (priority, element, ignore, path, parent = element.parentNode) {\n const pattern = findAttributesPattern(priority, element, ignore)\n if (pattern) {\n const matches = parent.querySelectorAll(pattern)\n if (matches.length === 1) {\n path.unshift(pattern)\n return true\n }\n }\n return false\n}\n\n/**\n * Lookup attribute identifier\n *\n * @param {Array.} priority - [description]\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @return {string?} - [description]\n */\nfunction findAttributesPattern (priority, element, ignore) {\n const attributes = element.attributes\n const sortedKeys = Object.keys(attributes).sort((curr, next) => {\n const currPos = priority.indexOf(attributes[curr].name)\n const nextPos = priority.indexOf(attributes[next].name)\n if (nextPos === -1) {\n if (currPos === -1) {\n return 0\n }\n return -1\n }\n if (currPos === -1) {\n return 1\n }\n return currPos - nextPos;\n })\n\n for (var i = 0, l = sortedKeys.length; i < l; i++) {\n const key = sortedKeys[i]\n const attribute = attributes[key]\n const attributeName = attribute.name\n const attributeValue = escapeValue(attribute.value)\n\n const currentIgnore = ignore[attributeName] || ignore.attribute\n const currentDefaultIgnore = defaultIgnore[attributeName] || defaultIgnore.attribute\n if (checkIgnore(currentIgnore, attributeName, attributeValue, currentDefaultIgnore)) {\n continue\n }\n\n var pattern = `[${attributeName}=\"${attributeValue}\"]`\n\n if (attributeName === 'id' && (/^[A-Za-z][-\\d\\w:,.]*$/).test(attributeValue)) {\n pattern = `#${attributeValue}`\n }\n\n if (attributeName === 'class' && (/^[A-Za-z][-\\d\\w]*$/).test(attributeValue)) {\n const className = attributeValue.trim().replace(/\\s+/g, '.')\n pattern = `.${className}`\n }\n\n return pattern\n }\n return null\n}\n\n/**\n * Extend path with tag identifier\n *\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @param {Array.} path - [description]\n * @param {HTMLElement} parent - [description]\n * @return {boolean} - [description]\n */\nfunction checkTag (element, ignore, path, parent = element.parentNode) {\n const pattern = findTagPattern(element, ignore)\n if (pattern) {\n const matches = parent.getElementsByTagName(pattern)\n if (matches.length === 1) {\n path.unshift(pattern)\n return true\n }\n }\n return false\n}\n\n/**\n * Lookup tag identifier\n *\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @return {boolean} - [description]\n */\nfunction findTagPattern (element, ignore) {\n const tagName = element.tagName.toLowerCase()\n if (checkIgnore(ignore.tag, null, tagName)) {\n return null\n }\n return tagName\n}\n\n/**\n * Extend path with specific child identifier\n *\n * NOTE: 'childTags' is a custom property to use as a view filter for tags using 'adapter.js'\n *\n * @param {Array.} priority - [description]\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @param {Array.} path - [description]\n * @return {boolean} - [description]\n */\nfunction checkChilds (priority, element, ignore, path) {\n const parent = element.parentNode\n const children = parent.childTags || parent.children\n for (var i = 0, l = children.length; i < l; i++) {\n const child = children[i]\n if (child === element) {\n const childPattern = findPattern(priority, child, ignore)\n if (!childPattern) {\n return console.warn(`\n Element couldn\\'t be matched through strict ignore pattern!\n `, child, ignore, childPattern)\n }\n const pattern = `> ${childPattern}:nth-child(${i+1})`\n path.unshift(pattern)\n return true\n }\n }\n return false\n}\n\n/**\n * Lookup identifier\n *\n * @param {Array.} priority - [description]\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @return {string} - [description]\n */\nfunction findPattern (priority, element, ignore) {\n var pattern = findAttributesPattern(priority, element, ignore)\n if (!pattern) {\n pattern = findTagPattern(element, ignore)\n }\n return pattern\n}\n\n/**\n * Validate with custom and default functions\n *\n * @param {Function} predicate - [description]\n * @param {string?} name - [description]\n * @param {string} value - [description]\n * @param {Function} defaultPredicate - [description]\n * @return {boolean} - [description]\n */\nfunction checkIgnore (predicate, name, value, defaultPredicate) {\n if (!value) {\n return true\n }\n const check = predicate || defaultPredicate\n if (!check) {\n return false\n }\n return check(name, value, defaultPredicate)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/match.js","export select, { getSingleSelector, getMultiSelector } from './select'\nexport optimize from './optimize'\nexport * as common from './common'\n\nexport default from './select'\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 9e56bb83f3630d81e1d9","webpack:///optimal-select.min.js","webpack:///./src/utilities.js","webpack:///./src/common.js","webpack:///./src/optimize.js","webpack:///./src/adapt.js","webpack:///./src/select.js","webpack:///./~/cssesc/cssesc.js","webpack:///./src/index.js","webpack:///./src/match.js"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","moduleId","installedModules","i","l","modules","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","convertNodeList","nodes","length","arr","Array","escapeValue","cssesc","require","getCommonAncestor","elements","options","document","ancestors","forEach","element","index","parents","parentNode","unshift","sort","curr","next","shallowAncestor","shift","ancestor","parent","some","otherParents","otherParent","getCommonProperties","commonProperties","classes","attributes","tag","commonClasses","commonAttributes","commonTag","undefined","getAttribute","trim","split","filter","entry","elementAttributes","keys","reduce","key","attribute","attributeName","attributesNames","commonAttributesNames","nextCommonAttributes","tagName","toLowerCase","optimize","selector","isArray","nodeType","Error","path","replace","optimizePart","shortened","pop","current","prePart","join","postPart","pattern","matches","querySelectorAll","err","slice","test","compareResults","references","reference","contains","description","descendant","type","names","map","partial","charAt","match","every","default","_adapt2","obj","_adapt","adapt","sliceIterator","_arr","_n","_d","_e","_s","_i","Symbol","iterator","done","push","_interopRequireDefault","getSingleSelector","getMultiSelector","ancestorSelector","commonSelectors","getCommonSelectors","descendantSelector","selectorMatches","console","warn","selectorPath","classSelector","attributeSelector","parts","getQuerySelector","input","_typeof","constructor","_match2","_match","_optimize2","_optimize","merge","defaults","result","regexAnySingleEscape","regexSingleEscape","regexExcessiveSpaces","string","quotes","quote","isIdentifier","firstChar","output","counter","character","codePoint","charCodeAt","extra","toString","toUpperCase","escapeEverything","$0","$1","$2","wrap","version","common","select","_select2","_select3","_optimize3","_common2","_common","newObj","node","skip","priority","ignore","ignoreClass","skipCompare","predicate","RegExp","ignoreAttribute","defaultPredicate","class","compare","checkAttributes","checkTag","checkChilds","findPattern","findAttributesPattern","sortedKeys","currPos","indexOf","nextPos","attributeValue","checkIgnore","defaultIgnore","findTagPattern","getElementsByTagName","children","childTags","child","childPattern","check"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9CD,UAAWH,GACe,gBAAZC,SACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,KACvBK,KAAM,WACT,M,aCNE,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUN,OAGnC,IAAIC,GAASM,EAAiBD,IAC7BE,EAAGF,EACHG,GAAG,EACHT,WAUD,OANAU,GAAQJ,GAAUK,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASK,GAG/DJ,EAAOQ,GAAI,EAGJR,EAAOD,QAvBf,GAAIO,KA+DJ,OAnCAF,GAAoBO,EAAIF,EAGxBL,EAAoBQ,EAAIN,EAGxBF,EAAoBG,EAAI,SAASM,GAAS,MAAOA,IAGjDT,EAAoBU,EAAI,SAASf,EAASgB,EAAMC,GAC3CZ,EAAoBa,EAAElB,EAASgB,IAClCG,OA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":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OptimalSelect\"] = factory();\n\telse\n\t\troot[\"OptimalSelect\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9e56bb83f3630d81e1d9","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OptimalSelect\"] = factory();\n\telse\n\t\troot[\"OptimalSelect\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 6);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.convertNodeList = convertNodeList;\nexports.escapeValue = escapeValue;\n/**\n * # Utilities\n *\n * Convenience helpers.\n */\n\nvar cssesc = __webpack_require__(5);\n\n/**\n * Create an array with the DOM nodes of the list\n *\n * @param {NodeList} nodes - [description]\n * @return {Array.} - [description]\n */\nfunction convertNodeList(nodes) {\n var length = nodes.length;\n\n var arr = new Array(length);\n for (var i = 0; i < length; i++) {\n arr[i] = nodes[i];\n }\n return arr;\n}\n\n/**\n * Escape special characters and line breaks as a simplified version of 'CSS.escape()'\n *\n * Description of valid characters: https://mathiasbynens.be/notes/css-escapes\n *\n * @param {String?} value - [description]\n * @return {String} - [description]\n */\nfunction escapeValue(value) {\n return value && cssesc(value);\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getCommonAncestor = getCommonAncestor;\nexports.getCommonProperties = getCommonProperties;\n/**\n * # Common\n *\n * Process collections for similarities.\n */\n\n/**\n * Find the last common ancestor of elements\n *\n * @param {Array.} elements - [description]\n * @return {HTMLElement} - [description]\n */\nfunction getCommonAncestor(elements) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _options$root = options.root,\n root = _options$root === undefined ? document : _options$root;\n\n\n var ancestors = [];\n\n elements.forEach(function (element, index) {\n var parents = [];\n while (element !== root) {\n element = element.parentNode;\n parents.unshift(element);\n }\n ancestors[index] = parents;\n });\n\n ancestors.sort(function (curr, next) {\n return curr.length - next.length;\n });\n\n var shallowAncestor = ancestors.shift();\n\n var ancestor = null;\n\n var _loop = function _loop() {\n var parent = shallowAncestor[i];\n var missing = ancestors.some(function (otherParents) {\n return !otherParents.some(function (otherParent) {\n return otherParent === parent;\n });\n });\n\n if (missing) {\n // TODO: find similar sub-parents, not the top root, e.g. sharing a class selector\n return 'break';\n }\n\n ancestor = parent;\n };\n\n for (var i = 0, l = shallowAncestor.length; i < l; i++) {\n var _ret = _loop();\n\n if (_ret === 'break') break;\n }\n\n return ancestor;\n}\n\n/**\n * Get a set of common properties of elements\n *\n * @param {Array.} elements - [description]\n * @return {Object} - [description]\n */\nfunction getCommonProperties(elements) {\n\n var commonProperties = {\n classes: [],\n attributes: {},\n tag: null\n };\n\n elements.forEach(function (element) {\n var commonClasses = commonProperties.classes,\n commonAttributes = commonProperties.attributes,\n commonTag = commonProperties.tag;\n\n // ~ classes\n\n if (commonClasses !== undefined) {\n var classes = element.getAttribute('class');\n if (classes) {\n classes = classes.trim().split(' ');\n if (!commonClasses.length) {\n commonProperties.classes = classes;\n } else {\n commonClasses = commonClasses.filter(function (entry) {\n return classes.some(function (name) {\n return name === entry;\n });\n });\n if (commonClasses.length) {\n commonProperties.classes = commonClasses;\n } else {\n delete commonProperties.classes;\n }\n }\n } else {\n // TODO: restructure removal as 2x set / 2x delete, instead of modify always replacing with new collection\n delete commonProperties.classes;\n }\n }\n\n // ~ attributes\n if (commonAttributes !== undefined) {\n var elementAttributes = element.attributes;\n var attributes = Object.keys(elementAttributes).reduce(function (attributes, key) {\n var attribute = elementAttributes[key];\n var attributeName = attribute.name;\n // NOTE: workaround detection for non-standard phantomjs NamedNodeMap behaviour\n // (issue: https://github.com/ariya/phantomjs/issues/14634)\n if (attribute && attributeName !== 'class') {\n attributes[attributeName] = attribute.value;\n }\n return attributes;\n }, {});\n\n var attributesNames = Object.keys(attributes);\n var commonAttributesNames = Object.keys(commonAttributes);\n\n if (attributesNames.length) {\n if (!commonAttributesNames.length) {\n commonProperties.attributes = attributes;\n } else {\n commonAttributes = commonAttributesNames.reduce(function (nextCommonAttributes, name) {\n var value = commonAttributes[name];\n if (value === attributes[name]) {\n nextCommonAttributes[name] = value;\n }\n return nextCommonAttributes;\n }, {});\n if (Object.keys(commonAttributes).length) {\n commonProperties.attributes = commonAttributes;\n } else {\n delete commonProperties.attributes;\n }\n }\n } else {\n delete commonProperties.attributes;\n }\n }\n\n // ~ tag\n if (commonTag !== undefined) {\n var tag = element.tagName.toLowerCase();\n if (!commonTag) {\n commonProperties.tag = tag;\n } else if (tag !== commonTag) {\n delete commonProperties.tag;\n }\n }\n });\n\n return commonProperties;\n}\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = optimize;\n\nvar _adapt = __webpack_require__(3);\n\nvar _adapt2 = _interopRequireDefault(_adapt);\n\nvar _utilities = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Apply different optimization techniques\n *\n * @param {string} selector - [description]\n * @param {HTMLElement|Array.} element - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\n/**\n * # Optimize\n *\n * 1.) Improve efficiency through shorter selectors by removing redundancy\n * 2.) Improve robustness through selector transformation\n */\n\nfunction optimize(selector, elements) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n\n // convert single entry and NodeList\n if (!Array.isArray(elements)) {\n elements = !elements.length ? [elements] : (0, _utilities.convertNodeList)(elements);\n }\n\n if (!elements.length || elements.some(function (element) {\n return element.nodeType !== 1;\n })) {\n throw new Error('Invalid input - to compare HTMLElements its necessary to provide a reference of the selected node(s)! (missing \"elements\")');\n }\n\n var globalModified = (0, _adapt2.default)(elements[0], options);\n\n // chunk parts outside of quotes (http://stackoverflow.com/a/25663729)\n var path = selector.replace(/> /g, '>').split(/\\s+(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/);\n\n if (path.length < 2) {\n return optimizePart('', selector, '', elements);\n }\n\n var shortened = [path.pop()];\n while (path.length > 1) {\n var current = path.pop();\n var prePart = path.join(' ');\n var postPart = shortened.join(' ');\n\n var pattern = prePart + ' ' + postPart;\n var matches = [];\n try {\n matches = document.querySelectorAll(pattern);\n } catch (err) {\n //\n }\n if (matches.length !== elements.length) {\n shortened.unshift(optimizePart(prePart, current, postPart, elements));\n }\n }\n shortened.unshift(path[0]);\n path = shortened;\n\n // optimize start + end\n path[0] = optimizePart('', path[0], path.slice(1).join(' '), elements);\n path[path.length - 1] = optimizePart(path.slice(0, -1).join(' '), path[path.length - 1], '', elements);\n\n if (globalModified) {\n delete true;\n }\n\n return path.join(' ').replace(/>/g, '> ').trim();\n}\n\n/**\n * Improve a chunk of the selector\n *\n * @param {string} prePart - [description]\n * @param {string} current - [description]\n * @param {string} postPart - [description]\n * @param {Array.} elements - [description]\n * @return {string} - [description]\n */\nfunction optimizePart(prePart, current, postPart, elements) {\n if (prePart.length) prePart = prePart + ' ';\n if (postPart.length) postPart = ' ' + postPart;\n\n // robustness: attribute without value (generalization)\n if (/\\[*\\]/.test(current)) {\n var key = current.replace(/=.*$/, ']');\n var pattern = '' + prePart + key + postPart;\n var matches = [];\n try {\n matches = document.querySelectorAll(pattern);\n } catch (err) {\n //\n }\n if (compareResults(matches, elements)) {\n current = key;\n } else {\n // robustness: replace specific key-value with base tag (heuristic)\n var references = [];\n try {\n references = document.querySelectorAll('' + prePart + key);\n } catch (err) {\n //\n }\n\n var _loop = function _loop() {\n var reference = references[i];\n if (elements.some(function (element) {\n return reference.contains(element);\n })) {\n var description = reference.tagName.toLowerCase();\n pattern = '' + prePart + description + postPart;\n\n var _matches = [];\n try {\n _matches = document.querySelectorAll(pattern);\n } catch (err) {\n //\n }\n if (compareResults(_matches, elements)) {\n current = description;\n }\n return 'break';\n }\n };\n\n for (var i = 0, l = references.length; i < l; i++) {\n var pattern;\n\n var _ret = _loop();\n\n if (_ret === 'break') break;\n }\n }\n }\n\n // robustness: descendant instead child (heuristic)\n if (/>/.test(current)) {\n var descendant = current.replace(/>/, '');\n var pattern = '' + prePart + descendant + postPart;\n var _matches2 = [];\n try {\n _matches2 = document.querySelectorAll(pattern);\n } catch (err) {\n //\n }\n if (compareResults(_matches2, elements)) {\n current = descendant;\n }\n }\n\n // robustness: 'nth-of-type' instead 'nth-child' (heuristic)\n if (/:nth-child/.test(current)) {\n // TODO: consider complete coverage of 'nth-of-type' replacement\n var type = current.replace(/nth-child/g, 'nth-of-type');\n var pattern = '' + prePart + type + postPart;\n var _matches3 = [];\n try {\n _matches3 = document.querySelectorAll(pattern);\n } catch (err) {\n //\n }\n if (compareResults(_matches3, elements)) {\n current = type;\n }\n }\n\n // efficiency: combinations of classname (partial permutations)\n if (/\\.\\S+\\.\\S+/.test(current)) {\n var names = current.trim().split('.').slice(1).map(function (name) {\n return '.' + name;\n }).sort(function (curr, next) {\n return curr.length - next.length;\n });\n while (names.length) {\n var partial = current.replace(names.shift(), '').trim();\n if (partial.charAt(0) === '>' || partial.charAt(partial.length - 1) === '>') {\n break;\n }\n var pattern = ('' + prePart + partial + postPart).trim();\n if (!pattern.length || pattern.charAt(0) === '>' || pattern.charAt(pattern.length - 1) === '>') {\n break;\n }\n var _matches4 = [];\n\n try {\n _matches4 = document.querySelectorAll(pattern);\n } catch (err) {\n //\n }\n if (compareResults(_matches4, elements)) {\n current = partial;\n }\n }\n\n // robustness: degrade complex classname (heuristic)\n names = current && current.match(/\\./g);\n if (names && names.length > 2) {\n var _references = [];\n try {\n _references = document.querySelectorAll('' + prePart + current);\n } catch (err) {\n //\n }\n\n var _loop2 = function _loop2() {\n var reference = _references[i];\n if (elements.some(function (element) {\n return reference.contains(element);\n })) {\n // TODO:\n // - check using attributes + regard excludes\n var description = reference.tagName.toLowerCase();\n pattern = '' + prePart + description + postPart;\n\n var _matches5 = [];\n try {\n _matches5 = document.querySelectorAll(pattern);\n } catch (err) {\n //\n }\n if (compareResults(_matches5, elements)) {\n current = description;\n }\n return 'break';\n }\n };\n\n for (var i = 0, l = _references.length; i < l; i++) {\n var pattern;\n\n var _ret2 = _loop2();\n\n if (_ret2 === 'break') break;\n }\n }\n }\n\n return current;\n}\n\n/**\n * Evaluate matches with expected elements\n *\n * @param {Array.} matches - [description]\n * @param {Array.} elements - [description]\n * @return {Boolean} - [description]\n */\nfunction compareResults(matches, elements) {\n var length = matches.length;\n\n return length === elements.length && elements.every(function (element) {\n for (var i = 0; i < length; i++) {\n if (matches[i] === element) {\n return true;\n }\n }\n return false;\n });\n}\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.default = adapt;\n/**\n * # Adapt\n *\n * Check and extend the environment for universal usage.\n */\n\n/**\n * Modify the context based on the environment\n *\n * @param {HTMLELement} element - [description]\n * @param {Object} options - [description]\n * @return {boolean} - [description]\n */\nfunction adapt(element, options) {\n\n // detect environment setup\n if (true) {\n return false;\n } else {\n global.document = options.context || function () {\n var root = element;\n while (root.parent) {\n root = root.parent;\n }\n return root;\n }();\n }\n\n // https://github.com/fb55/domhandler/blob/master/index.js#L75\n var ElementPrototype = Object.getPrototypeOf(true);\n\n // alternative descriptor to access elements with filtering invalid elements (e.g. textnodes)\n if (!Object.getOwnPropertyDescriptor(ElementPrototype, 'childTags')) {\n Object.defineProperty(ElementPrototype, 'childTags', {\n enumerable: true,\n get: function get() {\n return this.children.filter(function (node) {\n // https://github.com/fb55/domelementtype/blob/master/index.js#L12\n return node.type === 'tag' || node.type === 'script' || node.type === 'style';\n });\n }\n });\n }\n\n if (!Object.getOwnPropertyDescriptor(ElementPrototype, 'attributes')) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes\n // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap\n Object.defineProperty(ElementPrototype, 'attributes', {\n enumerable: true,\n get: function get() {\n var attribs = this.attribs;\n\n var attributesNames = Object.keys(attribs);\n var NamedNodeMap = attributesNames.reduce(function (attributes, attributeName, index) {\n attributes[index] = {\n name: attributeName,\n value: attribs[attributeName]\n };\n return attributes;\n }, {});\n Object.defineProperty(NamedNodeMap, 'length', {\n enumerable: false,\n configurable: false,\n value: attributesNames.length\n });\n return NamedNodeMap;\n }\n });\n }\n\n if (!ElementPrototype.getAttribute) {\n // https://docs.webplatform.org/wiki/dom/Element/getAttribute\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute\n ElementPrototype.getAttribute = function (name) {\n return this.attribs[name] || null;\n };\n }\n\n if (!ElementPrototype.getElementsByTagName) {\n // https://docs.webplatform.org/wiki/dom/Document/getElementsByTagName\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName\n ElementPrototype.getElementsByTagName = function (tagName) {\n var HTMLCollection = [];\n traverseDescendants(this.childTags, function (descendant) {\n if (descendant.name === tagName || tagName === '*') {\n HTMLCollection.push(descendant);\n }\n });\n return HTMLCollection;\n };\n }\n\n if (!ElementPrototype.getElementsByClassName) {\n // https://docs.webplatform.org/wiki/dom/Document/getElementsByClassName\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByClassName\n ElementPrototype.getElementsByClassName = function (className) {\n var names = className.trim().replace(/\\s+/g, ' ').split(' ');\n var HTMLCollection = [];\n traverseDescendants([this], function (descendant) {\n var descendantClassName = descendant.attribs.class;\n if (descendantClassName && names.every(function (name) {\n return descendantClassName.indexOf(name) > -1;\n })) {\n HTMLCollection.push(descendant);\n }\n });\n return HTMLCollection;\n };\n }\n\n if (!ElementPrototype.querySelectorAll) {\n // https://docs.webplatform.org/wiki/css/selectors_api/querySelectorAll\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelectorAll\n ElementPrototype.querySelectorAll = function (selectors) {\n var _this = this;\n\n selectors = selectors.replace(/(>)(\\S)/g, '$1 $2').trim(); // add space for '>' selector\n\n // using right to left execution => https://github.com/fb55/css-select#how-does-it-work\n var instructions = getInstructions(selectors);\n var discover = instructions.shift();\n\n var total = instructions.length;\n return discover(this).filter(function (node) {\n var step = 0;\n while (step < total) {\n node = instructions[step](node, _this);\n if (!node) {\n // hierarchy doesn't match\n return false;\n }\n step += 1;\n }\n return true;\n });\n };\n }\n\n if (!ElementPrototype.contains) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/contains\n ElementPrototype.contains = function (element) {\n var inclusive = false;\n traverseDescendants([this], function (descendant, done) {\n if (descendant === element) {\n inclusive = true;\n done();\n }\n });\n return inclusive;\n };\n }\n\n return true;\n}\n\n/**\n * Retrieve transformation steps\n *\n * @param {Array.} selectors - [description]\n * @return {Array.} - [description]\n */\nfunction getInstructions(selectors) {\n return selectors.split(' ').reverse().map(function (selector, step) {\n var discover = step === 0;\n\n var _selector$split = selector.split(':'),\n _selector$split2 = _slicedToArray(_selector$split, 2),\n type = _selector$split2[0],\n pseudo = _selector$split2[1];\n\n var validate = null;\n var instruction = null;\n\n switch (true) {\n\n // child: '>'\n case />/.test(type):\n instruction = function checkParent(node) {\n return function (validate) {\n return validate(node.parent) && node.parent;\n };\n };\n break;\n\n // class: '.'\n case /^\\./.test(type):\n var names = type.substr(1).split('.');\n validate = function validate(node) {\n var nodeClassName = node.attribs.class;\n return nodeClassName && names.every(function (name) {\n return nodeClassName.indexOf(name) > -1;\n });\n };\n instruction = function checkClass(node, root) {\n if (discover) {\n return node.getElementsByClassName(names.join(' '));\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n break;\n\n // attribute: '[key=\"value\"]'\n case /^\\[/.test(type):\n var _type$replace$split = type.replace(/\\[|\\]|\"/g, '').split('='),\n _type$replace$split2 = _slicedToArray(_type$replace$split, 2),\n attributeKey = _type$replace$split2[0],\n attributeValue = _type$replace$split2[1];\n\n validate = function validate(node) {\n var hasAttribute = Object.keys(node.attribs).indexOf(attributeKey) > -1;\n if (hasAttribute) {\n // regard optional attributeValue\n if (!attributeValue || node.attribs[attributeKey] === attributeValue) {\n return true;\n }\n }\n return false;\n };\n instruction = function checkAttribute(node, root) {\n if (discover) {\n var NodeList = [];\n traverseDescendants([node], function (descendant) {\n if (validate(descendant)) {\n NodeList.push(descendant);\n }\n });\n return NodeList;\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n break;\n\n // id: '#'\n case /^#/.test(type):\n var id = type.substr(1);\n validate = function validate(node) {\n return node.attribs.id === id;\n };\n instruction = function checkId(node, root) {\n if (discover) {\n var NodeList = [];\n traverseDescendants([node], function (descendant, done) {\n if (validate(descendant)) {\n NodeList.push(descendant);\n done();\n }\n });\n return NodeList;\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n break;\n\n // universal: '*'\n case /\\*/.test(type):\n validate = function validate(node) {\n return true;\n };\n instruction = function checkUniversal(node, root) {\n if (discover) {\n var NodeList = [];\n traverseDescendants([node], function (descendant) {\n return NodeList.push(descendant);\n });\n return NodeList;\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n break;\n\n // tag: '...'\n default:\n validate = function validate(node) {\n return node.name === type;\n };\n instruction = function checkTag(node, root) {\n if (discover) {\n var NodeList = [];\n traverseDescendants([node], function (descendant) {\n if (validate(descendant)) {\n NodeList.push(descendant);\n }\n });\n return NodeList;\n }\n return typeof node === 'function' ? node(validate) : getAncestor(node, root, validate);\n };\n }\n\n if (!pseudo) {\n return instruction;\n }\n\n var rule = pseudo.match(/-(child|type)\\((\\d+)\\)$/);\n var kind = rule[1];\n var index = parseInt(rule[2], 10) - 1;\n\n var validatePseudo = function validatePseudo(node) {\n if (node) {\n var compareSet = node.parent.childTags;\n if (kind === 'type') {\n compareSet = compareSet.filter(validate);\n }\n var nodeIndex = compareSet.findIndex(function (child) {\n return child === node;\n });\n if (nodeIndex === index) {\n return true;\n }\n }\n return false;\n };\n\n return function enhanceInstruction(node) {\n var match = instruction(node);\n if (discover) {\n return match.reduce(function (NodeList, matchedNode) {\n if (validatePseudo(matchedNode)) {\n NodeList.push(matchedNode);\n }\n return NodeList;\n }, []);\n }\n return validatePseudo(match) && match;\n };\n });\n}\n\n/**\n * Walking recursive to invoke callbacks\n *\n * @param {Array.} nodes - [description]\n * @param {Function} handler - [description]\n */\nfunction traverseDescendants(nodes, handler) {\n nodes.forEach(function (node) {\n var progress = true;\n handler(node, function () {\n return progress = false;\n });\n if (node.childTags && progress) {\n traverseDescendants(node.childTags, handler);\n }\n });\n}\n\n/**\n * Bubble up from bottom to top\n *\n * @param {HTMLELement} node - [description]\n * @param {HTMLELement} root - [description]\n * @param {Function} validate - [description]\n * @return {HTMLELement} - [description]\n */\nfunction getAncestor(node, root, validate) {\n while (node.parent) {\n node = node.parent;\n if (validate(node)) {\n return node;\n }\n if (node === root) {\n break;\n }\n }\n return null;\n}\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; /**\n * # Select\n *\n * Construct a unique CSS query selector to access the selected DOM element(s).\n * For longevity it applies different matching and optimization strategies.\n */\n\nexports.getSingleSelector = getSingleSelector;\nexports.getMultiSelector = getMultiSelector;\nexports.default = getQuerySelector;\n\nvar _adapt = __webpack_require__(3);\n\nvar _adapt2 = _interopRequireDefault(_adapt);\n\nvar _match = __webpack_require__(7);\n\nvar _match2 = _interopRequireDefault(_match);\n\nvar _optimize = __webpack_require__(2);\n\nvar _optimize2 = _interopRequireDefault(_optimize);\n\nvar _utilities = __webpack_require__(0);\n\nvar _common = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Get a selector for the provided element\n *\n * @param {HTMLElement} element - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\nfunction getSingleSelector(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\n if (element.nodeType === 3) {\n element = element.parentNode;\n }\n\n if (element.nodeType !== 1) {\n throw new Error('Invalid input - only HTMLElements or representations of them are supported! (not \"' + (typeof element === 'undefined' ? 'undefined' : _typeof(element)) + '\")');\n }\n\n var globalModified = (0, _adapt2.default)(element, options);\n\n var selector = (0, _match2.default)(element, options);\n var optimized = (0, _optimize2.default)(selector, element, options);\n\n // debug\n // console.log(`\n // selector: ${selector}\n // optimized: ${optimized}\n // `)\n\n if (globalModified) {\n delete true;\n }\n\n return optimized;\n}\n\n/**\n * Get a selector to match multiple descendants from an ancestor\n *\n * @param {Array.|NodeList} elements - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\nfunction getMultiSelector(elements) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\n if (!Array.isArray(elements)) {\n elements = (0, _utilities.convertNodeList)(elements);\n }\n\n if (elements.some(function (element) {\n return element.nodeType !== 1;\n })) {\n throw new Error('Invalid input - only an Array of HTMLElements or representations of them is supported!');\n }\n\n var globalModified = (0, _adapt2.default)(elements[0], options);\n\n var ancestor = (0, _common.getCommonAncestor)(elements, options);\n var ancestorSelector = getSingleSelector(ancestor, options);\n\n // TODO: consider usage of multiple selectors + parent-child relation + check for part redundancy\n var commonSelectors = getCommonSelectors(elements);\n var descendantSelector = commonSelectors[0];\n\n var selector = (0, _optimize2.default)(ancestorSelector + ' ' + descendantSelector, elements, options);\n var selectorMatches = (0, _utilities.convertNodeList)(document.querySelectorAll(selector));\n\n if (!elements.every(function (element) {\n return selectorMatches.some(function (entry) {\n return entry === element;\n });\n })) {\n // TODO: cluster matches to split into similar groups for sub selections\n return console.warn('\\n The selected elements can\\'t be efficiently mapped.\\n Its probably best to use multiple single selectors instead!\\n ', elements);\n }\n\n if (globalModified) {\n delete true;\n }\n\n return selector;\n}\n\n/**\n * Get selectors to describe a set of elements\n *\n * @param {Array.} elements - [description]\n * @return {string} - [description]\n */\nfunction getCommonSelectors(elements) {\n var _getCommonProperties = (0, _common.getCommonProperties)(elements),\n classes = _getCommonProperties.classes,\n attributes = _getCommonProperties.attributes,\n tag = _getCommonProperties.tag;\n\n var selectorPath = [];\n\n if (tag) {\n selectorPath.push(tag);\n }\n\n if (classes) {\n var classSelector = classes.map(function (name) {\n return '.' + name;\n }).join('');\n selectorPath.push(classSelector);\n }\n\n if (attributes) {\n var attributeSelector = Object.keys(attributes).reduce(function (parts, name) {\n parts.push('[' + name + '=\"' + attributes[name] + '\"]');\n return parts;\n }, []).join('');\n selectorPath.push(attributeSelector);\n }\n\n if (selectorPath.length) {\n // TODO: check for parent-child relation\n }\n\n return [selectorPath.join('')];\n}\n\n/**\n * Choose action depending on the input (multiple/single)\n *\n * NOTE: extended detection is used for special cases like the element with \n *\n * @param {HTMLElement|NodeList|Array.} input - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\nexport default function getQuerySelector (input, options = {}) {\n if (input.length && !input.name) {\n return getMultiSelector(input, options)\n }\n return getSingleSelector(input, options)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/select.js","/*! https://mths.be/cssesc v3.0.0 by @mathias */\n'use strict';\n\nvar object = {};\nvar hasOwnProperty = object.hasOwnProperty;\nvar merge = function merge(options, defaults) {\n\tif (!options) {\n\t\treturn defaults;\n\t}\n\tvar result = {};\n\tfor (var key in defaults) {\n\t\t// `if (defaults.hasOwnProperty(key) { … }` is not needed here, since\n\t\t// only recognized option names are used.\n\t\tresult[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];\n\t}\n\treturn result;\n};\n\nvar regexAnySingleEscape = /[ -,\\.\\/:-@\\[-\\^`\\{-~]/;\nvar regexSingleEscape = /[ -,\\.\\/:-@\\[\\]\\^`\\{-~]/;\nvar regexAlwaysEscape = /['\"\\\\]/;\nvar regexExcessiveSpaces = /(^|\\\\+)?(\\\\[A-F0-9]{1,6})\\x20(?![a-fA-F0-9\\x20])/g;\n\n// https://mathiasbynens.be/notes/css-escapes#css\nvar cssesc = function cssesc(string, options) {\n\toptions = merge(options, cssesc.options);\n\tif (options.quotes != 'single' && options.quotes != 'double') {\n\t\toptions.quotes = 'single';\n\t}\n\tvar quote = options.quotes == 'double' ? '\"' : '\\'';\n\tvar isIdentifier = options.isIdentifier;\n\n\tvar firstChar = string.charAt(0);\n\tvar output = '';\n\tvar counter = 0;\n\tvar length = string.length;\n\twhile (counter < length) {\n\t\tvar character = string.charAt(counter++);\n\t\tvar codePoint = character.charCodeAt();\n\t\tvar value = void 0;\n\t\t// If it’s not a printable ASCII character…\n\t\tif (codePoint < 0x20 || codePoint > 0x7E) {\n\t\t\tif (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {\n\t\t\t\t// It’s a high surrogate, and there is a next character.\n\t\t\t\tvar extra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) {\n\t\t\t\t\t// next character is low surrogate\n\t\t\t\t\tcodePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;\n\t\t\t\t} else {\n\t\t\t\t\t// It’s an unmatched surrogate; only append this code unit, in case\n\t\t\t\t\t// the next code unit is the high surrogate of a surrogate pair.\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t} else {\n\t\t\tif (options.escapeEverything) {\n\t\t\t\tif (regexAnySingleEscape.test(character)) {\n\t\t\t\t\tvalue = '\\\\' + character;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t\t\t}\n\t\t\t} else if (/[\\t\\n\\f\\r\\x0B]/.test(character)) {\n\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t\t} else if (character == '\\\\' || !isIdentifier && (character == '\"' && quote == character || character == '\\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {\n\t\t\t\tvalue = '\\\\' + character;\n\t\t\t} else {\n\t\t\t\tvalue = character;\n\t\t\t}\n\t\t}\n\t\toutput += value;\n\t}\n\n\tif (isIdentifier) {\n\t\tif (/^-[-\\d]/.test(output)) {\n\t\t\toutput = '\\\\-' + output.slice(1);\n\t\t} else if (/\\d/.test(firstChar)) {\n\t\t\toutput = '\\\\3' + firstChar + ' ' + output.slice(1);\n\t\t}\n\t}\n\n\t// Remove spaces after `\\HEX` escapes that are not followed by a hex digit,\n\t// since they’re redundant. Note that this is only possible if the escape\n\t// sequence isn’t preceded by an odd number of backslashes.\n\toutput = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {\n\t\tif ($1 && $1.length % 2) {\n\t\t\t// It’s not safe to remove the space, so don’t.\n\t\t\treturn $0;\n\t\t}\n\t\t// Strip the space.\n\t\treturn ($1 || '') + $2;\n\t});\n\n\tif (!isIdentifier && options.wrap) {\n\t\treturn quote + output + quote;\n\t}\n\treturn output;\n};\n\n// Expose default options (so they can be overridden globally).\ncssesc.options = {\n\t'escapeEverything': false,\n\t'isIdentifier': false,\n\t'quotes': 'single',\n\t'wrap': false\n};\n\ncssesc.version = '3.0.0';\n\nmodule.exports = cssesc;\n\n\n\n// WEBPACK FOOTER //\n// ./~/cssesc/cssesc.js","export select, { getSingleSelector, getMultiSelector } from './select'\nexport optimize from './optimize'\nexport * as common from './common'\n\nexport default from './select'\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","/**\n * # Match\n *\n * Retrieve selector for a node.\n */\n\nimport { escapeValue } from './utilities'\n\nconst defaultIgnore = {\n attribute (attributeName) {\n return [\n 'style',\n 'data-reactid',\n 'data-react-checksum'\n ].indexOf(attributeName) > -1\n }\n}\n\n/**\n * Get the path of the element\n *\n * @param {HTMLElement} node - [description]\n * @param {Object} options - [description]\n * @return {string} - [description]\n */\nexport default function match (node, options) {\n\n const {\n root = document,\n skip = null,\n priority = ['id', 'class', 'href', 'src'],\n ignore = {}\n } = options\n\n const path = []\n var element = node\n var length = path.length\n var ignoreClass = false\n\n const skipCompare = skip && (Array.isArray(skip) ? skip : [skip]).map((entry) => {\n if (typeof entry !== 'function') {\n return (element) => element === entry\n }\n return entry\n })\n\n const skipChecks = (element) => {\n return skip && skipCompare.some((compare) => compare(element))\n }\n\n Object.keys(ignore).forEach((type) => {\n if (type === 'class') {\n ignoreClass = true\n }\n var predicate = ignore[type]\n if (typeof predicate === 'function') return\n if (typeof predicate === 'number') {\n predicate = predicate.toString()\n }\n if (typeof predicate === 'string') {\n predicate = new RegExp(escapeValue(predicate).replace(/\\\\/g, '\\\\\\\\'))\n }\n if (typeof predicate === 'boolean') {\n predicate = predicate ? /(?:)/ : /.^/\n }\n // check class-/attributename for regex\n ignore[type] = (name, value) => predicate.test(value)\n })\n\n if (ignoreClass) {\n const ignoreAttribute = ignore.attribute\n ignore.attribute = (name, value, defaultPredicate) => {\n return ignore.class(value) || ignoreAttribute && ignoreAttribute(name, value, defaultPredicate)\n }\n }\n\n while (element !== root) {\n if (skipChecks(element) !== true) {\n // ~ global\n if (checkAttributes(priority, element, ignore, path, root)) break\n if (checkTag(element, ignore, path, root)) break\n\n // ~ local\n checkAttributes(priority, element, ignore, path)\n if (path.length === length) {\n checkTag(element, ignore, path)\n }\n\n // define only one part each iteration\n if (path.length === length) {\n checkChilds(priority, element, ignore, path)\n }\n }\n\n element = element.parentNode\n length = path.length\n }\n\n if (element === root) {\n const pattern = findPattern(priority, element, ignore)\n path.unshift(pattern)\n }\n\n return path.join(' ')\n}\n\n/**\n * Extend path with attribute identifier\n *\n * @param {Array.} priority - [description]\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @param {Array.} path - [description]\n * @param {HTMLElement} parent - [description]\n * @return {boolean} - [description]\n */\nfunction checkAttributes (priority, element, ignore, path, parent = element.parentNode) {\n const pattern = findAttributesPattern(priority, element, ignore)\n if (pattern) {\n const matches = parent.querySelectorAll(pattern)\n if (matches.length === 1) {\n path.unshift(pattern)\n return true\n }\n }\n return false\n}\n\n/**\n * Lookup attribute identifier\n *\n * @param {Array.} priority - [description]\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @return {string?} - [description]\n */\nfunction findAttributesPattern (priority, element, ignore) {\n const attributes = element.attributes\n const sortedKeys = Object.keys(attributes).sort((curr, next) => {\n const currPos = priority.indexOf(attributes[curr].name)\n const nextPos = priority.indexOf(attributes[next].name)\n if (nextPos === -1) {\n if (currPos === -1) {\n return 0\n }\n return -1\n }\n if (currPos === -1) {\n return 1\n }\n return currPos - nextPos;\n })\n\n for (var i = 0, l = sortedKeys.length; i < l; i++) {\n const key = sortedKeys[i]\n const attribute = attributes[key]\n const attributeName = attribute.name\n const attributeValue = escapeValue(attribute.value)\n\n const currentIgnore = ignore[attributeName] || ignore.attribute\n const currentDefaultIgnore = defaultIgnore[attributeName] || defaultIgnore.attribute\n if (checkIgnore(currentIgnore, attributeName, attributeValue, currentDefaultIgnore)) {\n continue\n }\n\n var pattern = `[${attributeName}=\"${attributeValue}\"]`\n\n if (attributeName === 'id' && (/^[A-Za-z][-\\d\\w:,.]*$/).test(attributeValue)) {\n pattern = `#${attributeValue}`\n }\n\n if (attributeName === 'class' && (/^[A-Za-z][-\\d\\w]*$/).test(attributeValue)) {\n const className = attributeValue.trim().replace(/\\s+/g, '.')\n pattern = `.${className}`\n }\n\n return pattern\n }\n return null\n}\n\n/**\n * Extend path with tag identifier\n *\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @param {Array.} path - [description]\n * @param {HTMLElement} parent - [description]\n * @return {boolean} - [description]\n */\nfunction checkTag (element, ignore, path, parent = element.parentNode) {\n const pattern = findTagPattern(element, ignore)\n if (pattern) {\n const matches = parent.getElementsByTagName(pattern)\n if (matches.length === 1) {\n path.unshift(pattern)\n return true\n }\n }\n return false\n}\n\n/**\n * Lookup tag identifier\n *\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @return {boolean} - [description]\n */\nfunction findTagPattern (element, ignore) {\n const tagName = element.tagName.toLowerCase()\n if (checkIgnore(ignore.tag, null, tagName)) {\n return null\n }\n return tagName\n}\n\n/**\n * Extend path with specific child identifier\n *\n * NOTE: 'childTags' is a custom property to use as a view filter for tags using 'adapter.js'\n *\n * @param {Array.} priority - [description]\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @param {Array.} path - [description]\n * @return {boolean} - [description]\n */\nfunction checkChilds (priority, element, ignore, path) {\n const parent = element.parentNode\n const children = parent.childTags || parent.children\n for (var i = 0, l = children.length; i < l; i++) {\n const child = children[i]\n if (child === element) {\n const childPattern = findPattern(priority, child, ignore)\n if (!childPattern) {\n return console.warn(`\n Element couldn\\'t be matched through strict ignore pattern!\n `, child, ignore, childPattern)\n }\n const pattern = `> ${childPattern}:nth-child(${i+1})`\n path.unshift(pattern)\n return true\n }\n }\n return false\n}\n\n/**\n * Lookup identifier\n *\n * @param {Array.} priority - [description]\n * @param {HTMLElement} element - [description]\n * @param {Object} ignore - [description]\n * @return {string} - [description]\n */\nfunction findPattern (priority, element, ignore) {\n var pattern = findAttributesPattern(priority, element, ignore)\n if (!pattern) {\n pattern = findTagPattern(element, ignore)\n }\n return pattern\n}\n\n/**\n * Validate with custom and default functions\n *\n * @param {Function} predicate - [description]\n * @param {string?} name - [description]\n * @param {string} value - [description]\n * @param {Function} defaultPredicate - [description]\n * @return {boolean} - [description]\n */\nfunction checkIgnore (predicate, name, value, defaultPredicate) {\n if (!value) {\n return true\n }\n const check = predicate || defaultPredicate\n if (!check) {\n return false\n }\n return check(name, value, defaultPredicate)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/match.js"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index f5b85e5..f48a5b7 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "babel-preset-stage-0": "^6.16.0", "babel-register": "^6.16.3", "cheerio": "^0.22.0", + "cssesc": "^3.0.0", "deep-merge": "^1.0.0", "fs-extra": "^1.0.0", "gulp": "^3.9.1", diff --git a/src/optimize.js b/src/optimize.js index 2d89309..fafde8d 100644 --- a/src/optimize.js +++ b/src/optimize.js @@ -43,7 +43,12 @@ export default function optimize (selector, elements, options = {}) { const postPart = shortened.join(' ') const pattern = `${prePart} ${postPart}` - const matches = document.querySelectorAll(pattern) + let matches = []; + try { + matches = document.querySelectorAll(pattern) + } catch(err) { + // + } if (matches.length !== elements.length) { shortened.unshift(optimizePart(prePart, current, postPart, elements)) } @@ -79,18 +84,33 @@ function optimizePart (prePart, current, postPart, elements) { if (/\[*\]/.test(current)) { const key = current.replace(/=.*$/, ']') var pattern = `${prePart}${key}${postPart}` - var matches = document.querySelectorAll(pattern) + let matches = []; + try { + matches = document.querySelectorAll(pattern) + } catch(err) { + // + } if (compareResults(matches, elements)) { current = key } else { // robustness: replace specific key-value with base tag (heuristic) - const references = document.querySelectorAll(`${prePart}${key}`) + let references = []; + try { + references = document.querySelectorAll(`${prePart}${key}`) + } catch(err) { + // + } for (var i = 0, l = references.length; i < l; i++) { const reference = references[i] if (elements.some((element) => reference.contains(element))) { const description = reference.tagName.toLowerCase() var pattern = `${prePart}${description}${postPart}` - var matches = document.querySelectorAll(pattern) + let matches = []; + try { + matches = document.querySelectorAll(pattern) + } catch(err) { + // + } if (compareResults(matches, elements)) { current = description } @@ -104,7 +124,12 @@ function optimizePart (prePart, current, postPart, elements) { if (/>/.test(current)) { const descendant = current.replace(/>/, '') var pattern = `${prePart}${descendant}${postPart}` - var matches = document.querySelectorAll(pattern) + let matches = []; + try { + matches = document.querySelectorAll(pattern) + } catch(err) { + // + } if (compareResults(matches, elements)) { current = descendant } @@ -115,7 +140,12 @@ function optimizePart (prePart, current, postPart, elements) { // TODO: consider complete coverage of 'nth-of-type' replacement const type = current.replace(/nth-child/g, 'nth-of-type') var pattern = `${prePart}${type}${postPart}` - var matches = document.querySelectorAll(pattern) + let matches = []; + try { + matches = document.querySelectorAll(pattern) + } catch(err) { + // + } if (compareResults(matches, elements)) { current = type } @@ -125,14 +155,23 @@ function optimizePart (prePart, current, postPart, elements) { if (/\.\S+\.\S+/.test(current)) { var names = current.trim().split('.').slice(1) .map((name) => `.${name}`) - .sort((curr, next) => curr.length - next.length) + .sort((curr, next) => curr.length - next.length); while (names.length) { const partial = current.replace(names.shift(), '').trim() + if(partial.charAt(0) === '>' || partial.charAt(partial.length-1) === '>') { + break + } var pattern = `${prePart}${partial}${postPart}`.trim() if (!pattern.length || pattern.charAt(0) === '>' || pattern.charAt(pattern.length-1) === '>') { break } - var matches = document.querySelectorAll(pattern) + let matches = []; + + try { + matches = document.querySelectorAll(pattern) + } catch(err) { + // + } if (compareResults(matches, elements)) { current = partial } @@ -141,7 +180,12 @@ function optimizePart (prePart, current, postPart, elements) { // robustness: degrade complex classname (heuristic) names = current && current.match(/\./g) if (names && names.length > 2) { - const references = document.querySelectorAll(`${prePart}${current}`) + let references = []; + try { + references = document.querySelectorAll(`${prePart}${current}`); + } catch (err) { + // + } for (var i = 0, l = references.length; i < l; i++) { const reference = references[i] if (elements.some((element) => reference.contains(element) )) { @@ -149,7 +193,12 @@ function optimizePart (prePart, current, postPart, elements) { // - check using attributes + regard excludes const description = reference.tagName.toLowerCase() var pattern = `${prePart}${description}${postPart}` - var matches = document.querySelectorAll(pattern) + let matches = []; + try { + matches = document.querySelectorAll(pattern) + } catch(err) { + // + } if (compareResults(matches, elements)) { current = description } diff --git a/src/utilities.js b/src/utilities.js index da1837e..9955d16 100644 --- a/src/utilities.js +++ b/src/utilities.js @@ -4,6 +4,8 @@ * Convenience helpers. */ +const cssesc = require('cssesc'); + /** * Create an array with the DOM nodes of the list * @@ -28,6 +30,5 @@ export function convertNodeList (nodes) { * @return {String} - [description] */ export function escapeValue (value) { - return value && value.replace(/['"`\\/:\?&!#$%^()[\]{|}*+;,.<=>@~]/g, '\\$&') - .replace(/\n/g, '\A') + return value && cssesc(value); }