netscape-bookmark-parser 0.0.1-pre1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +234 -0
  3. package/esm/_dnt.polyfills.d.ts +101 -0
  4. package/esm/_dnt.polyfills.d.ts.map +1 -0
  5. package/esm/_dnt.polyfills.js +127 -0
  6. package/esm/_dnt.shims.d.ts +6 -0
  7. package/esm/_dnt.shims.d.ts.map +1 -0
  8. package/esm/_dnt.shims.js +61 -0
  9. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/build/deno-wasm/deno-wasm.d.ts +14 -0
  10. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/build/deno-wasm/deno-wasm.d.ts.map +1 -0
  11. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/build/deno-wasm/deno-wasm.js +151 -0
  12. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/deno-dom-wasm.d.ts +23 -0
  13. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/deno-dom-wasm.d.ts.map +1 -0
  14. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/deno-dom-wasm.js +26 -0
  15. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/api.d.ts +24 -0
  16. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/api.d.ts.map +1 -0
  17. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/api.js +48 -0
  18. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/constructor-lock.d.ts +5 -0
  19. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/constructor-lock.d.ts.map +1 -0
  20. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/constructor-lock.js +4 -0
  21. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/deserialize.d.ts +4 -0
  22. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/deserialize.d.ts.map +1 -0
  23. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/deserialize.js +61 -0
  24. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/document-fragment.d.ts +19 -0
  25. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/document-fragment.d.ts.map +1 -0
  26. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/document-fragment.js +110 -0
  27. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/document.d.ts +68 -0
  28. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/document.d.ts.map +1 -0
  29. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/document.js +322 -0
  30. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/dom-parser.d.ts +6 -0
  31. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/dom-parser.d.ts.map +1 -0
  32. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/dom-parser.js +46 -0
  33. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/element.d.ts +127 -0
  34. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/element.d.ts.map +1 -0
  35. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/element.js +1068 -0
  36. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/elements/html-template-element.d.ts +29 -0
  37. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/elements/html-template-element.d.ts.map +1 -0
  38. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/elements/html-template-element.js +94 -0
  39. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/html-collection.d.ts +21 -0
  40. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/html-collection.d.ts.map +1 -0
  41. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/html-collection.js +80 -0
  42. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/node-list.d.ts +23 -0
  43. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/node-list.d.ts.map +1 -0
  44. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/node-list.js +159 -0
  45. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/node.d.ts +127 -0
  46. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/node.d.ts.map +1 -0
  47. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/node.js +629 -0
  48. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/custom-api.d.ts +6 -0
  49. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/custom-api.d.ts.map +1 -0
  50. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/custom-api.js +5 -0
  51. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/nwsapi-types.d.ts +12 -0
  52. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/nwsapi-types.d.ts.map +1 -0
  53. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/nwsapi-types.js +2 -0
  54. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/nwsapi.d.ts +90 -0
  55. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/nwsapi.d.ts.map +1 -0
  56. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/nwsapi.js +1611 -0
  57. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/selectors.d.ts +16 -0
  58. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/selectors.d.ts.map +1 -0
  59. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/selectors.js +28 -0
  60. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/sizzle-types.d.ts +8 -0
  61. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/sizzle-types.d.ts.map +1 -0
  62. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/sizzle-types.js +2 -0
  63. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/sizzle.d.ts +7 -0
  64. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/sizzle.d.ts.map +1 -0
  65. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/selectors/sizzle.js +2061 -0
  66. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/string-cache.d.ts +3 -0
  67. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/string-cache.d.ts.map +1 -0
  68. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/string-cache.js +10 -0
  69. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/utils-types.d.ts +13 -0
  70. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/utils-types.d.ts.map +1 -0
  71. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/utils-types.js +8 -0
  72. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/utils.d.ts +31 -0
  73. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/utils.d.ts.map +1 -0
  74. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/dom/utils.js +239 -0
  75. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/parser.d.ts +5 -0
  76. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/parser.d.ts.map +1 -0
  77. package/esm/deps/jsr.io/@b-fuze/deno-dom/0.1.49/src/parser.js +20 -0
  78. package/esm/mod.d.ts +10 -0
  79. package/esm/mod.d.ts.map +1 -0
  80. package/esm/mod.js +9 -0
  81. package/esm/package.json +3 -0
  82. package/esm/src/BookmarksTree/BookmarksTree.d.ts +16 -0
  83. package/esm/src/BookmarksTree/BookmarksTree.d.ts.map +1 -0
  84. package/esm/src/BookmarksTree/BookmarksTree.js +113 -0
  85. package/esm/src/BookmarksTree/index.d.ts +8 -0
  86. package/esm/src/BookmarksTree/index.d.ts.map +1 -0
  87. package/esm/src/BookmarksTree/index.js +7 -0
  88. package/esm/src/Parser/Parser.d.ts +11 -0
  89. package/esm/src/Parser/Parser.d.ts.map +1 -0
  90. package/esm/src/Parser/Parser.js +15 -0
  91. package/esm/src/Parser/index.d.ts +8 -0
  92. package/esm/src/Parser/index.d.ts.map +1 -0
  93. package/esm/src/Parser/index.js +7 -0
  94. package/package.json +20 -0
@@ -0,0 +1,2061 @@
1
+ /*!
2
+ * Sizzle CSS Selector Engine v2.3.7-pre
3
+ * https://sizzlejs.com/
4
+ *
5
+ * Copyright JS Foundation and other contributors
6
+ * Released under the MIT license
7
+ * https://js.foundation/
8
+ *
9
+ * Date: 2022-04-02
10
+ *
11
+ * git commit hash for Deno DOM: ede0e97563c8473b8cfa4045c7c2cd6129ecc1aa
12
+ */
13
+ import { customByTagNameSym, customByClassNameSym } from "./custom-api.js";
14
+ export default document => {
15
+ const sizzleWindow = {
16
+ document,
17
+ };
18
+ SetupSizzle(sizzleWindow);
19
+ const { Sizzle } = sizzleWindow;
20
+ return {
21
+ first(selectors, context) {
22
+ return Sizzle(selectors, context)[0] ?? null;
23
+ },
24
+ select(selectors, context) {
25
+ return Sizzle(selectors, context);
26
+ },
27
+ match(selectors, context) {
28
+ return Sizzle.matchesSelector(context, selectors);
29
+ },
30
+ };
31
+ };
32
+ function SetupSizzle(window) {
33
+ var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate,
34
+ // Local document vars
35
+ setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains,
36
+ // Instance-specific data
37
+ expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function (a, b) {
38
+ if (a === b) {
39
+ hasDuplicate = true;
40
+ }
41
+ return 0;
42
+ },
43
+ // Instance methods
44
+ hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, pushNative = arr.push, push = arr.push, slice = arr.slice,
45
+ // Use a stripped-down indexOf as it's faster than native
46
+ // https://jsperf.com/thor-indexof-vs-for/5
47
+ indexOf = function (list, elem) {
48
+ var i = 0, len = list.length;
49
+ for (; i < len; i++) {
50
+ if (list[i] === elem) {
51
+ return i;
52
+ }
53
+ }
54
+ return -1;
55
+ }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
56
+ "ismap|loop|multiple|open|readonly|required|scoped",
57
+ // Regular expressions
58
+ // http://www.w3.org/TR/css3-selectors/#whitespace
59
+ whitespace = "[\\x20\\t\\r\\n\\f]",
60
+ // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
61
+ identifier = "(?:\\\\[\\da-fA-F]{1,6}" +
62
+ whitespace +
63
+ "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
64
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
65
+ attributes = "\\[" +
66
+ whitespace +
67
+ "*(" +
68
+ identifier +
69
+ ")(?:" +
70
+ whitespace +
71
+ // Operator (capture 2)
72
+ "*([*^$|!~]?=)" +
73
+ whitespace +
74
+ // "Attribute values must be CSS identifiers [capture 5]
75
+ // or strings [capture 3 or capture 4]"
76
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" +
77
+ identifier +
78
+ "))|)" +
79
+ whitespace +
80
+ "*\\]", pseudos = ":(" +
81
+ identifier +
82
+ ")(?:\\((" +
83
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
84
+ // 1. quoted (capture 3; capture 4 or capture 5)
85
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
86
+ // 2. simple (capture 6)
87
+ "((?:\\\\.|[^\\\\()[\\]]|" +
88
+ attributes +
89
+ ")*)|" +
90
+ // 3. anything else (capture 2)
91
+ ".*" +
92
+ ")\\)|)",
93
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
94
+ rwhitespace = new RegExp(whitespace + "+", "g"), rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = new RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = {
95
+ ID: new RegExp("^#(" + identifier + ")"),
96
+ CLASS: new RegExp("^\\.(" + identifier + ")"),
97
+ TAG: new RegExp("^(" + identifier + "|[*])"),
98
+ ATTR: new RegExp("^" + attributes),
99
+ PSEUDO: new RegExp("^" + pseudos),
100
+ CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
101
+ whitespace +
102
+ "*(even|odd|(([+-]|)(\\d*)n|)" +
103
+ whitespace +
104
+ "*(?:([+-]|)" +
105
+ whitespace +
106
+ "*(\\d+)|))" +
107
+ whitespace +
108
+ "*\\)|)", "i"),
109
+ bool: new RegExp("^(?:" + booleans + ")$", "i"),
110
+ // For use in libraries implementing .is()
111
+ // We use this for POS matching in `select`
112
+ needsContext: new RegExp("^" +
113
+ whitespace +
114
+ "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
115
+ whitespace +
116
+ "*((?:-\\d)?\\d*)" +
117
+ whitespace +
118
+ "*\\)|)(?=[^-]|$)", "i"),
119
+ }, rhtml = /HTML$/i, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/,
120
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
121
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/,
122
+ // CSS escapes
123
+ // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
124
+ runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function (escape, nonHex) {
125
+ var high = "0x" + escape.slice(1) - 0x10000;
126
+ return nonHex
127
+ ? // Strip the backslash prefix from a non-hex escape sequence
128
+ nonHex
129
+ : // Replace a hexadecimal escape sequence with the encoded Unicode code point
130
+ // Support: IE <=11+
131
+ // For values outside the Basic Multilingual Plane (BMP), manually construct a
132
+ // surrogate pair
133
+ high < 0
134
+ ? String.fromCharCode(high + 0x10000)
135
+ : String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00);
136
+ },
137
+ // CSS string/identifier serialization
138
+ // https://drafts.csswg.org/cssom/#common-serializing-idioms
139
+ rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, fcssescape = function (ch, asCodePoint) {
140
+ if (asCodePoint) {
141
+ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
142
+ if (ch === "\0") {
143
+ return "\uFFFD";
144
+ }
145
+ // Control characters and (dependent upon position) numbers get escaped as code points
146
+ return (ch.slice(0, -1) +
147
+ "\\" +
148
+ ch.charCodeAt(ch.length - 1).toString(16) +
149
+ " ");
150
+ }
151
+ // Other potentially-special ASCII characters get backslash-escaped
152
+ return "\\" + ch;
153
+ },
154
+ // Used for iframes
155
+ // See setDocument()
156
+ // Removing the function wrapper causes a "Permission Denied"
157
+ // error in IE
158
+ unloadHandler = function () {
159
+ setDocument();
160
+ }, inDisabledFieldset = addCombinator(function (elem) {
161
+ return (elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset");
162
+ }, { dir: "parentNode", next: "legend" });
163
+ // Optimize for push.apply( _, NodeList )
164
+ try {
165
+ push.apply((arr = slice.call(preferredDoc.childNodes)), preferredDoc.childNodes);
166
+ // Support: Android<4.0
167
+ // Detect silently failing push.apply
168
+ // eslint-disable-next-line no-unused-expressions
169
+ arr[preferredDoc.childNodes.length].nodeType;
170
+ }
171
+ catch (e) {
172
+ push = {
173
+ apply: arr.length
174
+ ? // Leverage slice if possible
175
+ function (target, els) {
176
+ pushNative.apply(target, slice.call(els));
177
+ }
178
+ : // Support: IE<9
179
+ // Otherwise append directly
180
+ function (target, els) {
181
+ var j = target.length, i = 0;
182
+ // Can't trust NodeList.length
183
+ while ((target[j++] = els[i++])) { }
184
+ target.length = j - 1;
185
+ },
186
+ };
187
+ }
188
+ function Sizzle(selector, context, results, seed) {
189
+ var m, i, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument,
190
+ // nodeType defaults to 9, since context defaults to document
191
+ nodeType = context ? context.nodeType : 9;
192
+ results = results || [];
193
+ // Return early from calls with invalid selector or context
194
+ if (typeof selector !== "string" ||
195
+ !selector ||
196
+ (nodeType !== 1 && nodeType !== 9 && nodeType !== 11)) {
197
+ return results;
198
+ }
199
+ // Try to shortcut find operations (as opposed to filters) in HTML documents
200
+ if (!seed) {
201
+ setDocument(context);
202
+ context = context || document;
203
+ if (documentIsHTML) {
204
+ // If the selector is sufficiently simple, try using a "get*By*" DOM method
205
+ // (excepting DocumentFragment context, where the methods don't exist)
206
+ if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
207
+ // ID selector
208
+ if ((m = match[1])) {
209
+ // Document context
210
+ if (nodeType === 9) {
211
+ if ((elem = context.getElementById(m))) {
212
+ // Support: IE, Opera, Webkit
213
+ // TODO: identify versions
214
+ // getElementById can match elements by name instead of ID
215
+ if (elem.id === m) {
216
+ results.push(elem);
217
+ return results;
218
+ }
219
+ }
220
+ else {
221
+ return results;
222
+ }
223
+ // Element context
224
+ }
225
+ else {
226
+ // Support: IE, Opera, Webkit
227
+ // TODO: identify versions
228
+ // getElementById can match elements by name instead of ID
229
+ if (newContext &&
230
+ (elem = newContext.getElementById(m)) &&
231
+ contains(context, elem) &&
232
+ elem.id === m) {
233
+ results.push(elem);
234
+ return results;
235
+ }
236
+ }
237
+ // Type selector
238
+ }
239
+ else if (match[2]) {
240
+ push.apply(results, context.getElementsByTagName(selector));
241
+ return results;
242
+ // Class selector
243
+ }
244
+ else if ((m = match[3]) &&
245
+ support.getElementsByClassName &&
246
+ context.getElementsByClassName) {
247
+ push.apply(results, context.getElementsByClassName(m));
248
+ return results;
249
+ }
250
+ }
251
+ // Take advantage of querySelectorAll
252
+ if (support.qsa &&
253
+ !nonnativeSelectorCache[selector + " "] &&
254
+ (!rbuggyQSA || !rbuggyQSA.test(selector)) &&
255
+ // Support: IE 8 only
256
+ // Exclude object elements
257
+ (nodeType !== 1 || context.nodeName.toLowerCase() !== "object")) {
258
+ newSelector = selector;
259
+ newContext = context;
260
+ // qSA considers elements outside a scoping root when evaluating child or
261
+ // descendant combinators, which is not what we want.
262
+ // In such cases, we work around the behavior by prefixing every selector in the
263
+ // list with an ID selector referencing the scope context.
264
+ // The technique has to be used as well when a leading combinator is used
265
+ // as such selectors are not recognized by querySelectorAll.
266
+ // Thanks to Andrew Dupont for this technique.
267
+ if (nodeType === 1 &&
268
+ (rdescend.test(selector) || rcombinators.test(selector))) {
269
+ // Expand context for sibling selectors
270
+ newContext =
271
+ (rsibling.test(selector) && testContext(context.parentNode)) ||
272
+ context;
273
+ // We can use :scope instead of the ID hack if the browser
274
+ // supports it & if we're not changing the context.
275
+ if (newContext !== context || !support.scope) {
276
+ // Capture the context ID, setting it first if necessary
277
+ if ((nid = context.getAttribute("id"))) {
278
+ nid = nid.replace(rcssescape, fcssescape);
279
+ }
280
+ else {
281
+ context.setAttribute("id", (nid = expando));
282
+ }
283
+ }
284
+ // Prefix every selector in the list
285
+ groups = tokenize(selector);
286
+ i = groups.length;
287
+ while (i--) {
288
+ groups[i] =
289
+ (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i]);
290
+ }
291
+ newSelector = groups.join(",");
292
+ }
293
+ try {
294
+ push.apply(results, newContext.querySelectorAll(newSelector));
295
+ return results;
296
+ }
297
+ catch (qsaError) {
298
+ nonnativeSelectorCache(selector, true);
299
+ }
300
+ finally {
301
+ if (nid === expando) {
302
+ context.removeAttribute("id");
303
+ }
304
+ }
305
+ }
306
+ }
307
+ }
308
+ // All others
309
+ return select(selector.replace(rtrim, "$1"), context, results, seed);
310
+ }
311
+ /**
312
+ * Create key-value caches of limited size
313
+ * @returns {function(string, object)} Returns the Object data after storing it on itself with
314
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
315
+ * deleting the oldest entry
316
+ */
317
+ function createCache() {
318
+ var keys = [];
319
+ function cache(key, value) {
320
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
321
+ if (keys.push(key + " ") > Expr.cacheLength) {
322
+ // Only keep the most recent entries
323
+ delete cache[keys.shift()];
324
+ }
325
+ return (cache[key + " "] = value);
326
+ }
327
+ return cache;
328
+ }
329
+ /**
330
+ * Mark a function for special use by Sizzle
331
+ * @param {Function} fn The function to mark
332
+ */
333
+ function markFunction(fn) {
334
+ fn[expando] = true;
335
+ return fn;
336
+ }
337
+ /**
338
+ * Support testing using an element
339
+ * @param {Function} fn Passed the created element and returns a boolean result
340
+ */
341
+ function assert(fn) {
342
+ // deno-dom: we don't need to assert anything
343
+ return true;
344
+ var el = document.createElement("fieldset");
345
+ try {
346
+ return !!fn(el);
347
+ }
348
+ catch (e) {
349
+ return false;
350
+ }
351
+ finally {
352
+ // Remove from its parent by default
353
+ if (el.parentNode) {
354
+ el.parentNode.removeChild(el);
355
+ }
356
+ // release memory in IE
357
+ el = null;
358
+ }
359
+ }
360
+ /**
361
+ * Adds the same handler for all of the specified attrs
362
+ * @param {String} attrs Pipe-separated list of attributes
363
+ * @param {Function} handler The method that will be applied
364
+ */
365
+ function addHandle(attrs, handler) {
366
+ var arr = attrs.split("|"), i = arr.length;
367
+ while (i--) {
368
+ Expr.attrHandle[arr[i]] = handler;
369
+ }
370
+ }
371
+ /**
372
+ * Checks document order of two siblings
373
+ * @param {Element} a
374
+ * @param {Element} b
375
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
376
+ */
377
+ function siblingCheck(a, b) {
378
+ var cur = b && a, diff = cur &&
379
+ a.nodeType === 1 &&
380
+ b.nodeType === 1 &&
381
+ a.sourceIndex - b.sourceIndex;
382
+ // Use IE sourceIndex if available on both nodes
383
+ if (diff) {
384
+ return diff;
385
+ }
386
+ // Check if b follows a
387
+ if (cur) {
388
+ while ((cur = cur.nextSibling)) {
389
+ if (cur === b) {
390
+ return -1;
391
+ }
392
+ }
393
+ }
394
+ return a ? 1 : -1;
395
+ }
396
+ /**
397
+ * Returns a function to use in pseudos for input types
398
+ * @param {String} type
399
+ */
400
+ function createInputPseudo(type) {
401
+ return function (elem) {
402
+ var name = elem.nodeName.toLowerCase();
403
+ return name === "input" && elem.type === type;
404
+ };
405
+ }
406
+ /**
407
+ * Returns a function to use in pseudos for buttons
408
+ * @param {String} type
409
+ */
410
+ function createButtonPseudo(type) {
411
+ return function (elem) {
412
+ var name = elem.nodeName.toLowerCase();
413
+ return (name === "input" || name === "button") && elem.type === type;
414
+ };
415
+ }
416
+ /**
417
+ * Returns a function to use in pseudos for :enabled/:disabled
418
+ * @param {Boolean} disabled true for :disabled; false for :enabled
419
+ */
420
+ function createDisabledPseudo(disabled) {
421
+ // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
422
+ return function (elem) {
423
+ // Only certain elements can match :enabled or :disabled
424
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
425
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
426
+ if ("form" in elem) {
427
+ // Check for inherited disabledness on relevant non-disabled elements:
428
+ // * listed form-associated elements in a disabled fieldset
429
+ // https://html.spec.whatwg.org/multipage/forms.html#category-listed
430
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
431
+ // * option elements in a disabled optgroup
432
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
433
+ // All such elements have a "form" property.
434
+ if (elem.parentNode && elem.disabled === false) {
435
+ // Option elements defer to a parent optgroup if present
436
+ if ("label" in elem) {
437
+ if ("label" in elem.parentNode) {
438
+ return elem.parentNode.disabled === disabled;
439
+ }
440
+ else {
441
+ return elem.disabled === disabled;
442
+ }
443
+ }
444
+ // Support: IE 6 - 11
445
+ // Use the isDisabled shortcut property to check for disabled fieldset ancestors
446
+ return (elem.isDisabled === disabled ||
447
+ // Where there is no isDisabled, check manually
448
+ /* jshint -W018 */
449
+ (elem.isDisabled !== !disabled &&
450
+ inDisabledFieldset(elem) === disabled));
451
+ }
452
+ return elem.disabled === disabled;
453
+ // Try to winnow out elements that can't be disabled before trusting the disabled property.
454
+ // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
455
+ // even exist on them, let alone have a boolean value.
456
+ }
457
+ else if ("label" in elem) {
458
+ return elem.disabled === disabled;
459
+ }
460
+ // Remaining elements are neither :enabled nor :disabled
461
+ return false;
462
+ };
463
+ }
464
+ /**
465
+ * Returns a function to use in pseudos for positionals
466
+ * @param {Function} fn
467
+ */
468
+ function createPositionalPseudo(fn) {
469
+ return markFunction(function (argument) {
470
+ argument = +argument;
471
+ return markFunction(function (seed, matches) {
472
+ var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length;
473
+ // Match elements found at the specified indexes
474
+ while (i--) {
475
+ if (seed[(j = matchIndexes[i])]) {
476
+ seed[j] = !(matches[j] = seed[j]);
477
+ }
478
+ }
479
+ });
480
+ });
481
+ }
482
+ /**
483
+ * Checks a node for validity as a Sizzle context
484
+ * @param {Element|Object=} context
485
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
486
+ */
487
+ function testContext(context) {
488
+ return (context && typeof context.getElementsByTagName !== "undefined" && context);
489
+ }
490
+ // Expose support vars for convenience
491
+ support = Sizzle.support = {};
492
+ /**
493
+ * Detects XML nodes
494
+ * @param {Element|Object} elem An element or a document
495
+ * @returns {Boolean} True iff elem is a non-HTML XML node
496
+ */
497
+ isXML = Sizzle.isXML = function (elem) {
498
+ var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
499
+ // Support: IE <=8
500
+ // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
501
+ // https://bugs.jquery.com/ticket/4833
502
+ return !rhtml.test(namespace || (docElem && docElem.nodeName) || "HTML");
503
+ };
504
+ /**
505
+ * Sets document-related variables once based on the current document
506
+ * @param {Element|Object} [doc] An element or document object to use to set the document
507
+ * @returns {Object} Returns the current document
508
+ */
509
+ setDocument = Sizzle.setDocument = function (node) {
510
+ var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc;
511
+ // Return early if doc is invalid or already selected
512
+ // Support: IE 11+, Edge 17 - 18+
513
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
514
+ // two documents; shallow comparisons work.
515
+ // eslint-disable-next-line eqeqeq
516
+ if (doc == document || doc.nodeType !== 9 || !doc.documentElement) {
517
+ return document;
518
+ }
519
+ // Update global variables
520
+ document = doc;
521
+ docElem = document.documentElement;
522
+ documentIsHTML = !isXML(document);
523
+ // Support: IE 9 - 11+, Edge 12 - 18+
524
+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
525
+ // Support: IE 11+, Edge 17 - 18+
526
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
527
+ // two documents; shallow comparisons work.
528
+ // eslint-disable-next-line eqeqeq
529
+ if (preferredDoc != document &&
530
+ (subWindow = document.defaultView) &&
531
+ subWindow.top !== subWindow) {
532
+ // Support: IE 11, Edge
533
+ if (subWindow.addEventListener) {
534
+ subWindow.addEventListener("unload", unloadHandler, false);
535
+ // Support: IE 9 - 10 only
536
+ }
537
+ else if (subWindow.attachEvent) {
538
+ subWindow.attachEvent("onunload", unloadHandler);
539
+ }
540
+ }
541
+ // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
542
+ // Safari 4 - 5 only, Opera <=11.6 - 12.x only
543
+ // IE/Edge & older browsers don't support the :scope pseudo-class.
544
+ // Support: Safari 6.0 only
545
+ // Safari 6.0 supports :scope but it's an alias of :root there.
546
+ support.scope = assert(function (el) {
547
+ docElem.appendChild(el).appendChild(document.createElement("div"));
548
+ return (typeof el.querySelectorAll !== "undefined" &&
549
+ !el.querySelectorAll(":scope fieldset div").length);
550
+ });
551
+ /* Attributes
552
+ ---------------------------------------------------------------------- */
553
+ // Support: IE<8
554
+ // Verify that getAttribute really returns attributes and not properties
555
+ // (excepting IE8 booleans)
556
+ support.attributes = assert(function (el) {
557
+ el.className = "i";
558
+ return !el.getAttribute("className");
559
+ });
560
+ /* getElement(s)By*
561
+ ---------------------------------------------------------------------- */
562
+ // Check if getElementsByTagName("*") returns only elements
563
+ support.getElementsByTagName = assert(function (el) {
564
+ el.appendChild(document.createComment(""));
565
+ return !el.getElementsByTagName("*").length;
566
+ });
567
+ // Support: IE<9
568
+ support.getElementsByClassName = rnative.test(document.getElementsByClassName);
569
+ // Support: IE<10
570
+ // Check if getElementById returns elements by name
571
+ // The broken getElementById methods don't pick up programmatically-set names,
572
+ // so use a roundabout getElementsByName test
573
+ support.getById = assert(function (el) {
574
+ docElem.appendChild(el).id = expando;
575
+ return (!document.getElementsByName ||
576
+ !document.getElementsByName(expando).length);
577
+ });
578
+ // ID filter and find
579
+ if (support.getById) {
580
+ Expr.filter["ID"] = function (id) {
581
+ var attrId = id.replace(runescape, funescape);
582
+ return function (elem) {
583
+ return elem.getAttribute("id") === attrId;
584
+ };
585
+ };
586
+ Expr.find["ID"] = function (id, context) {
587
+ if (typeof context.getElementById !== "undefined" && documentIsHTML) {
588
+ var elem = context.getElementById(id);
589
+ return elem ? [elem] : [];
590
+ }
591
+ };
592
+ }
593
+ else {
594
+ Expr.filter["ID"] = function (id) {
595
+ var attrId = id.replace(runescape, funescape);
596
+ return function (elem) {
597
+ var node = typeof elem.getAttributeNode !== "undefined" &&
598
+ elem.getAttributeNode("id");
599
+ return node && node.value === attrId;
600
+ };
601
+ };
602
+ // Support: IE 6 - 7 only
603
+ // getElementById is not reliable as a find shortcut
604
+ Expr.find["ID"] = function (id, context) {
605
+ if (typeof context.getElementById !== "undefined" && documentIsHTML) {
606
+ var node, i, elems, elem = context.getElementById(id);
607
+ if (elem) {
608
+ // Verify the id attribute
609
+ node = elem.getAttributeNode("id");
610
+ if (node && node.value === id) {
611
+ return [elem];
612
+ }
613
+ // Fall back on getElementsByName
614
+ elems = context.getElementsByName(id);
615
+ i = 0;
616
+ while ((elem = elems[i++])) {
617
+ node = elem.getAttributeNode("id");
618
+ if (node && node.value === id) {
619
+ return [elem];
620
+ }
621
+ }
622
+ }
623
+ return [];
624
+ }
625
+ };
626
+ }
627
+ // Tag
628
+ Expr.find["TAG"] = support.getElementsByTagName
629
+ ? function (tag, context) {
630
+ if (typeof context.getElementsByTagName !== "undefined") {
631
+ return context.getElementsByTagName(tag);
632
+ }
633
+ else if (context[customByTagNameSym]) {
634
+ // deno-dom: use DocumentFragment's custom API
635
+ return context[customByTagNameSym](tag);
636
+ // DocumentFragment nodes don't have gEBTN
637
+ }
638
+ else if (support.qsa) {
639
+ return context.querySelectorAll(tag);
640
+ }
641
+ }
642
+ : function (tag, context) {
643
+ var elem, tmp = [], i = 0,
644
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
645
+ results = context.getElementsByTagName(tag);
646
+ // Filter out possible comments
647
+ if (tag === "*") {
648
+ while ((elem = results[i++])) {
649
+ if (elem.nodeType === 1) {
650
+ tmp.push(elem);
651
+ }
652
+ }
653
+ return tmp;
654
+ }
655
+ return results;
656
+ };
657
+ // Class
658
+ Expr.find["CLASS"] =
659
+ support.getElementsByClassName &&
660
+ function (className, context) {
661
+ if (typeof context.getElementsByClassName !== "undefined" &&
662
+ documentIsHTML) {
663
+ return context.getElementsByClassName(className);
664
+ }
665
+ else if (context[customByClassNameSym]) {
666
+ // deno-dom: use DocumentFragment's custom API
667
+ return context[customByClassNameSym](className);
668
+ }
669
+ };
670
+ /* QSA/matchesSelector
671
+ ---------------------------------------------------------------------- */
672
+ // QSA and matchesSelector support
673
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
674
+ rbuggyMatches = [];
675
+ // qSa(:focus) reports false when true (Chrome 21)
676
+ // We allow this because of a bug in IE8/9 that throws an error
677
+ // whenever `document.activeElement` is accessed on an iframe
678
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
679
+ // See https://bugs.jquery.com/ticket/13378
680
+ rbuggyQSA = [];
681
+ if ((support.qsa = rnative.test(document.querySelectorAll))) {
682
+ // Build QSA regex
683
+ // Regex strategy adopted from Diego Perini
684
+ assert(function (el) {
685
+ var input;
686
+ // Select is set to empty string on purpose
687
+ // This is to test IE's treatment of not explicitly
688
+ // setting a boolean content attribute,
689
+ // since its presence should be enough
690
+ // https://bugs.jquery.com/ticket/12359
691
+ docElem.appendChild(el).innerHTML =
692
+ "<a id='" +
693
+ expando +
694
+ "'></a>" +
695
+ "<select id='" +
696
+ expando +
697
+ "-\r\\' msallowcapture=''>" +
698
+ "<option selected=''></option></select>";
699
+ // Support: IE8, Opera 11-12.16
700
+ // Nothing should be selected when empty strings follow ^= or $= or *=
701
+ // The test attribute must be unknown in Opera but "safe" for WinRT
702
+ // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
703
+ if (el.querySelectorAll("[msallowcapture^='']").length) {
704
+ rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
705
+ }
706
+ // Support: IE8
707
+ // Boolean attributes and "value" are not treated correctly
708
+ if (!el.querySelectorAll("[selected]").length) {
709
+ rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
710
+ }
711
+ // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
712
+ if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
713
+ rbuggyQSA.push("~=");
714
+ }
715
+ // Support: IE 11+, Edge 15 - 18+
716
+ // IE 11/Edge don't find elements on a `[name='']` query in some cases.
717
+ // Adding a temporary attribute to the document before the selection works
718
+ // around the issue.
719
+ // Interestingly, IE 10 & older don't seem to have the issue.
720
+ input = document.createElement("input");
721
+ input.setAttribute("name", "");
722
+ el.appendChild(input);
723
+ if (!el.querySelectorAll("[name='']").length) {
724
+ rbuggyQSA.push("\\[" +
725
+ whitespace +
726
+ "*name" +
727
+ whitespace +
728
+ "*=" +
729
+ whitespace +
730
+ "*(?:''|\"\")");
731
+ }
732
+ // Webkit/Opera - :checked should return selected option elements
733
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
734
+ // IE8 throws error here and will not see later tests
735
+ if (!el.querySelectorAll(":checked").length) {
736
+ rbuggyQSA.push(":checked");
737
+ }
738
+ // Support: Safari 8+, iOS 8+
739
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
740
+ // In-page `selector#id sibling-combinator selector` fails
741
+ if (!el.querySelectorAll("a#" + expando + "+*").length) {
742
+ rbuggyQSA.push(".#.+[+~]");
743
+ }
744
+ // Support: Firefox <=3.6 - 5 only
745
+ // Old Firefox doesn't throw on a badly-escaped identifier.
746
+ el.querySelectorAll("\\\f");
747
+ rbuggyQSA.push("[\\r\\n\\f]");
748
+ });
749
+ assert(function (el) {
750
+ el.innerHTML =
751
+ "<a href='' disabled='disabled'></a>" +
752
+ "<select disabled='disabled'><option/></select>";
753
+ // Support: Windows 8 Native Apps
754
+ // The type and name attributes are restricted during .innerHTML assignment
755
+ var input = document.createElement("input");
756
+ input.setAttribute("type", "hidden");
757
+ el.appendChild(input).setAttribute("name", "D");
758
+ // Support: IE8
759
+ // Enforce case-sensitivity of name attribute
760
+ if (el.querySelectorAll("[name=d]").length) {
761
+ rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
762
+ }
763
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
764
+ // IE8 throws error here and will not see later tests
765
+ if (el.querySelectorAll(":enabled").length !== 2) {
766
+ rbuggyQSA.push(":enabled", ":disabled");
767
+ }
768
+ // Support: IE9-11+
769
+ // IE's :disabled selector does not pick up the children of disabled fieldsets
770
+ docElem.appendChild(el).disabled = true;
771
+ if (el.querySelectorAll(":disabled").length !== 2) {
772
+ rbuggyQSA.push(":enabled", ":disabled");
773
+ }
774
+ // Support: Opera 10 - 11 only
775
+ // Opera 10-11 does not throw on post-comma invalid pseudos
776
+ el.querySelectorAll("*,:x");
777
+ rbuggyQSA.push(",.*:");
778
+ });
779
+ }
780
+ if ((support.matchesSelector = rnative.test((matches =
781
+ docElem.matches ||
782
+ docElem.webkitMatchesSelector ||
783
+ docElem.mozMatchesSelector ||
784
+ docElem.oMatchesSelector ||
785
+ docElem.msMatchesSelector)))) {
786
+ assert(function (el) {
787
+ // Check to see if it's possible to do matchesSelector
788
+ // on a disconnected node (IE 9)
789
+ support.disconnectedMatch = matches.call(el, "*");
790
+ // This should fail with an exception
791
+ // Gecko does not error, returns false instead
792
+ matches.call(el, "[s!='']:x");
793
+ rbuggyMatches.push("!=", pseudos);
794
+ });
795
+ }
796
+ rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
797
+ rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
798
+ /* Contains
799
+ ---------------------------------------------------------------------- */
800
+ hasCompare = rnative.test(docElem.compareDocumentPosition);
801
+ // Element contains another
802
+ // Purposefully self-exclusive
803
+ // As in, an element does not contain itself
804
+ contains =
805
+ hasCompare || rnative.test(docElem.contains)
806
+ ? function (a, b) {
807
+ var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode;
808
+ return (a === bup ||
809
+ !!(bup &&
810
+ bup.nodeType === 1 &&
811
+ (adown.contains
812
+ ? adown.contains(bup)
813
+ : a.compareDocumentPosition &&
814
+ a.compareDocumentPosition(bup) & 16)));
815
+ }
816
+ : function (a, b) {
817
+ if (b) {
818
+ while ((b = b.parentNode)) {
819
+ if (b === a) {
820
+ return true;
821
+ }
822
+ }
823
+ }
824
+ return false;
825
+ };
826
+ /* Sorting
827
+ ---------------------------------------------------------------------- */
828
+ // Document order sorting
829
+ sortOrder = hasCompare
830
+ ? function (a, b) {
831
+ // Flag for duplicate removal
832
+ if (a === b) {
833
+ hasDuplicate = true;
834
+ return 0;
835
+ }
836
+ // Sort on method existence if only one input has compareDocumentPosition
837
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
838
+ if (compare) {
839
+ return compare;
840
+ }
841
+ // Calculate position if both inputs belong to the same document
842
+ // Support: IE 11+, Edge 17 - 18+
843
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
844
+ // two documents; shallow comparisons work.
845
+ // eslint-disable-next-line eqeqeq
846
+ compare =
847
+ (a.ownerDocument || a) == (b.ownerDocument || b)
848
+ ? a.compareDocumentPosition(b)
849
+ : // Otherwise we know they are disconnected
850
+ 1;
851
+ // Disconnected nodes
852
+ if (compare & 1 ||
853
+ (!support.sortDetached && b.compareDocumentPosition(a) === compare)) {
854
+ // Choose the first element that is related to our preferred document
855
+ // Support: IE 11+, Edge 17 - 18+
856
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
857
+ // two documents; shallow comparisons work.
858
+ // eslint-disable-next-line eqeqeq
859
+ if (a == document ||
860
+ (a.ownerDocument == preferredDoc && contains(preferredDoc, a))) {
861
+ return -1;
862
+ }
863
+ // Support: IE 11+, Edge 17 - 18+
864
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
865
+ // two documents; shallow comparisons work.
866
+ // eslint-disable-next-line eqeqeq
867
+ if (b == document ||
868
+ (b.ownerDocument == preferredDoc && contains(preferredDoc, b))) {
869
+ return 1;
870
+ }
871
+ // Maintain original order
872
+ return sortInput
873
+ ? indexOf(sortInput, a) - indexOf(sortInput, b)
874
+ : 0;
875
+ }
876
+ return compare & 4 ? -1 : 1;
877
+ }
878
+ : function (a, b) {
879
+ // Exit early if the nodes are identical
880
+ if (a === b) {
881
+ hasDuplicate = true;
882
+ return 0;
883
+ }
884
+ var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b];
885
+ // Parentless nodes are either documents or disconnected
886
+ if (!aup || !bup) {
887
+ // Support: IE 11+, Edge 17 - 18+
888
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
889
+ // two documents; shallow comparisons work.
890
+ /* eslint-disable eqeqeq */
891
+ return a == document
892
+ ? -1
893
+ : b == document
894
+ ? 1
895
+ : /* eslint-enable eqeqeq */
896
+ aup
897
+ ? -1
898
+ : bup
899
+ ? 1
900
+ : sortInput
901
+ ? indexOf(sortInput, a) - indexOf(sortInput, b)
902
+ : 0;
903
+ // If the nodes are siblings, we can do a quick check
904
+ }
905
+ else if (aup === bup) {
906
+ return siblingCheck(a, b);
907
+ }
908
+ // Otherwise we need full lists of their ancestors for comparison
909
+ cur = a;
910
+ while ((cur = cur.parentNode)) {
911
+ ap.unshift(cur);
912
+ }
913
+ cur = b;
914
+ while ((cur = cur.parentNode)) {
915
+ bp.unshift(cur);
916
+ }
917
+ // Walk down the tree looking for a discrepancy
918
+ while (ap[i] === bp[i]) {
919
+ i++;
920
+ }
921
+ return i
922
+ ? // Do a sibling check if the nodes have a common ancestor
923
+ siblingCheck(ap[i], bp[i])
924
+ : // Otherwise nodes in our document sort first
925
+ // Support: IE 11+, Edge 17 - 18+
926
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
927
+ // two documents; shallow comparisons work.
928
+ /* eslint-disable eqeqeq */
929
+ ap[i] == preferredDoc
930
+ ? -1
931
+ : bp[i] == preferredDoc
932
+ ? 1
933
+ : /* eslint-enable eqeqeq */
934
+ 0;
935
+ };
936
+ return document;
937
+ };
938
+ Sizzle.matches = function (expr, elements) {
939
+ return Sizzle(expr, null, null, elements);
940
+ };
941
+ Sizzle.matchesSelector = function (elem, expr) {
942
+ setDocument(elem);
943
+ if (support.matchesSelector &&
944
+ documentIsHTML &&
945
+ !nonnativeSelectorCache[expr + " "] &&
946
+ (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
947
+ (!rbuggyQSA || !rbuggyQSA.test(expr))) {
948
+ try {
949
+ var ret = matches.call(elem, expr);
950
+ // IE 9's matchesSelector returns false on disconnected nodes
951
+ if (ret ||
952
+ support.disconnectedMatch ||
953
+ // As well, disconnected nodes are said to be in a document
954
+ // fragment in IE 9
955
+ (elem.document && elem.document.nodeType !== 11)) {
956
+ return ret;
957
+ }
958
+ }
959
+ catch (e) {
960
+ nonnativeSelectorCache(expr, true);
961
+ }
962
+ }
963
+ return Sizzle(expr, document, null, [elem]).length > 0;
964
+ };
965
+ Sizzle.contains = function (context, elem) {
966
+ // Set document vars if needed
967
+ // Support: IE 11+, Edge 17 - 18+
968
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
969
+ // two documents; shallow comparisons work.
970
+ // eslint-disable-next-line eqeqeq
971
+ if ((context.ownerDocument || context) != document) {
972
+ setDocument(context);
973
+ }
974
+ return contains(context, elem);
975
+ };
976
+ Sizzle.attr = function (elem, name) {
977
+ // Set document vars if needed
978
+ // Support: IE 11+, Edge 17 - 18+
979
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
980
+ // two documents; shallow comparisons work.
981
+ // eslint-disable-next-line eqeqeq
982
+ if ((elem.ownerDocument || elem) != document) {
983
+ setDocument(elem);
984
+ }
985
+ var fn = Expr.attrHandle[name.toLowerCase()],
986
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
987
+ val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase())
988
+ ? fn(elem, name, !documentIsHTML)
989
+ : undefined;
990
+ return val !== undefined
991
+ ? val
992
+ : support.attributes || !documentIsHTML
993
+ ? elem.getAttribute(name)
994
+ : (val = elem.getAttributeNode(name)) && val.specified
995
+ ? val.value
996
+ : null;
997
+ };
998
+ Sizzle.escape = function (sel) {
999
+ return (sel + "").replace(rcssescape, fcssescape);
1000
+ };
1001
+ Sizzle.error = function (msg) {
1002
+ // throw new Error("Syntax error, unrecognized expression: " + msg);
1003
+ // deno-dom: syntax errors should be DOMExceptions
1004
+ throw new DOMException(`'${msg}' is not a valid selector`);
1005
+ };
1006
+ /**
1007
+ * Document sorting and removing duplicates
1008
+ * @param {ArrayLike} results
1009
+ */
1010
+ Sizzle.uniqueSort = function (results) {
1011
+ var elem, duplicates = [], j = 0, i = 0;
1012
+ // Unless we *know* we can detect duplicates, assume their presence
1013
+ hasDuplicate = !support.detectDuplicates;
1014
+ sortInput = !support.sortStable && results.slice(0);
1015
+ results.sort(sortOrder);
1016
+ if (hasDuplicate) {
1017
+ while ((elem = results[i++])) {
1018
+ if (elem === results[i]) {
1019
+ j = duplicates.push(i);
1020
+ }
1021
+ }
1022
+ while (j--) {
1023
+ results.splice(duplicates[j], 1);
1024
+ }
1025
+ }
1026
+ // Clear input after sorting to release objects
1027
+ // See https://github.com/jquery/sizzle/pull/225
1028
+ sortInput = null;
1029
+ return results;
1030
+ };
1031
+ /**
1032
+ * Utility function for retrieving the text value of an array of DOM nodes
1033
+ * @param {Array|Element} elem
1034
+ */
1035
+ getText = Sizzle.getText = function (elem) {
1036
+ var node, ret = "", i = 0, nodeType = elem.nodeType;
1037
+ if (!nodeType) {
1038
+ // If no nodeType, this is expected to be an array
1039
+ while ((node = elem[i++])) {
1040
+ // Do not traverse comment nodes
1041
+ ret += getText(node);
1042
+ }
1043
+ }
1044
+ else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
1045
+ // Use textContent for elements
1046
+ // innerText usage removed for consistency of new lines (jQuery #11153)
1047
+ if (typeof elem.textContent === "string") {
1048
+ return elem.textContent;
1049
+ }
1050
+ else {
1051
+ // Traverse its children
1052
+ for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
1053
+ ret += getText(elem);
1054
+ }
1055
+ }
1056
+ }
1057
+ else if (nodeType === 3 || nodeType === 4) {
1058
+ return elem.nodeValue;
1059
+ }
1060
+ // Do not include comment or processing instruction nodes
1061
+ return ret;
1062
+ };
1063
+ Expr = Sizzle.selectors = {
1064
+ // Can be adjusted by the user
1065
+ cacheLength: 50,
1066
+ createPseudo: markFunction,
1067
+ match: matchExpr,
1068
+ attrHandle: {},
1069
+ find: {},
1070
+ relative: {
1071
+ ">": { dir: "parentNode", first: true },
1072
+ " ": { dir: "parentNode" },
1073
+ "+": { dir: "previousSibling", first: true },
1074
+ "~": { dir: "previousSibling" },
1075
+ },
1076
+ preFilter: {
1077
+ ATTR: function (match) {
1078
+ match[1] = match[1].replace(runescape, funescape);
1079
+ // Move the given value to match[3] whether quoted or unquoted
1080
+ match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
1081
+ if (match[2] === "~=") {
1082
+ match[3] = " " + match[3] + " ";
1083
+ }
1084
+ return match.slice(0, 4);
1085
+ },
1086
+ CHILD: function (match) {
1087
+ /* matches from matchExpr["CHILD"]
1088
+ 1 type (only|nth|...)
1089
+ 2 what (child|of-type)
1090
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1091
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
1092
+ 5 sign of xn-component
1093
+ 6 x of xn-component
1094
+ 7 sign of y-component
1095
+ 8 y of y-component
1096
+ */
1097
+ match[1] = match[1].toLowerCase();
1098
+ if (match[1].slice(0, 3) === "nth") {
1099
+ // nth-* requires argument
1100
+ if (!match[3]) {
1101
+ Sizzle.error(match[0]);
1102
+ }
1103
+ // numeric x and y parameters for Expr.filter.CHILD
1104
+ // remember that false/true cast respectively to 0/1
1105
+ match[4] = +(match[4]
1106
+ ? match[5] + (match[6] || 1)
1107
+ : 2 * (match[3] === "even" || match[3] === "odd"));
1108
+ match[5] = +(match[7] + match[8] || match[3] === "odd");
1109
+ // other types prohibit arguments
1110
+ }
1111
+ else if (match[3]) {
1112
+ Sizzle.error(match[0]);
1113
+ }
1114
+ return match;
1115
+ },
1116
+ PSEUDO: function (match) {
1117
+ var excess, unquoted = !match[6] && match[2];
1118
+ if (matchExpr["CHILD"].test(match[0])) {
1119
+ return null;
1120
+ }
1121
+ // Accept quoted arguments as-is
1122
+ if (match[3]) {
1123
+ match[2] = match[4] || match[5] || "";
1124
+ // Strip excess characters from unquoted arguments
1125
+ }
1126
+ else if (unquoted &&
1127
+ rpseudo.test(unquoted) &&
1128
+ // Get excess from tokenize (recursively)
1129
+ (excess = tokenize(unquoted, true)) &&
1130
+ // advance to the next closing parenthesis
1131
+ (excess =
1132
+ unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
1133
+ // excess is a negative index
1134
+ match[0] = match[0].slice(0, excess);
1135
+ match[2] = unquoted.slice(0, excess);
1136
+ }
1137
+ // Return only captures needed by the pseudo filter method (type and argument)
1138
+ return match.slice(0, 3);
1139
+ },
1140
+ },
1141
+ filter: {
1142
+ TAG: function (nodeNameSelector) {
1143
+ var nodeName = nodeNameSelector
1144
+ .replace(runescape, funescape)
1145
+ .toLowerCase();
1146
+ return nodeNameSelector === "*"
1147
+ ? function () {
1148
+ return true;
1149
+ }
1150
+ : function (elem) {
1151
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1152
+ };
1153
+ },
1154
+ CLASS: function (className) {
1155
+ var pattern = classCache[className + " "];
1156
+ return (pattern ||
1157
+ ((pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) &&
1158
+ classCache(className, function (elem) {
1159
+ return pattern.test((typeof elem.className === "string" && elem.className) ||
1160
+ (typeof elem.getAttribute !== "undefined" &&
1161
+ elem.getAttribute("class")) ||
1162
+ "");
1163
+ })));
1164
+ },
1165
+ ATTR: function (name, operator, check) {
1166
+ return function (elem) {
1167
+ var result = Sizzle.attr(elem, name);
1168
+ if (result == null) {
1169
+ return operator === "!=";
1170
+ }
1171
+ if (!operator) {
1172
+ return true;
1173
+ }
1174
+ result += "";
1175
+ /* eslint-disable max-len */
1176
+ return operator === "="
1177
+ ? result === check
1178
+ : operator === "!="
1179
+ ? result !== check
1180
+ : operator === "^="
1181
+ ? check && result.indexOf(check) === 0
1182
+ : operator === "*="
1183
+ ? check && result.indexOf(check) > -1
1184
+ : operator === "$="
1185
+ ? check && result.slice(-check.length) === check
1186
+ : operator === "~="
1187
+ ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1
1188
+ : operator === "|="
1189
+ ? result === check ||
1190
+ result.slice(0, check.length + 1) === check + "-"
1191
+ : false;
1192
+ /* eslint-enable max-len */
1193
+ };
1194
+ },
1195
+ CHILD: function (type, what, _argument, first, last) {
1196
+ var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type";
1197
+ return first === 1 && last === 0
1198
+ ? // Shortcut for :nth-*(n)
1199
+ function (elem) {
1200
+ return !!elem.parentNode;
1201
+ }
1202
+ : function (elem, _context, xml) {
1203
+ var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
1204
+ if (parent) {
1205
+ // :(first|last|only)-(child|of-type)
1206
+ if (simple) {
1207
+ while (dir) {
1208
+ node = elem;
1209
+ while ((node = node[dir])) {
1210
+ if (ofType
1211
+ ? node.nodeName.toLowerCase() === name
1212
+ : node.nodeType === 1) {
1213
+ return false;
1214
+ }
1215
+ }
1216
+ // Reverse direction for :only-* (if we haven't yet done so)
1217
+ start = dir = type === "only" && !start && "nextSibling";
1218
+ }
1219
+ return true;
1220
+ }
1221
+ start = [forward ? parent.firstChild : parent.lastChild];
1222
+ // non-xml :nth-child(...) stores cache data on `parent`
1223
+ if (forward && useCache) {
1224
+ // Seek `elem` from a previously-cached index
1225
+ // ...in a gzip-friendly way
1226
+ node = parent;
1227
+ outerCache = node[expando] || (node[expando] = {});
1228
+ // Support: IE <9 only
1229
+ // Defend against cloned attroperties (jQuery gh-1709)
1230
+ uniqueCache =
1231
+ outerCache[node.uniqueID] ||
1232
+ (outerCache[node.uniqueID] = {});
1233
+ cache = uniqueCache[type] || [];
1234
+ nodeIndex = cache[0] === dirruns && cache[1];
1235
+ diff = nodeIndex && cache[2];
1236
+ node = nodeIndex && parent.childNodes[nodeIndex];
1237
+ while ((node =
1238
+ (++nodeIndex && node && node[dir]) ||
1239
+ // Fallback to seeking `elem` from the start
1240
+ (diff = nodeIndex = 0) ||
1241
+ start.pop())) {
1242
+ // When found, cache indexes on `parent` and break
1243
+ if (node.nodeType === 1 && ++diff && node === elem) {
1244
+ uniqueCache[type] = [dirruns, nodeIndex, diff];
1245
+ break;
1246
+ }
1247
+ }
1248
+ }
1249
+ else {
1250
+ // Use previously-cached element index if available
1251
+ if (useCache) {
1252
+ // ...in a gzip-friendly way
1253
+ node = elem;
1254
+ outerCache = node[expando] || (node[expando] = {});
1255
+ // Support: IE <9 only
1256
+ // Defend against cloned attroperties (jQuery gh-1709)
1257
+ uniqueCache =
1258
+ outerCache[node.uniqueID] ||
1259
+ (outerCache[node.uniqueID] = {});
1260
+ cache = uniqueCache[type] || [];
1261
+ nodeIndex = cache[0] === dirruns && cache[1];
1262
+ diff = nodeIndex;
1263
+ }
1264
+ // xml :nth-child(...)
1265
+ // or :nth-last-child(...) or :nth(-last)?-of-type(...)
1266
+ if (diff === false) {
1267
+ // Use the same loop as above to seek `elem` from the start
1268
+ while ((node =
1269
+ (++nodeIndex && node && node[dir]) ||
1270
+ (diff = nodeIndex = 0) ||
1271
+ start.pop())) {
1272
+ if ((ofType
1273
+ ? node.nodeName.toLowerCase() === name
1274
+ : node.nodeType === 1) &&
1275
+ ++diff) {
1276
+ // Cache the index of each encountered element
1277
+ if (useCache) {
1278
+ outerCache = node[expando] || (node[expando] = {});
1279
+ // Support: IE <9 only
1280
+ // Defend against cloned attroperties (jQuery gh-1709)
1281
+ uniqueCache =
1282
+ outerCache[node.uniqueID] ||
1283
+ (outerCache[node.uniqueID] = {});
1284
+ uniqueCache[type] = [dirruns, diff];
1285
+ }
1286
+ if (node === elem) {
1287
+ break;
1288
+ }
1289
+ }
1290
+ }
1291
+ }
1292
+ }
1293
+ // Incorporate the offset, then check against cycle size
1294
+ diff -= last;
1295
+ return (diff === first || (diff % first === 0 && diff / first >= 0));
1296
+ }
1297
+ };
1298
+ },
1299
+ PSEUDO: function (pseudo, argument) {
1300
+ // pseudo-class names are case-insensitive
1301
+ // http://www.w3.org/TR/selectors/#pseudo-classes
1302
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1303
+ // Remember that setFilters inherits from pseudos
1304
+ var args, fn = Expr.pseudos[pseudo] ||
1305
+ Expr.setFilters[pseudo.toLowerCase()] ||
1306
+ Sizzle.error("unsupported pseudo: " + pseudo);
1307
+ // The user may use createPseudo to indicate that
1308
+ // arguments are needed to create the filter function
1309
+ // just as Sizzle does
1310
+ if (fn[expando]) {
1311
+ return fn(argument);
1312
+ }
1313
+ // But maintain support for old signatures
1314
+ if (fn.length > 1) {
1315
+ args = [pseudo, pseudo, "", argument];
1316
+ return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())
1317
+ ? markFunction(function (seed, matches) {
1318
+ var idx, matched = fn(seed, argument), i = matched.length;
1319
+ while (i--) {
1320
+ idx = indexOf(seed, matched[i]);
1321
+ seed[idx] = !(matches[idx] = matched[i]);
1322
+ }
1323
+ })
1324
+ : function (elem) {
1325
+ return fn(elem, 0, args);
1326
+ };
1327
+ }
1328
+ return fn;
1329
+ },
1330
+ },
1331
+ pseudos: {
1332
+ // Potentially complex pseudos
1333
+ not: markFunction(function (selector) {
1334
+ // Trim the selector passed to compile
1335
+ // to avoid treating leading and trailing
1336
+ // spaces as combinators
1337
+ var input = [], results = [], matcher = compile(selector.replace(rtrim, "$1"));
1338
+ return matcher[expando]
1339
+ ? markFunction(function (seed, matches, _context, xml) {
1340
+ var elem, unmatched = matcher(seed, null, xml, []), i = seed.length;
1341
+ // Match elements unmatched by `matcher`
1342
+ while (i--) {
1343
+ if ((elem = unmatched[i])) {
1344
+ seed[i] = !(matches[i] = elem);
1345
+ }
1346
+ }
1347
+ })
1348
+ : function (elem, _context, xml) {
1349
+ input[0] = elem;
1350
+ matcher(input, null, xml, results);
1351
+ // Don't keep the element (issue #299)
1352
+ input[0] = null;
1353
+ return !results.pop();
1354
+ };
1355
+ }),
1356
+ has: markFunction(function (selector) {
1357
+ return function (elem) {
1358
+ return Sizzle(selector, elem).length > 0;
1359
+ };
1360
+ }),
1361
+ contains: markFunction(function (text) {
1362
+ text = text.replace(runescape, funescape);
1363
+ return function (elem) {
1364
+ return (elem.textContent || getText(elem)).indexOf(text) > -1;
1365
+ };
1366
+ }),
1367
+ // "Whether an element is represented by a :lang() selector
1368
+ // is based solely on the element's language value
1369
+ // being equal to the identifier C,
1370
+ // or beginning with the identifier C immediately followed by "-".
1371
+ // The matching of C against the element's language value is performed case-insensitively.
1372
+ // The identifier C does not have to be a valid language name."
1373
+ // http://www.w3.org/TR/selectors/#lang-pseudo
1374
+ lang: markFunction(function (lang) {
1375
+ // lang value must be a valid identifier
1376
+ if (!ridentifier.test(lang || "")) {
1377
+ Sizzle.error("unsupported lang: " + lang);
1378
+ }
1379
+ lang = lang.replace(runescape, funescape).toLowerCase();
1380
+ return function (elem) {
1381
+ var elemLang;
1382
+ do {
1383
+ if ((elemLang = documentIsHTML
1384
+ ? elem.lang
1385
+ : elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) {
1386
+ elemLang = elemLang.toLowerCase();
1387
+ return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
1388
+ }
1389
+ } while ((elem = elem.parentNode) && elem.nodeType === 1);
1390
+ return false;
1391
+ };
1392
+ }),
1393
+ // Miscellaneous
1394
+ target: function (elem) {
1395
+ var hash = window.location && window.location.hash;
1396
+ return hash && hash.slice(1) === elem.id;
1397
+ },
1398
+ root: function (elem) {
1399
+ return elem === docElem;
1400
+ },
1401
+ focus: function (elem) {
1402
+ return (elem === document.activeElement &&
1403
+ (!document.hasFocus || document.hasFocus()) &&
1404
+ !!(elem.type || elem.href || ~elem.tabIndex));
1405
+ },
1406
+ // Boolean properties
1407
+ enabled: createDisabledPseudo(false),
1408
+ disabled: createDisabledPseudo(true),
1409
+ checked: function (elem) {
1410
+ // In CSS3, :checked should return both checked and selected elements
1411
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1412
+ var nodeName = elem.nodeName.toLowerCase();
1413
+ return ((nodeName === "input" && !!elem.checked) ||
1414
+ (nodeName === "option" && !!elem.selected));
1415
+ },
1416
+ selected: function (elem) {
1417
+ // Accessing this property makes selected-by-default
1418
+ // options in Safari work properly
1419
+ if (elem.parentNode) {
1420
+ // eslint-disable-next-line no-unused-expressions
1421
+ elem.parentNode.selectedIndex;
1422
+ }
1423
+ return elem.selected === true;
1424
+ },
1425
+ // Contents
1426
+ empty: function (elem) {
1427
+ // http://www.w3.org/TR/selectors/#empty-pseudo
1428
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1429
+ // but not by others (comment: 8; processing instruction: 7; etc.)
1430
+ // nodeType < 6 works because attributes (2) do not appear as children
1431
+ for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
1432
+ if (elem.nodeType < 6) {
1433
+ return false;
1434
+ }
1435
+ }
1436
+ return true;
1437
+ },
1438
+ parent: function (elem) {
1439
+ return !Expr.pseudos["empty"](elem);
1440
+ },
1441
+ // Element/input types
1442
+ header: function (elem) {
1443
+ return rheader.test(elem.nodeName);
1444
+ },
1445
+ input: function (elem) {
1446
+ return rinputs.test(elem.nodeName);
1447
+ },
1448
+ button: function (elem) {
1449
+ var name = elem.nodeName.toLowerCase();
1450
+ return ((name === "input" && elem.type === "button") || name === "button");
1451
+ },
1452
+ text: function (elem) {
1453
+ var attr;
1454
+ return (elem.nodeName.toLowerCase() === "input" &&
1455
+ elem.type === "text" &&
1456
+ // Support: IE<8
1457
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1458
+ ((attr = elem.getAttribute("type")) == null ||
1459
+ attr.toLowerCase() === "text"));
1460
+ },
1461
+ // Position-in-collection
1462
+ first: createPositionalPseudo(function () {
1463
+ return [0];
1464
+ }),
1465
+ last: createPositionalPseudo(function (_matchIndexes, length) {
1466
+ return [length - 1];
1467
+ }),
1468
+ eq: createPositionalPseudo(function (_matchIndexes, length, argument) {
1469
+ return [argument < 0 ? argument + length : argument];
1470
+ }),
1471
+ even: createPositionalPseudo(function (matchIndexes, length) {
1472
+ var i = 0;
1473
+ for (; i < length; i += 2) {
1474
+ matchIndexes.push(i);
1475
+ }
1476
+ return matchIndexes;
1477
+ }),
1478
+ odd: createPositionalPseudo(function (matchIndexes, length) {
1479
+ var i = 1;
1480
+ for (; i < length; i += 2) {
1481
+ matchIndexes.push(i);
1482
+ }
1483
+ return matchIndexes;
1484
+ }),
1485
+ lt: createPositionalPseudo(function (matchIndexes, length, argument) {
1486
+ var i = argument < 0
1487
+ ? argument + length
1488
+ : argument > length
1489
+ ? length
1490
+ : argument;
1491
+ for (; --i >= 0;) {
1492
+ matchIndexes.push(i);
1493
+ }
1494
+ return matchIndexes;
1495
+ }),
1496
+ gt: createPositionalPseudo(function (matchIndexes, length, argument) {
1497
+ var i = argument < 0 ? argument + length : argument;
1498
+ for (; ++i < length;) {
1499
+ matchIndexes.push(i);
1500
+ }
1501
+ return matchIndexes;
1502
+ }),
1503
+ },
1504
+ };
1505
+ Expr.pseudos["nth"] = Expr.pseudos["eq"];
1506
+ // Add button/input type pseudos
1507
+ for (i in {
1508
+ radio: true,
1509
+ checkbox: true,
1510
+ file: true,
1511
+ password: true,
1512
+ image: true,
1513
+ }) {
1514
+ Expr.pseudos[i] = createInputPseudo(i);
1515
+ }
1516
+ for (i in { submit: true, reset: true }) {
1517
+ Expr.pseudos[i] = createButtonPseudo(i);
1518
+ }
1519
+ // Easy API for creating new setFilters
1520
+ function setFilters() { }
1521
+ setFilters.prototype = Expr.filters = Expr.pseudos;
1522
+ Expr.setFilters = new setFilters();
1523
+ tokenize = Sizzle.tokenize = function (selector, parseOnly) {
1524
+ var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
1525
+ if (cached) {
1526
+ return parseOnly ? 0 : cached.slice(0);
1527
+ }
1528
+ soFar = selector;
1529
+ groups = [];
1530
+ preFilters = Expr.preFilter;
1531
+ while (soFar) {
1532
+ // Comma and first run
1533
+ if (!matched || (match = rcomma.exec(soFar))) {
1534
+ if (match) {
1535
+ // Don't consume trailing commas as valid
1536
+ soFar = soFar.slice(match[0].length) || soFar;
1537
+ }
1538
+ groups.push((tokens = []));
1539
+ }
1540
+ matched = false;
1541
+ // Combinators
1542
+ if ((match = rcombinators.exec(soFar))) {
1543
+ matched = match.shift();
1544
+ tokens.push({
1545
+ value: matched,
1546
+ // Cast descendant combinators to space
1547
+ type: match[0].replace(rtrim, " "),
1548
+ });
1549
+ soFar = soFar.slice(matched.length);
1550
+ }
1551
+ // Filters
1552
+ for (type in Expr.filter) {
1553
+ if ((match = matchExpr[type].exec(soFar)) &&
1554
+ (!preFilters[type] || (match = preFilters[type](match)))) {
1555
+ matched = match.shift();
1556
+ tokens.push({
1557
+ value: matched,
1558
+ type: type,
1559
+ matches: match,
1560
+ });
1561
+ soFar = soFar.slice(matched.length);
1562
+ }
1563
+ }
1564
+ if (!matched) {
1565
+ break;
1566
+ }
1567
+ }
1568
+ // Return the length of the invalid excess
1569
+ // if we're just parsing
1570
+ // Otherwise, throw an error or return tokens
1571
+ return parseOnly
1572
+ ? soFar.length
1573
+ : soFar
1574
+ ? Sizzle.error(selector)
1575
+ : // Cache the tokens
1576
+ tokenCache(selector, groups).slice(0);
1577
+ };
1578
+ function toSelector(tokens) {
1579
+ var i = 0, len = tokens.length, selector = "";
1580
+ for (; i < len; i++) {
1581
+ selector += tokens[i].value;
1582
+ }
1583
+ return selector;
1584
+ }
1585
+ function addCombinator(matcher, combinator, base) {
1586
+ var dir = combinator.dir, skip = combinator.next, key = skip || dir, checkNonElements = base && key === "parentNode", doneName = done++;
1587
+ return combinator.first
1588
+ ? // Check against closest ancestor/preceding element
1589
+ function (elem, context, xml) {
1590
+ while ((elem = elem[dir])) {
1591
+ if (elem.nodeType === 1 || checkNonElements) {
1592
+ return matcher(elem, context, xml);
1593
+ }
1594
+ }
1595
+ return false;
1596
+ }
1597
+ : // Check against all ancestor/preceding elements
1598
+ function (elem, context, xml) {
1599
+ var oldCache, uniqueCache, outerCache, newCache = [dirruns, doneName];
1600
+ // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
1601
+ if (xml) {
1602
+ while ((elem = elem[dir])) {
1603
+ if (elem.nodeType === 1 || checkNonElements) {
1604
+ if (matcher(elem, context, xml)) {
1605
+ return true;
1606
+ }
1607
+ }
1608
+ }
1609
+ }
1610
+ else {
1611
+ while ((elem = elem[dir])) {
1612
+ if (elem.nodeType === 1 || checkNonElements) {
1613
+ outerCache = elem[expando] || (elem[expando] = {});
1614
+ // Support: IE <9 only
1615
+ // Defend against cloned attroperties (jQuery gh-1709)
1616
+ uniqueCache =
1617
+ outerCache[elem.uniqueID] || (outerCache[elem.uniqueID] = {});
1618
+ if (skip && skip === elem.nodeName.toLowerCase()) {
1619
+ elem = elem[dir] || elem;
1620
+ }
1621
+ else if ((oldCache = uniqueCache[key]) &&
1622
+ oldCache[0] === dirruns &&
1623
+ oldCache[1] === doneName) {
1624
+ // Assign to newCache so results back-propagate to previous elements
1625
+ return (newCache[2] = oldCache[2]);
1626
+ }
1627
+ else {
1628
+ // Reuse newcache so results back-propagate to previous elements
1629
+ uniqueCache[key] = newCache;
1630
+ // A match means we're done; a fail means we have to keep checking
1631
+ if ((newCache[2] = matcher(elem, context, xml))) {
1632
+ return true;
1633
+ }
1634
+ }
1635
+ }
1636
+ }
1637
+ }
1638
+ return false;
1639
+ };
1640
+ }
1641
+ function elementMatcher(matchers) {
1642
+ return matchers.length > 1
1643
+ ? function (elem, context, xml) {
1644
+ var i = matchers.length;
1645
+ while (i--) {
1646
+ if (!matchers[i](elem, context, xml)) {
1647
+ return false;
1648
+ }
1649
+ }
1650
+ return true;
1651
+ }
1652
+ : matchers[0];
1653
+ }
1654
+ function multipleContexts(selector, contexts, results) {
1655
+ var i = 0, len = contexts.length;
1656
+ for (; i < len; i++) {
1657
+ Sizzle(selector, contexts[i], results);
1658
+ }
1659
+ return results;
1660
+ }
1661
+ function condense(unmatched, map, filter, context, xml) {
1662
+ var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null;
1663
+ for (; i < len; i++) {
1664
+ if ((elem = unmatched[i])) {
1665
+ if (!filter || filter(elem, context, xml)) {
1666
+ newUnmatched.push(elem);
1667
+ if (mapped) {
1668
+ map.push(i);
1669
+ }
1670
+ }
1671
+ }
1672
+ }
1673
+ return newUnmatched;
1674
+ }
1675
+ function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
1676
+ if (postFilter && !postFilter[expando]) {
1677
+ postFilter = setMatcher(postFilter);
1678
+ }
1679
+ if (postFinder && !postFinder[expando]) {
1680
+ postFinder = setMatcher(postFinder, postSelector);
1681
+ }
1682
+ return markFunction(function (seed, results, context, xml) {
1683
+ var temp, i, elem, preMap = [], postMap = [], preexisting = results.length,
1684
+ // Get initial elements from seed or context
1685
+ elems = seed ||
1686
+ multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
1687
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
1688
+ matcherIn = preFilter && (seed || !selector)
1689
+ ? condense(elems, preMap, preFilter, context, xml)
1690
+ : elems, matcherOut = matcher
1691
+ ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
1692
+ postFinder || (seed ? preFilter : preexisting || postFilter)
1693
+ ? // ...intermediate processing is necessary
1694
+ []
1695
+ : // ...otherwise use results directly
1696
+ results
1697
+ : matcherIn;
1698
+ // Find primary matches
1699
+ if (matcher) {
1700
+ matcher(matcherIn, matcherOut, context, xml);
1701
+ }
1702
+ // Apply postFilter
1703
+ if (postFilter) {
1704
+ temp = condense(matcherOut, postMap);
1705
+ postFilter(temp, [], context, xml);
1706
+ // Un-match failing elements by moving them back to matcherIn
1707
+ i = temp.length;
1708
+ while (i--) {
1709
+ if ((elem = temp[i])) {
1710
+ matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
1711
+ }
1712
+ }
1713
+ }
1714
+ if (seed) {
1715
+ if (postFinder || preFilter) {
1716
+ if (postFinder) {
1717
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
1718
+ temp = [];
1719
+ i = matcherOut.length;
1720
+ while (i--) {
1721
+ if ((elem = matcherOut[i])) {
1722
+ // Restore matcherIn since elem is not yet a final match
1723
+ temp.push((matcherIn[i] = elem));
1724
+ }
1725
+ }
1726
+ postFinder(null, (matcherOut = []), temp, xml);
1727
+ }
1728
+ // Move matched elements from seed to results to keep them synchronized
1729
+ i = matcherOut.length;
1730
+ while (i--) {
1731
+ if ((elem = matcherOut[i]) &&
1732
+ (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {
1733
+ seed[temp] = !(results[temp] = elem);
1734
+ }
1735
+ }
1736
+ }
1737
+ // Add elements to results, through postFinder if defined
1738
+ }
1739
+ else {
1740
+ matcherOut = condense(matcherOut === results
1741
+ ? matcherOut.splice(preexisting, matcherOut.length)
1742
+ : matcherOut);
1743
+ if (postFinder) {
1744
+ postFinder(null, results, matcherOut, xml);
1745
+ }
1746
+ else {
1747
+ push.apply(results, matcherOut);
1748
+ }
1749
+ }
1750
+ });
1751
+ }
1752
+ function matcherFromTokens(tokens) {
1753
+ var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0,
1754
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
1755
+ matchContext = addCombinator(function (elem) {
1756
+ return elem === checkContext;
1757
+ }, implicitRelative, true), matchAnyContext = addCombinator(function (elem) {
1758
+ return indexOf(checkContext, elem) > -1;
1759
+ }, implicitRelative, true), matchers = [
1760
+ function (elem, context, xml) {
1761
+ var ret = (!leadingRelative && (xml || context !== outermostContext)) ||
1762
+ ((checkContext = context).nodeType
1763
+ ? matchContext(elem, context, xml)
1764
+ : matchAnyContext(elem, context, xml));
1765
+ // Avoid hanging onto element (issue #299)
1766
+ checkContext = null;
1767
+ return ret;
1768
+ },
1769
+ ];
1770
+ for (; i < len; i++) {
1771
+ if ((matcher = Expr.relative[tokens[i].type])) {
1772
+ matchers = [addCombinator(elementMatcher(matchers), matcher)];
1773
+ }
1774
+ else {
1775
+ matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
1776
+ // Return special upon seeing a positional matcher
1777
+ if (matcher[expando]) {
1778
+ // Find the next relative operator (if any) for proper handling
1779
+ j = ++i;
1780
+ for (; j < len; j++) {
1781
+ if (Expr.relative[tokens[j].type]) {
1782
+ break;
1783
+ }
1784
+ }
1785
+ return setMatcher(i > 1 && elementMatcher(matchers), i > 1 &&
1786
+ toSelector(
1787
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
1788
+ tokens
1789
+ .slice(0, i - 1)
1790
+ .concat({ value: tokens[i - 2].type === " " ? "*" : "" })).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens((tokens = tokens.slice(j))), j < len && toSelector(tokens));
1791
+ }
1792
+ matchers.push(matcher);
1793
+ }
1794
+ }
1795
+ return elementMatcher(matchers);
1796
+ }
1797
+ function matcherFromGroupMatchers(elementMatchers, setMatchers) {
1798
+ var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function (seed, context, xml, results, outermost) {
1799
+ var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext,
1800
+ // We must always have either seed elements or outermost context
1801
+ elems = seed || (byElement && Expr.find["TAG"]("*", outermost)),
1802
+ // Use integer dirruns iff this is the outermost matcher
1803
+ dirrunsUnique = (dirruns +=
1804
+ contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length;
1805
+ if (outermost) {
1806
+ // Support: IE 11+, Edge 17 - 18+
1807
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1808
+ // two documents; shallow comparisons work.
1809
+ // eslint-disable-next-line eqeqeq
1810
+ outermostContext = context == document || context || outermost;
1811
+ }
1812
+ // Add elements passing elementMatchers directly to results
1813
+ // Support: IE<9, Safari
1814
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
1815
+ for (; i !== len && (elem = elems[i]) != null; i++) {
1816
+ if (byElement && elem) {
1817
+ j = 0;
1818
+ // Support: IE 11+, Edge 17 - 18+
1819
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1820
+ // two documents; shallow comparisons work.
1821
+ // eslint-disable-next-line eqeqeq
1822
+ if (!context && elem.ownerDocument != document) {
1823
+ setDocument(elem);
1824
+ xml = !documentIsHTML;
1825
+ }
1826
+ while ((matcher = elementMatchers[j++])) {
1827
+ if (matcher(elem, context || document, xml)) {
1828
+ results.push(elem);
1829
+ break;
1830
+ }
1831
+ }
1832
+ if (outermost) {
1833
+ dirruns = dirrunsUnique;
1834
+ }
1835
+ }
1836
+ // Track unmatched elements for set filters
1837
+ if (bySet) {
1838
+ // They will have gone through all possible matchers
1839
+ if ((elem = !matcher && elem)) {
1840
+ matchedCount--;
1841
+ }
1842
+ // Lengthen the array for every element, matched or not
1843
+ if (seed) {
1844
+ unmatched.push(elem);
1845
+ }
1846
+ }
1847
+ }
1848
+ // `i` is now the count of elements visited above, and adding it to `matchedCount`
1849
+ // makes the latter nonnegative.
1850
+ matchedCount += i;
1851
+ // Apply set filters to unmatched elements
1852
+ // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
1853
+ // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
1854
+ // no element matchers and no seed.
1855
+ // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
1856
+ // case, which will result in a "00" `matchedCount` that differs from `i` but is also
1857
+ // numerically zero.
1858
+ if (bySet && i !== matchedCount) {
1859
+ j = 0;
1860
+ while ((matcher = setMatchers[j++])) {
1861
+ matcher(unmatched, setMatched, context, xml);
1862
+ }
1863
+ if (seed) {
1864
+ // Reintegrate element matches to eliminate the need for sorting
1865
+ if (matchedCount > 0) {
1866
+ while (i--) {
1867
+ if (!(unmatched[i] || setMatched[i])) {
1868
+ setMatched[i] = pop.call(results);
1869
+ }
1870
+ }
1871
+ }
1872
+ // Discard index placeholder values to get only actual matches
1873
+ setMatched = condense(setMatched);
1874
+ }
1875
+ // Add matches to results
1876
+ push.apply(results, setMatched);
1877
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
1878
+ if (outermost &&
1879
+ !seed &&
1880
+ setMatched.length > 0 &&
1881
+ matchedCount + setMatchers.length > 1) {
1882
+ Sizzle.uniqueSort(results);
1883
+ }
1884
+ }
1885
+ // Override manipulation of globals by nested matchers
1886
+ if (outermost) {
1887
+ dirruns = dirrunsUnique;
1888
+ outermostContext = contextBackup;
1889
+ }
1890
+ return unmatched;
1891
+ };
1892
+ return bySet ? markFunction(superMatcher) : superMatcher;
1893
+ }
1894
+ compile = Sizzle.compile = function (selector, match /* Internal Use Only */) {
1895
+ var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
1896
+ if (!cached) {
1897
+ // Generate a function of recursive functions that can be used to check each element
1898
+ if (!match) {
1899
+ match = tokenize(selector);
1900
+ }
1901
+ i = match.length;
1902
+ while (i--) {
1903
+ cached = matcherFromTokens(match[i]);
1904
+ if (cached[expando]) {
1905
+ setMatchers.push(cached);
1906
+ }
1907
+ else {
1908
+ elementMatchers.push(cached);
1909
+ }
1910
+ }
1911
+ // Cache the compiled function
1912
+ cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
1913
+ // Save selector and tokenization
1914
+ cached.selector = selector;
1915
+ }
1916
+ return cached;
1917
+ };
1918
+ /**
1919
+ * A low-level selection function that works with Sizzle's compiled
1920
+ * selector functions
1921
+ * @param {String|Function} selector A selector or a pre-compiled
1922
+ * selector function built with Sizzle.compile
1923
+ * @param {Element} context
1924
+ * @param {Array} [results]
1925
+ * @param {Array} [seed] A set of elements to match against
1926
+ */
1927
+ select = Sizzle.select = function (selector, context, results, seed) {
1928
+ var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize((selector = compiled.selector || selector));
1929
+ results = results || [];
1930
+ // Try to minimize operations if there is only one selector in the list and no seed
1931
+ // (the latter of which guarantees us context)
1932
+ if (match.length === 1) {
1933
+ // Reduce context if the leading compound selector is an ID
1934
+ tokens = match[0] = match[0].slice(0);
1935
+ if (tokens.length > 2 &&
1936
+ (token = tokens[0]).type === "ID" &&
1937
+ context.nodeType === 9 &&
1938
+ documentIsHTML &&
1939
+ Expr.relative[tokens[1].type]) {
1940
+ context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
1941
+ if (!context) {
1942
+ return results;
1943
+ // Precompiled matchers will still verify ancestry, so step up a level
1944
+ }
1945
+ else if (compiled) {
1946
+ context = context.parentNode;
1947
+ }
1948
+ selector = selector.slice(tokens.shift().value.length);
1949
+ }
1950
+ // Fetch a seed set for right-to-left matching
1951
+ i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
1952
+ while (i--) {
1953
+ token = tokens[i];
1954
+ // Abort if we hit a combinator
1955
+ if (Expr.relative[(type = token.type)]) {
1956
+ break;
1957
+ }
1958
+ if ((find = Expr.find[type])) {
1959
+ // Search, expanding context for leading sibling combinators
1960
+ if ((seed = find(token.matches[0].replace(runescape, funescape), (rsibling.test(tokens[0].type) &&
1961
+ testContext(context.parentNode)) ||
1962
+ context))) {
1963
+ // If seed is empty or no tokens remain, we can return early
1964
+ tokens.splice(i, 1);
1965
+ selector = seed.length && toSelector(tokens);
1966
+ if (!selector) {
1967
+ push.apply(results, seed);
1968
+ return results;
1969
+ }
1970
+ break;
1971
+ }
1972
+ }
1973
+ }
1974
+ }
1975
+ // Compile and execute a filtering function if one is not provided
1976
+ // Provide `match` to avoid retokenization if we modified the selector above
1977
+ (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context ||
1978
+ (rsibling.test(selector) && testContext(context.parentNode)) ||
1979
+ context);
1980
+ return results;
1981
+ };
1982
+ // One-time assignments
1983
+ // Sort stability
1984
+ support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
1985
+ // Support: Chrome 14-35+
1986
+ // Always assume duplicates if they aren't passed to the comparison function
1987
+ support.detectDuplicates = !!hasDuplicate;
1988
+ // Initialize against the default document
1989
+ setDocument();
1990
+ // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
1991
+ // Detached nodes confoundingly follow *each other*
1992
+ support.sortDetached = assert(function (el) {
1993
+ // Should return 1, but returns 4 (following)
1994
+ return el.compareDocumentPosition(document.createElement("fieldset")) & 1;
1995
+ });
1996
+ // Support: IE<8
1997
+ // Prevent attribute/property "interpolation"
1998
+ // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
1999
+ if (!assert(function (el) {
2000
+ el.innerHTML = "<a href='#'></a>";
2001
+ return el.firstChild.getAttribute("href") === "#";
2002
+ })) {
2003
+ addHandle("type|href|height|width", function (elem, name, isXML) {
2004
+ if (!isXML) {
2005
+ return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
2006
+ }
2007
+ });
2008
+ }
2009
+ // Support: IE<9
2010
+ // Use defaultValue in place of getAttribute("value")
2011
+ if (!support.attributes ||
2012
+ !assert(function (el) {
2013
+ el.innerHTML = "<input/>";
2014
+ el.firstChild.setAttribute("value", "");
2015
+ return el.firstChild.getAttribute("value") === "";
2016
+ })) {
2017
+ addHandle("value", function (elem, _name, isXML) {
2018
+ if (!isXML && elem.nodeName.toLowerCase() === "input") {
2019
+ return elem.defaultValue;
2020
+ }
2021
+ });
2022
+ }
2023
+ // Support: IE<9
2024
+ // Use getAttributeNode to fetch booleans when getAttribute lies
2025
+ if (!assert(function (el) {
2026
+ return el.getAttribute("disabled") == null;
2027
+ })) {
2028
+ addHandle(booleans, function (elem, name, isXML) {
2029
+ var val;
2030
+ if (!isXML) {
2031
+ return elem[name] === true
2032
+ ? name.toLowerCase()
2033
+ : (val = elem.getAttributeNode(name)) && val.specified
2034
+ ? val.value
2035
+ : null;
2036
+ }
2037
+ });
2038
+ }
2039
+ // EXPOSE
2040
+ var _sizzle = window.Sizzle;
2041
+ Sizzle.noConflict = function () {
2042
+ if (window.Sizzle === Sizzle) {
2043
+ window.Sizzle = _sizzle;
2044
+ }
2045
+ return Sizzle;
2046
+ };
2047
+ if (typeof define === "function" && define.amd) {
2048
+ define(function () {
2049
+ return Sizzle;
2050
+ });
2051
+ // Sizzle requires that there be a global window in Common-JS like environments
2052
+ }
2053
+ else if (typeof module !== "undefined" && module.exports) {
2054
+ module.exports = Sizzle;
2055
+ }
2056
+ else {
2057
+ window.Sizzle = Sizzle;
2058
+ }
2059
+ // EXPOSE
2060
+ }
2061
+ ;