3.6.4
[jquery.git] / dist / jquery.slim.js
blobedf6ce9ca53050f2d926f3529da6acdb3c7bab8e
1 /*!
2  * jQuery JavaScript Library v3.6.4 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/animatedSelector,-effects/Tween
3  * https://jquery.com/
4  *
5  * Includes Sizzle.js
6  * https://sizzlejs.com/
7  *
8  * Copyright OpenJS Foundation and other contributors
9  * Released under the MIT license
10  * https://jquery.org/license
11  *
12  * Date: 2023-03-08T15:29Z
13  */
14 ( function( global, factory ) {
16         "use strict";
18         if ( typeof module === "object" && typeof module.exports === "object" ) {
20                 // For CommonJS and CommonJS-like environments where a proper `window`
21                 // is present, execute the factory and get jQuery.
22                 // For environments that do not have a `window` with a `document`
23                 // (such as Node.js), expose a factory as module.exports.
24                 // This accentuates the need for the creation of a real `window`.
25                 // e.g. var jQuery = require("jquery")(window);
26                 // See ticket trac-14549 for more info.
27                 module.exports = global.document ?
28                         factory( global, true ) :
29                         function( w ) {
30                                 if ( !w.document ) {
31                                         throw new Error( "jQuery requires a window with a document" );
32                                 }
33                                 return factory( w );
34                         };
35         } else {
36                 factory( global );
37         }
39 // Pass this if window is not defined yet
40 } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
42 // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
43 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
44 // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
45 // enough that all such attempts are guarded in a try block.
46 "use strict";
48 var arr = [];
50 var getProto = Object.getPrototypeOf;
52 var slice = arr.slice;
54 var flat = arr.flat ? function( array ) {
55         return arr.flat.call( array );
56 } : function( array ) {
57         return arr.concat.apply( [], array );
61 var push = arr.push;
63 var indexOf = arr.indexOf;
65 var class2type = {};
67 var toString = class2type.toString;
69 var hasOwn = class2type.hasOwnProperty;
71 var fnToString = hasOwn.toString;
73 var ObjectFunctionString = fnToString.call( Object );
75 var support = {};
77 var isFunction = function isFunction( obj ) {
79                 // Support: Chrome <=57, Firefox <=52
80                 // In some browsers, typeof returns "function" for HTML <object> elements
81                 // (i.e., `typeof document.createElement( "object" ) === "function"`).
82                 // We don't want to classify *any* DOM node as a function.
83                 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
84                 // Plus for old WebKit, typeof returns "function" for HTML collections
85                 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
86                 return typeof obj === "function" && typeof obj.nodeType !== "number" &&
87                         typeof obj.item !== "function";
88         };
91 var isWindow = function isWindow( obj ) {
92                 return obj != null && obj === obj.window;
93         };
96 var document = window.document;
100         var preservedScriptAttributes = {
101                 type: true,
102                 src: true,
103                 nonce: true,
104                 noModule: true
105         };
107         function DOMEval( code, node, doc ) {
108                 doc = doc || document;
110                 var i, val,
111                         script = doc.createElement( "script" );
113                 script.text = code;
114                 if ( node ) {
115                         for ( i in preservedScriptAttributes ) {
117                                 // Support: Firefox 64+, Edge 18+
118                                 // Some browsers don't support the "nonce" property on scripts.
119                                 // On the other hand, just using `getAttribute` is not enough as
120                                 // the `nonce` attribute is reset to an empty string whenever it
121                                 // becomes browsing-context connected.
122                                 // See https://github.com/whatwg/html/issues/2369
123                                 // See https://html.spec.whatwg.org/#nonce-attributes
124                                 // The `node.getAttribute` check was added for the sake of
125                                 // `jQuery.globalEval` so that it can fake a nonce-containing node
126                                 // via an object.
127                                 val = node[ i ] || node.getAttribute && node.getAttribute( i );
128                                 if ( val ) {
129                                         script.setAttribute( i, val );
130                                 }
131                         }
132                 }
133                 doc.head.appendChild( script ).parentNode.removeChild( script );
134         }
137 function toType( obj ) {
138         if ( obj == null ) {
139                 return obj + "";
140         }
142         // Support: Android <=2.3 only (functionish RegExp)
143         return typeof obj === "object" || typeof obj === "function" ?
144                 class2type[ toString.call( obj ) ] || "object" :
145                 typeof obj;
147 /* global Symbol */
148 // Defining this global in .eslintrc.json would create a danger of using the global
149 // unguarded in another place, it seems safer to define global only for this module
154         version = "3.6.4 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/animatedSelector,-effects/Tween",
156         // Define a local copy of jQuery
157         jQuery = function( selector, context ) {
159                 // The jQuery object is actually just the init constructor 'enhanced'
160                 // Need init if jQuery is called (just allow error to be thrown if not included)
161                 return new jQuery.fn.init( selector, context );
162         };
164 jQuery.fn = jQuery.prototype = {
166         // The current version of jQuery being used
167         jquery: version,
169         constructor: jQuery,
171         // The default length of a jQuery object is 0
172         length: 0,
174         toArray: function() {
175                 return slice.call( this );
176         },
178         // Get the Nth element in the matched element set OR
179         // Get the whole matched element set as a clean array
180         get: function( num ) {
182                 // Return all the elements in a clean array
183                 if ( num == null ) {
184                         return slice.call( this );
185                 }
187                 // Return just the one element from the set
188                 return num < 0 ? this[ num + this.length ] : this[ num ];
189         },
191         // Take an array of elements and push it onto the stack
192         // (returning the new matched element set)
193         pushStack: function( elems ) {
195                 // Build a new jQuery matched element set
196                 var ret = jQuery.merge( this.constructor(), elems );
198                 // Add the old object onto the stack (as a reference)
199                 ret.prevObject = this;
201                 // Return the newly-formed element set
202                 return ret;
203         },
205         // Execute a callback for every element in the matched set.
206         each: function( callback ) {
207                 return jQuery.each( this, callback );
208         },
210         map: function( callback ) {
211                 return this.pushStack( jQuery.map( this, function( elem, i ) {
212                         return callback.call( elem, i, elem );
213                 } ) );
214         },
216         slice: function() {
217                 return this.pushStack( slice.apply( this, arguments ) );
218         },
220         first: function() {
221                 return this.eq( 0 );
222         },
224         last: function() {
225                 return this.eq( -1 );
226         },
228         even: function() {
229                 return this.pushStack( jQuery.grep( this, function( _elem, i ) {
230                         return ( i + 1 ) % 2;
231                 } ) );
232         },
234         odd: function() {
235                 return this.pushStack( jQuery.grep( this, function( _elem, i ) {
236                         return i % 2;
237                 } ) );
238         },
240         eq: function( i ) {
241                 var len = this.length,
242                         j = +i + ( i < 0 ? len : 0 );
243                 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
244         },
246         end: function() {
247                 return this.prevObject || this.constructor();
248         },
250         // For internal use only.
251         // Behaves like an Array's method, not like a jQuery method.
252         push: push,
253         sort: arr.sort,
254         splice: arr.splice
257 jQuery.extend = jQuery.fn.extend = function() {
258         var options, name, src, copy, copyIsArray, clone,
259                 target = arguments[ 0 ] || {},
260                 i = 1,
261                 length = arguments.length,
262                 deep = false;
264         // Handle a deep copy situation
265         if ( typeof target === "boolean" ) {
266                 deep = target;
268                 // Skip the boolean and the target
269                 target = arguments[ i ] || {};
270                 i++;
271         }
273         // Handle case when target is a string or something (possible in deep copy)
274         if ( typeof target !== "object" && !isFunction( target ) ) {
275                 target = {};
276         }
278         // Extend jQuery itself if only one argument is passed
279         if ( i === length ) {
280                 target = this;
281                 i--;
282         }
284         for ( ; i < length; i++ ) {
286                 // Only deal with non-null/undefined values
287                 if ( ( options = arguments[ i ] ) != null ) {
289                         // Extend the base object
290                         for ( name in options ) {
291                                 copy = options[ name ];
293                                 // Prevent Object.prototype pollution
294                                 // Prevent never-ending loop
295                                 if ( name === "__proto__" || target === copy ) {
296                                         continue;
297                                 }
299                                 // Recurse if we're merging plain objects or arrays
300                                 if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
301                                         ( copyIsArray = Array.isArray( copy ) ) ) ) {
302                                         src = target[ name ];
304                                         // Ensure proper type for the source value
305                                         if ( copyIsArray && !Array.isArray( src ) ) {
306                                                 clone = [];
307                                         } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
308                                                 clone = {};
309                                         } else {
310                                                 clone = src;
311                                         }
312                                         copyIsArray = false;
314                                         // Never move original objects, clone them
315                                         target[ name ] = jQuery.extend( deep, clone, copy );
317                                 // Don't bring in undefined values
318                                 } else if ( copy !== undefined ) {
319                                         target[ name ] = copy;
320                                 }
321                         }
322                 }
323         }
325         // Return the modified object
326         return target;
329 jQuery.extend( {
331         // Unique for each copy of jQuery on the page
332         expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
334         // Assume jQuery is ready without the ready module
335         isReady: true,
337         error: function( msg ) {
338                 throw new Error( msg );
339         },
341         noop: function() {},
343         isPlainObject: function( obj ) {
344                 var proto, Ctor;
346                 // Detect obvious negatives
347                 // Use toString instead of jQuery.type to catch host objects
348                 if ( !obj || toString.call( obj ) !== "[object Object]" ) {
349                         return false;
350                 }
352                 proto = getProto( obj );
354                 // Objects with no prototype (e.g., `Object.create( null )`) are plain
355                 if ( !proto ) {
356                         return true;
357                 }
359                 // Objects with prototype are plain iff they were constructed by a global Object function
360                 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
361                 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
362         },
364         isEmptyObject: function( obj ) {
365                 var name;
367                 for ( name in obj ) {
368                         return false;
369                 }
370                 return true;
371         },
373         // Evaluates a script in a provided context; falls back to the global one
374         // if not specified.
375         globalEval: function( code, options, doc ) {
376                 DOMEval( code, { nonce: options && options.nonce }, doc );
377         },
379         each: function( obj, callback ) {
380                 var length, i = 0;
382                 if ( isArrayLike( obj ) ) {
383                         length = obj.length;
384                         for ( ; i < length; i++ ) {
385                                 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
386                                         break;
387                                 }
388                         }
389                 } else {
390                         for ( i in obj ) {
391                                 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
392                                         break;
393                                 }
394                         }
395                 }
397                 return obj;
398         },
400         // results is for internal usage only
401         makeArray: function( arr, results ) {
402                 var ret = results || [];
404                 if ( arr != null ) {
405                         if ( isArrayLike( Object( arr ) ) ) {
406                                 jQuery.merge( ret,
407                                         typeof arr === "string" ?
408                                                 [ arr ] : arr
409                                 );
410                         } else {
411                                 push.call( ret, arr );
412                         }
413                 }
415                 return ret;
416         },
418         inArray: function( elem, arr, i ) {
419                 return arr == null ? -1 : indexOf.call( arr, elem, i );
420         },
422         // Support: Android <=4.0 only, PhantomJS 1 only
423         // push.apply(_, arraylike) throws on ancient WebKit
424         merge: function( first, second ) {
425                 var len = +second.length,
426                         j = 0,
427                         i = first.length;
429                 for ( ; j < len; j++ ) {
430                         first[ i++ ] = second[ j ];
431                 }
433                 first.length = i;
435                 return first;
436         },
438         grep: function( elems, callback, invert ) {
439                 var callbackInverse,
440                         matches = [],
441                         i = 0,
442                         length = elems.length,
443                         callbackExpect = !invert;
445                 // Go through the array, only saving the items
446                 // that pass the validator function
447                 for ( ; i < length; i++ ) {
448                         callbackInverse = !callback( elems[ i ], i );
449                         if ( callbackInverse !== callbackExpect ) {
450                                 matches.push( elems[ i ] );
451                         }
452                 }
454                 return matches;
455         },
457         // arg is for internal usage only
458         map: function( elems, callback, arg ) {
459                 var length, value,
460                         i = 0,
461                         ret = [];
463                 // Go through the array, translating each of the items to their new values
464                 if ( isArrayLike( elems ) ) {
465                         length = elems.length;
466                         for ( ; i < length; i++ ) {
467                                 value = callback( elems[ i ], i, arg );
469                                 if ( value != null ) {
470                                         ret.push( value );
471                                 }
472                         }
474                 // Go through every key on the object,
475                 } else {
476                         for ( i in elems ) {
477                                 value = callback( elems[ i ], i, arg );
479                                 if ( value != null ) {
480                                         ret.push( value );
481                                 }
482                         }
483                 }
485                 // Flatten any nested arrays
486                 return flat( ret );
487         },
489         // A global GUID counter for objects
490         guid: 1,
492         // jQuery.support is not used in Core but other projects attach their
493         // properties to it so it needs to exist.
494         support: support
495 } );
497 if ( typeof Symbol === "function" ) {
498         jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
501 // Populate the class2type map
502 jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
503         function( _i, name ) {
504                 class2type[ "[object " + name + "]" ] = name.toLowerCase();
505         } );
507 function isArrayLike( obj ) {
509         // Support: real iOS 8.2 only (not reproducible in simulator)
510         // `in` check used to prevent JIT error (gh-2145)
511         // hasOwn isn't used here due to false negatives
512         // regarding Nodelist length in IE
513         var length = !!obj && "length" in obj && obj.length,
514                 type = toType( obj );
516         if ( isFunction( obj ) || isWindow( obj ) ) {
517                 return false;
518         }
520         return type === "array" || length === 0 ||
521                 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
523 var Sizzle =
525  * Sizzle CSS Selector Engine v2.3.10
526  * https://sizzlejs.com/
528  * Copyright JS Foundation and other contributors
529  * Released under the MIT license
530  * https://js.foundation/
532  * Date: 2023-02-14
533  */
534 ( function( window ) {
535 var i,
536         support,
537         Expr,
538         getText,
539         isXML,
540         tokenize,
541         compile,
542         select,
543         outermostContext,
544         sortInput,
545         hasDuplicate,
547         // Local document vars
548         setDocument,
549         document,
550         docElem,
551         documentIsHTML,
552         rbuggyQSA,
553         rbuggyMatches,
554         matches,
555         contains,
557         // Instance-specific data
558         expando = "sizzle" + 1 * new Date(),
559         preferredDoc = window.document,
560         dirruns = 0,
561         done = 0,
562         classCache = createCache(),
563         tokenCache = createCache(),
564         compilerCache = createCache(),
565         nonnativeSelectorCache = createCache(),
566         sortOrder = function( a, b ) {
567                 if ( a === b ) {
568                         hasDuplicate = true;
569                 }
570                 return 0;
571         },
573         // Instance methods
574         hasOwn = ( {} ).hasOwnProperty,
575         arr = [],
576         pop = arr.pop,
577         pushNative = arr.push,
578         push = arr.push,
579         slice = arr.slice,
581         // Use a stripped-down indexOf as it's faster than native
582         // https://jsperf.com/thor-indexof-vs-for/5
583         indexOf = function( list, elem ) {
584                 var i = 0,
585                         len = list.length;
586                 for ( ; i < len; i++ ) {
587                         if ( list[ i ] === elem ) {
588                                 return i;
589                         }
590                 }
591                 return -1;
592         },
594         booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
595                 "ismap|loop|multiple|open|readonly|required|scoped",
597         // Regular expressions
599         // http://www.w3.org/TR/css3-selectors/#whitespace
600         whitespace = "[\\x20\\t\\r\\n\\f]",
602         // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
603         identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
604                 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
606         // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
607         attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
609                 // Operator (capture 2)
610                 "*([*^$|!~]?=)" + whitespace +
612                 // "Attribute values must be CSS identifiers [capture 5]
613                 // or strings [capture 3 or capture 4]"
614                 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
615                 whitespace + "*\\]",
617         pseudos = ":(" + identifier + ")(?:\\((" +
619                 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
620                 // 1. quoted (capture 3; capture 4 or capture 5)
621                 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
623                 // 2. simple (capture 6)
624                 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
626                 // 3. anything else (capture 2)
627                 ".*" +
628                 ")\\)|)",
630         // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
631         rwhitespace = new RegExp( whitespace + "+", "g" ),
632         rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
633                 whitespace + "+$", "g" ),
635         rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
636         rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
637                 "*" ),
638         rdescend = new RegExp( whitespace + "|>" ),
640         rpseudo = new RegExp( pseudos ),
641         ridentifier = new RegExp( "^" + identifier + "$" ),
643         matchExpr = {
644                 "ID": new RegExp( "^#(" + identifier + ")" ),
645                 "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
646                 "TAG": new RegExp( "^(" + identifier + "|[*])" ),
647                 "ATTR": new RegExp( "^" + attributes ),
648                 "PSEUDO": new RegExp( "^" + pseudos ),
649                 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
650                         whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
651                         whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
652                 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
654                 // For use in libraries implementing .is()
655                 // We use this for POS matching in `select`
656                 "needsContext": new RegExp( "^" + whitespace +
657                         "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
658                         "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
659         },
661         rhtml = /HTML$/i,
662         rinputs = /^(?:input|select|textarea|button)$/i,
663         rheader = /^h\d$/i,
665         rnative = /^[^{]+\{\s*\[native \w/,
667         // Easily-parseable/retrievable ID or TAG or CLASS selectors
668         rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
670         rsibling = /[+~]/,
672         // CSS escapes
673         // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
674         runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
675         funescape = function( escape, nonHex ) {
676                 var high = "0x" + escape.slice( 1 ) - 0x10000;
678                 return nonHex ?
680                         // Strip the backslash prefix from a non-hex escape sequence
681                         nonHex :
683                         // Replace a hexadecimal escape sequence with the encoded Unicode code point
684                         // Support: IE <=11+
685                         // For values outside the Basic Multilingual Plane (BMP), manually construct a
686                         // surrogate pair
687                         high < 0 ?
688                                 String.fromCharCode( high + 0x10000 ) :
689                                 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
690         },
692         // CSS string/identifier serialization
693         // https://drafts.csswg.org/cssom/#common-serializing-idioms
694         rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
695         fcssescape = function( ch, asCodePoint ) {
696                 if ( asCodePoint ) {
698                         // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
699                         if ( ch === "\0" ) {
700                                 return "\uFFFD";
701                         }
703                         // Control characters and (dependent upon position) numbers get escaped as code points
704                         return ch.slice( 0, -1 ) + "\\" +
705                                 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
706                 }
708                 // Other potentially-special ASCII characters get backslash-escaped
709                 return "\\" + ch;
710         },
712         // Used for iframes
713         // See setDocument()
714         // Removing the function wrapper causes a "Permission Denied"
715         // error in IE
716         unloadHandler = function() {
717                 setDocument();
718         },
720         inDisabledFieldset = addCombinator(
721                 function( elem ) {
722                         return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
723                 },
724                 { dir: "parentNode", next: "legend" }
725         );
727 // Optimize for push.apply( _, NodeList )
728 try {
729         push.apply(
730                 ( arr = slice.call( preferredDoc.childNodes ) ),
731                 preferredDoc.childNodes
732         );
734         // Support: Android<4.0
735         // Detect silently failing push.apply
736         // eslint-disable-next-line no-unused-expressions
737         arr[ preferredDoc.childNodes.length ].nodeType;
738 } catch ( e ) {
739         push = { apply: arr.length ?
741                 // Leverage slice if possible
742                 function( target, els ) {
743                         pushNative.apply( target, slice.call( els ) );
744                 } :
746                 // Support: IE<9
747                 // Otherwise append directly
748                 function( target, els ) {
749                         var j = target.length,
750                                 i = 0;
752                         // Can't trust NodeList.length
753                         while ( ( target[ j++ ] = els[ i++ ] ) ) {}
754                         target.length = j - 1;
755                 }
756         };
759 function Sizzle( selector, context, results, seed ) {
760         var m, i, elem, nid, match, groups, newSelector,
761                 newContext = context && context.ownerDocument,
763                 // nodeType defaults to 9, since context defaults to document
764                 nodeType = context ? context.nodeType : 9;
766         results = results || [];
768         // Return early from calls with invalid selector or context
769         if ( typeof selector !== "string" || !selector ||
770                 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
772                 return results;
773         }
775         // Try to shortcut find operations (as opposed to filters) in HTML documents
776         if ( !seed ) {
777                 setDocument( context );
778                 context = context || document;
780                 if ( documentIsHTML ) {
782                         // If the selector is sufficiently simple, try using a "get*By*" DOM method
783                         // (excepting DocumentFragment context, where the methods don't exist)
784                         if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
786                                 // ID selector
787                                 if ( ( m = match[ 1 ] ) ) {
789                                         // Document context
790                                         if ( nodeType === 9 ) {
791                                                 if ( ( elem = context.getElementById( m ) ) ) {
793                                                         // Support: IE, Opera, Webkit
794                                                         // TODO: identify versions
795                                                         // getElementById can match elements by name instead of ID
796                                                         if ( elem.id === m ) {
797                                                                 results.push( elem );
798                                                                 return results;
799                                                         }
800                                                 } else {
801                                                         return results;
802                                                 }
804                                         // Element context
805                                         } else {
807                                                 // Support: IE, Opera, Webkit
808                                                 // TODO: identify versions
809                                                 // getElementById can match elements by name instead of ID
810                                                 if ( newContext && ( elem = newContext.getElementById( m ) ) &&
811                                                         contains( context, elem ) &&
812                                                         elem.id === m ) {
814                                                         results.push( elem );
815                                                         return results;
816                                                 }
817                                         }
819                                 // Type selector
820                                 } else if ( match[ 2 ] ) {
821                                         push.apply( results, context.getElementsByTagName( selector ) );
822                                         return results;
824                                 // Class selector
825                                 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
826                                         context.getElementsByClassName ) {
828                                         push.apply( results, context.getElementsByClassName( m ) );
829                                         return results;
830                                 }
831                         }
833                         // Take advantage of querySelectorAll
834                         if ( support.qsa &&
835                                 !nonnativeSelectorCache[ selector + " " ] &&
836                                 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
838                                 // Support: IE 8 only
839                                 // Exclude object elements
840                                 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
842                                 newSelector = selector;
843                                 newContext = context;
845                                 // qSA considers elements outside a scoping root when evaluating child or
846                                 // descendant combinators, which is not what we want.
847                                 // In such cases, we work around the behavior by prefixing every selector in the
848                                 // list with an ID selector referencing the scope context.
849                                 // The technique has to be used as well when a leading combinator is used
850                                 // as such selectors are not recognized by querySelectorAll.
851                                 // Thanks to Andrew Dupont for this technique.
852                                 if ( nodeType === 1 &&
853                                         ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
855                                         // Expand context for sibling selectors
856                                         newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
857                                                 context;
859                                         // We can use :scope instead of the ID hack if the browser
860                                         // supports it & if we're not changing the context.
861                                         if ( newContext !== context || !support.scope ) {
863                                                 // Capture the context ID, setting it first if necessary
864                                                 if ( ( nid = context.getAttribute( "id" ) ) ) {
865                                                         nid = nid.replace( rcssescape, fcssescape );
866                                                 } else {
867                                                         context.setAttribute( "id", ( nid = expando ) );
868                                                 }
869                                         }
871                                         // Prefix every selector in the list
872                                         groups = tokenize( selector );
873                                         i = groups.length;
874                                         while ( i-- ) {
875                                                 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
876                                                         toSelector( groups[ i ] );
877                                         }
878                                         newSelector = groups.join( "," );
879                                 }
881                                 try {
882                                         push.apply( results,
883                                                 newContext.querySelectorAll( newSelector )
884                                         );
885                                         return results;
886                                 } catch ( qsaError ) {
887                                         nonnativeSelectorCache( selector, true );
888                                 } finally {
889                                         if ( nid === expando ) {
890                                                 context.removeAttribute( "id" );
891                                         }
892                                 }
893                         }
894                 }
895         }
897         // All others
898         return select( selector.replace( rtrim, "$1" ), context, results, seed );
902  * Create key-value caches of limited size
903  * @returns {function(string, object)} Returns the Object data after storing it on itself with
904  *      property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
905  *      deleting the oldest entry
906  */
907 function createCache() {
908         var keys = [];
910         function cache( key, value ) {
912                 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
913                 if ( keys.push( key + " " ) > Expr.cacheLength ) {
915                         // Only keep the most recent entries
916                         delete cache[ keys.shift() ];
917                 }
918                 return ( cache[ key + " " ] = value );
919         }
920         return cache;
924  * Mark a function for special use by Sizzle
925  * @param {Function} fn The function to mark
926  */
927 function markFunction( fn ) {
928         fn[ expando ] = true;
929         return fn;
933  * Support testing using an element
934  * @param {Function} fn Passed the created element and returns a boolean result
935  */
936 function assert( fn ) {
937         var el = document.createElement( "fieldset" );
939         try {
940                 return !!fn( el );
941         } catch ( e ) {
942                 return false;
943         } finally {
945                 // Remove from its parent by default
946                 if ( el.parentNode ) {
947                         el.parentNode.removeChild( el );
948                 }
950                 // release memory in IE
951                 el = null;
952         }
956  * Adds the same handler for all of the specified attrs
957  * @param {String} attrs Pipe-separated list of attributes
958  * @param {Function} handler The method that will be applied
959  */
960 function addHandle( attrs, handler ) {
961         var arr = attrs.split( "|" ),
962                 i = arr.length;
964         while ( i-- ) {
965                 Expr.attrHandle[ arr[ i ] ] = handler;
966         }
970  * Checks document order of two siblings
971  * @param {Element} a
972  * @param {Element} b
973  * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
974  */
975 function siblingCheck( a, b ) {
976         var cur = b && a,
977                 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
978                         a.sourceIndex - b.sourceIndex;
980         // Use IE sourceIndex if available on both nodes
981         if ( diff ) {
982                 return diff;
983         }
985         // Check if b follows a
986         if ( cur ) {
987                 while ( ( cur = cur.nextSibling ) ) {
988                         if ( cur === b ) {
989                                 return -1;
990                         }
991                 }
992         }
994         return a ? 1 : -1;
998  * Returns a function to use in pseudos for input types
999  * @param {String} type
1000  */
1001 function createInputPseudo( type ) {
1002         return function( elem ) {
1003                 var name = elem.nodeName.toLowerCase();
1004                 return name === "input" && elem.type === type;
1005         };
1009  * Returns a function to use in pseudos for buttons
1010  * @param {String} type
1011  */
1012 function createButtonPseudo( type ) {
1013         return function( elem ) {
1014                 var name = elem.nodeName.toLowerCase();
1015                 return ( name === "input" || name === "button" ) && elem.type === type;
1016         };
1020  * Returns a function to use in pseudos for :enabled/:disabled
1021  * @param {Boolean} disabled true for :disabled; false for :enabled
1022  */
1023 function createDisabledPseudo( disabled ) {
1025         // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
1026         return function( elem ) {
1028                 // Only certain elements can match :enabled or :disabled
1029                 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
1030                 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
1031                 if ( "form" in elem ) {
1033                         // Check for inherited disabledness on relevant non-disabled elements:
1034                         // * listed form-associated elements in a disabled fieldset
1035                         //   https://html.spec.whatwg.org/multipage/forms.html#category-listed
1036                         //   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
1037                         // * option elements in a disabled optgroup
1038                         //   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
1039                         // All such elements have a "form" property.
1040                         if ( elem.parentNode && elem.disabled === false ) {
1042                                 // Option elements defer to a parent optgroup if present
1043                                 if ( "label" in elem ) {
1044                                         if ( "label" in elem.parentNode ) {
1045                                                 return elem.parentNode.disabled === disabled;
1046                                         } else {
1047                                                 return elem.disabled === disabled;
1048                                         }
1049                                 }
1051                                 // Support: IE 6 - 11
1052                                 // Use the isDisabled shortcut property to check for disabled fieldset ancestors
1053                                 return elem.isDisabled === disabled ||
1055                                         // Where there is no isDisabled, check manually
1056                                         /* jshint -W018 */
1057                                         elem.isDisabled !== !disabled &&
1058                                         inDisabledFieldset( elem ) === disabled;
1059                         }
1061                         return elem.disabled === disabled;
1063                 // Try to winnow out elements that can't be disabled before trusting the disabled property.
1064                 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
1065                 // even exist on them, let alone have a boolean value.
1066                 } else if ( "label" in elem ) {
1067                         return elem.disabled === disabled;
1068                 }
1070                 // Remaining elements are neither :enabled nor :disabled
1071                 return false;
1072         };
1076  * Returns a function to use in pseudos for positionals
1077  * @param {Function} fn
1078  */
1079 function createPositionalPseudo( fn ) {
1080         return markFunction( function( argument ) {
1081                 argument = +argument;
1082                 return markFunction( function( seed, matches ) {
1083                         var j,
1084                                 matchIndexes = fn( [], seed.length, argument ),
1085                                 i = matchIndexes.length;
1087                         // Match elements found at the specified indexes
1088                         while ( i-- ) {
1089                                 if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
1090                                         seed[ j ] = !( matches[ j ] = seed[ j ] );
1091                                 }
1092                         }
1093                 } );
1094         } );
1098  * Checks a node for validity as a Sizzle context
1099  * @param {Element|Object=} context
1100  * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1101  */
1102 function testContext( context ) {
1103         return context && typeof context.getElementsByTagName !== "undefined" && context;
1106 // Expose support vars for convenience
1107 support = Sizzle.support = {};
1110  * Detects XML nodes
1111  * @param {Element|Object} elem An element or a document
1112  * @returns {Boolean} True iff elem is a non-HTML XML node
1113  */
1114 isXML = Sizzle.isXML = function( elem ) {
1115         var namespace = elem && elem.namespaceURI,
1116                 docElem = elem && ( elem.ownerDocument || elem ).documentElement;
1118         // Support: IE <=8
1119         // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
1120         // https://bugs.jquery.com/ticket/4833
1121         return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
1125  * Sets document-related variables once based on the current document
1126  * @param {Element|Object} [doc] An element or document object to use to set the document
1127  * @returns {Object} Returns the current document
1128  */
1129 setDocument = Sizzle.setDocument = function( node ) {
1130         var hasCompare, subWindow,
1131                 doc = node ? node.ownerDocument || node : preferredDoc;
1133         // Return early if doc is invalid or already selected
1134         // Support: IE 11+, Edge 17 - 18+
1135         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1136         // two documents; shallow comparisons work.
1137         // eslint-disable-next-line eqeqeq
1138         if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
1139                 return document;
1140         }
1142         // Update global variables
1143         document = doc;
1144         docElem = document.documentElement;
1145         documentIsHTML = !isXML( document );
1147         // Support: IE 9 - 11+, Edge 12 - 18+
1148         // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1149         // Support: IE 11+, Edge 17 - 18+
1150         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1151         // two documents; shallow comparisons work.
1152         // eslint-disable-next-line eqeqeq
1153         if ( preferredDoc != document &&
1154                 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
1156                 // Support: IE 11, Edge
1157                 if ( subWindow.addEventListener ) {
1158                         subWindow.addEventListener( "unload", unloadHandler, false );
1160                 // Support: IE 9 - 10 only
1161                 } else if ( subWindow.attachEvent ) {
1162                         subWindow.attachEvent( "onunload", unloadHandler );
1163                 }
1164         }
1166         // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
1167         // Safari 4 - 5 only, Opera <=11.6 - 12.x only
1168         // IE/Edge & older browsers don't support the :scope pseudo-class.
1169         // Support: Safari 6.0 only
1170         // Safari 6.0 supports :scope but it's an alias of :root there.
1171         support.scope = assert( function( el ) {
1172                 docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
1173                 return typeof el.querySelectorAll !== "undefined" &&
1174                         !el.querySelectorAll( ":scope fieldset div" ).length;
1175         } );
1177         // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
1178         // Make sure the the `:has()` argument is parsed unforgivingly.
1179         // We include `*` in the test to detect buggy implementations that are
1180         // _selectively_ forgiving (specifically when the list includes at least
1181         // one valid selector).
1182         // Note that we treat complete lack of support for `:has()` as if it were
1183         // spec-compliant support, which is fine because use of `:has()` in such
1184         // environments will fail in the qSA path and fall back to jQuery traversal
1185         // anyway.
1186         support.cssHas = assert( function() {
1187                 try {
1188                         document.querySelector( ":has(*,:jqfake)" );
1189                         return false;
1190                 } catch ( e ) {
1191                         return true;
1192                 }
1193         } );
1195         /* Attributes
1196         ---------------------------------------------------------------------- */
1198         // Support: IE<8
1199         // Verify that getAttribute really returns attributes and not properties
1200         // (excepting IE8 booleans)
1201         support.attributes = assert( function( el ) {
1202                 el.className = "i";
1203                 return !el.getAttribute( "className" );
1204         } );
1206         /* getElement(s)By*
1207         ---------------------------------------------------------------------- */
1209         // Check if getElementsByTagName("*") returns only elements
1210         support.getElementsByTagName = assert( function( el ) {
1211                 el.appendChild( document.createComment( "" ) );
1212                 return !el.getElementsByTagName( "*" ).length;
1213         } );
1215         // Support: IE<9
1216         support.getElementsByClassName = rnative.test( document.getElementsByClassName );
1218         // Support: IE<10
1219         // Check if getElementById returns elements by name
1220         // The broken getElementById methods don't pick up programmatically-set names,
1221         // so use a roundabout getElementsByName test
1222         support.getById = assert( function( el ) {
1223                 docElem.appendChild( el ).id = expando;
1224                 return !document.getElementsByName || !document.getElementsByName( expando ).length;
1225         } );
1227         // ID filter and find
1228         if ( support.getById ) {
1229                 Expr.filter[ "ID" ] = function( id ) {
1230                         var attrId = id.replace( runescape, funescape );
1231                         return function( elem ) {
1232                                 return elem.getAttribute( "id" ) === attrId;
1233                         };
1234                 };
1235                 Expr.find[ "ID" ] = function( id, context ) {
1236                         if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1237                                 var elem = context.getElementById( id );
1238                                 return elem ? [ elem ] : [];
1239                         }
1240                 };
1241         } else {
1242                 Expr.filter[ "ID" ] =  function( id ) {
1243                         var attrId = id.replace( runescape, funescape );
1244                         return function( elem ) {
1245                                 var node = typeof elem.getAttributeNode !== "undefined" &&
1246                                         elem.getAttributeNode( "id" );
1247                                 return node && node.value === attrId;
1248                         };
1249                 };
1251                 // Support: IE 6 - 7 only
1252                 // getElementById is not reliable as a find shortcut
1253                 Expr.find[ "ID" ] = function( id, context ) {
1254                         if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1255                                 var node, i, elems,
1256                                         elem = context.getElementById( id );
1258                                 if ( elem ) {
1260                                         // Verify the id attribute
1261                                         node = elem.getAttributeNode( "id" );
1262                                         if ( node && node.value === id ) {
1263                                                 return [ elem ];
1264                                         }
1266                                         // Fall back on getElementsByName
1267                                         elems = context.getElementsByName( id );
1268                                         i = 0;
1269                                         while ( ( elem = elems[ i++ ] ) ) {
1270                                                 node = elem.getAttributeNode( "id" );
1271                                                 if ( node && node.value === id ) {
1272                                                         return [ elem ];
1273                                                 }
1274                                         }
1275                                 }
1277                                 return [];
1278                         }
1279                 };
1280         }
1282         // Tag
1283         Expr.find[ "TAG" ] = support.getElementsByTagName ?
1284                 function( tag, context ) {
1285                         if ( typeof context.getElementsByTagName !== "undefined" ) {
1286                                 return context.getElementsByTagName( tag );
1288                         // DocumentFragment nodes don't have gEBTN
1289                         } else if ( support.qsa ) {
1290                                 return context.querySelectorAll( tag );
1291                         }
1292                 } :
1294                 function( tag, context ) {
1295                         var elem,
1296                                 tmp = [],
1297                                 i = 0,
1299                                 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1300                                 results = context.getElementsByTagName( tag );
1302                         // Filter out possible comments
1303                         if ( tag === "*" ) {
1304                                 while ( ( elem = results[ i++ ] ) ) {
1305                                         if ( elem.nodeType === 1 ) {
1306                                                 tmp.push( elem );
1307                                         }
1308                                 }
1310                                 return tmp;
1311                         }
1312                         return results;
1313                 };
1315         // Class
1316         Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
1317                 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
1318                         return context.getElementsByClassName( className );
1319                 }
1320         };
1322         /* QSA/matchesSelector
1323         ---------------------------------------------------------------------- */
1325         // QSA and matchesSelector support
1327         // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1328         rbuggyMatches = [];
1330         // qSa(:focus) reports false when true (Chrome 21)
1331         // We allow this because of a bug in IE8/9 that throws an error
1332         // whenever `document.activeElement` is accessed on an iframe
1333         // So, we allow :focus to pass through QSA all the time to avoid the IE error
1334         // See https://bugs.jquery.com/ticket/13378
1335         rbuggyQSA = [];
1337         if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
1339                 // Build QSA regex
1340                 // Regex strategy adopted from Diego Perini
1341                 assert( function( el ) {
1343                         var input;
1345                         // Select is set to empty string on purpose
1346                         // This is to test IE's treatment of not explicitly
1347                         // setting a boolean content attribute,
1348                         // since its presence should be enough
1349                         // https://bugs.jquery.com/ticket/12359
1350                         docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
1351                                 "<select id='" + expando + "-\r\\' msallowcapture=''>" +
1352                                 "<option selected=''></option></select>";
1354                         // Support: IE8, Opera 11-12.16
1355                         // Nothing should be selected when empty strings follow ^= or $= or *=
1356                         // The test attribute must be unknown in Opera but "safe" for WinRT
1357                         // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1358                         if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
1359                                 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1360                         }
1362                         // Support: IE8
1363                         // Boolean attributes and "value" are not treated correctly
1364                         if ( !el.querySelectorAll( "[selected]" ).length ) {
1365                                 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1366                         }
1368                         // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1369                         if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1370                                 rbuggyQSA.push( "~=" );
1371                         }
1373                         // Support: IE 11+, Edge 15 - 18+
1374                         // IE 11/Edge don't find elements on a `[name='']` query in some cases.
1375                         // Adding a temporary attribute to the document before the selection works
1376                         // around the issue.
1377                         // Interestingly, IE 10 & older don't seem to have the issue.
1378                         input = document.createElement( "input" );
1379                         input.setAttribute( "name", "" );
1380                         el.appendChild( input );
1381                         if ( !el.querySelectorAll( "[name='']" ).length ) {
1382                                 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
1383                                         whitespace + "*(?:''|\"\")" );
1384                         }
1386                         // Webkit/Opera - :checked should return selected option elements
1387                         // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1388                         // IE8 throws error here and will not see later tests
1389                         if ( !el.querySelectorAll( ":checked" ).length ) {
1390                                 rbuggyQSA.push( ":checked" );
1391                         }
1393                         // Support: Safari 8+, iOS 8+
1394                         // https://bugs.webkit.org/show_bug.cgi?id=136851
1395                         // In-page `selector#id sibling-combinator selector` fails
1396                         if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
1397                                 rbuggyQSA.push( ".#.+[+~]" );
1398                         }
1400                         // Support: Firefox <=3.6 - 5 only
1401                         // Old Firefox doesn't throw on a badly-escaped identifier.
1402                         el.querySelectorAll( "\\\f" );
1403                         rbuggyQSA.push( "[\\r\\n\\f]" );
1404                 } );
1406                 assert( function( el ) {
1407                         el.innerHTML = "<a href='' disabled='disabled'></a>" +
1408                                 "<select disabled='disabled'><option/></select>";
1410                         // Support: Windows 8 Native Apps
1411                         // The type and name attributes are restricted during .innerHTML assignment
1412                         var input = document.createElement( "input" );
1413                         input.setAttribute( "type", "hidden" );
1414                         el.appendChild( input ).setAttribute( "name", "D" );
1416                         // Support: IE8
1417                         // Enforce case-sensitivity of name attribute
1418                         if ( el.querySelectorAll( "[name=d]" ).length ) {
1419                                 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1420                         }
1422                         // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1423                         // IE8 throws error here and will not see later tests
1424                         if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
1425                                 rbuggyQSA.push( ":enabled", ":disabled" );
1426                         }
1428                         // Support: IE9-11+
1429                         // IE's :disabled selector does not pick up the children of disabled fieldsets
1430                         docElem.appendChild( el ).disabled = true;
1431                         if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
1432                                 rbuggyQSA.push( ":enabled", ":disabled" );
1433                         }
1435                         // Support: Opera 10 - 11 only
1436                         // Opera 10-11 does not throw on post-comma invalid pseudos
1437                         el.querySelectorAll( "*,:x" );
1438                         rbuggyQSA.push( ",.*:" );
1439                 } );
1440         }
1442         if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
1443                 docElem.webkitMatchesSelector ||
1444                 docElem.mozMatchesSelector ||
1445                 docElem.oMatchesSelector ||
1446                 docElem.msMatchesSelector ) ) ) ) {
1448                 assert( function( el ) {
1450                         // Check to see if it's possible to do matchesSelector
1451                         // on a disconnected node (IE 9)
1452                         support.disconnectedMatch = matches.call( el, "*" );
1454                         // This should fail with an exception
1455                         // Gecko does not error, returns false instead
1456                         matches.call( el, "[s!='']:x" );
1457                         rbuggyMatches.push( "!=", pseudos );
1458                 } );
1459         }
1461         if ( !support.cssHas ) {
1463                 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
1464                 // Our regular `try-catch` mechanism fails to detect natively-unsupported
1465                 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
1466                 // in browsers that parse the `:has()` argument as a forgiving selector list.
1467                 // https://drafts.csswg.org/selectors/#relational now requires the argument
1468                 // to be parsed unforgivingly, but browsers have not yet fully adjusted.
1469                 rbuggyQSA.push( ":has" );
1470         }
1472         rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
1473         rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
1475         /* Contains
1476         ---------------------------------------------------------------------- */
1477         hasCompare = rnative.test( docElem.compareDocumentPosition );
1479         // Element contains another
1480         // Purposefully self-exclusive
1481         // As in, an element does not contain itself
1482         contains = hasCompare || rnative.test( docElem.contains ) ?
1483                 function( a, b ) {
1485                         // Support: IE <9 only
1486                         // IE doesn't have `contains` on `document` so we need to check for
1487                         // `documentElement` presence.
1488                         // We need to fall back to `a` when `documentElement` is missing
1489                         // as `ownerDocument` of elements within `<template/>` may have
1490                         // a null one - a default behavior of all modern browsers.
1491                         var adown = a.nodeType === 9 && a.documentElement || a,
1492                                 bup = b && b.parentNode;
1493                         return a === bup || !!( bup && bup.nodeType === 1 && (
1494                                 adown.contains ?
1495                                         adown.contains( bup ) :
1496                                         a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1497                         ) );
1498                 } :
1499                 function( a, b ) {
1500                         if ( b ) {
1501                                 while ( ( b = b.parentNode ) ) {
1502                                         if ( b === a ) {
1503                                                 return true;
1504                                         }
1505                                 }
1506                         }
1507                         return false;
1508                 };
1510         /* Sorting
1511         ---------------------------------------------------------------------- */
1513         // Document order sorting
1514         sortOrder = hasCompare ?
1515         function( a, b ) {
1517                 // Flag for duplicate removal
1518                 if ( a === b ) {
1519                         hasDuplicate = true;
1520                         return 0;
1521                 }
1523                 // Sort on method existence if only one input has compareDocumentPosition
1524                 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1525                 if ( compare ) {
1526                         return compare;
1527                 }
1529                 // Calculate position if both inputs belong to the same document
1530                 // Support: IE 11+, Edge 17 - 18+
1531                 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1532                 // two documents; shallow comparisons work.
1533                 // eslint-disable-next-line eqeqeq
1534                 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
1535                         a.compareDocumentPosition( b ) :
1537                         // Otherwise we know they are disconnected
1538                         1;
1540                 // Disconnected nodes
1541                 if ( compare & 1 ||
1542                         ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
1544                         // Choose the first element that is related to our preferred document
1545                         // Support: IE 11+, Edge 17 - 18+
1546                         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1547                         // two documents; shallow comparisons work.
1548                         // eslint-disable-next-line eqeqeq
1549                         if ( a == document || a.ownerDocument == preferredDoc &&
1550                                 contains( preferredDoc, a ) ) {
1551                                 return -1;
1552                         }
1554                         // Support: IE 11+, Edge 17 - 18+
1555                         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1556                         // two documents; shallow comparisons work.
1557                         // eslint-disable-next-line eqeqeq
1558                         if ( b == document || b.ownerDocument == preferredDoc &&
1559                                 contains( preferredDoc, b ) ) {
1560                                 return 1;
1561                         }
1563                         // Maintain original order
1564                         return sortInput ?
1565                                 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1566                                 0;
1567                 }
1569                 return compare & 4 ? -1 : 1;
1570         } :
1571         function( a, b ) {
1573                 // Exit early if the nodes are identical
1574                 if ( a === b ) {
1575                         hasDuplicate = true;
1576                         return 0;
1577                 }
1579                 var cur,
1580                         i = 0,
1581                         aup = a.parentNode,
1582                         bup = b.parentNode,
1583                         ap = [ a ],
1584                         bp = [ b ];
1586                 // Parentless nodes are either documents or disconnected
1587                 if ( !aup || !bup ) {
1589                         // Support: IE 11+, Edge 17 - 18+
1590                         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1591                         // two documents; shallow comparisons work.
1592                         /* eslint-disable eqeqeq */
1593                         return a == document ? -1 :
1594                                 b == document ? 1 :
1595                                 /* eslint-enable eqeqeq */
1596                                 aup ? -1 :
1597                                 bup ? 1 :
1598                                 sortInput ?
1599                                 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1600                                 0;
1602                 // If the nodes are siblings, we can do a quick check
1603                 } else if ( aup === bup ) {
1604                         return siblingCheck( a, b );
1605                 }
1607                 // Otherwise we need full lists of their ancestors for comparison
1608                 cur = a;
1609                 while ( ( cur = cur.parentNode ) ) {
1610                         ap.unshift( cur );
1611                 }
1612                 cur = b;
1613                 while ( ( cur = cur.parentNode ) ) {
1614                         bp.unshift( cur );
1615                 }
1617                 // Walk down the tree looking for a discrepancy
1618                 while ( ap[ i ] === bp[ i ] ) {
1619                         i++;
1620                 }
1622                 return i ?
1624                         // Do a sibling check if the nodes have a common ancestor
1625                         siblingCheck( ap[ i ], bp[ i ] ) :
1627                         // Otherwise nodes in our document sort first
1628                         // Support: IE 11+, Edge 17 - 18+
1629                         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1630                         // two documents; shallow comparisons work.
1631                         /* eslint-disable eqeqeq */
1632                         ap[ i ] == preferredDoc ? -1 :
1633                         bp[ i ] == preferredDoc ? 1 :
1634                         /* eslint-enable eqeqeq */
1635                         0;
1636         };
1638         return document;
1641 Sizzle.matches = function( expr, elements ) {
1642         return Sizzle( expr, null, null, elements );
1645 Sizzle.matchesSelector = function( elem, expr ) {
1646         setDocument( elem );
1648         if ( support.matchesSelector && documentIsHTML &&
1649                 !nonnativeSelectorCache[ expr + " " ] &&
1650                 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1651                 ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
1653                 try {
1654                         var ret = matches.call( elem, expr );
1656                         // IE 9's matchesSelector returns false on disconnected nodes
1657                         if ( ret || support.disconnectedMatch ||
1659                                 // As well, disconnected nodes are said to be in a document
1660                                 // fragment in IE 9
1661                                 elem.document && elem.document.nodeType !== 11 ) {
1662                                 return ret;
1663                         }
1664                 } catch ( e ) {
1665                         nonnativeSelectorCache( expr, true );
1666                 }
1667         }
1669         return Sizzle( expr, document, null, [ elem ] ).length > 0;
1672 Sizzle.contains = function( context, elem ) {
1674         // Set document vars if needed
1675         // Support: IE 11+, Edge 17 - 18+
1676         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1677         // two documents; shallow comparisons work.
1678         // eslint-disable-next-line eqeqeq
1679         if ( ( context.ownerDocument || context ) != document ) {
1680                 setDocument( context );
1681         }
1682         return contains( context, elem );
1685 Sizzle.attr = function( elem, name ) {
1687         // Set document vars if needed
1688         // Support: IE 11+, Edge 17 - 18+
1689         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1690         // two documents; shallow comparisons work.
1691         // eslint-disable-next-line eqeqeq
1692         if ( ( elem.ownerDocument || elem ) != document ) {
1693                 setDocument( elem );
1694         }
1696         var fn = Expr.attrHandle[ name.toLowerCase() ],
1698                 // Don't get fooled by Object.prototype properties (jQuery #13807)
1699                 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1700                         fn( elem, name, !documentIsHTML ) :
1701                         undefined;
1703         return val !== undefined ?
1704                 val :
1705                 support.attributes || !documentIsHTML ?
1706                         elem.getAttribute( name ) :
1707                         ( val = elem.getAttributeNode( name ) ) && val.specified ?
1708                                 val.value :
1709                                 null;
1712 Sizzle.escape = function( sel ) {
1713         return ( sel + "" ).replace( rcssescape, fcssescape );
1716 Sizzle.error = function( msg ) {
1717         throw new Error( "Syntax error, unrecognized expression: " + msg );
1721  * Document sorting and removing duplicates
1722  * @param {ArrayLike} results
1723  */
1724 Sizzle.uniqueSort = function( results ) {
1725         var elem,
1726                 duplicates = [],
1727                 j = 0,
1728                 i = 0;
1730         // Unless we *know* we can detect duplicates, assume their presence
1731         hasDuplicate = !support.detectDuplicates;
1732         sortInput = !support.sortStable && results.slice( 0 );
1733         results.sort( sortOrder );
1735         if ( hasDuplicate ) {
1736                 while ( ( elem = results[ i++ ] ) ) {
1737                         if ( elem === results[ i ] ) {
1738                                 j = duplicates.push( i );
1739                         }
1740                 }
1741                 while ( j-- ) {
1742                         results.splice( duplicates[ j ], 1 );
1743                 }
1744         }
1746         // Clear input after sorting to release objects
1747         // See https://github.com/jquery/sizzle/pull/225
1748         sortInput = null;
1750         return results;
1754  * Utility function for retrieving the text value of an array of DOM nodes
1755  * @param {Array|Element} elem
1756  */
1757 getText = Sizzle.getText = function( elem ) {
1758         var node,
1759                 ret = "",
1760                 i = 0,
1761                 nodeType = elem.nodeType;
1763         if ( !nodeType ) {
1765                 // If no nodeType, this is expected to be an array
1766                 while ( ( node = elem[ i++ ] ) ) {
1768                         // Do not traverse comment nodes
1769                         ret += getText( node );
1770                 }
1771         } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1773                 // Use textContent for elements
1774                 // innerText usage removed for consistency of new lines (jQuery #11153)
1775                 if ( typeof elem.textContent === "string" ) {
1776                         return elem.textContent;
1777                 } else {
1779                         // Traverse its children
1780                         for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1781                                 ret += getText( elem );
1782                         }
1783                 }
1784         } else if ( nodeType === 3 || nodeType === 4 ) {
1785                 return elem.nodeValue;
1786         }
1788         // Do not include comment or processing instruction nodes
1790         return ret;
1793 Expr = Sizzle.selectors = {
1795         // Can be adjusted by the user
1796         cacheLength: 50,
1798         createPseudo: markFunction,
1800         match: matchExpr,
1802         attrHandle: {},
1804         find: {},
1806         relative: {
1807                 ">": { dir: "parentNode", first: true },
1808                 " ": { dir: "parentNode" },
1809                 "+": { dir: "previousSibling", first: true },
1810                 "~": { dir: "previousSibling" }
1811         },
1813         preFilter: {
1814                 "ATTR": function( match ) {
1815                         match[ 1 ] = match[ 1 ].replace( runescape, funescape );
1817                         // Move the given value to match[3] whether quoted or unquoted
1818                         match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
1819                                 match[ 5 ] || "" ).replace( runescape, funescape );
1821                         if ( match[ 2 ] === "~=" ) {
1822                                 match[ 3 ] = " " + match[ 3 ] + " ";
1823                         }
1825                         return match.slice( 0, 4 );
1826                 },
1828                 "CHILD": function( match ) {
1830                         /* matches from matchExpr["CHILD"]
1831                                 1 type (only|nth|...)
1832                                 2 what (child|of-type)
1833                                 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1834                                 4 xn-component of xn+y argument ([+-]?\d*n|)
1835                                 5 sign of xn-component
1836                                 6 x of xn-component
1837                                 7 sign of y-component
1838                                 8 y of y-component
1839                         */
1840                         match[ 1 ] = match[ 1 ].toLowerCase();
1842                         if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
1844                                 // nth-* requires argument
1845                                 if ( !match[ 3 ] ) {
1846                                         Sizzle.error( match[ 0 ] );
1847                                 }
1849                                 // numeric x and y parameters for Expr.filter.CHILD
1850                                 // remember that false/true cast respectively to 0/1
1851                                 match[ 4 ] = +( match[ 4 ] ?
1852                                         match[ 5 ] + ( match[ 6 ] || 1 ) :
1853                                         2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
1854                                 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
1856                                 // other types prohibit arguments
1857                         } else if ( match[ 3 ] ) {
1858                                 Sizzle.error( match[ 0 ] );
1859                         }
1861                         return match;
1862                 },
1864                 "PSEUDO": function( match ) {
1865                         var excess,
1866                                 unquoted = !match[ 6 ] && match[ 2 ];
1868                         if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
1869                                 return null;
1870                         }
1872                         // Accept quoted arguments as-is
1873                         if ( match[ 3 ] ) {
1874                                 match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
1876                         // Strip excess characters from unquoted arguments
1877                         } else if ( unquoted && rpseudo.test( unquoted ) &&
1879                                 // Get excess from tokenize (recursively)
1880                                 ( excess = tokenize( unquoted, true ) ) &&
1882                                 // advance to the next closing parenthesis
1883                                 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
1885                                 // excess is a negative index
1886                                 match[ 0 ] = match[ 0 ].slice( 0, excess );
1887                                 match[ 2 ] = unquoted.slice( 0, excess );
1888                         }
1890                         // Return only captures needed by the pseudo filter method (type and argument)
1891                         return match.slice( 0, 3 );
1892                 }
1893         },
1895         filter: {
1897                 "TAG": function( nodeNameSelector ) {
1898                         var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1899                         return nodeNameSelector === "*" ?
1900                                 function() {
1901                                         return true;
1902                                 } :
1903                                 function( elem ) {
1904                                         return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1905                                 };
1906                 },
1908                 "CLASS": function( className ) {
1909                         var pattern = classCache[ className + " " ];
1911                         return pattern ||
1912                                 ( pattern = new RegExp( "(^|" + whitespace +
1913                                         ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
1914                                                 className, function( elem ) {
1915                                                         return pattern.test(
1916                                                                 typeof elem.className === "string" && elem.className ||
1917                                                                 typeof elem.getAttribute !== "undefined" &&
1918                                                                         elem.getAttribute( "class" ) ||
1919                                                                 ""
1920                                                         );
1921                                 } );
1922                 },
1924                 "ATTR": function( name, operator, check ) {
1925                         return function( elem ) {
1926                                 var result = Sizzle.attr( elem, name );
1928                                 if ( result == null ) {
1929                                         return operator === "!=";
1930                                 }
1931                                 if ( !operator ) {
1932                                         return true;
1933                                 }
1935                                 result += "";
1937                                 /* eslint-disable max-len */
1939                                 return operator === "=" ? result === check :
1940                                         operator === "!=" ? result !== check :
1941                                         operator === "^=" ? check && result.indexOf( check ) === 0 :
1942                                         operator === "*=" ? check && result.indexOf( check ) > -1 :
1943                                         operator === "$=" ? check && result.slice( -check.length ) === check :
1944                                         operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1945                                         operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1946                                         false;
1947                                 /* eslint-enable max-len */
1949                         };
1950                 },
1952                 "CHILD": function( type, what, _argument, first, last ) {
1953                         var simple = type.slice( 0, 3 ) !== "nth",
1954                                 forward = type.slice( -4 ) !== "last",
1955                                 ofType = what === "of-type";
1957                         return first === 1 && last === 0 ?
1959                                 // Shortcut for :nth-*(n)
1960                                 function( elem ) {
1961                                         return !!elem.parentNode;
1962                                 } :
1964                                 function( elem, _context, xml ) {
1965                                         var cache, uniqueCache, outerCache, node, nodeIndex, start,
1966                                                 dir = simple !== forward ? "nextSibling" : "previousSibling",
1967                                                 parent = elem.parentNode,
1968                                                 name = ofType && elem.nodeName.toLowerCase(),
1969                                                 useCache = !xml && !ofType,
1970                                                 diff = false;
1972                                         if ( parent ) {
1974                                                 // :(first|last|only)-(child|of-type)
1975                                                 if ( simple ) {
1976                                                         while ( dir ) {
1977                                                                 node = elem;
1978                                                                 while ( ( node = node[ dir ] ) ) {
1979                                                                         if ( ofType ?
1980                                                                                 node.nodeName.toLowerCase() === name :
1981                                                                                 node.nodeType === 1 ) {
1983                                                                                 return false;
1984                                                                         }
1985                                                                 }
1987                                                                 // Reverse direction for :only-* (if we haven't yet done so)
1988                                                                 start = dir = type === "only" && !start && "nextSibling";
1989                                                         }
1990                                                         return true;
1991                                                 }
1993                                                 start = [ forward ? parent.firstChild : parent.lastChild ];
1995                                                 // non-xml :nth-child(...) stores cache data on `parent`
1996                                                 if ( forward && useCache ) {
1998                                                         // Seek `elem` from a previously-cached index
2000                                                         // ...in a gzip-friendly way
2001                                                         node = parent;
2002                                                         outerCache = node[ expando ] || ( node[ expando ] = {} );
2004                                                         // Support: IE <9 only
2005                                                         // Defend against cloned attroperties (jQuery gh-1709)
2006                                                         uniqueCache = outerCache[ node.uniqueID ] ||
2007                                                                 ( outerCache[ node.uniqueID ] = {} );
2009                                                         cache = uniqueCache[ type ] || [];
2010                                                         nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
2011                                                         diff = nodeIndex && cache[ 2 ];
2012                                                         node = nodeIndex && parent.childNodes[ nodeIndex ];
2014                                                         while ( ( node = ++nodeIndex && node && node[ dir ] ||
2016                                                                 // Fallback to seeking `elem` from the start
2017                                                                 ( diff = nodeIndex = 0 ) || start.pop() ) ) {
2019                                                                 // When found, cache indexes on `parent` and break
2020                                                                 if ( node.nodeType === 1 && ++diff && node === elem ) {
2021                                                                         uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
2022                                                                         break;
2023                                                                 }
2024                                                         }
2026                                                 } else {
2028                                                         // Use previously-cached element index if available
2029                                                         if ( useCache ) {
2031                                                                 // ...in a gzip-friendly way
2032                                                                 node = elem;
2033                                                                 outerCache = node[ expando ] || ( node[ expando ] = {} );
2035                                                                 // Support: IE <9 only
2036                                                                 // Defend against cloned attroperties (jQuery gh-1709)
2037                                                                 uniqueCache = outerCache[ node.uniqueID ] ||
2038                                                                         ( outerCache[ node.uniqueID ] = {} );
2040                                                                 cache = uniqueCache[ type ] || [];
2041                                                                 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
2042                                                                 diff = nodeIndex;
2043                                                         }
2045                                                         // xml :nth-child(...)
2046                                                         // or :nth-last-child(...) or :nth(-last)?-of-type(...)
2047                                                         if ( diff === false ) {
2049                                                                 // Use the same loop as above to seek `elem` from the start
2050                                                                 while ( ( node = ++nodeIndex && node && node[ dir ] ||
2051                                                                         ( diff = nodeIndex = 0 ) || start.pop() ) ) {
2053                                                                         if ( ( ofType ?
2054                                                                                 node.nodeName.toLowerCase() === name :
2055                                                                                 node.nodeType === 1 ) &&
2056                                                                                 ++diff ) {
2058                                                                                 // Cache the index of each encountered element
2059                                                                                 if ( useCache ) {
2060                                                                                         outerCache = node[ expando ] ||
2061                                                                                                 ( node[ expando ] = {} );
2063                                                                                         // Support: IE <9 only
2064                                                                                         // Defend against cloned attroperties (jQuery gh-1709)
2065                                                                                         uniqueCache = outerCache[ node.uniqueID ] ||
2066                                                                                                 ( outerCache[ node.uniqueID ] = {} );
2068                                                                                         uniqueCache[ type ] = [ dirruns, diff ];
2069                                                                                 }
2071                                                                                 if ( node === elem ) {
2072                                                                                         break;
2073                                                                                 }
2074                                                                         }
2075                                                                 }
2076                                                         }
2077                                                 }
2079                                                 // Incorporate the offset, then check against cycle size
2080                                                 diff -= last;
2081                                                 return diff === first || ( diff % first === 0 && diff / first >= 0 );
2082                                         }
2083                                 };
2084                 },
2086                 "PSEUDO": function( pseudo, argument ) {
2088                         // pseudo-class names are case-insensitive
2089                         // http://www.w3.org/TR/selectors/#pseudo-classes
2090                         // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
2091                         // Remember that setFilters inherits from pseudos
2092                         var args,
2093                                 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
2094                                         Sizzle.error( "unsupported pseudo: " + pseudo );
2096                         // The user may use createPseudo to indicate that
2097                         // arguments are needed to create the filter function
2098                         // just as Sizzle does
2099                         if ( fn[ expando ] ) {
2100                                 return fn( argument );
2101                         }
2103                         // But maintain support for old signatures
2104                         if ( fn.length > 1 ) {
2105                                 args = [ pseudo, pseudo, "", argument ];
2106                                 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
2107                                         markFunction( function( seed, matches ) {
2108                                                 var idx,
2109                                                         matched = fn( seed, argument ),
2110                                                         i = matched.length;
2111                                                 while ( i-- ) {
2112                                                         idx = indexOf( seed, matched[ i ] );
2113                                                         seed[ idx ] = !( matches[ idx ] = matched[ i ] );
2114                                                 }
2115                                         } ) :
2116                                         function( elem ) {
2117                                                 return fn( elem, 0, args );
2118                                         };
2119                         }
2121                         return fn;
2122                 }
2123         },
2125         pseudos: {
2127                 // Potentially complex pseudos
2128                 "not": markFunction( function( selector ) {
2130                         // Trim the selector passed to compile
2131                         // to avoid treating leading and trailing
2132                         // spaces as combinators
2133                         var input = [],
2134                                 results = [],
2135                                 matcher = compile( selector.replace( rtrim, "$1" ) );
2137                         return matcher[ expando ] ?
2138                                 markFunction( function( seed, matches, _context, xml ) {
2139                                         var elem,
2140                                                 unmatched = matcher( seed, null, xml, [] ),
2141                                                 i = seed.length;
2143                                         // Match elements unmatched by `matcher`
2144                                         while ( i-- ) {
2145                                                 if ( ( elem = unmatched[ i ] ) ) {
2146                                                         seed[ i ] = !( matches[ i ] = elem );
2147                                                 }
2148                                         }
2149                                 } ) :
2150                                 function( elem, _context, xml ) {
2151                                         input[ 0 ] = elem;
2152                                         matcher( input, null, xml, results );
2154                                         // Don't keep the element (issue #299)
2155                                         input[ 0 ] = null;
2156                                         return !results.pop();
2157                                 };
2158                 } ),
2160                 "has": markFunction( function( selector ) {
2161                         return function( elem ) {
2162                                 return Sizzle( selector, elem ).length > 0;
2163                         };
2164                 } ),
2166                 "contains": markFunction( function( text ) {
2167                         text = text.replace( runescape, funescape );
2168                         return function( elem ) {
2169                                 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
2170                         };
2171                 } ),
2173                 // "Whether an element is represented by a :lang() selector
2174                 // is based solely on the element's language value
2175                 // being equal to the identifier C,
2176                 // or beginning with the identifier C immediately followed by "-".
2177                 // The matching of C against the element's language value is performed case-insensitively.
2178                 // The identifier C does not have to be a valid language name."
2179                 // http://www.w3.org/TR/selectors/#lang-pseudo
2180                 "lang": markFunction( function( lang ) {
2182                         // lang value must be a valid identifier
2183                         if ( !ridentifier.test( lang || "" ) ) {
2184                                 Sizzle.error( "unsupported lang: " + lang );
2185                         }
2186                         lang = lang.replace( runescape, funescape ).toLowerCase();
2187                         return function( elem ) {
2188                                 var elemLang;
2189                                 do {
2190                                         if ( ( elemLang = documentIsHTML ?
2191                                                 elem.lang :
2192                                                 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
2194                                                 elemLang = elemLang.toLowerCase();
2195                                                 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
2196                                         }
2197                                 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
2198                                 return false;
2199                         };
2200                 } ),
2202                 // Miscellaneous
2203                 "target": function( elem ) {
2204                         var hash = window.location && window.location.hash;
2205                         return hash && hash.slice( 1 ) === elem.id;
2206                 },
2208                 "root": function( elem ) {
2209                         return elem === docElem;
2210                 },
2212                 "focus": function( elem ) {
2213                         return elem === document.activeElement &&
2214                                 ( !document.hasFocus || document.hasFocus() ) &&
2215                                 !!( elem.type || elem.href || ~elem.tabIndex );
2216                 },
2218                 // Boolean properties
2219                 "enabled": createDisabledPseudo( false ),
2220                 "disabled": createDisabledPseudo( true ),
2222                 "checked": function( elem ) {
2224                         // In CSS3, :checked should return both checked and selected elements
2225                         // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2226                         var nodeName = elem.nodeName.toLowerCase();
2227                         return ( nodeName === "input" && !!elem.checked ) ||
2228                                 ( nodeName === "option" && !!elem.selected );
2229                 },
2231                 "selected": function( elem ) {
2233                         // Accessing this property makes selected-by-default
2234                         // options in Safari work properly
2235                         if ( elem.parentNode ) {
2236                                 // eslint-disable-next-line no-unused-expressions
2237                                 elem.parentNode.selectedIndex;
2238                         }
2240                         return elem.selected === true;
2241                 },
2243                 // Contents
2244                 "empty": function( elem ) {
2246                         // http://www.w3.org/TR/selectors/#empty-pseudo
2247                         // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
2248                         //   but not by others (comment: 8; processing instruction: 7; etc.)
2249                         // nodeType < 6 works because attributes (2) do not appear as children
2250                         for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2251                                 if ( elem.nodeType < 6 ) {
2252                                         return false;
2253                                 }
2254                         }
2255                         return true;
2256                 },
2258                 "parent": function( elem ) {
2259                         return !Expr.pseudos[ "empty" ]( elem );
2260                 },
2262                 // Element/input types
2263                 "header": function( elem ) {
2264                         return rheader.test( elem.nodeName );
2265                 },
2267                 "input": function( elem ) {
2268                         return rinputs.test( elem.nodeName );
2269                 },
2271                 "button": function( elem ) {
2272                         var name = elem.nodeName.toLowerCase();
2273                         return name === "input" && elem.type === "button" || name === "button";
2274                 },
2276                 "text": function( elem ) {
2277                         var attr;
2278                         return elem.nodeName.toLowerCase() === "input" &&
2279                                 elem.type === "text" &&
2281                                 // Support: IE <10 only
2282                                 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2283                                 ( ( attr = elem.getAttribute( "type" ) ) == null ||
2284                                         attr.toLowerCase() === "text" );
2285                 },
2287                 // Position-in-collection
2288                 "first": createPositionalPseudo( function() {
2289                         return [ 0 ];
2290                 } ),
2292                 "last": createPositionalPseudo( function( _matchIndexes, length ) {
2293                         return [ length - 1 ];
2294                 } ),
2296                 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
2297                         return [ argument < 0 ? argument + length : argument ];
2298                 } ),
2300                 "even": createPositionalPseudo( function( matchIndexes, length ) {
2301                         var i = 0;
2302                         for ( ; i < length; i += 2 ) {
2303                                 matchIndexes.push( i );
2304                         }
2305                         return matchIndexes;
2306                 } ),
2308                 "odd": createPositionalPseudo( function( matchIndexes, length ) {
2309                         var i = 1;
2310                         for ( ; i < length; i += 2 ) {
2311                                 matchIndexes.push( i );
2312                         }
2313                         return matchIndexes;
2314                 } ),
2316                 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
2317                         var i = argument < 0 ?
2318                                 argument + length :
2319                                 argument > length ?
2320                                         length :
2321                                         argument;
2322                         for ( ; --i >= 0; ) {
2323                                 matchIndexes.push( i );
2324                         }
2325                         return matchIndexes;
2326                 } ),
2328                 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
2329                         var i = argument < 0 ? argument + length : argument;
2330                         for ( ; ++i < length; ) {
2331                                 matchIndexes.push( i );
2332                         }
2333                         return matchIndexes;
2334                 } )
2335         }
2338 Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
2340 // Add button/input type pseudos
2341 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2342         Expr.pseudos[ i ] = createInputPseudo( i );
2344 for ( i in { submit: true, reset: true } ) {
2345         Expr.pseudos[ i ] = createButtonPseudo( i );
2348 // Easy API for creating new setFilters
2349 function setFilters() {}
2350 setFilters.prototype = Expr.filters = Expr.pseudos;
2351 Expr.setFilters = new setFilters();
2353 tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2354         var matched, match, tokens, type,
2355                 soFar, groups, preFilters,
2356                 cached = tokenCache[ selector + " " ];
2358         if ( cached ) {
2359                 return parseOnly ? 0 : cached.slice( 0 );
2360         }
2362         soFar = selector;
2363         groups = [];
2364         preFilters = Expr.preFilter;
2366         while ( soFar ) {
2368                 // Comma and first run
2369                 if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
2370                         if ( match ) {
2372                                 // Don't consume trailing commas as valid
2373                                 soFar = soFar.slice( match[ 0 ].length ) || soFar;
2374                         }
2375                         groups.push( ( tokens = [] ) );
2376                 }
2378                 matched = false;
2380                 // Combinators
2381                 if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
2382                         matched = match.shift();
2383                         tokens.push( {
2384                                 value: matched,
2386                                 // Cast descendant combinators to space
2387                                 type: match[ 0 ].replace( rtrim, " " )
2388                         } );
2389                         soFar = soFar.slice( matched.length );
2390                 }
2392                 // Filters
2393                 for ( type in Expr.filter ) {
2394                         if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
2395                                 ( match = preFilters[ type ]( match ) ) ) ) {
2396                                 matched = match.shift();
2397                                 tokens.push( {
2398                                         value: matched,
2399                                         type: type,
2400                                         matches: match
2401                                 } );
2402                                 soFar = soFar.slice( matched.length );
2403                         }
2404                 }
2406                 if ( !matched ) {
2407                         break;
2408                 }
2409         }
2411         // Return the length of the invalid excess
2412         // if we're just parsing
2413         // Otherwise, throw an error or return tokens
2414         return parseOnly ?
2415                 soFar.length :
2416                 soFar ?
2417                         Sizzle.error( selector ) :
2419                         // Cache the tokens
2420                         tokenCache( selector, groups ).slice( 0 );
2423 function toSelector( tokens ) {
2424         var i = 0,
2425                 len = tokens.length,
2426                 selector = "";
2427         for ( ; i < len; i++ ) {
2428                 selector += tokens[ i ].value;
2429         }
2430         return selector;
2433 function addCombinator( matcher, combinator, base ) {
2434         var dir = combinator.dir,
2435                 skip = combinator.next,
2436                 key = skip || dir,
2437                 checkNonElements = base && key === "parentNode",
2438                 doneName = done++;
2440         return combinator.first ?
2442                 // Check against closest ancestor/preceding element
2443                 function( elem, context, xml ) {
2444                         while ( ( elem = elem[ dir ] ) ) {
2445                                 if ( elem.nodeType === 1 || checkNonElements ) {
2446                                         return matcher( elem, context, xml );
2447                                 }
2448                         }
2449                         return false;
2450                 } :
2452                 // Check against all ancestor/preceding elements
2453                 function( elem, context, xml ) {
2454                         var oldCache, uniqueCache, outerCache,
2455                                 newCache = [ dirruns, doneName ];
2457                         // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2458                         if ( xml ) {
2459                                 while ( ( elem = elem[ dir ] ) ) {
2460                                         if ( elem.nodeType === 1 || checkNonElements ) {
2461                                                 if ( matcher( elem, context, xml ) ) {
2462                                                         return true;
2463                                                 }
2464                                         }
2465                                 }
2466                         } else {
2467                                 while ( ( elem = elem[ dir ] ) ) {
2468                                         if ( elem.nodeType === 1 || checkNonElements ) {
2469                                                 outerCache = elem[ expando ] || ( elem[ expando ] = {} );
2471                                                 // Support: IE <9 only
2472                                                 // Defend against cloned attroperties (jQuery gh-1709)
2473                                                 uniqueCache = outerCache[ elem.uniqueID ] ||
2474                                                         ( outerCache[ elem.uniqueID ] = {} );
2476                                                 if ( skip && skip === elem.nodeName.toLowerCase() ) {
2477                                                         elem = elem[ dir ] || elem;
2478                                                 } else if ( ( oldCache = uniqueCache[ key ] ) &&
2479                                                         oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2481                                                         // Assign to newCache so results back-propagate to previous elements
2482                                                         return ( newCache[ 2 ] = oldCache[ 2 ] );
2483                                                 } else {
2485                                                         // Reuse newcache so results back-propagate to previous elements
2486                                                         uniqueCache[ key ] = newCache;
2488                                                         // A match means we're done; a fail means we have to keep checking
2489                                                         if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
2490                                                                 return true;
2491                                                         }
2492                                                 }
2493                                         }
2494                                 }
2495                         }
2496                         return false;
2497                 };
2500 function elementMatcher( matchers ) {
2501         return matchers.length > 1 ?
2502                 function( elem, context, xml ) {
2503                         var i = matchers.length;
2504                         while ( i-- ) {
2505                                 if ( !matchers[ i ]( elem, context, xml ) ) {
2506                                         return false;
2507                                 }
2508                         }
2509                         return true;
2510                 } :
2511                 matchers[ 0 ];
2514 function multipleContexts( selector, contexts, results ) {
2515         var i = 0,
2516                 len = contexts.length;
2517         for ( ; i < len; i++ ) {
2518                 Sizzle( selector, contexts[ i ], results );
2519         }
2520         return results;
2523 function condense( unmatched, map, filter, context, xml ) {
2524         var elem,
2525                 newUnmatched = [],
2526                 i = 0,
2527                 len = unmatched.length,
2528                 mapped = map != null;
2530         for ( ; i < len; i++ ) {
2531                 if ( ( elem = unmatched[ i ] ) ) {
2532                         if ( !filter || filter( elem, context, xml ) ) {
2533                                 newUnmatched.push( elem );
2534                                 if ( mapped ) {
2535                                         map.push( i );
2536                                 }
2537                         }
2538                 }
2539         }
2541         return newUnmatched;
2544 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2545         if ( postFilter && !postFilter[ expando ] ) {
2546                 postFilter = setMatcher( postFilter );
2547         }
2548         if ( postFinder && !postFinder[ expando ] ) {
2549                 postFinder = setMatcher( postFinder, postSelector );
2550         }
2551         return markFunction( function( seed, results, context, xml ) {
2552                 var temp, i, elem,
2553                         preMap = [],
2554                         postMap = [],
2555                         preexisting = results.length,
2557                         // Get initial elements from seed or context
2558                         elems = seed || multipleContexts(
2559                                 selector || "*",
2560                                 context.nodeType ? [ context ] : context,
2561                                 []
2562                         ),
2564                         // Prefilter to get matcher input, preserving a map for seed-results synchronization
2565                         matcherIn = preFilter && ( seed || !selector ) ?
2566                                 condense( elems, preMap, preFilter, context, xml ) :
2567                                 elems,
2569                         matcherOut = matcher ?
2571                                 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2572                                 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2574                                         // ...intermediate processing is necessary
2575                                         [] :
2577                                         // ...otherwise use results directly
2578                                         results :
2579                                 matcherIn;
2581                 // Find primary matches
2582                 if ( matcher ) {
2583                         matcher( matcherIn, matcherOut, context, xml );
2584                 }
2586                 // Apply postFilter
2587                 if ( postFilter ) {
2588                         temp = condense( matcherOut, postMap );
2589                         postFilter( temp, [], context, xml );
2591                         // Un-match failing elements by moving them back to matcherIn
2592                         i = temp.length;
2593                         while ( i-- ) {
2594                                 if ( ( elem = temp[ i ] ) ) {
2595                                         matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
2596                                 }
2597                         }
2598                 }
2600                 if ( seed ) {
2601                         if ( postFinder || preFilter ) {
2602                                 if ( postFinder ) {
2604                                         // Get the final matcherOut by condensing this intermediate into postFinder contexts
2605                                         temp = [];
2606                                         i = matcherOut.length;
2607                                         while ( i-- ) {
2608                                                 if ( ( elem = matcherOut[ i ] ) ) {
2610                                                         // Restore matcherIn since elem is not yet a final match
2611                                                         temp.push( ( matcherIn[ i ] = elem ) );
2612                                                 }
2613                                         }
2614                                         postFinder( null, ( matcherOut = [] ), temp, xml );
2615                                 }
2617                                 // Move matched elements from seed to results to keep them synchronized
2618                                 i = matcherOut.length;
2619                                 while ( i-- ) {
2620                                         if ( ( elem = matcherOut[ i ] ) &&
2621                                                 ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
2623                                                 seed[ temp ] = !( results[ temp ] = elem );
2624                                         }
2625                                 }
2626                         }
2628                 // Add elements to results, through postFinder if defined
2629                 } else {
2630                         matcherOut = condense(
2631                                 matcherOut === results ?
2632                                         matcherOut.splice( preexisting, matcherOut.length ) :
2633                                         matcherOut
2634                         );
2635                         if ( postFinder ) {
2636                                 postFinder( null, results, matcherOut, xml );
2637                         } else {
2638                                 push.apply( results, matcherOut );
2639                         }
2640                 }
2641         } );
2644 function matcherFromTokens( tokens ) {
2645         var checkContext, matcher, j,
2646                 len = tokens.length,
2647                 leadingRelative = Expr.relative[ tokens[ 0 ].type ],
2648                 implicitRelative = leadingRelative || Expr.relative[ " " ],
2649                 i = leadingRelative ? 1 : 0,
2651                 // The foundational matcher ensures that elements are reachable from top-level context(s)
2652                 matchContext = addCombinator( function( elem ) {
2653                         return elem === checkContext;
2654                 }, implicitRelative, true ),
2655                 matchAnyContext = addCombinator( function( elem ) {
2656                         return indexOf( checkContext, elem ) > -1;
2657                 }, implicitRelative, true ),
2658                 matchers = [ function( elem, context, xml ) {
2659                         var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2660                                 ( checkContext = context ).nodeType ?
2661                                         matchContext( elem, context, xml ) :
2662                                         matchAnyContext( elem, context, xml ) );
2664                         // Avoid hanging onto element (issue #299)
2665                         checkContext = null;
2666                         return ret;
2667                 } ];
2669         for ( ; i < len; i++ ) {
2670                 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
2671                         matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
2672                 } else {
2673                         matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
2675                         // Return special upon seeing a positional matcher
2676                         if ( matcher[ expando ] ) {
2678                                 // Find the next relative operator (if any) for proper handling
2679                                 j = ++i;
2680                                 for ( ; j < len; j++ ) {
2681                                         if ( Expr.relative[ tokens[ j ].type ] ) {
2682                                                 break;
2683                                         }
2684                                 }
2685                                 return setMatcher(
2686                                         i > 1 && elementMatcher( matchers ),
2687                                         i > 1 && toSelector(
2689                                         // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2690                                         tokens
2691                                                 .slice( 0, i - 1 )
2692                                                 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
2693                                         ).replace( rtrim, "$1" ),
2694                                         matcher,
2695                                         i < j && matcherFromTokens( tokens.slice( i, j ) ),
2696                                         j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
2697                                         j < len && toSelector( tokens )
2698                                 );
2699                         }
2700                         matchers.push( matcher );
2701                 }
2702         }
2704         return elementMatcher( matchers );
2707 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2708         var bySet = setMatchers.length > 0,
2709                 byElement = elementMatchers.length > 0,
2710                 superMatcher = function( seed, context, xml, results, outermost ) {
2711                         var elem, j, matcher,
2712                                 matchedCount = 0,
2713                                 i = "0",
2714                                 unmatched = seed && [],
2715                                 setMatched = [],
2716                                 contextBackup = outermostContext,
2718                                 // We must always have either seed elements or outermost context
2719                                 elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
2721                                 // Use integer dirruns iff this is the outermost matcher
2722                                 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
2723                                 len = elems.length;
2725                         if ( outermost ) {
2727                                 // Support: IE 11+, Edge 17 - 18+
2728                                 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
2729                                 // two documents; shallow comparisons work.
2730                                 // eslint-disable-next-line eqeqeq
2731                                 outermostContext = context == document || context || outermost;
2732                         }
2734                         // Add elements passing elementMatchers directly to results
2735                         // Support: IE<9, Safari
2736                         // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2737                         for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
2738                                 if ( byElement && elem ) {
2739                                         j = 0;
2741                                         // Support: IE 11+, Edge 17 - 18+
2742                                         // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
2743                                         // two documents; shallow comparisons work.
2744                                         // eslint-disable-next-line eqeqeq
2745                                         if ( !context && elem.ownerDocument != document ) {
2746                                                 setDocument( elem );
2747                                                 xml = !documentIsHTML;
2748                                         }
2749                                         while ( ( matcher = elementMatchers[ j++ ] ) ) {
2750                                                 if ( matcher( elem, context || document, xml ) ) {
2751                                                         results.push( elem );
2752                                                         break;
2753                                                 }
2754                                         }
2755                                         if ( outermost ) {
2756                                                 dirruns = dirrunsUnique;
2757                                         }
2758                                 }
2760                                 // Track unmatched elements for set filters
2761                                 if ( bySet ) {
2763                                         // They will have gone through all possible matchers
2764                                         if ( ( elem = !matcher && elem ) ) {
2765                                                 matchedCount--;
2766                                         }
2768                                         // Lengthen the array for every element, matched or not
2769                                         if ( seed ) {
2770                                                 unmatched.push( elem );
2771                                         }
2772                                 }
2773                         }
2775                         // `i` is now the count of elements visited above, and adding it to `matchedCount`
2776                         // makes the latter nonnegative.
2777                         matchedCount += i;
2779                         // Apply set filters to unmatched elements
2780                         // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
2781                         // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
2782                         // no element matchers and no seed.
2783                         // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
2784                         // case, which will result in a "00" `matchedCount` that differs from `i` but is also
2785                         // numerically zero.
2786                         if ( bySet && i !== matchedCount ) {
2787                                 j = 0;
2788                                 while ( ( matcher = setMatchers[ j++ ] ) ) {
2789                                         matcher( unmatched, setMatched, context, xml );
2790                                 }
2792                                 if ( seed ) {
2794                                         // Reintegrate element matches to eliminate the need for sorting
2795                                         if ( matchedCount > 0 ) {
2796                                                 while ( i-- ) {
2797                                                         if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
2798                                                                 setMatched[ i ] = pop.call( results );
2799                                                         }
2800                                                 }
2801                                         }
2803                                         // Discard index placeholder values to get only actual matches
2804                                         setMatched = condense( setMatched );
2805                                 }
2807                                 // Add matches to results
2808                                 push.apply( results, setMatched );
2810                                 // Seedless set matches succeeding multiple successful matchers stipulate sorting
2811                                 if ( outermost && !seed && setMatched.length > 0 &&
2812                                         ( matchedCount + setMatchers.length ) > 1 ) {
2814                                         Sizzle.uniqueSort( results );
2815                                 }
2816                         }
2818                         // Override manipulation of globals by nested matchers
2819                         if ( outermost ) {
2820                                 dirruns = dirrunsUnique;
2821                                 outermostContext = contextBackup;
2822                         }
2824                         return unmatched;
2825                 };
2827         return bySet ?
2828                 markFunction( superMatcher ) :
2829                 superMatcher;
2832 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2833         var i,
2834                 setMatchers = [],
2835                 elementMatchers = [],
2836                 cached = compilerCache[ selector + " " ];
2838         if ( !cached ) {
2840                 // Generate a function of recursive functions that can be used to check each element
2841                 if ( !match ) {
2842                         match = tokenize( selector );
2843                 }
2844                 i = match.length;
2845                 while ( i-- ) {
2846                         cached = matcherFromTokens( match[ i ] );
2847                         if ( cached[ expando ] ) {
2848                                 setMatchers.push( cached );
2849                         } else {
2850                                 elementMatchers.push( cached );
2851                         }
2852                 }
2854                 // Cache the compiled function
2855                 cached = compilerCache(
2856                         selector,
2857                         matcherFromGroupMatchers( elementMatchers, setMatchers )
2858                 );
2860                 // Save selector and tokenization
2861                 cached.selector = selector;
2862         }
2863         return cached;
2867  * A low-level selection function that works with Sizzle's compiled
2868  *  selector functions
2869  * @param {String|Function} selector A selector or a pre-compiled
2870  *  selector function built with Sizzle.compile
2871  * @param {Element} context
2872  * @param {Array} [results]
2873  * @param {Array} [seed] A set of elements to match against
2874  */
2875 select = Sizzle.select = function( selector, context, results, seed ) {
2876         var i, tokens, token, type, find,
2877                 compiled = typeof selector === "function" && selector,
2878                 match = !seed && tokenize( ( selector = compiled.selector || selector ) );
2880         results = results || [];
2882         // Try to minimize operations if there is only one selector in the list and no seed
2883         // (the latter of which guarantees us context)
2884         if ( match.length === 1 ) {
2886                 // Reduce context if the leading compound selector is an ID
2887                 tokens = match[ 0 ] = match[ 0 ].slice( 0 );
2888                 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
2889                         context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
2891                         context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
2892                                 .replace( runescape, funescape ), context ) || [] )[ 0 ];
2893                         if ( !context ) {
2894                                 return results;
2896                         // Precompiled matchers will still verify ancestry, so step up a level
2897                         } else if ( compiled ) {
2898                                 context = context.parentNode;
2899                         }
2901                         selector = selector.slice( tokens.shift().value.length );
2902                 }
2904                 // Fetch a seed set for right-to-left matching
2905                 i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
2906                 while ( i-- ) {
2907                         token = tokens[ i ];
2909                         // Abort if we hit a combinator
2910                         if ( Expr.relative[ ( type = token.type ) ] ) {
2911                                 break;
2912                         }
2913                         if ( ( find = Expr.find[ type ] ) ) {
2915                                 // Search, expanding context for leading sibling combinators
2916                                 if ( ( seed = find(
2917                                         token.matches[ 0 ].replace( runescape, funescape ),
2918                                         rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
2919                                                 context
2920                                 ) ) ) {
2922                                         // If seed is empty or no tokens remain, we can return early
2923                                         tokens.splice( i, 1 );
2924                                         selector = seed.length && toSelector( tokens );
2925                                         if ( !selector ) {
2926                                                 push.apply( results, seed );
2927                                                 return results;
2928                                         }
2930                                         break;
2931                                 }
2932                         }
2933                 }
2934         }
2936         // Compile and execute a filtering function if one is not provided
2937         // Provide `match` to avoid retokenization if we modified the selector above
2938         ( compiled || compile( selector, match ) )(
2939                 seed,
2940                 context,
2941                 !documentIsHTML,
2942                 results,
2943                 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
2944         );
2945         return results;
2948 // One-time assignments
2950 // Sort stability
2951 support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
2953 // Support: Chrome 14-35+
2954 // Always assume duplicates if they aren't passed to the comparison function
2955 support.detectDuplicates = !!hasDuplicate;
2957 // Initialize against the default document
2958 setDocument();
2960 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2961 // Detached nodes confoundingly follow *each other*
2962 support.sortDetached = assert( function( el ) {
2964         // Should return 1, but returns 4 (following)
2965         return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
2966 } );
2968 // Support: IE<8
2969 // Prevent attribute/property "interpolation"
2970 // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2971 if ( !assert( function( el ) {
2972         el.innerHTML = "<a href='#'></a>";
2973         return el.firstChild.getAttribute( "href" ) === "#";
2974 } ) ) {
2975         addHandle( "type|href|height|width", function( elem, name, isXML ) {
2976                 if ( !isXML ) {
2977                         return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2978                 }
2979         } );
2982 // Support: IE<9
2983 // Use defaultValue in place of getAttribute("value")
2984 if ( !support.attributes || !assert( function( el ) {
2985         el.innerHTML = "<input/>";
2986         el.firstChild.setAttribute( "value", "" );
2987         return el.firstChild.getAttribute( "value" ) === "";
2988 } ) ) {
2989         addHandle( "value", function( elem, _name, isXML ) {
2990                 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2991                         return elem.defaultValue;
2992                 }
2993         } );
2996 // Support: IE<9
2997 // Use getAttributeNode to fetch booleans when getAttribute lies
2998 if ( !assert( function( el ) {
2999         return el.getAttribute( "disabled" ) == null;
3000 } ) ) {
3001         addHandle( booleans, function( elem, name, isXML ) {
3002                 var val;
3003                 if ( !isXML ) {
3004                         return elem[ name ] === true ? name.toLowerCase() :
3005                                 ( val = elem.getAttributeNode( name ) ) && val.specified ?
3006                                         val.value :
3007                                         null;
3008                 }
3009         } );
3012 return Sizzle;
3014 } )( window );
3018 jQuery.find = Sizzle;
3019 jQuery.expr = Sizzle.selectors;
3021 // Deprecated
3022 jQuery.expr[ ":" ] = jQuery.expr.pseudos;
3023 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
3024 jQuery.text = Sizzle.getText;
3025 jQuery.isXMLDoc = Sizzle.isXML;
3026 jQuery.contains = Sizzle.contains;
3027 jQuery.escapeSelector = Sizzle.escape;
3032 var dir = function( elem, dir, until ) {
3033         var matched = [],
3034                 truncate = until !== undefined;
3036         while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
3037                 if ( elem.nodeType === 1 ) {
3038                         if ( truncate && jQuery( elem ).is( until ) ) {
3039                                 break;
3040                         }
3041                         matched.push( elem );
3042                 }
3043         }
3044         return matched;
3048 var siblings = function( n, elem ) {
3049         var matched = [];
3051         for ( ; n; n = n.nextSibling ) {
3052                 if ( n.nodeType === 1 && n !== elem ) {
3053                         matched.push( n );
3054                 }
3055         }
3057         return matched;
3061 var rneedsContext = jQuery.expr.match.needsContext;
3065 function nodeName( elem, name ) {
3067         return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
3070 var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
3074 // Implement the identical functionality for filter and not
3075 function winnow( elements, qualifier, not ) {
3076         if ( isFunction( qualifier ) ) {
3077                 return jQuery.grep( elements, function( elem, i ) {
3078                         return !!qualifier.call( elem, i, elem ) !== not;
3079                 } );
3080         }
3082         // Single element
3083         if ( qualifier.nodeType ) {
3084                 return jQuery.grep( elements, function( elem ) {
3085                         return ( elem === qualifier ) !== not;
3086                 } );
3087         }
3089         // Arraylike of elements (jQuery, arguments, Array)
3090         if ( typeof qualifier !== "string" ) {
3091                 return jQuery.grep( elements, function( elem ) {
3092                         return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
3093                 } );
3094         }
3096         // Filtered directly for both simple and complex selectors
3097         return jQuery.filter( qualifier, elements, not );
3100 jQuery.filter = function( expr, elems, not ) {
3101         var elem = elems[ 0 ];
3103         if ( not ) {
3104                 expr = ":not(" + expr + ")";
3105         }
3107         if ( elems.length === 1 && elem.nodeType === 1 ) {
3108                 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
3109         }
3111         return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
3112                 return elem.nodeType === 1;
3113         } ) );
3116 jQuery.fn.extend( {
3117         find: function( selector ) {
3118                 var i, ret,
3119                         len = this.length,
3120                         self = this;
3122                 if ( typeof selector !== "string" ) {
3123                         return this.pushStack( jQuery( selector ).filter( function() {
3124                                 for ( i = 0; i < len; i++ ) {
3125                                         if ( jQuery.contains( self[ i ], this ) ) {
3126                                                 return true;
3127                                         }
3128                                 }
3129                         } ) );
3130                 }
3132                 ret = this.pushStack( [] );
3134                 for ( i = 0; i < len; i++ ) {
3135                         jQuery.find( selector, self[ i ], ret );
3136                 }
3138                 return len > 1 ? jQuery.uniqueSort( ret ) : ret;
3139         },
3140         filter: function( selector ) {
3141                 return this.pushStack( winnow( this, selector || [], false ) );
3142         },
3143         not: function( selector ) {
3144                 return this.pushStack( winnow( this, selector || [], true ) );
3145         },
3146         is: function( selector ) {
3147                 return !!winnow(
3148                         this,
3150                         // If this is a positional/relative selector, check membership in the returned set
3151                         // so $("p:first").is("p:last") won't return true for a doc with two "p".
3152                         typeof selector === "string" && rneedsContext.test( selector ) ?
3153                                 jQuery( selector ) :
3154                                 selector || [],
3155                         false
3156                 ).length;
3157         }
3158 } );
3161 // Initialize a jQuery object
3164 // A central reference to the root jQuery(document)
3165 var rootjQuery,
3167         // A simple way to check for HTML strings
3168         // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
3169         // Strict HTML recognition (trac-11290: must start with <)
3170         // Shortcut simple #id case for speed
3171         rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
3173         init = jQuery.fn.init = function( selector, context, root ) {
3174                 var match, elem;
3176                 // HANDLE: $(""), $(null), $(undefined), $(false)
3177                 if ( !selector ) {
3178                         return this;
3179                 }
3181                 // Method init() accepts an alternate rootjQuery
3182                 // so migrate can support jQuery.sub (gh-2101)
3183                 root = root || rootjQuery;
3185                 // Handle HTML strings
3186                 if ( typeof selector === "string" ) {
3187                         if ( selector[ 0 ] === "<" &&
3188                                 selector[ selector.length - 1 ] === ">" &&
3189                                 selector.length >= 3 ) {
3191                                 // Assume that strings that start and end with <> are HTML and skip the regex check
3192                                 match = [ null, selector, null ];
3194                         } else {
3195                                 match = rquickExpr.exec( selector );
3196                         }
3198                         // Match html or make sure no context is specified for #id
3199                         if ( match && ( match[ 1 ] || !context ) ) {
3201                                 // HANDLE: $(html) -> $(array)
3202                                 if ( match[ 1 ] ) {
3203                                         context = context instanceof jQuery ? context[ 0 ] : context;
3205                                         // Option to run scripts is true for back-compat
3206                                         // Intentionally let the error be thrown if parseHTML is not present
3207                                         jQuery.merge( this, jQuery.parseHTML(
3208                                                 match[ 1 ],
3209                                                 context && context.nodeType ? context.ownerDocument || context : document,
3210                                                 true
3211                                         ) );
3213                                         // HANDLE: $(html, props)
3214                                         if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
3215                                                 for ( match in context ) {
3217                                                         // Properties of context are called as methods if possible
3218                                                         if ( isFunction( this[ match ] ) ) {
3219                                                                 this[ match ]( context[ match ] );
3221                                                         // ...and otherwise set as attributes
3222                                                         } else {
3223                                                                 this.attr( match, context[ match ] );
3224                                                         }
3225                                                 }
3226                                         }
3228                                         return this;
3230                                 // HANDLE: $(#id)
3231                                 } else {
3232                                         elem = document.getElementById( match[ 2 ] );
3234                                         if ( elem ) {
3236                                                 // Inject the element directly into the jQuery object
3237                                                 this[ 0 ] = elem;
3238                                                 this.length = 1;
3239                                         }
3240                                         return this;
3241                                 }
3243                         // HANDLE: $(expr, $(...))
3244                         } else if ( !context || context.jquery ) {
3245                                 return ( context || root ).find( selector );
3247                         // HANDLE: $(expr, context)
3248                         // (which is just equivalent to: $(context).find(expr)
3249                         } else {
3250                                 return this.constructor( context ).find( selector );
3251                         }
3253                 // HANDLE: $(DOMElement)
3254                 } else if ( selector.nodeType ) {
3255                         this[ 0 ] = selector;
3256                         this.length = 1;
3257                         return this;
3259                 // HANDLE: $(function)
3260                 // Shortcut for document ready
3261                 } else if ( isFunction( selector ) ) {
3262                         return root.ready !== undefined ?
3263                                 root.ready( selector ) :
3265                                 // Execute immediately if ready is not present
3266                                 selector( jQuery );
3267                 }
3269                 return jQuery.makeArray( selector, this );
3270         };
3272 // Give the init function the jQuery prototype for later instantiation
3273 init.prototype = jQuery.fn;
3275 // Initialize central reference
3276 rootjQuery = jQuery( document );
3279 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
3281         // Methods guaranteed to produce a unique set when starting from a unique set
3282         guaranteedUnique = {
3283                 children: true,
3284                 contents: true,
3285                 next: true,
3286                 prev: true
3287         };
3289 jQuery.fn.extend( {
3290         has: function( target ) {
3291                 var targets = jQuery( target, this ),
3292                         l = targets.length;
3294                 return this.filter( function() {
3295                         var i = 0;
3296                         for ( ; i < l; i++ ) {
3297                                 if ( jQuery.contains( this, targets[ i ] ) ) {
3298                                         return true;
3299                                 }
3300                         }
3301                 } );
3302         },
3304         closest: function( selectors, context ) {
3305                 var cur,
3306                         i = 0,
3307                         l = this.length,
3308                         matched = [],
3309                         targets = typeof selectors !== "string" && jQuery( selectors );
3311                 // Positional selectors never match, since there's no _selection_ context
3312                 if ( !rneedsContext.test( selectors ) ) {
3313                         for ( ; i < l; i++ ) {
3314                                 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
3316                                         // Always skip document fragments
3317                                         if ( cur.nodeType < 11 && ( targets ?
3318                                                 targets.index( cur ) > -1 :
3320                                                 // Don't pass non-elements to Sizzle
3321                                                 cur.nodeType === 1 &&
3322                                                         jQuery.find.matchesSelector( cur, selectors ) ) ) {
3324                                                 matched.push( cur );
3325                                                 break;
3326                                         }
3327                                 }
3328                         }
3329                 }
3331                 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
3332         },
3334         // Determine the position of an element within the set
3335         index: function( elem ) {
3337                 // No argument, return index in parent
3338                 if ( !elem ) {
3339                         return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
3340                 }
3342                 // Index in selector
3343                 if ( typeof elem === "string" ) {
3344                         return indexOf.call( jQuery( elem ), this[ 0 ] );
3345                 }
3347                 // Locate the position of the desired element
3348                 return indexOf.call( this,
3350                         // If it receives a jQuery object, the first element is used
3351                         elem.jquery ? elem[ 0 ] : elem
3352                 );
3353         },
3355         add: function( selector, context ) {
3356                 return this.pushStack(
3357                         jQuery.uniqueSort(
3358                                 jQuery.merge( this.get(), jQuery( selector, context ) )
3359                         )
3360                 );
3361         },
3363         addBack: function( selector ) {
3364                 return this.add( selector == null ?
3365                         this.prevObject : this.prevObject.filter( selector )
3366                 );
3367         }
3368 } );
3370 function sibling( cur, dir ) {
3371         while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
3372         return cur;
3375 jQuery.each( {
3376         parent: function( elem ) {
3377                 var parent = elem.parentNode;
3378                 return parent && parent.nodeType !== 11 ? parent : null;
3379         },
3380         parents: function( elem ) {
3381                 return dir( elem, "parentNode" );
3382         },
3383         parentsUntil: function( elem, _i, until ) {
3384                 return dir( elem, "parentNode", until );
3385         },
3386         next: function( elem ) {
3387                 return sibling( elem, "nextSibling" );
3388         },
3389         prev: function( elem ) {
3390                 return sibling( elem, "previousSibling" );
3391         },
3392         nextAll: function( elem ) {
3393                 return dir( elem, "nextSibling" );
3394         },
3395         prevAll: function( elem ) {
3396                 return dir( elem, "previousSibling" );
3397         },
3398         nextUntil: function( elem, _i, until ) {
3399                 return dir( elem, "nextSibling", until );
3400         },
3401         prevUntil: function( elem, _i, until ) {
3402                 return dir( elem, "previousSibling", until );
3403         },
3404         siblings: function( elem ) {
3405                 return siblings( ( elem.parentNode || {} ).firstChild, elem );
3406         },
3407         children: function( elem ) {
3408                 return siblings( elem.firstChild );
3409         },
3410         contents: function( elem ) {
3411                 if ( elem.contentDocument != null &&
3413                         // Support: IE 11+
3414                         // <object> elements with no `data` attribute has an object
3415                         // `contentDocument` with a `null` prototype.
3416                         getProto( elem.contentDocument ) ) {
3418                         return elem.contentDocument;
3419                 }
3421                 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
3422                 // Treat the template element as a regular one in browsers that
3423                 // don't support it.
3424                 if ( nodeName( elem, "template" ) ) {
3425                         elem = elem.content || elem;
3426                 }
3428                 return jQuery.merge( [], elem.childNodes );
3429         }
3430 }, function( name, fn ) {
3431         jQuery.fn[ name ] = function( until, selector ) {
3432                 var matched = jQuery.map( this, fn, until );
3434                 if ( name.slice( -5 ) !== "Until" ) {
3435                         selector = until;
3436                 }
3438                 if ( selector && typeof selector === "string" ) {
3439                         matched = jQuery.filter( selector, matched );
3440                 }
3442                 if ( this.length > 1 ) {
3444                         // Remove duplicates
3445                         if ( !guaranteedUnique[ name ] ) {
3446                                 jQuery.uniqueSort( matched );
3447                         }
3449                         // Reverse order for parents* and prev-derivatives
3450                         if ( rparentsprev.test( name ) ) {
3451                                 matched.reverse();
3452                         }
3453                 }
3455                 return this.pushStack( matched );
3456         };
3457 } );
3458 var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
3462 // Convert String-formatted options into Object-formatted ones
3463 function createOptions( options ) {
3464         var object = {};
3465         jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
3466                 object[ flag ] = true;
3467         } );
3468         return object;
3472  * Create a callback list using the following parameters:
3474  *      options: an optional list of space-separated options that will change how
3475  *                      the callback list behaves or a more traditional option object
3477  * By default a callback list will act like an event callback list and can be
3478  * "fired" multiple times.
3480  * Possible options:
3482  *      once:                   will ensure the callback list can only be fired once (like a Deferred)
3484  *      memory:                 will keep track of previous values and will call any callback added
3485  *                                      after the list has been fired right away with the latest "memorized"
3486  *                                      values (like a Deferred)
3488  *      unique:                 will ensure a callback can only be added once (no duplicate in the list)
3490  *      stopOnFalse:    interrupt callings when a callback returns false
3492  */
3493 jQuery.Callbacks = function( options ) {
3495         // Convert options from String-formatted to Object-formatted if needed
3496         // (we check in cache first)
3497         options = typeof options === "string" ?
3498                 createOptions( options ) :
3499                 jQuery.extend( {}, options );
3501         var // Flag to know if list is currently firing
3502                 firing,
3504                 // Last fire value for non-forgettable lists
3505                 memory,
3507                 // Flag to know if list was already fired
3508                 fired,
3510                 // Flag to prevent firing
3511                 locked,
3513                 // Actual callback list
3514                 list = [],
3516                 // Queue of execution data for repeatable lists
3517                 queue = [],
3519                 // Index of currently firing callback (modified by add/remove as needed)
3520                 firingIndex = -1,
3522                 // Fire callbacks
3523                 fire = function() {
3525                         // Enforce single-firing
3526                         locked = locked || options.once;
3528                         // Execute callbacks for all pending executions,
3529                         // respecting firingIndex overrides and runtime changes
3530                         fired = firing = true;
3531                         for ( ; queue.length; firingIndex = -1 ) {
3532                                 memory = queue.shift();
3533                                 while ( ++firingIndex < list.length ) {
3535                                         // Run callback and check for early termination
3536                                         if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
3537                                                 options.stopOnFalse ) {
3539                                                 // Jump to end and forget the data so .add doesn't re-fire
3540                                                 firingIndex = list.length;
3541                                                 memory = false;
3542                                         }
3543                                 }
3544                         }
3546                         // Forget the data if we're done with it
3547                         if ( !options.memory ) {
3548                                 memory = false;
3549                         }
3551                         firing = false;
3553                         // Clean up if we're done firing for good
3554                         if ( locked ) {
3556                                 // Keep an empty list if we have data for future add calls
3557                                 if ( memory ) {
3558                                         list = [];
3560                                 // Otherwise, this object is spent
3561                                 } else {
3562                                         list = "";
3563                                 }
3564                         }
3565                 },
3567                 // Actual Callbacks object
3568                 self = {
3570                         // Add a callback or a collection of callbacks to the list
3571                         add: function() {
3572                                 if ( list ) {
3574                                         // If we have memory from a past run, we should fire after adding
3575                                         if ( memory && !firing ) {
3576                                                 firingIndex = list.length - 1;
3577                                                 queue.push( memory );
3578                                         }
3580                                         ( function add( args ) {
3581                                                 jQuery.each( args, function( _, arg ) {
3582                                                         if ( isFunction( arg ) ) {
3583                                                                 if ( !options.unique || !self.has( arg ) ) {
3584                                                                         list.push( arg );
3585                                                                 }
3586                                                         } else if ( arg && arg.length && toType( arg ) !== "string" ) {
3588                                                                 // Inspect recursively
3589                                                                 add( arg );
3590                                                         }
3591                                                 } );
3592                                         } )( arguments );
3594                                         if ( memory && !firing ) {
3595                                                 fire();
3596                                         }
3597                                 }
3598                                 return this;
3599                         },
3601                         // Remove a callback from the list
3602                         remove: function() {
3603                                 jQuery.each( arguments, function( _, arg ) {
3604                                         var index;
3605                                         while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3606                                                 list.splice( index, 1 );
3608                                                 // Handle firing indexes
3609                                                 if ( index <= firingIndex ) {
3610                                                         firingIndex--;
3611                                                 }
3612                                         }
3613                                 } );
3614                                 return this;
3615                         },
3617                         // Check if a given callback is in the list.
3618                         // If no argument is given, return whether or not list has callbacks attached.
3619                         has: function( fn ) {
3620                                 return fn ?
3621                                         jQuery.inArray( fn, list ) > -1 :
3622                                         list.length > 0;
3623                         },
3625                         // Remove all callbacks from the list
3626                         empty: function() {
3627                                 if ( list ) {
3628                                         list = [];
3629                                 }
3630                                 return this;
3631                         },
3633                         // Disable .fire and .add
3634                         // Abort any current/pending executions
3635                         // Clear all callbacks and values
3636                         disable: function() {
3637                                 locked = queue = [];
3638                                 list = memory = "";
3639                                 return this;
3640                         },
3641                         disabled: function() {
3642                                 return !list;
3643                         },
3645                         // Disable .fire
3646                         // Also disable .add unless we have memory (since it would have no effect)
3647                         // Abort any pending executions
3648                         lock: function() {
3649                                 locked = queue = [];
3650                                 if ( !memory && !firing ) {
3651                                         list = memory = "";
3652                                 }
3653                                 return this;
3654                         },
3655                         locked: function() {
3656                                 return !!locked;
3657                         },
3659                         // Call all callbacks with the given context and arguments
3660                         fireWith: function( context, args ) {
3661                                 if ( !locked ) {
3662                                         args = args || [];
3663                                         args = [ context, args.slice ? args.slice() : args ];
3664                                         queue.push( args );
3665                                         if ( !firing ) {
3666                                                 fire();
3667                                         }
3668                                 }
3669                                 return this;
3670                         },
3672                         // Call all the callbacks with the given arguments
3673                         fire: function() {
3674                                 self.fireWith( this, arguments );
3675                                 return this;
3676                         },
3678                         // To know if the callbacks have already been called at least once
3679                         fired: function() {
3680                                 return !!fired;
3681                         }
3682                 };
3684         return self;
3688 function Identity( v ) {
3689         return v;
3691 function Thrower( ex ) {
3692         throw ex;
3695 function adoptValue( value, resolve, reject, noValue ) {
3696         var method;
3698         try {
3700                 // Check for promise aspect first to privilege synchronous behavior
3701                 if ( value && isFunction( ( method = value.promise ) ) ) {
3702                         method.call( value ).done( resolve ).fail( reject );
3704                 // Other thenables
3705                 } else if ( value && isFunction( ( method = value.then ) ) ) {
3706                         method.call( value, resolve, reject );
3708                 // Other non-thenables
3709                 } else {
3711                         // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
3712                         // * false: [ value ].slice( 0 ) => resolve( value )
3713                         // * true: [ value ].slice( 1 ) => resolve()
3714                         resolve.apply( undefined, [ value ].slice( noValue ) );
3715                 }
3717         // For Promises/A+, convert exceptions into rejections
3718         // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
3719         // Deferred#then to conditionally suppress rejection.
3720         } catch ( value ) {
3722                 // Support: Android 4.0 only
3723                 // Strict mode functions invoked without .call/.apply get global-object context
3724                 reject.apply( undefined, [ value ] );
3725         }
3728 jQuery.extend( {
3730         Deferred: function( func ) {
3731                 var tuples = [
3733                                 // action, add listener, callbacks,
3734                                 // ... .then handlers, argument index, [final state]
3735                                 [ "notify", "progress", jQuery.Callbacks( "memory" ),
3736                                         jQuery.Callbacks( "memory" ), 2 ],
3737                                 [ "resolve", "done", jQuery.Callbacks( "once memory" ),
3738                                         jQuery.Callbacks( "once memory" ), 0, "resolved" ],
3739                                 [ "reject", "fail", jQuery.Callbacks( "once memory" ),
3740                                         jQuery.Callbacks( "once memory" ), 1, "rejected" ]
3741                         ],
3742                         state = "pending",
3743                         promise = {
3744                                 state: function() {
3745                                         return state;
3746                                 },
3747                                 always: function() {
3748                                         deferred.done( arguments ).fail( arguments );
3749                                         return this;
3750                                 },
3751                                 "catch": function( fn ) {
3752                                         return promise.then( null, fn );
3753                                 },
3755                                 // Keep pipe for back-compat
3756                                 pipe: function( /* fnDone, fnFail, fnProgress */ ) {
3757                                         var fns = arguments;
3759                                         return jQuery.Deferred( function( newDefer ) {
3760                                                 jQuery.each( tuples, function( _i, tuple ) {
3762                                                         // Map tuples (progress, done, fail) to arguments (done, fail, progress)
3763                                                         var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
3765                                                         // deferred.progress(function() { bind to newDefer or newDefer.notify })
3766                                                         // deferred.done(function() { bind to newDefer or newDefer.resolve })
3767                                                         // deferred.fail(function() { bind to newDefer or newDefer.reject })
3768                                                         deferred[ tuple[ 1 ] ]( function() {
3769                                                                 var returned = fn && fn.apply( this, arguments );
3770                                                                 if ( returned && isFunction( returned.promise ) ) {
3771                                                                         returned.promise()
3772                                                                                 .progress( newDefer.notify )
3773                                                                                 .done( newDefer.resolve )
3774                                                                                 .fail( newDefer.reject );
3775                                                                 } else {
3776                                                                         newDefer[ tuple[ 0 ] + "With" ](
3777                                                                                 this,
3778                                                                                 fn ? [ returned ] : arguments
3779                                                                         );
3780                                                                 }
3781                                                         } );
3782                                                 } );
3783                                                 fns = null;
3784                                         } ).promise();
3785                                 },
3786                                 then: function( onFulfilled, onRejected, onProgress ) {
3787                                         var maxDepth = 0;
3788                                         function resolve( depth, deferred, handler, special ) {
3789                                                 return function() {
3790                                                         var that = this,
3791                                                                 args = arguments,
3792                                                                 mightThrow = function() {
3793                                                                         var returned, then;
3795                                                                         // Support: Promises/A+ section 2.3.3.3.3
3796                                                                         // https://promisesaplus.com/#point-59
3797                                                                         // Ignore double-resolution attempts
3798                                                                         if ( depth < maxDepth ) {
3799                                                                                 return;
3800                                                                         }
3802                                                                         returned = handler.apply( that, args );
3804                                                                         // Support: Promises/A+ section 2.3.1
3805                                                                         // https://promisesaplus.com/#point-48
3806                                                                         if ( returned === deferred.promise() ) {
3807                                                                                 throw new TypeError( "Thenable self-resolution" );
3808                                                                         }
3810                                                                         // Support: Promises/A+ sections 2.3.3.1, 3.5
3811                                                                         // https://promisesaplus.com/#point-54
3812                                                                         // https://promisesaplus.com/#point-75
3813                                                                         // Retrieve `then` only once
3814                                                                         then = returned &&
3816                                                                                 // Support: Promises/A+ section 2.3.4
3817                                                                                 // https://promisesaplus.com/#point-64
3818                                                                                 // Only check objects and functions for thenability
3819                                                                                 ( typeof returned === "object" ||
3820                                                                                         typeof returned === "function" ) &&
3821                                                                                 returned.then;
3823                                                                         // Handle a returned thenable
3824                                                                         if ( isFunction( then ) ) {
3826                                                                                 // Special processors (notify) just wait for resolution
3827                                                                                 if ( special ) {
3828                                                                                         then.call(
3829                                                                                                 returned,
3830                                                                                                 resolve( maxDepth, deferred, Identity, special ),
3831                                                                                                 resolve( maxDepth, deferred, Thrower, special )
3832                                                                                         );
3834                                                                                 // Normal processors (resolve) also hook into progress
3835                                                                                 } else {
3837                                                                                         // ...and disregard older resolution values
3838                                                                                         maxDepth++;
3840                                                                                         then.call(
3841                                                                                                 returned,
3842                                                                                                 resolve( maxDepth, deferred, Identity, special ),
3843                                                                                                 resolve( maxDepth, deferred, Thrower, special ),
3844                                                                                                 resolve( maxDepth, deferred, Identity,
3845                                                                                                         deferred.notifyWith )
3846                                                                                         );
3847                                                                                 }
3849                                                                         // Handle all other returned values
3850                                                                         } else {
3852                                                                                 // Only substitute handlers pass on context
3853                                                                                 // and multiple values (non-spec behavior)
3854                                                                                 if ( handler !== Identity ) {
3855                                                                                         that = undefined;
3856                                                                                         args = [ returned ];
3857                                                                                 }
3859                                                                                 // Process the value(s)
3860                                                                                 // Default process is resolve
3861                                                                                 ( special || deferred.resolveWith )( that, args );
3862                                                                         }
3863                                                                 },
3865                                                                 // Only normal processors (resolve) catch and reject exceptions
3866                                                                 process = special ?
3867                                                                         mightThrow :
3868                                                                         function() {
3869                                                                                 try {
3870                                                                                         mightThrow();
3871                                                                                 } catch ( e ) {
3873                                                                                         if ( jQuery.Deferred.exceptionHook ) {
3874                                                                                                 jQuery.Deferred.exceptionHook( e,
3875                                                                                                         process.stackTrace );
3876                                                                                         }
3878                                                                                         // Support: Promises/A+ section 2.3.3.3.4.1
3879                                                                                         // https://promisesaplus.com/#point-61
3880                                                                                         // Ignore post-resolution exceptions
3881                                                                                         if ( depth + 1 >= maxDepth ) {
3883                                                                                                 // Only substitute handlers pass on context
3884                                                                                                 // and multiple values (non-spec behavior)
3885                                                                                                 if ( handler !== Thrower ) {
3886                                                                                                         that = undefined;
3887                                                                                                         args = [ e ];
3888                                                                                                 }
3890                                                                                                 deferred.rejectWith( that, args );
3891                                                                                         }
3892                                                                                 }
3893                                                                         };
3895                                                         // Support: Promises/A+ section 2.3.3.3.1
3896                                                         // https://promisesaplus.com/#point-57
3897                                                         // Re-resolve promises immediately to dodge false rejection from
3898                                                         // subsequent errors
3899                                                         if ( depth ) {
3900                                                                 process();
3901                                                         } else {
3903                                                                 // Call an optional hook to record the stack, in case of exception
3904                                                                 // since it's otherwise lost when execution goes async
3905                                                                 if ( jQuery.Deferred.getStackHook ) {
3906                                                                         process.stackTrace = jQuery.Deferred.getStackHook();
3907                                                                 }
3908                                                                 window.setTimeout( process );
3909                                                         }
3910                                                 };
3911                                         }
3913                                         return jQuery.Deferred( function( newDefer ) {
3915                                                 // progress_handlers.add( ... )
3916                                                 tuples[ 0 ][ 3 ].add(
3917                                                         resolve(
3918                                                                 0,
3919                                                                 newDefer,
3920                                                                 isFunction( onProgress ) ?
3921                                                                         onProgress :
3922                                                                         Identity,
3923                                                                 newDefer.notifyWith
3924                                                         )
3925                                                 );
3927                                                 // fulfilled_handlers.add( ... )
3928                                                 tuples[ 1 ][ 3 ].add(
3929                                                         resolve(
3930                                                                 0,
3931                                                                 newDefer,
3932                                                                 isFunction( onFulfilled ) ?
3933                                                                         onFulfilled :
3934                                                                         Identity
3935                                                         )
3936                                                 );
3938                                                 // rejected_handlers.add( ... )
3939                                                 tuples[ 2 ][ 3 ].add(
3940                                                         resolve(
3941                                                                 0,
3942                                                                 newDefer,
3943                                                                 isFunction( onRejected ) ?
3944                                                                         onRejected :
3945                                                                         Thrower
3946                                                         )
3947                                                 );
3948                                         } ).promise();
3949                                 },
3951                                 // Get a promise for this deferred
3952                                 // If obj is provided, the promise aspect is added to the object
3953                                 promise: function( obj ) {
3954                                         return obj != null ? jQuery.extend( obj, promise ) : promise;
3955                                 }
3956                         },
3957                         deferred = {};
3959                 // Add list-specific methods
3960                 jQuery.each( tuples, function( i, tuple ) {
3961                         var list = tuple[ 2 ],
3962                                 stateString = tuple[ 5 ];
3964                         // promise.progress = list.add
3965                         // promise.done = list.add
3966                         // promise.fail = list.add
3967                         promise[ tuple[ 1 ] ] = list.add;
3969                         // Handle state
3970                         if ( stateString ) {
3971                                 list.add(
3972                                         function() {
3974                                                 // state = "resolved" (i.e., fulfilled)
3975                                                 // state = "rejected"
3976                                                 state = stateString;
3977                                         },
3979                                         // rejected_callbacks.disable
3980                                         // fulfilled_callbacks.disable
3981                                         tuples[ 3 - i ][ 2 ].disable,
3983                                         // rejected_handlers.disable
3984                                         // fulfilled_handlers.disable
3985                                         tuples[ 3 - i ][ 3 ].disable,
3987                                         // progress_callbacks.lock
3988                                         tuples[ 0 ][ 2 ].lock,
3990                                         // progress_handlers.lock
3991                                         tuples[ 0 ][ 3 ].lock
3992                                 );
3993                         }
3995                         // progress_handlers.fire
3996                         // fulfilled_handlers.fire
3997                         // rejected_handlers.fire
3998                         list.add( tuple[ 3 ].fire );
4000                         // deferred.notify = function() { deferred.notifyWith(...) }
4001                         // deferred.resolve = function() { deferred.resolveWith(...) }
4002                         // deferred.reject = function() { deferred.rejectWith(...) }
4003                         deferred[ tuple[ 0 ] ] = function() {
4004                                 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
4005                                 return this;
4006                         };
4008                         // deferred.notifyWith = list.fireWith
4009                         // deferred.resolveWith = list.fireWith
4010                         // deferred.rejectWith = list.fireWith
4011                         deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
4012                 } );
4014                 // Make the deferred a promise
4015                 promise.promise( deferred );
4017                 // Call given func if any
4018                 if ( func ) {
4019                         func.call( deferred, deferred );
4020                 }
4022                 // All done!
4023                 return deferred;
4024         },
4026         // Deferred helper
4027         when: function( singleValue ) {
4028                 var
4030                         // count of uncompleted subordinates
4031                         remaining = arguments.length,
4033                         // count of unprocessed arguments
4034                         i = remaining,
4036                         // subordinate fulfillment data
4037                         resolveContexts = Array( i ),
4038                         resolveValues = slice.call( arguments ),
4040                         // the primary Deferred
4041                         primary = jQuery.Deferred(),
4043                         // subordinate callback factory
4044                         updateFunc = function( i ) {
4045                                 return function( value ) {
4046                                         resolveContexts[ i ] = this;
4047                                         resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
4048                                         if ( !( --remaining ) ) {
4049                                                 primary.resolveWith( resolveContexts, resolveValues );
4050                                         }
4051                                 };
4052                         };
4054                 // Single- and empty arguments are adopted like Promise.resolve
4055                 if ( remaining <= 1 ) {
4056                         adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
4057                                 !remaining );
4059                         // Use .then() to unwrap secondary thenables (cf. gh-3000)
4060                         if ( primary.state() === "pending" ||
4061                                 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
4063                                 return primary.then();
4064                         }
4065                 }
4067                 // Multiple arguments are aggregated like Promise.all array elements
4068                 while ( i-- ) {
4069                         adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
4070                 }
4072                 return primary.promise();
4073         }
4074 } );
4077 // These usually indicate a programmer mistake during development,
4078 // warn about them ASAP rather than swallowing them by default.
4079 var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
4081 jQuery.Deferred.exceptionHook = function( error, stack ) {
4083         // Support: IE 8 - 9 only
4084         // Console exists when dev tools are open, which can happen at any time
4085         if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
4086                 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
4087         }
4093 jQuery.readyException = function( error ) {
4094         window.setTimeout( function() {
4095                 throw error;
4096         } );
4102 // The deferred used on DOM ready
4103 var readyList = jQuery.Deferred();
4105 jQuery.fn.ready = function( fn ) {
4107         readyList
4108                 .then( fn )
4110                 // Wrap jQuery.readyException in a function so that the lookup
4111                 // happens at the time of error handling instead of callback
4112                 // registration.
4113                 .catch( function( error ) {
4114                         jQuery.readyException( error );
4115                 } );
4117         return this;
4120 jQuery.extend( {
4122         // Is the DOM ready to be used? Set to true once it occurs.
4123         isReady: false,
4125         // A counter to track how many items to wait for before
4126         // the ready event fires. See trac-6781
4127         readyWait: 1,
4129         // Handle when the DOM is ready
4130         ready: function( wait ) {
4132                 // Abort if there are pending holds or we're already ready
4133                 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
4134                         return;
4135                 }
4137                 // Remember that the DOM is ready
4138                 jQuery.isReady = true;
4140                 // If a normal DOM Ready event fired, decrement, and wait if need be
4141                 if ( wait !== true && --jQuery.readyWait > 0 ) {
4142                         return;
4143                 }
4145                 // If there are functions bound, to execute
4146                 readyList.resolveWith( document, [ jQuery ] );
4147         }
4148 } );
4150 jQuery.ready.then = readyList.then;
4152 // The ready event handler and self cleanup method
4153 function completed() {
4154         document.removeEventListener( "DOMContentLoaded", completed );
4155         window.removeEventListener( "load", completed );
4156         jQuery.ready();
4159 // Catch cases where $(document).ready() is called
4160 // after the browser event has already occurred.
4161 // Support: IE <=9 - 10 only
4162 // Older IE sometimes signals "interactive" too soon
4163 if ( document.readyState === "complete" ||
4164         ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
4166         // Handle it asynchronously to allow scripts the opportunity to delay ready
4167         window.setTimeout( jQuery.ready );
4169 } else {
4171         // Use the handy event callback
4172         document.addEventListener( "DOMContentLoaded", completed );
4174         // A fallback to window.onload, that will always work
4175         window.addEventListener( "load", completed );
4181 // Multifunctional method to get and set values of a collection
4182 // The value/s can optionally be executed if it's a function
4183 var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4184         var i = 0,
4185                 len = elems.length,
4186                 bulk = key == null;
4188         // Sets many values
4189         if ( toType( key ) === "object" ) {
4190                 chainable = true;
4191                 for ( i in key ) {
4192                         access( elems, fn, i, key[ i ], true, emptyGet, raw );
4193                 }
4195         // Sets one value
4196         } else if ( value !== undefined ) {
4197                 chainable = true;
4199                 if ( !isFunction( value ) ) {
4200                         raw = true;
4201                 }
4203                 if ( bulk ) {
4205                         // Bulk operations run against the entire set
4206                         if ( raw ) {
4207                                 fn.call( elems, value );
4208                                 fn = null;
4210                         // ...except when executing function values
4211                         } else {
4212                                 bulk = fn;
4213                                 fn = function( elem, _key, value ) {
4214                                         return bulk.call( jQuery( elem ), value );
4215                                 };
4216                         }
4217                 }
4219                 if ( fn ) {
4220                         for ( ; i < len; i++ ) {
4221                                 fn(
4222                                         elems[ i ], key, raw ?
4223                                                 value :
4224                                                 value.call( elems[ i ], i, fn( elems[ i ], key ) )
4225                                 );
4226                         }
4227                 }
4228         }
4230         if ( chainable ) {
4231                 return elems;
4232         }
4234         // Gets
4235         if ( bulk ) {
4236                 return fn.call( elems );
4237         }
4239         return len ? fn( elems[ 0 ], key ) : emptyGet;
4243 // Matches dashed string for camelizing
4244 var rmsPrefix = /^-ms-/,
4245         rdashAlpha = /-([a-z])/g;
4247 // Used by camelCase as callback to replace()
4248 function fcamelCase( _all, letter ) {
4249         return letter.toUpperCase();
4252 // Convert dashed to camelCase; used by the css and data modules
4253 // Support: IE <=9 - 11, Edge 12 - 15
4254 // Microsoft forgot to hump their vendor prefix (trac-9572)
4255 function camelCase( string ) {
4256         return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4258 var acceptData = function( owner ) {
4260         // Accepts only:
4261         //  - Node
4262         //    - Node.ELEMENT_NODE
4263         //    - Node.DOCUMENT_NODE
4264         //  - Object
4265         //    - Any
4266         return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
4272 function Data() {
4273         this.expando = jQuery.expando + Data.uid++;
4276 Data.uid = 1;
4278 Data.prototype = {
4280         cache: function( owner ) {
4282                 // Check if the owner object already has a cache
4283                 var value = owner[ this.expando ];
4285                 // If not, create one
4286                 if ( !value ) {
4287                         value = {};
4289                         // We can accept data for non-element nodes in modern browsers,
4290                         // but we should not, see trac-8335.
4291                         // Always return an empty object.
4292                         if ( acceptData( owner ) ) {
4294                                 // If it is a node unlikely to be stringify-ed or looped over
4295                                 // use plain assignment
4296                                 if ( owner.nodeType ) {
4297                                         owner[ this.expando ] = value;
4299                                 // Otherwise secure it in a non-enumerable property
4300                                 // configurable must be true to allow the property to be
4301                                 // deleted when data is removed
4302                                 } else {
4303                                         Object.defineProperty( owner, this.expando, {
4304                                                 value: value,
4305                                                 configurable: true
4306                                         } );
4307                                 }
4308                         }
4309                 }
4311                 return value;
4312         },
4313         set: function( owner, data, value ) {
4314                 var prop,
4315                         cache = this.cache( owner );
4317                 // Handle: [ owner, key, value ] args
4318                 // Always use camelCase key (gh-2257)
4319                 if ( typeof data === "string" ) {
4320                         cache[ camelCase( data ) ] = value;
4322                 // Handle: [ owner, { properties } ] args
4323                 } else {
4325                         // Copy the properties one-by-one to the cache object
4326                         for ( prop in data ) {
4327                                 cache[ camelCase( prop ) ] = data[ prop ];
4328                         }
4329                 }
4330                 return cache;
4331         },
4332         get: function( owner, key ) {
4333                 return key === undefined ?
4334                         this.cache( owner ) :
4336                         // Always use camelCase key (gh-2257)
4337                         owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
4338         },
4339         access: function( owner, key, value ) {
4341                 // In cases where either:
4342                 //
4343                 //   1. No key was specified
4344                 //   2. A string key was specified, but no value provided
4345                 //
4346                 // Take the "read" path and allow the get method to determine
4347                 // which value to return, respectively either:
4348                 //
4349                 //   1. The entire cache object
4350                 //   2. The data stored at the key
4351                 //
4352                 if ( key === undefined ||
4353                                 ( ( key && typeof key === "string" ) && value === undefined ) ) {
4355                         return this.get( owner, key );
4356                 }
4358                 // When the key is not a string, or both a key and value
4359                 // are specified, set or extend (existing objects) with either:
4360                 //
4361                 //   1. An object of properties
4362                 //   2. A key and value
4363                 //
4364                 this.set( owner, key, value );
4366                 // Since the "set" path can have two possible entry points
4367                 // return the expected data based on which path was taken[*]
4368                 return value !== undefined ? value : key;
4369         },
4370         remove: function( owner, key ) {
4371                 var i,
4372                         cache = owner[ this.expando ];
4374                 if ( cache === undefined ) {
4375                         return;
4376                 }
4378                 if ( key !== undefined ) {
4380                         // Support array or space separated string of keys
4381                         if ( Array.isArray( key ) ) {
4383                                 // If key is an array of keys...
4384                                 // We always set camelCase keys, so remove that.
4385                                 key = key.map( camelCase );
4386                         } else {
4387                                 key = camelCase( key );
4389                                 // If a key with the spaces exists, use it.
4390                                 // Otherwise, create an array by matching non-whitespace
4391                                 key = key in cache ?
4392                                         [ key ] :
4393                                         ( key.match( rnothtmlwhite ) || [] );
4394                         }
4396                         i = key.length;
4398                         while ( i-- ) {
4399                                 delete cache[ key[ i ] ];
4400                         }
4401                 }
4403                 // Remove the expando if there's no more data
4404                 if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
4406                         // Support: Chrome <=35 - 45
4407                         // Webkit & Blink performance suffers when deleting properties
4408                         // from DOM nodes, so set to undefined instead
4409                         // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
4410                         if ( owner.nodeType ) {
4411                                 owner[ this.expando ] = undefined;
4412                         } else {
4413                                 delete owner[ this.expando ];
4414                         }
4415                 }
4416         },
4417         hasData: function( owner ) {
4418                 var cache = owner[ this.expando ];
4419                 return cache !== undefined && !jQuery.isEmptyObject( cache );
4420         }
4422 var dataPriv = new Data();
4424 var dataUser = new Data();
4428 //      Implementation Summary
4430 //      1. Enforce API surface and semantic compatibility with 1.9.x branch
4431 //      2. Improve the module's maintainability by reducing the storage
4432 //              paths to a single mechanism.
4433 //      3. Use the same single mechanism to support "private" and "user" data.
4434 //      4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
4435 //      5. Avoid exposing implementation details on user objects (eg. expando properties)
4436 //      6. Provide a clear path for implementation upgrade to WeakMap in 2014
4438 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
4439         rmultiDash = /[A-Z]/g;
4441 function getData( data ) {
4442         if ( data === "true" ) {
4443                 return true;
4444         }
4446         if ( data === "false" ) {
4447                 return false;
4448         }
4450         if ( data === "null" ) {
4451                 return null;
4452         }
4454         // Only convert to a number if it doesn't change the string
4455         if ( data === +data + "" ) {
4456                 return +data;
4457         }
4459         if ( rbrace.test( data ) ) {
4460                 return JSON.parse( data );
4461         }
4463         return data;
4466 function dataAttr( elem, key, data ) {
4467         var name;
4469         // If nothing was found internally, try to fetch any
4470         // data from the HTML5 data-* attribute
4471         if ( data === undefined && elem.nodeType === 1 ) {
4472                 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
4473                 data = elem.getAttribute( name );
4475                 if ( typeof data === "string" ) {
4476                         try {
4477                                 data = getData( data );
4478                         } catch ( e ) {}
4480                         // Make sure we set the data so it isn't changed later
4481                         dataUser.set( elem, key, data );
4482                 } else {
4483                         data = undefined;
4484                 }
4485         }
4486         return data;
4489 jQuery.extend( {
4490         hasData: function( elem ) {
4491                 return dataUser.hasData( elem ) || dataPriv.hasData( elem );
4492         },
4494         data: function( elem, name, data ) {
4495                 return dataUser.access( elem, name, data );
4496         },
4498         removeData: function( elem, name ) {
4499                 dataUser.remove( elem, name );
4500         },
4502         // TODO: Now that all calls to _data and _removeData have been replaced
4503         // with direct calls to dataPriv methods, these can be deprecated.
4504         _data: function( elem, name, data ) {
4505                 return dataPriv.access( elem, name, data );
4506         },
4508         _removeData: function( elem, name ) {
4509                 dataPriv.remove( elem, name );
4510         }
4511 } );
4513 jQuery.fn.extend( {
4514         data: function( key, value ) {
4515                 var i, name, data,
4516                         elem = this[ 0 ],
4517                         attrs = elem && elem.attributes;
4519                 // Gets all values
4520                 if ( key === undefined ) {
4521                         if ( this.length ) {
4522                                 data = dataUser.get( elem );
4524                                 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
4525                                         i = attrs.length;
4526                                         while ( i-- ) {
4528                                                 // Support: IE 11 only
4529                                                 // The attrs elements can be null (trac-14894)
4530                                                 if ( attrs[ i ] ) {
4531                                                         name = attrs[ i ].name;
4532                                                         if ( name.indexOf( "data-" ) === 0 ) {
4533                                                                 name = camelCase( name.slice( 5 ) );
4534                                                                 dataAttr( elem, name, data[ name ] );
4535                                                         }
4536                                                 }
4537                                         }
4538                                         dataPriv.set( elem, "hasDataAttrs", true );
4539                                 }
4540                         }
4542                         return data;
4543                 }
4545                 // Sets multiple values
4546                 if ( typeof key === "object" ) {
4547                         return this.each( function() {
4548                                 dataUser.set( this, key );
4549                         } );
4550                 }
4552                 return access( this, function( value ) {
4553                         var data;
4555                         // The calling jQuery object (element matches) is not empty
4556                         // (and therefore has an element appears at this[ 0 ]) and the
4557                         // `value` parameter was not undefined. An empty jQuery object
4558                         // will result in `undefined` for elem = this[ 0 ] which will
4559                         // throw an exception if an attempt to read a data cache is made.
4560                         if ( elem && value === undefined ) {
4562                                 // Attempt to get data from the cache
4563                                 // The key will always be camelCased in Data
4564                                 data = dataUser.get( elem, key );
4565                                 if ( data !== undefined ) {
4566                                         return data;
4567                                 }
4569                                 // Attempt to "discover" the data in
4570                                 // HTML5 custom data-* attrs
4571                                 data = dataAttr( elem, key );
4572                                 if ( data !== undefined ) {
4573                                         return data;
4574                                 }
4576                                 // We tried really hard, but the data doesn't exist.
4577                                 return;
4578                         }
4580                         // Set the data...
4581                         this.each( function() {
4583                                 // We always store the camelCased key
4584                                 dataUser.set( this, key, value );
4585                         } );
4586                 }, null, value, arguments.length > 1, null, true );
4587         },
4589         removeData: function( key ) {
4590                 return this.each( function() {
4591                         dataUser.remove( this, key );
4592                 } );
4593         }
4594 } );
4597 jQuery.extend( {
4598         queue: function( elem, type, data ) {
4599                 var queue;
4601                 if ( elem ) {
4602                         type = ( type || "fx" ) + "queue";
4603                         queue = dataPriv.get( elem, type );
4605                         // Speed up dequeue by getting out quickly if this is just a lookup
4606                         if ( data ) {
4607                                 if ( !queue || Array.isArray( data ) ) {
4608                                         queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
4609                                 } else {
4610                                         queue.push( data );
4611                                 }
4612                         }
4613                         return queue || [];
4614                 }
4615         },
4617         dequeue: function( elem, type ) {
4618                 type = type || "fx";
4620                 var queue = jQuery.queue( elem, type ),
4621                         startLength = queue.length,
4622                         fn = queue.shift(),
4623                         hooks = jQuery._queueHooks( elem, type ),
4624                         next = function() {
4625                                 jQuery.dequeue( elem, type );
4626                         };
4628                 // If the fx queue is dequeued, always remove the progress sentinel
4629                 if ( fn === "inprogress" ) {
4630                         fn = queue.shift();
4631                         startLength--;
4632                 }
4634                 if ( fn ) {
4636                         // Add a progress sentinel to prevent the fx queue from being
4637                         // automatically dequeued
4638                         if ( type === "fx" ) {
4639                                 queue.unshift( "inprogress" );
4640                         }
4642                         // Clear up the last queue stop function
4643                         delete hooks.stop;
4644                         fn.call( elem, next, hooks );
4645                 }
4647                 if ( !startLength && hooks ) {
4648                         hooks.empty.fire();
4649                 }
4650         },
4652         // Not public - generate a queueHooks object, or return the current one
4653         _queueHooks: function( elem, type ) {
4654                 var key = type + "queueHooks";
4655                 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
4656                         empty: jQuery.Callbacks( "once memory" ).add( function() {
4657                                 dataPriv.remove( elem, [ type + "queue", key ] );
4658                         } )
4659                 } );
4660         }
4661 } );
4663 jQuery.fn.extend( {
4664         queue: function( type, data ) {
4665                 var setter = 2;
4667                 if ( typeof type !== "string" ) {
4668                         data = type;
4669                         type = "fx";
4670                         setter--;
4671                 }
4673                 if ( arguments.length < setter ) {
4674                         return jQuery.queue( this[ 0 ], type );
4675                 }
4677                 return data === undefined ?
4678                         this :
4679                         this.each( function() {
4680                                 var queue = jQuery.queue( this, type, data );
4682                                 // Ensure a hooks for this queue
4683                                 jQuery._queueHooks( this, type );
4685                                 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
4686                                         jQuery.dequeue( this, type );
4687                                 }
4688                         } );
4689         },
4690         dequeue: function( type ) {
4691                 return this.each( function() {
4692                         jQuery.dequeue( this, type );
4693                 } );
4694         },
4695         clearQueue: function( type ) {
4696                 return this.queue( type || "fx", [] );
4697         },
4699         // Get a promise resolved when queues of a certain type
4700         // are emptied (fx is the type by default)
4701         promise: function( type, obj ) {
4702                 var tmp,
4703                         count = 1,
4704                         defer = jQuery.Deferred(),
4705                         elements = this,
4706                         i = this.length,
4707                         resolve = function() {
4708                                 if ( !( --count ) ) {
4709                                         defer.resolveWith( elements, [ elements ] );
4710                                 }
4711                         };
4713                 if ( typeof type !== "string" ) {
4714                         obj = type;
4715                         type = undefined;
4716                 }
4717                 type = type || "fx";
4719                 while ( i-- ) {
4720                         tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
4721                         if ( tmp && tmp.empty ) {
4722                                 count++;
4723                                 tmp.empty.add( resolve );
4724                         }
4725                 }
4726                 resolve();
4727                 return defer.promise( obj );
4728         }
4729 } );
4730 var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
4732 var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
4735 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4737 var documentElement = document.documentElement;
4741         var isAttached = function( elem ) {
4742                         return jQuery.contains( elem.ownerDocument, elem );
4743                 },
4744                 composed = { composed: true };
4746         // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
4747         // Check attachment across shadow DOM boundaries when possible (gh-3504)
4748         // Support: iOS 10.0-10.2 only
4749         // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
4750         // leading to errors. We need to check for `getRootNode`.
4751         if ( documentElement.getRootNode ) {
4752                 isAttached = function( elem ) {
4753                         return jQuery.contains( elem.ownerDocument, elem ) ||
4754                                 elem.getRootNode( composed ) === elem.ownerDocument;
4755                 };
4756         }
4757 var isHiddenWithinTree = function( elem, el ) {
4759                 // isHiddenWithinTree might be called from jQuery#filter function;
4760                 // in that case, element will be second argument
4761                 elem = el || elem;
4763                 // Inline style trumps all
4764                 return elem.style.display === "none" ||
4765                         elem.style.display === "" &&
4767                         // Otherwise, check computed style
4768                         // Support: Firefox <=43 - 45
4769                         // Disconnected elements can have computed display: none, so first confirm that elem is
4770                         // in the document.
4771                         isAttached( elem ) &&
4773                         jQuery.css( elem, "display" ) === "none";
4774         };
4778 function adjustCSS( elem, prop, valueParts, tween ) {
4779         var adjusted, scale,
4780                 maxIterations = 20,
4781                 currentValue = tween ?
4782                         function() {
4783                                 return tween.cur();
4784                         } :
4785                         function() {
4786                                 return jQuery.css( elem, prop, "" );
4787                         },
4788                 initial = currentValue(),
4789                 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
4791                 // Starting value computation is required for potential unit mismatches
4792                 initialInUnit = elem.nodeType &&
4793                         ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
4794                         rcssNum.exec( jQuery.css( elem, prop ) );
4796         if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
4798                 // Support: Firefox <=54
4799                 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
4800                 initial = initial / 2;
4802                 // Trust units reported by jQuery.css
4803                 unit = unit || initialInUnit[ 3 ];
4805                 // Iteratively approximate from a nonzero starting point
4806                 initialInUnit = +initial || 1;
4808                 while ( maxIterations-- ) {
4810                         // Evaluate and update our best guess (doubling guesses that zero out).
4811                         // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
4812                         jQuery.style( elem, prop, initialInUnit + unit );
4813                         if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
4814                                 maxIterations = 0;
4815                         }
4816                         initialInUnit = initialInUnit / scale;
4818                 }
4820                 initialInUnit = initialInUnit * 2;
4821                 jQuery.style( elem, prop, initialInUnit + unit );
4823                 // Make sure we update the tween properties later on
4824                 valueParts = valueParts || [];
4825         }
4827         if ( valueParts ) {
4828                 initialInUnit = +initialInUnit || +initial || 0;
4830                 // Apply relative offset (+=/-=) if specified
4831                 adjusted = valueParts[ 1 ] ?
4832                         initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
4833                         +valueParts[ 2 ];
4834                 if ( tween ) {
4835                         tween.unit = unit;
4836                         tween.start = initialInUnit;
4837                         tween.end = adjusted;
4838                 }
4839         }
4840         return adjusted;
4844 var defaultDisplayMap = {};
4846 function getDefaultDisplay( elem ) {
4847         var temp,
4848                 doc = elem.ownerDocument,
4849                 nodeName = elem.nodeName,
4850                 display = defaultDisplayMap[ nodeName ];
4852         if ( display ) {
4853                 return display;
4854         }
4856         temp = doc.body.appendChild( doc.createElement( nodeName ) );
4857         display = jQuery.css( temp, "display" );
4859         temp.parentNode.removeChild( temp );
4861         if ( display === "none" ) {
4862                 display = "block";
4863         }
4864         defaultDisplayMap[ nodeName ] = display;
4866         return display;
4869 function showHide( elements, show ) {
4870         var display, elem,
4871                 values = [],
4872                 index = 0,
4873                 length = elements.length;
4875         // Determine new display value for elements that need to change
4876         for ( ; index < length; index++ ) {
4877                 elem = elements[ index ];
4878                 if ( !elem.style ) {
4879                         continue;
4880                 }
4882                 display = elem.style.display;
4883                 if ( show ) {
4885                         // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
4886                         // check is required in this first loop unless we have a nonempty display value (either
4887                         // inline or about-to-be-restored)
4888                         if ( display === "none" ) {
4889                                 values[ index ] = dataPriv.get( elem, "display" ) || null;
4890                                 if ( !values[ index ] ) {
4891                                         elem.style.display = "";
4892                                 }
4893                         }
4894                         if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
4895                                 values[ index ] = getDefaultDisplay( elem );
4896                         }
4897                 } else {
4898                         if ( display !== "none" ) {
4899                                 values[ index ] = "none";
4901                                 // Remember what we're overwriting
4902                                 dataPriv.set( elem, "display", display );
4903                         }
4904                 }
4905         }
4907         // Set the display of the elements in a second loop to avoid constant reflow
4908         for ( index = 0; index < length; index++ ) {
4909                 if ( values[ index ] != null ) {
4910                         elements[ index ].style.display = values[ index ];
4911                 }
4912         }
4914         return elements;
4917 jQuery.fn.extend( {
4918         show: function() {
4919                 return showHide( this, true );
4920         },
4921         hide: function() {
4922                 return showHide( this );
4923         },
4924         toggle: function( state ) {
4925                 if ( typeof state === "boolean" ) {
4926                         return state ? this.show() : this.hide();
4927                 }
4929                 return this.each( function() {
4930                         if ( isHiddenWithinTree( this ) ) {
4931                                 jQuery( this ).show();
4932                         } else {
4933                                 jQuery( this ).hide();
4934                         }
4935                 } );
4936         }
4937 } );
4938 var rcheckableType = ( /^(?:checkbox|radio)$/i );
4940 var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
4942 var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4946 ( function() {
4947         var fragment = document.createDocumentFragment(),
4948                 div = fragment.appendChild( document.createElement( "div" ) ),
4949                 input = document.createElement( "input" );
4951         // Support: Android 4.0 - 4.3 only
4952         // Check state lost if the name is set (trac-11217)
4953         // Support: Windows Web Apps (WWA)
4954         // `name` and `type` must use .setAttribute for WWA (trac-14901)
4955         input.setAttribute( "type", "radio" );
4956         input.setAttribute( "checked", "checked" );
4957         input.setAttribute( "name", "t" );
4959         div.appendChild( input );
4961         // Support: Android <=4.1 only
4962         // Older WebKit doesn't clone checked state correctly in fragments
4963         support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4965         // Support: IE <=11 only
4966         // Make sure textarea (and checkbox) defaultValue is properly cloned
4967         div.innerHTML = "<textarea>x</textarea>";
4968         support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4970         // Support: IE <=9 only
4971         // IE <=9 replaces <option> tags with their contents when inserted outside of
4972         // the select element.
4973         div.innerHTML = "<option></option>";
4974         support.option = !!div.lastChild;
4975 } )();
4978 // We have to close these tags to support XHTML (trac-13200)
4979 var wrapMap = {
4981         // XHTML parsers do not magically insert elements in the
4982         // same way that tag soup parsers do. So we cannot shorten
4983         // this by omitting <tbody> or other required elements.
4984         thead: [ 1, "<table>", "</table>" ],
4985         col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
4986         tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4987         td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4989         _default: [ 0, "", "" ]
4992 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4993 wrapMap.th = wrapMap.td;
4995 // Support: IE <=9 only
4996 if ( !support.option ) {
4997         wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
5001 function getAll( context, tag ) {
5003         // Support: IE <=9 - 11 only
5004         // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
5005         var ret;
5007         if ( typeof context.getElementsByTagName !== "undefined" ) {
5008                 ret = context.getElementsByTagName( tag || "*" );
5010         } else if ( typeof context.querySelectorAll !== "undefined" ) {
5011                 ret = context.querySelectorAll( tag || "*" );
5013         } else {
5014                 ret = [];
5015         }
5017         if ( tag === undefined || tag && nodeName( context, tag ) ) {
5018                 return jQuery.merge( [ context ], ret );
5019         }
5021         return ret;
5025 // Mark scripts as having already been evaluated
5026 function setGlobalEval( elems, refElements ) {
5027         var i = 0,
5028                 l = elems.length;
5030         for ( ; i < l; i++ ) {
5031                 dataPriv.set(
5032                         elems[ i ],
5033                         "globalEval",
5034                         !refElements || dataPriv.get( refElements[ i ], "globalEval" )
5035                 );
5036         }
5040 var rhtml = /<|&#?\w+;/;
5042 function buildFragment( elems, context, scripts, selection, ignored ) {
5043         var elem, tmp, tag, wrap, attached, j,
5044                 fragment = context.createDocumentFragment(),
5045                 nodes = [],
5046                 i = 0,
5047                 l = elems.length;
5049         for ( ; i < l; i++ ) {
5050                 elem = elems[ i ];
5052                 if ( elem || elem === 0 ) {
5054                         // Add nodes directly
5055                         if ( toType( elem ) === "object" ) {
5057                                 // Support: Android <=4.0 only, PhantomJS 1 only
5058                                 // push.apply(_, arraylike) throws on ancient WebKit
5059                                 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
5061                         // Convert non-html into a text node
5062                         } else if ( !rhtml.test( elem ) ) {
5063                                 nodes.push( context.createTextNode( elem ) );
5065                         // Convert html into DOM nodes
5066                         } else {
5067                                 tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
5069                                 // Deserialize a standard representation
5070                                 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
5071                                 wrap = wrapMap[ tag ] || wrapMap._default;
5072                                 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
5074                                 // Descend through wrappers to the right content
5075                                 j = wrap[ 0 ];
5076                                 while ( j-- ) {
5077                                         tmp = tmp.lastChild;
5078                                 }
5080                                 // Support: Android <=4.0 only, PhantomJS 1 only
5081                                 // push.apply(_, arraylike) throws on ancient WebKit
5082                                 jQuery.merge( nodes, tmp.childNodes );
5084                                 // Remember the top-level container
5085                                 tmp = fragment.firstChild;
5087                                 // Ensure the created nodes are orphaned (trac-12392)
5088                                 tmp.textContent = "";
5089                         }
5090                 }
5091         }
5093         // Remove wrapper from fragment
5094         fragment.textContent = "";
5096         i = 0;
5097         while ( ( elem = nodes[ i++ ] ) ) {
5099                 // Skip elements already in the context collection (trac-4087)
5100                 if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
5101                         if ( ignored ) {
5102                                 ignored.push( elem );
5103                         }
5104                         continue;
5105                 }
5107                 attached = isAttached( elem );
5109                 // Append to fragment
5110                 tmp = getAll( fragment.appendChild( elem ), "script" );
5112                 // Preserve script evaluation history
5113                 if ( attached ) {
5114                         setGlobalEval( tmp );
5115                 }
5117                 // Capture executables
5118                 if ( scripts ) {
5119                         j = 0;
5120                         while ( ( elem = tmp[ j++ ] ) ) {
5121                                 if ( rscriptType.test( elem.type || "" ) ) {
5122                                         scripts.push( elem );
5123                                 }
5124                         }
5125                 }
5126         }
5128         return fragment;
5132 var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5134 function returnTrue() {
5135         return true;
5138 function returnFalse() {
5139         return false;
5142 // Support: IE <=9 - 11+
5143 // focus() and blur() are asynchronous, except when they are no-op.
5144 // So expect focus to be synchronous when the element is already active,
5145 // and blur to be synchronous when the element is not already active.
5146 // (focus and blur are always synchronous in other supported browsers,
5147 // this just defines when we can count on it).
5148 function expectSync( elem, type ) {
5149         return ( elem === safeActiveElement() ) === ( type === "focus" );
5152 // Support: IE <=9 only
5153 // Accessing document.activeElement can throw unexpectedly
5154 // https://bugs.jquery.com/ticket/13393
5155 function safeActiveElement() {
5156         try {
5157                 return document.activeElement;
5158         } catch ( err ) { }
5161 function on( elem, types, selector, data, fn, one ) {
5162         var origFn, type;
5164         // Types can be a map of types/handlers
5165         if ( typeof types === "object" ) {
5167                 // ( types-Object, selector, data )
5168                 if ( typeof selector !== "string" ) {
5170                         // ( types-Object, data )
5171                         data = data || selector;
5172                         selector = undefined;
5173                 }
5174                 for ( type in types ) {
5175                         on( elem, type, selector, data, types[ type ], one );
5176                 }
5177                 return elem;
5178         }
5180         if ( data == null && fn == null ) {
5182                 // ( types, fn )
5183                 fn = selector;
5184                 data = selector = undefined;
5185         } else if ( fn == null ) {
5186                 if ( typeof selector === "string" ) {
5188                         // ( types, selector, fn )
5189                         fn = data;
5190                         data = undefined;
5191                 } else {
5193                         // ( types, data, fn )
5194                         fn = data;
5195                         data = selector;
5196                         selector = undefined;
5197                 }
5198         }
5199         if ( fn === false ) {
5200                 fn = returnFalse;
5201         } else if ( !fn ) {
5202                 return elem;
5203         }
5205         if ( one === 1 ) {
5206                 origFn = fn;
5207                 fn = function( event ) {
5209                         // Can use an empty set, since event contains the info
5210                         jQuery().off( event );
5211                         return origFn.apply( this, arguments );
5212                 };
5214                 // Use same guid so caller can remove using origFn
5215                 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5216         }
5217         return elem.each( function() {
5218                 jQuery.event.add( this, types, fn, data, selector );
5219         } );
5223  * Helper functions for managing events -- not part of the public interface.
5224  * Props to Dean Edwards' addEvent library for many of the ideas.
5225  */
5226 jQuery.event = {
5228         global: {},
5230         add: function( elem, types, handler, data, selector ) {
5232                 var handleObjIn, eventHandle, tmp,
5233                         events, t, handleObj,
5234                         special, handlers, type, namespaces, origType,
5235                         elemData = dataPriv.get( elem );
5237                 // Only attach events to objects that accept data
5238                 if ( !acceptData( elem ) ) {
5239                         return;
5240                 }
5242                 // Caller can pass in an object of custom data in lieu of the handler
5243                 if ( handler.handler ) {
5244                         handleObjIn = handler;
5245                         handler = handleObjIn.handler;
5246                         selector = handleObjIn.selector;
5247                 }
5249                 // Ensure that invalid selectors throw exceptions at attach time
5250                 // Evaluate against documentElement in case elem is a non-element node (e.g., document)
5251                 if ( selector ) {
5252                         jQuery.find.matchesSelector( documentElement, selector );
5253                 }
5255                 // Make sure that the handler has a unique ID, used to find/remove it later
5256                 if ( !handler.guid ) {
5257                         handler.guid = jQuery.guid++;
5258                 }
5260                 // Init the element's event structure and main handler, if this is the first
5261                 if ( !( events = elemData.events ) ) {
5262                         events = elemData.events = Object.create( null );
5263                 }
5264                 if ( !( eventHandle = elemData.handle ) ) {
5265                         eventHandle = elemData.handle = function( e ) {
5267                                 // Discard the second event of a jQuery.event.trigger() and
5268                                 // when an event is called after a page has unloaded
5269                                 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
5270                                         jQuery.event.dispatch.apply( elem, arguments ) : undefined;
5271                         };
5272                 }
5274                 // Handle multiple events separated by a space
5275                 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5276                 t = types.length;
5277                 while ( t-- ) {
5278                         tmp = rtypenamespace.exec( types[ t ] ) || [];
5279                         type = origType = tmp[ 1 ];
5280                         namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5282                         // There *must* be a type, no attaching namespace-only handlers
5283                         if ( !type ) {
5284                                 continue;
5285                         }
5287                         // If event changes its type, use the special event handlers for the changed type
5288                         special = jQuery.event.special[ type ] || {};
5290                         // If selector defined, determine special event api type, otherwise given type
5291                         type = ( selector ? special.delegateType : special.bindType ) || type;
5293                         // Update special based on newly reset type
5294                         special = jQuery.event.special[ type ] || {};
5296                         // handleObj is passed to all event handlers
5297                         handleObj = jQuery.extend( {
5298                                 type: type,
5299                                 origType: origType,
5300                                 data: data,
5301                                 handler: handler,
5302                                 guid: handler.guid,
5303                                 selector: selector,
5304                                 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
5305                                 namespace: namespaces.join( "." )
5306                         }, handleObjIn );
5308                         // Init the event handler queue if we're the first
5309                         if ( !( handlers = events[ type ] ) ) {
5310                                 handlers = events[ type ] = [];
5311                                 handlers.delegateCount = 0;
5313                                 // Only use addEventListener if the special events handler returns false
5314                                 if ( !special.setup ||
5315                                         special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
5317                                         if ( elem.addEventListener ) {
5318                                                 elem.addEventListener( type, eventHandle );
5319                                         }
5320                                 }
5321                         }
5323                         if ( special.add ) {
5324                                 special.add.call( elem, handleObj );
5326                                 if ( !handleObj.handler.guid ) {
5327                                         handleObj.handler.guid = handler.guid;
5328                                 }
5329                         }
5331                         // Add to the element's handler list, delegates in front
5332                         if ( selector ) {
5333                                 handlers.splice( handlers.delegateCount++, 0, handleObj );
5334                         } else {
5335                                 handlers.push( handleObj );
5336                         }
5338                         // Keep track of which events have ever been used, for event optimization
5339                         jQuery.event.global[ type ] = true;
5340                 }
5342         },
5344         // Detach an event or set of events from an element
5345         remove: function( elem, types, handler, selector, mappedTypes ) {
5347                 var j, origCount, tmp,
5348                         events, t, handleObj,
5349                         special, handlers, type, namespaces, origType,
5350                         elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
5352                 if ( !elemData || !( events = elemData.events ) ) {
5353                         return;
5354                 }
5356                 // Once for each type.namespace in types; type may be omitted
5357                 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5358                 t = types.length;
5359                 while ( t-- ) {
5360                         tmp = rtypenamespace.exec( types[ t ] ) || [];
5361                         type = origType = tmp[ 1 ];
5362                         namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5364                         // Unbind all events (on this namespace, if provided) for the element
5365                         if ( !type ) {
5366                                 for ( type in events ) {
5367                                         jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
5368                                 }
5369                                 continue;
5370                         }
5372                         special = jQuery.event.special[ type ] || {};
5373                         type = ( selector ? special.delegateType : special.bindType ) || type;
5374                         handlers = events[ type ] || [];
5375                         tmp = tmp[ 2 ] &&
5376                                 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
5378                         // Remove matching events
5379                         origCount = j = handlers.length;
5380                         while ( j-- ) {
5381                                 handleObj = handlers[ j ];
5383                                 if ( ( mappedTypes || origType === handleObj.origType ) &&
5384                                         ( !handler || handler.guid === handleObj.guid ) &&
5385                                         ( !tmp || tmp.test( handleObj.namespace ) ) &&
5386                                         ( !selector || selector === handleObj.selector ||
5387                                                 selector === "**" && handleObj.selector ) ) {
5388                                         handlers.splice( j, 1 );
5390                                         if ( handleObj.selector ) {
5391                                                 handlers.delegateCount--;
5392                                         }
5393                                         if ( special.remove ) {
5394                                                 special.remove.call( elem, handleObj );
5395                                         }
5396                                 }
5397                         }
5399                         // Remove generic event handler if we removed something and no more handlers exist
5400                         // (avoids potential for endless recursion during removal of special event handlers)
5401                         if ( origCount && !handlers.length ) {
5402                                 if ( !special.teardown ||
5403                                         special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
5405                                         jQuery.removeEvent( elem, type, elemData.handle );
5406                                 }
5408                                 delete events[ type ];
5409                         }
5410                 }
5412                 // Remove data and the expando if it's no longer used
5413                 if ( jQuery.isEmptyObject( events ) ) {
5414                         dataPriv.remove( elem, "handle events" );
5415                 }
5416         },
5418         dispatch: function( nativeEvent ) {
5420                 var i, j, ret, matched, handleObj, handlerQueue,
5421                         args = new Array( arguments.length ),
5423                         // Make a writable jQuery.Event from the native event object
5424                         event = jQuery.event.fix( nativeEvent ),
5426                         handlers = (
5427                                 dataPriv.get( this, "events" ) || Object.create( null )
5428                         )[ event.type ] || [],
5429                         special = jQuery.event.special[ event.type ] || {};
5431                 // Use the fix-ed jQuery.Event rather than the (read-only) native event
5432                 args[ 0 ] = event;
5434                 for ( i = 1; i < arguments.length; i++ ) {
5435                         args[ i ] = arguments[ i ];
5436                 }
5438                 event.delegateTarget = this;
5440                 // Call the preDispatch hook for the mapped type, and let it bail if desired
5441                 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5442                         return;
5443                 }
5445                 // Determine handlers
5446                 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5448                 // Run delegates first; they may want to stop propagation beneath us
5449                 i = 0;
5450                 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
5451                         event.currentTarget = matched.elem;
5453                         j = 0;
5454                         while ( ( handleObj = matched.handlers[ j++ ] ) &&
5455                                 !event.isImmediatePropagationStopped() ) {
5457                                 // If the event is namespaced, then each handler is only invoked if it is
5458                                 // specially universal or its namespaces are a superset of the event's.
5459                                 if ( !event.rnamespace || handleObj.namespace === false ||
5460                                         event.rnamespace.test( handleObj.namespace ) ) {
5462                                         event.handleObj = handleObj;
5463                                         event.data = handleObj.data;
5465                                         ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
5466                                                 handleObj.handler ).apply( matched.elem, args );
5468                                         if ( ret !== undefined ) {
5469                                                 if ( ( event.result = ret ) === false ) {
5470                                                         event.preventDefault();
5471                                                         event.stopPropagation();
5472                                                 }
5473                                         }
5474                                 }
5475                         }
5476                 }
5478                 // Call the postDispatch hook for the mapped type
5479                 if ( special.postDispatch ) {
5480                         special.postDispatch.call( this, event );
5481                 }
5483                 return event.result;
5484         },
5486         handlers: function( event, handlers ) {
5487                 var i, handleObj, sel, matchedHandlers, matchedSelectors,
5488                         handlerQueue = [],
5489                         delegateCount = handlers.delegateCount,
5490                         cur = event.target;
5492                 // Find delegate handlers
5493                 if ( delegateCount &&
5495                         // Support: IE <=9
5496                         // Black-hole SVG <use> instance trees (trac-13180)
5497                         cur.nodeType &&
5499                         // Support: Firefox <=42
5500                         // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
5501                         // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
5502                         // Support: IE 11 only
5503                         // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
5504                         !( event.type === "click" && event.button >= 1 ) ) {
5506                         for ( ; cur !== this; cur = cur.parentNode || this ) {
5508                                 // Don't check non-elements (trac-13208)
5509                                 // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
5510                                 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5511                                         matchedHandlers = [];
5512                                         matchedSelectors = {};
5513                                         for ( i = 0; i < delegateCount; i++ ) {
5514                                                 handleObj = handlers[ i ];
5516                                                 // Don't conflict with Object.prototype properties (trac-13203)
5517                                                 sel = handleObj.selector + " ";
5519                                                 if ( matchedSelectors[ sel ] === undefined ) {
5520                                                         matchedSelectors[ sel ] = handleObj.needsContext ?
5521                                                                 jQuery( sel, this ).index( cur ) > -1 :
5522                                                                 jQuery.find( sel, this, null, [ cur ] ).length;
5523                                                 }
5524                                                 if ( matchedSelectors[ sel ] ) {
5525                                                         matchedHandlers.push( handleObj );
5526                                                 }
5527                                         }
5528                                         if ( matchedHandlers.length ) {
5529                                                 handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
5530                                         }
5531                                 }
5532                         }
5533                 }
5535                 // Add the remaining (directly-bound) handlers
5536                 cur = this;
5537                 if ( delegateCount < handlers.length ) {
5538                         handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
5539                 }
5541                 return handlerQueue;
5542         },
5544         addProp: function( name, hook ) {
5545                 Object.defineProperty( jQuery.Event.prototype, name, {
5546                         enumerable: true,
5547                         configurable: true,
5549                         get: isFunction( hook ) ?
5550                                 function() {
5551                                         if ( this.originalEvent ) {
5552                                                 return hook( this.originalEvent );
5553                                         }
5554                                 } :
5555                                 function() {
5556                                         if ( this.originalEvent ) {
5557                                                 return this.originalEvent[ name ];
5558                                         }
5559                                 },
5561                         set: function( value ) {
5562                                 Object.defineProperty( this, name, {
5563                                         enumerable: true,
5564                                         configurable: true,
5565                                         writable: true,
5566                                         value: value
5567                                 } );
5568                         }
5569                 } );
5570         },
5572         fix: function( originalEvent ) {
5573                 return originalEvent[ jQuery.expando ] ?
5574                         originalEvent :
5575                         new jQuery.Event( originalEvent );
5576         },
5578         special: {
5579                 load: {
5581                         // Prevent triggered image.load events from bubbling to window.load
5582                         noBubble: true
5583                 },
5584                 click: {
5586                         // Utilize native event to ensure correct state for checkable inputs
5587                         setup: function( data ) {
5589                                 // For mutual compressibility with _default, replace `this` access with a local var.
5590                                 // `|| data` is dead code meant only to preserve the variable through minification.
5591                                 var el = this || data;
5593                                 // Claim the first handler
5594                                 if ( rcheckableType.test( el.type ) &&
5595                                         el.click && nodeName( el, "input" ) ) {
5597                                         // dataPriv.set( el, "click", ... )
5598                                         leverageNative( el, "click", returnTrue );
5599                                 }
5601                                 // Return false to allow normal processing in the caller
5602                                 return false;
5603                         },
5604                         trigger: function( data ) {
5606                                 // For mutual compressibility with _default, replace `this` access with a local var.
5607                                 // `|| data` is dead code meant only to preserve the variable through minification.
5608                                 var el = this || data;
5610                                 // Force setup before triggering a click
5611                                 if ( rcheckableType.test( el.type ) &&
5612                                         el.click && nodeName( el, "input" ) ) {
5614                                         leverageNative( el, "click" );
5615                                 }
5617                                 // Return non-false to allow normal event-path propagation
5618                                 return true;
5619                         },
5621                         // For cross-browser consistency, suppress native .click() on links
5622                         // Also prevent it if we're currently inside a leveraged native-event stack
5623                         _default: function( event ) {
5624                                 var target = event.target;
5625                                 return rcheckableType.test( target.type ) &&
5626                                         target.click && nodeName( target, "input" ) &&
5627                                         dataPriv.get( target, "click" ) ||
5628                                         nodeName( target, "a" );
5629                         }
5630                 },
5632                 beforeunload: {
5633                         postDispatch: function( event ) {
5635                                 // Support: Firefox 20+
5636                                 // Firefox doesn't alert if the returnValue field is not set.
5637                                 if ( event.result !== undefined && event.originalEvent ) {
5638                                         event.originalEvent.returnValue = event.result;
5639                                 }
5640                         }
5641                 }
5642         }
5645 // Ensure the presence of an event listener that handles manually-triggered
5646 // synthetic events by interrupting progress until reinvoked in response to
5647 // *native* events that it fires directly, ensuring that state changes have
5648 // already occurred before other listeners are invoked.
5649 function leverageNative( el, type, expectSync ) {
5651         // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
5652         if ( !expectSync ) {
5653                 if ( dataPriv.get( el, type ) === undefined ) {
5654                         jQuery.event.add( el, type, returnTrue );
5655                 }
5656                 return;
5657         }
5659         // Register the controller as a special universal handler for all event namespaces
5660         dataPriv.set( el, type, false );
5661         jQuery.event.add( el, type, {
5662                 namespace: false,
5663                 handler: function( event ) {
5664                         var notAsync, result,
5665                                 saved = dataPriv.get( this, type );
5667                         if ( ( event.isTrigger & 1 ) && this[ type ] ) {
5669                                 // Interrupt processing of the outer synthetic .trigger()ed event
5670                                 // Saved data should be false in such cases, but might be a leftover capture object
5671                                 // from an async native handler (gh-4350)
5672                                 if ( !saved.length ) {
5674                                         // Store arguments for use when handling the inner native event
5675                                         // There will always be at least one argument (an event object), so this array
5676                                         // will not be confused with a leftover capture object.
5677                                         saved = slice.call( arguments );
5678                                         dataPriv.set( this, type, saved );
5680                                         // Trigger the native event and capture its result
5681                                         // Support: IE <=9 - 11+
5682                                         // focus() and blur() are asynchronous
5683                                         notAsync = expectSync( this, type );
5684                                         this[ type ]();
5685                                         result = dataPriv.get( this, type );
5686                                         if ( saved !== result || notAsync ) {
5687                                                 dataPriv.set( this, type, false );
5688                                         } else {
5689                                                 result = {};
5690                                         }
5691                                         if ( saved !== result ) {
5693                                                 // Cancel the outer synthetic event
5694                                                 event.stopImmediatePropagation();
5695                                                 event.preventDefault();
5697                                                 // Support: Chrome 86+
5698                                                 // In Chrome, if an element having a focusout handler is blurred by
5699                                                 // clicking outside of it, it invokes the handler synchronously. If
5700                                                 // that handler calls `.remove()` on the element, the data is cleared,
5701                                                 // leaving `result` undefined. We need to guard against this.
5702                                                 return result && result.value;
5703                                         }
5705                                 // If this is an inner synthetic event for an event with a bubbling surrogate
5706                                 // (focus or blur), assume that the surrogate already propagated from triggering the
5707                                 // native event and prevent that from happening again here.
5708                                 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
5709                                 // bubbling surrogate propagates *after* the non-bubbling base), but that seems
5710                                 // less bad than duplication.
5711                                 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
5712                                         event.stopPropagation();
5713                                 }
5715                         // If this is a native event triggered above, everything is now in order
5716                         // Fire an inner synthetic event with the original arguments
5717                         } else if ( saved.length ) {
5719                                 // ...and capture the result
5720                                 dataPriv.set( this, type, {
5721                                         value: jQuery.event.trigger(
5723                                                 // Support: IE <=9 - 11+
5724                                                 // Extend with the prototype to reset the above stopImmediatePropagation()
5725                                                 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
5726                                                 saved.slice( 1 ),
5727                                                 this
5728                                         )
5729                                 } );
5731                                 // Abort handling of the native event
5732                                 event.stopImmediatePropagation();
5733                         }
5734                 }
5735         } );
5738 jQuery.removeEvent = function( elem, type, handle ) {
5740         // This "if" is needed for plain objects
5741         if ( elem.removeEventListener ) {
5742                 elem.removeEventListener( type, handle );
5743         }
5746 jQuery.Event = function( src, props ) {
5748         // Allow instantiation without the 'new' keyword
5749         if ( !( this instanceof jQuery.Event ) ) {
5750                 return new jQuery.Event( src, props );
5751         }
5753         // Event object
5754         if ( src && src.type ) {
5755                 this.originalEvent = src;
5756                 this.type = src.type;
5758                 // Events bubbling up the document may have been marked as prevented
5759                 // by a handler lower down the tree; reflect the correct value.
5760                 this.isDefaultPrevented = src.defaultPrevented ||
5761                                 src.defaultPrevented === undefined &&
5763                                 // Support: Android <=2.3 only
5764                                 src.returnValue === false ?
5765                         returnTrue :
5766                         returnFalse;
5768                 // Create target properties
5769                 // Support: Safari <=6 - 7 only
5770                 // Target should not be a text node (trac-504, trac-13143)
5771                 this.target = ( src.target && src.target.nodeType === 3 ) ?
5772                         src.target.parentNode :
5773                         src.target;
5775                 this.currentTarget = src.currentTarget;
5776                 this.relatedTarget = src.relatedTarget;
5778         // Event type
5779         } else {
5780                 this.type = src;
5781         }
5783         // Put explicitly provided properties onto the event object
5784         if ( props ) {
5785                 jQuery.extend( this, props );
5786         }
5788         // Create a timestamp if incoming event doesn't have one
5789         this.timeStamp = src && src.timeStamp || Date.now();
5791         // Mark it as fixed
5792         this[ jQuery.expando ] = true;
5795 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5796 // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5797 jQuery.Event.prototype = {
5798         constructor: jQuery.Event,
5799         isDefaultPrevented: returnFalse,
5800         isPropagationStopped: returnFalse,
5801         isImmediatePropagationStopped: returnFalse,
5802         isSimulated: false,
5804         preventDefault: function() {
5805                 var e = this.originalEvent;
5807                 this.isDefaultPrevented = returnTrue;
5809                 if ( e && !this.isSimulated ) {
5810                         e.preventDefault();
5811                 }
5812         },
5813         stopPropagation: function() {
5814                 var e = this.originalEvent;
5816                 this.isPropagationStopped = returnTrue;
5818                 if ( e && !this.isSimulated ) {
5819                         e.stopPropagation();
5820                 }
5821         },
5822         stopImmediatePropagation: function() {
5823                 var e = this.originalEvent;
5825                 this.isImmediatePropagationStopped = returnTrue;
5827                 if ( e && !this.isSimulated ) {
5828                         e.stopImmediatePropagation();
5829                 }
5831                 this.stopPropagation();
5832         }
5835 // Includes all common event props including KeyEvent and MouseEvent specific props
5836 jQuery.each( {
5837         altKey: true,
5838         bubbles: true,
5839         cancelable: true,
5840         changedTouches: true,
5841         ctrlKey: true,
5842         detail: true,
5843         eventPhase: true,
5844         metaKey: true,
5845         pageX: true,
5846         pageY: true,
5847         shiftKey: true,
5848         view: true,
5849         "char": true,
5850         code: true,
5851         charCode: true,
5852         key: true,
5853         keyCode: true,
5854         button: true,
5855         buttons: true,
5856         clientX: true,
5857         clientY: true,
5858         offsetX: true,
5859         offsetY: true,
5860         pointerId: true,
5861         pointerType: true,
5862         screenX: true,
5863         screenY: true,
5864         targetTouches: true,
5865         toElement: true,
5866         touches: true,
5867         which: true
5868 }, jQuery.event.addProp );
5870 jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
5871         jQuery.event.special[ type ] = {
5873                 // Utilize native event if possible so blur/focus sequence is correct
5874                 setup: function() {
5876                         // Claim the first handler
5877                         // dataPriv.set( this, "focus", ... )
5878                         // dataPriv.set( this, "blur", ... )
5879                         leverageNative( this, type, expectSync );
5881                         // Return false to allow normal processing in the caller
5882                         return false;
5883                 },
5884                 trigger: function() {
5886                         // Force setup before trigger
5887                         leverageNative( this, type );
5889                         // Return non-false to allow normal event-path propagation
5890                         return true;
5891                 },
5893                 // Suppress native focus or blur if we're currently inside
5894                 // a leveraged native-event stack
5895                 _default: function( event ) {
5896                         return dataPriv.get( event.target, type );
5897                 },
5899                 delegateType: delegateType
5900         };
5901 } );
5903 // Create mouseenter/leave events using mouseover/out and event-time checks
5904 // so that event delegation works in jQuery.
5905 // Do the same for pointerenter/pointerleave and pointerover/pointerout
5907 // Support: Safari 7 only
5908 // Safari sends mouseenter too often; see:
5909 // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
5910 // for the description of the bug (it existed in older Chrome versions as well).
5911 jQuery.each( {
5912         mouseenter: "mouseover",
5913         mouseleave: "mouseout",
5914         pointerenter: "pointerover",
5915         pointerleave: "pointerout"
5916 }, function( orig, fix ) {
5917         jQuery.event.special[ orig ] = {
5918                 delegateType: fix,
5919                 bindType: fix,
5921                 handle: function( event ) {
5922                         var ret,
5923                                 target = this,
5924                                 related = event.relatedTarget,
5925                                 handleObj = event.handleObj;
5927                         // For mouseenter/leave call the handler if related is outside the target.
5928                         // NB: No relatedTarget if the mouse left/entered the browser window
5929                         if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
5930                                 event.type = handleObj.origType;
5931                                 ret = handleObj.handler.apply( this, arguments );
5932                                 event.type = fix;
5933                         }
5934                         return ret;
5935                 }
5936         };
5937 } );
5939 jQuery.fn.extend( {
5941         on: function( types, selector, data, fn ) {
5942                 return on( this, types, selector, data, fn );
5943         },
5944         one: function( types, selector, data, fn ) {
5945                 return on( this, types, selector, data, fn, 1 );
5946         },
5947         off: function( types, selector, fn ) {
5948                 var handleObj, type;
5949                 if ( types && types.preventDefault && types.handleObj ) {
5951                         // ( event )  dispatched jQuery.Event
5952                         handleObj = types.handleObj;
5953                         jQuery( types.delegateTarget ).off(
5954                                 handleObj.namespace ?
5955                                         handleObj.origType + "." + handleObj.namespace :
5956                                         handleObj.origType,
5957                                 handleObj.selector,
5958                                 handleObj.handler
5959                         );
5960                         return this;
5961                 }
5962                 if ( typeof types === "object" ) {
5964                         // ( types-object [, selector] )
5965                         for ( type in types ) {
5966                                 this.off( type, selector, types[ type ] );
5967                         }
5968                         return this;
5969                 }
5970                 if ( selector === false || typeof selector === "function" ) {
5972                         // ( types [, fn] )
5973                         fn = selector;
5974                         selector = undefined;
5975                 }
5976                 if ( fn === false ) {
5977                         fn = returnFalse;
5978                 }
5979                 return this.each( function() {
5980                         jQuery.event.remove( this, types, fn, selector );
5981                 } );
5982         }
5983 } );
5988         // Support: IE <=10 - 11, Edge 12 - 13 only
5989         // In IE/Edge using regex groups here causes severe slowdowns.
5990         // See https://connect.microsoft.com/IE/feedback/details/1736512/
5991         rnoInnerhtml = /<script|<style|<link/i,
5993         // checked="checked" or checked
5994         rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5996         rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
5998 // Prefer a tbody over its parent table for containing new rows
5999 function manipulationTarget( elem, content ) {
6000         if ( nodeName( elem, "table" ) &&
6001                 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
6003                 return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
6004         }
6006         return elem;
6009 // Replace/restore the type attribute of script elements for safe DOM manipulation
6010 function disableScript( elem ) {
6011         elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
6012         return elem;
6014 function restoreScript( elem ) {
6015         if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
6016                 elem.type = elem.type.slice( 5 );
6017         } else {
6018                 elem.removeAttribute( "type" );
6019         }
6021         return elem;
6024 function cloneCopyEvent( src, dest ) {
6025         var i, l, type, pdataOld, udataOld, udataCur, events;
6027         if ( dest.nodeType !== 1 ) {
6028                 return;
6029         }
6031         // 1. Copy private data: events, handlers, etc.
6032         if ( dataPriv.hasData( src ) ) {
6033                 pdataOld = dataPriv.get( src );
6034                 events = pdataOld.events;
6036                 if ( events ) {
6037                         dataPriv.remove( dest, "handle events" );
6039                         for ( type in events ) {
6040                                 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
6041                                         jQuery.event.add( dest, type, events[ type ][ i ] );
6042                                 }
6043                         }
6044                 }
6045         }
6047         // 2. Copy user data
6048         if ( dataUser.hasData( src ) ) {
6049                 udataOld = dataUser.access( src );
6050                 udataCur = jQuery.extend( {}, udataOld );
6052                 dataUser.set( dest, udataCur );
6053         }
6056 // Fix IE bugs, see support tests
6057 function fixInput( src, dest ) {
6058         var nodeName = dest.nodeName.toLowerCase();
6060         // Fails to persist the checked state of a cloned checkbox or radio button.
6061         if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
6062                 dest.checked = src.checked;
6064         // Fails to return the selected option to the default selected state when cloning options
6065         } else if ( nodeName === "input" || nodeName === "textarea" ) {
6066                 dest.defaultValue = src.defaultValue;
6067         }
6070 function domManip( collection, args, callback, ignored ) {
6072         // Flatten any nested arrays
6073         args = flat( args );
6075         var fragment, first, scripts, hasScripts, node, doc,
6076                 i = 0,
6077                 l = collection.length,
6078                 iNoClone = l - 1,
6079                 value = args[ 0 ],
6080                 valueIsFunction = isFunction( value );
6082         // We can't cloneNode fragments that contain checked, in WebKit
6083         if ( valueIsFunction ||
6084                         ( l > 1 && typeof value === "string" &&
6085                                 !support.checkClone && rchecked.test( value ) ) ) {
6086                 return collection.each( function( index ) {
6087                         var self = collection.eq( index );
6088                         if ( valueIsFunction ) {
6089                                 args[ 0 ] = value.call( this, index, self.html() );
6090                         }
6091                         domManip( self, args, callback, ignored );
6092                 } );
6093         }
6095         if ( l ) {
6096                 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
6097                 first = fragment.firstChild;
6099                 if ( fragment.childNodes.length === 1 ) {
6100                         fragment = first;
6101                 }
6103                 // Require either new content or an interest in ignored elements to invoke the callback
6104                 if ( first || ignored ) {
6105                         scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
6106                         hasScripts = scripts.length;
6108                         // Use the original fragment for the last item
6109                         // instead of the first because it can end up
6110                         // being emptied incorrectly in certain situations (trac-8070).
6111                         for ( ; i < l; i++ ) {
6112                                 node = fragment;
6114                                 if ( i !== iNoClone ) {
6115                                         node = jQuery.clone( node, true, true );
6117                                         // Keep references to cloned scripts for later restoration
6118                                         if ( hasScripts ) {
6120                                                 // Support: Android <=4.0 only, PhantomJS 1 only
6121                                                 // push.apply(_, arraylike) throws on ancient WebKit
6122                                                 jQuery.merge( scripts, getAll( node, "script" ) );
6123                                         }
6124                                 }
6126                                 callback.call( collection[ i ], node, i );
6127                         }
6129                         if ( hasScripts ) {
6130                                 doc = scripts[ scripts.length - 1 ].ownerDocument;
6132                                 // Reenable scripts
6133                                 jQuery.map( scripts, restoreScript );
6135                                 // Evaluate executable scripts on first document insertion
6136                                 for ( i = 0; i < hasScripts; i++ ) {
6137                                         node = scripts[ i ];
6138                                         if ( rscriptType.test( node.type || "" ) &&
6139                                                 !dataPriv.access( node, "globalEval" ) &&
6140                                                 jQuery.contains( doc, node ) ) {
6142                                                 if ( node.src && ( node.type || "" ).toLowerCase()  !== "module" ) {
6144                                                         // Optional AJAX dependency, but won't run scripts if not present
6145                                                         if ( jQuery._evalUrl && !node.noModule ) {
6146                                                                 jQuery._evalUrl( node.src, {
6147                                                                         nonce: node.nonce || node.getAttribute( "nonce" )
6148                                                                 }, doc );
6149                                                         }
6150                                                 } else {
6152                                                         // Unwrap a CDATA section containing script contents. This shouldn't be
6153                                                         // needed as in XML documents they're already not visible when
6154                                                         // inspecting element contents and in HTML documents they have no
6155                                                         // meaning but we're preserving that logic for backwards compatibility.
6156                                                         // This will be removed completely in 4.0. See gh-4904.
6157                                                         DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
6158                                                 }
6159                                         }
6160                                 }
6161                         }
6162                 }
6163         }
6165         return collection;
6168 function remove( elem, selector, keepData ) {
6169         var node,
6170                 nodes = selector ? jQuery.filter( selector, elem ) : elem,
6171                 i = 0;
6173         for ( ; ( node = nodes[ i ] ) != null; i++ ) {
6174                 if ( !keepData && node.nodeType === 1 ) {
6175                         jQuery.cleanData( getAll( node ) );
6176                 }
6178                 if ( node.parentNode ) {
6179                         if ( keepData && isAttached( node ) ) {
6180                                 setGlobalEval( getAll( node, "script" ) );
6181                         }
6182                         node.parentNode.removeChild( node );
6183                 }
6184         }
6186         return elem;
6189 jQuery.extend( {
6190         htmlPrefilter: function( html ) {
6191                 return html;
6192         },
6194         clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6195                 var i, l, srcElements, destElements,
6196                         clone = elem.cloneNode( true ),
6197                         inPage = isAttached( elem );
6199                 // Fix IE cloning issues
6200                 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
6201                                 !jQuery.isXMLDoc( elem ) ) {
6203                         // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
6204                         destElements = getAll( clone );
6205                         srcElements = getAll( elem );
6207                         for ( i = 0, l = srcElements.length; i < l; i++ ) {
6208                                 fixInput( srcElements[ i ], destElements[ i ] );
6209                         }
6210                 }
6212                 // Copy the events from the original to the clone
6213                 if ( dataAndEvents ) {
6214                         if ( deepDataAndEvents ) {
6215                                 srcElements = srcElements || getAll( elem );
6216                                 destElements = destElements || getAll( clone );
6218                                 for ( i = 0, l = srcElements.length; i < l; i++ ) {
6219                                         cloneCopyEvent( srcElements[ i ], destElements[ i ] );
6220                                 }
6221                         } else {
6222                                 cloneCopyEvent( elem, clone );
6223                         }
6224                 }
6226                 // Preserve script evaluation history
6227                 destElements = getAll( clone, "script" );
6228                 if ( destElements.length > 0 ) {
6229                         setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
6230                 }
6232                 // Return the cloned set
6233                 return clone;
6234         },
6236         cleanData: function( elems ) {
6237                 var data, elem, type,
6238                         special = jQuery.event.special,
6239                         i = 0;
6241                 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
6242                         if ( acceptData( elem ) ) {
6243                                 if ( ( data = elem[ dataPriv.expando ] ) ) {
6244                                         if ( data.events ) {
6245                                                 for ( type in data.events ) {
6246                                                         if ( special[ type ] ) {
6247                                                                 jQuery.event.remove( elem, type );
6249                                                         // This is a shortcut to avoid jQuery.event.remove's overhead
6250                                                         } else {
6251                                                                 jQuery.removeEvent( elem, type, data.handle );
6252                                                         }
6253                                                 }
6254                                         }
6256                                         // Support: Chrome <=35 - 45+
6257                                         // Assign undefined instead of using delete, see Data#remove
6258                                         elem[ dataPriv.expando ] = undefined;
6259                                 }
6260                                 if ( elem[ dataUser.expando ] ) {
6262                                         // Support: Chrome <=35 - 45+
6263                                         // Assign undefined instead of using delete, see Data#remove
6264                                         elem[ dataUser.expando ] = undefined;
6265                                 }
6266                         }
6267                 }
6268         }
6269 } );
6271 jQuery.fn.extend( {
6272         detach: function( selector ) {
6273                 return remove( this, selector, true );
6274         },
6276         remove: function( selector ) {
6277                 return remove( this, selector );
6278         },
6280         text: function( value ) {
6281                 return access( this, function( value ) {
6282                         return value === undefined ?
6283                                 jQuery.text( this ) :
6284                                 this.empty().each( function() {
6285                                         if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6286                                                 this.textContent = value;
6287                                         }
6288                                 } );
6289                 }, null, value, arguments.length );
6290         },
6292         append: function() {
6293                 return domManip( this, arguments, function( elem ) {
6294                         if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6295                                 var target = manipulationTarget( this, elem );
6296                                 target.appendChild( elem );
6297                         }
6298                 } );
6299         },
6301         prepend: function() {
6302                 return domManip( this, arguments, function( elem ) {
6303                         if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6304                                 var target = manipulationTarget( this, elem );
6305                                 target.insertBefore( elem, target.firstChild );
6306                         }
6307                 } );
6308         },
6310         before: function() {
6311                 return domManip( this, arguments, function( elem ) {
6312                         if ( this.parentNode ) {
6313                                 this.parentNode.insertBefore( elem, this );
6314                         }
6315                 } );
6316         },
6318         after: function() {
6319                 return domManip( this, arguments, function( elem ) {
6320                         if ( this.parentNode ) {
6321                                 this.parentNode.insertBefore( elem, this.nextSibling );
6322                         }
6323                 } );
6324         },
6326         empty: function() {
6327                 var elem,
6328                         i = 0;
6330                 for ( ; ( elem = this[ i ] ) != null; i++ ) {
6331                         if ( elem.nodeType === 1 ) {
6333                                 // Prevent memory leaks
6334                                 jQuery.cleanData( getAll( elem, false ) );
6336                                 // Remove any remaining nodes
6337                                 elem.textContent = "";
6338                         }
6339                 }
6341                 return this;
6342         },
6344         clone: function( dataAndEvents, deepDataAndEvents ) {
6345                 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6346                 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6348                 return this.map( function() {
6349                         return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
6350                 } );
6351         },
6353         html: function( value ) {
6354                 return access( this, function( value ) {
6355                         var elem = this[ 0 ] || {},
6356                                 i = 0,
6357                                 l = this.length;
6359                         if ( value === undefined && elem.nodeType === 1 ) {
6360                                 return elem.innerHTML;
6361                         }
6363                         // See if we can take a shortcut and just use innerHTML
6364                         if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
6365                                 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
6367                                 value = jQuery.htmlPrefilter( value );
6369                                 try {
6370                                         for ( ; i < l; i++ ) {
6371                                                 elem = this[ i ] || {};
6373                                                 // Remove element nodes and prevent memory leaks
6374                                                 if ( elem.nodeType === 1 ) {
6375                                                         jQuery.cleanData( getAll( elem, false ) );
6376                                                         elem.innerHTML = value;
6377                                                 }
6378                                         }
6380                                         elem = 0;
6382                                 // If using innerHTML throws an exception, use the fallback method
6383                                 } catch ( e ) {}
6384                         }
6386                         if ( elem ) {
6387                                 this.empty().append( value );
6388                         }
6389                 }, null, value, arguments.length );
6390         },
6392         replaceWith: function() {
6393                 var ignored = [];
6395                 // Make the changes, replacing each non-ignored context element with the new content
6396                 return domManip( this, arguments, function( elem ) {
6397                         var parent = this.parentNode;
6399                         if ( jQuery.inArray( this, ignored ) < 0 ) {
6400                                 jQuery.cleanData( getAll( this ) );
6401                                 if ( parent ) {
6402                                         parent.replaceChild( elem, this );
6403                                 }
6404                         }
6406                 // Force callback invocation
6407                 }, ignored );
6408         }
6409 } );
6411 jQuery.each( {
6412         appendTo: "append",
6413         prependTo: "prepend",
6414         insertBefore: "before",
6415         insertAfter: "after",
6416         replaceAll: "replaceWith"
6417 }, function( name, original ) {
6418         jQuery.fn[ name ] = function( selector ) {
6419                 var elems,
6420                         ret = [],
6421                         insert = jQuery( selector ),
6422                         last = insert.length - 1,
6423                         i = 0;
6425                 for ( ; i <= last; i++ ) {
6426                         elems = i === last ? this : this.clone( true );
6427                         jQuery( insert[ i ] )[ original ]( elems );
6429                         // Support: Android <=4.0 only, PhantomJS 1 only
6430                         // .get() because push.apply(_, arraylike) throws on ancient WebKit
6431                         push.apply( ret, elems.get() );
6432                 }
6434                 return this.pushStack( ret );
6435         };
6436 } );
6437 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6439 var rcustomProp = /^--/;
6442 var getStyles = function( elem ) {
6444                 // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
6445                 // IE throws on elements created in popups
6446                 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6447                 var view = elem.ownerDocument.defaultView;
6449                 if ( !view || !view.opener ) {
6450                         view = window;
6451                 }
6453                 return view.getComputedStyle( elem );
6454         };
6456 var swap = function( elem, options, callback ) {
6457         var ret, name,
6458                 old = {};
6460         // Remember the old values, and insert the new ones
6461         for ( name in options ) {
6462                 old[ name ] = elem.style[ name ];
6463                 elem.style[ name ] = options[ name ];
6464         }
6466         ret = callback.call( elem );
6468         // Revert the old values
6469         for ( name in options ) {
6470                 elem.style[ name ] = old[ name ];
6471         }
6473         return ret;
6477 var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6479 var whitespace = "[\\x20\\t\\r\\n\\f]";
6482 var rtrimCSS = new RegExp(
6483         "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
6484         "g"
6490 ( function() {
6492         // Executing both pixelPosition & boxSizingReliable tests require only one layout
6493         // so they're executed at the same time to save the second computation.
6494         function computeStyleTests() {
6496                 // This is a singleton, we need to execute it only once
6497                 if ( !div ) {
6498                         return;
6499                 }
6501                 container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
6502                         "margin-top:1px;padding:0;border:0";
6503                 div.style.cssText =
6504                         "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
6505                         "margin:auto;border:1px;padding:1px;" +
6506                         "width:60%;top:1%";
6507                 documentElement.appendChild( container ).appendChild( div );
6509                 var divStyle = window.getComputedStyle( div );
6510                 pixelPositionVal = divStyle.top !== "1%";
6512                 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
6513                 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
6515                 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
6516                 // Some styles come back with percentage values, even though they shouldn't
6517                 div.style.right = "60%";
6518                 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
6520                 // Support: IE 9 - 11 only
6521                 // Detect misreporting of content dimensions for box-sizing:border-box elements
6522                 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
6524                 // Support: IE 9 only
6525                 // Detect overflow:scroll screwiness (gh-3699)
6526                 // Support: Chrome <=64
6527                 // Don't get tricked when zoom affects offsetWidth (gh-4029)
6528                 div.style.position = "absolute";
6529                 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
6531                 documentElement.removeChild( container );
6533                 // Nullify the div so it wouldn't be stored in the memory and
6534                 // it will also be a sign that checks already performed
6535                 div = null;
6536         }
6538         function roundPixelMeasures( measure ) {
6539                 return Math.round( parseFloat( measure ) );
6540         }
6542         var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
6543                 reliableTrDimensionsVal, reliableMarginLeftVal,
6544                 container = document.createElement( "div" ),
6545                 div = document.createElement( "div" );
6547         // Finish early in limited (non-browser) environments
6548         if ( !div.style ) {
6549                 return;
6550         }
6552         // Support: IE <=9 - 11 only
6553         // Style of cloned element affects source element cloned (trac-8908)
6554         div.style.backgroundClip = "content-box";
6555         div.cloneNode( true ).style.backgroundClip = "";
6556         support.clearCloneStyle = div.style.backgroundClip === "content-box";
6558         jQuery.extend( support, {
6559                 boxSizingReliable: function() {
6560                         computeStyleTests();
6561                         return boxSizingReliableVal;
6562                 },
6563                 pixelBoxStyles: function() {
6564                         computeStyleTests();
6565                         return pixelBoxStylesVal;
6566                 },
6567                 pixelPosition: function() {
6568                         computeStyleTests();
6569                         return pixelPositionVal;
6570                 },
6571                 reliableMarginLeft: function() {
6572                         computeStyleTests();
6573                         return reliableMarginLeftVal;
6574                 },
6575                 scrollboxSize: function() {
6576                         computeStyleTests();
6577                         return scrollboxSizeVal;
6578                 },
6580                 // Support: IE 9 - 11+, Edge 15 - 18+
6581                 // IE/Edge misreport `getComputedStyle` of table rows with width/height
6582                 // set in CSS while `offset*` properties report correct values.
6583                 // Behavior in IE 9 is more subtle than in newer versions & it passes
6584                 // some versions of this test; make sure not to make it pass there!
6585                 //
6586                 // Support: Firefox 70+
6587                 // Only Firefox includes border widths
6588                 // in computed dimensions. (gh-4529)
6589                 reliableTrDimensions: function() {
6590                         var table, tr, trChild, trStyle;
6591                         if ( reliableTrDimensionsVal == null ) {
6592                                 table = document.createElement( "table" );
6593                                 tr = document.createElement( "tr" );
6594                                 trChild = document.createElement( "div" );
6596                                 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
6597                                 tr.style.cssText = "border:1px solid";
6599                                 // Support: Chrome 86+
6600                                 // Height set through cssText does not get applied.
6601                                 // Computed height then comes back as 0.
6602                                 tr.style.height = "1px";
6603                                 trChild.style.height = "9px";
6605                                 // Support: Android 8 Chrome 86+
6606                                 // In our bodyBackground.html iframe,
6607                                 // display for all div elements is set to "inline",
6608                                 // which causes a problem only in Android 8 Chrome 86.
6609                                 // Ensuring the div is display: block
6610                                 // gets around this issue.
6611                                 trChild.style.display = "block";
6613                                 documentElement
6614                                         .appendChild( table )
6615                                         .appendChild( tr )
6616                                         .appendChild( trChild );
6618                                 trStyle = window.getComputedStyle( tr );
6619                                 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
6620                                         parseInt( trStyle.borderTopWidth, 10 ) +
6621                                         parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
6623                                 documentElement.removeChild( table );
6624                         }
6625                         return reliableTrDimensionsVal;
6626                 }
6627         } );
6628 } )();
6631 function curCSS( elem, name, computed ) {
6632         var width, minWidth, maxWidth, ret,
6633                 isCustomProp = rcustomProp.test( name ),
6635                 // Support: Firefox 51+
6636                 // Retrieving style before computed somehow
6637                 // fixes an issue with getting wrong values
6638                 // on detached elements
6639                 style = elem.style;
6641         computed = computed || getStyles( elem );
6643         // getPropertyValue is needed for:
6644         //   .css('filter') (IE 9 only, trac-12537)
6645         //   .css('--customProperty) (gh-3144)
6646         if ( computed ) {
6648                 // Support: IE <=9 - 11+
6649                 // IE only supports `"float"` in `getPropertyValue`; in computed styles
6650                 // it's only available as `"cssFloat"`. We no longer modify properties
6651                 // sent to `.css()` apart from camelCasing, so we need to check both.
6652                 // Normally, this would create difference in behavior: if
6653                 // `getPropertyValue` returns an empty string, the value returned
6654                 // by `.css()` would be `undefined`. This is usually the case for
6655                 // disconnected elements. However, in IE even disconnected elements
6656                 // with no styles return `"none"` for `getPropertyValue( "float" )`
6657                 ret = computed.getPropertyValue( name ) || computed[ name ];
6659                 if ( isCustomProp && ret ) {
6661                         // Support: Firefox 105+, Chrome <=105+
6662                         // Spec requires trimming whitespace for custom properties (gh-4926).
6663                         // Firefox only trims leading whitespace. Chrome just collapses
6664                         // both leading & trailing whitespace to a single space.
6665                         //
6666                         // Fall back to `undefined` if empty string returned.
6667                         // This collapses a missing definition with property defined
6668                         // and set to an empty string but there's no standard API
6669                         // allowing us to differentiate them without a performance penalty
6670                         // and returning `undefined` aligns with older jQuery.
6671                         //
6672                         // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
6673                         // as whitespace while CSS does not, but this is not a problem
6674                         // because CSS preprocessing replaces them with U+000A LINE FEED
6675                         // (which *is* CSS whitespace)
6676                         // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
6677                         ret = ret.replace( rtrimCSS, "$1" ) || undefined;
6678                 }
6680                 if ( ret === "" && !isAttached( elem ) ) {
6681                         ret = jQuery.style( elem, name );
6682                 }
6684                 // A tribute to the "awesome hack by Dean Edwards"
6685                 // Android Browser returns percentage for some values,
6686                 // but width seems to be reliably pixels.
6687                 // This is against the CSSOM draft spec:
6688                 // https://drafts.csswg.org/cssom/#resolved-values
6689                 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
6691                         // Remember the original values
6692                         width = style.width;
6693                         minWidth = style.minWidth;
6694                         maxWidth = style.maxWidth;
6696                         // Put in the new values to get a computed value out
6697                         style.minWidth = style.maxWidth = style.width = ret;
6698                         ret = computed.width;
6700                         // Revert the changed values
6701                         style.width = width;
6702                         style.minWidth = minWidth;
6703                         style.maxWidth = maxWidth;
6704                 }
6705         }
6707         return ret !== undefined ?
6709                 // Support: IE <=9 - 11 only
6710                 // IE returns zIndex value as an integer.
6711                 ret + "" :
6712                 ret;
6716 function addGetHookIf( conditionFn, hookFn ) {
6718         // Define the hook, we'll check on the first run if it's really needed.
6719         return {
6720                 get: function() {
6721                         if ( conditionFn() ) {
6723                                 // Hook not needed (or it's not possible to use it due
6724                                 // to missing dependency), remove it.
6725                                 delete this.get;
6726                                 return;
6727                         }
6729                         // Hook needed; redefine it so that the support test is not executed again.
6730                         return ( this.get = hookFn ).apply( this, arguments );
6731                 }
6732         };
6736 var cssPrefixes = [ "Webkit", "Moz", "ms" ],
6737         emptyStyle = document.createElement( "div" ).style,
6738         vendorProps = {};
6740 // Return a vendor-prefixed property or undefined
6741 function vendorPropName( name ) {
6743         // Check for vendor prefixed names
6744         var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
6745                 i = cssPrefixes.length;
6747         while ( i-- ) {
6748                 name = cssPrefixes[ i ] + capName;
6749                 if ( name in emptyStyle ) {
6750                         return name;
6751                 }
6752         }
6755 // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
6756 function finalPropName( name ) {
6757         var final = jQuery.cssProps[ name ] || vendorProps[ name ];
6759         if ( final ) {
6760                 return final;
6761         }
6762         if ( name in emptyStyle ) {
6763                 return name;
6764         }
6765         return vendorProps[ name ] = vendorPropName( name ) || name;
6771         // Swappable if display is none or starts with table
6772         // except "table", "table-cell", or "table-caption"
6773         // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6774         rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6775         cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6776         cssNormalTransform = {
6777                 letterSpacing: "0",
6778                 fontWeight: "400"
6779         };
6781 function setPositiveNumber( _elem, value, subtract ) {
6783         // Any relative (+/-) values have already been
6784         // normalized at this point
6785         var matches = rcssNum.exec( value );
6786         return matches ?
6788                 // Guard against undefined "subtract", e.g., when used as in cssHooks
6789                 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
6790                 value;
6793 function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
6794         var i = dimension === "width" ? 1 : 0,
6795                 extra = 0,
6796                 delta = 0;
6798         // Adjustment may not be necessary
6799         if ( box === ( isBorderBox ? "border" : "content" ) ) {
6800                 return 0;
6801         }
6803         for ( ; i < 4; i += 2 ) {
6805                 // Both box models exclude margin
6806                 if ( box === "margin" ) {
6807                         delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
6808                 }
6810                 // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
6811                 if ( !isBorderBox ) {
6813                         // Add padding
6814                         delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6816                         // For "border" or "margin", add border
6817                         if ( box !== "padding" ) {
6818                                 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6820                         // But still keep track of it otherwise
6821                         } else {
6822                                 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6823                         }
6825                 // If we get here with a border-box (content + padding + border), we're seeking "content" or
6826                 // "padding" or "margin"
6827                 } else {
6829                         // For "content", subtract padding
6830                         if ( box === "content" ) {
6831                                 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6832                         }
6834                         // For "content" or "padding", subtract border
6835                         if ( box !== "margin" ) {
6836                                 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6837                         }
6838                 }
6839         }
6841         // Account for positive content-box scroll gutter when requested by providing computedVal
6842         if ( !isBorderBox && computedVal >= 0 ) {
6844                 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
6845                 // Assuming integer scroll gutter, subtract the rest and round down
6846                 delta += Math.max( 0, Math.ceil(
6847                         elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
6848                         computedVal -
6849                         delta -
6850                         extra -
6851                         0.5
6853                 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
6854                 // Use an explicit zero to avoid NaN (gh-3964)
6855                 ) ) || 0;
6856         }
6858         return delta;
6861 function getWidthOrHeight( elem, dimension, extra ) {
6863         // Start with computed style
6864         var styles = getStyles( elem ),
6866                 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
6867                 // Fake content-box until we know it's needed to know the true value.
6868                 boxSizingNeeded = !support.boxSizingReliable() || extra,
6869                 isBorderBox = boxSizingNeeded &&
6870                         jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6871                 valueIsBorderBox = isBorderBox,
6873                 val = curCSS( elem, dimension, styles ),
6874                 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
6876         // Support: Firefox <=54
6877         // Return a confounding non-pixel value or feign ignorance, as appropriate.
6878         if ( rnumnonpx.test( val ) ) {
6879                 if ( !extra ) {
6880                         return val;
6881                 }
6882                 val = "auto";
6883         }
6886         // Support: IE 9 - 11 only
6887         // Use offsetWidth/offsetHeight for when box sizing is unreliable.
6888         // In those cases, the computed value can be trusted to be border-box.
6889         if ( ( !support.boxSizingReliable() && isBorderBox ||
6891                 // Support: IE 10 - 11+, Edge 15 - 18+
6892                 // IE/Edge misreport `getComputedStyle` of table rows with width/height
6893                 // set in CSS while `offset*` properties report correct values.
6894                 // Interestingly, in some cases IE 9 doesn't suffer from this issue.
6895                 !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
6897                 // Fall back to offsetWidth/offsetHeight when value is "auto"
6898                 // This happens for inline elements with no explicit setting (gh-3571)
6899                 val === "auto" ||
6901                 // Support: Android <=4.1 - 4.3 only
6902                 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
6903                 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
6905                 // Make sure the element is visible & connected
6906                 elem.getClientRects().length ) {
6908                 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6910                 // Where available, offsetWidth/offsetHeight approximate border box dimensions.
6911                 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
6912                 // retrieved value as a content box dimension.
6913                 valueIsBorderBox = offsetProp in elem;
6914                 if ( valueIsBorderBox ) {
6915                         val = elem[ offsetProp ];
6916                 }
6917         }
6919         // Normalize "" and auto
6920         val = parseFloat( val ) || 0;
6922         // Adjust for the element's box model
6923         return ( val +
6924                 boxModelAdjustment(
6925                         elem,
6926                         dimension,
6927                         extra || ( isBorderBox ? "border" : "content" ),
6928                         valueIsBorderBox,
6929                         styles,
6931                         // Provide the current computed size to request scroll gutter calculation (gh-3589)
6932                         val
6933                 )
6934         ) + "px";
6937 jQuery.extend( {
6939         // Add in style property hooks for overriding the default
6940         // behavior of getting and setting a style property
6941         cssHooks: {
6942                 opacity: {
6943                         get: function( elem, computed ) {
6944                                 if ( computed ) {
6946                                         // We should always get a number back from opacity
6947                                         var ret = curCSS( elem, "opacity" );
6948                                         return ret === "" ? "1" : ret;
6949                                 }
6950                         }
6951                 }
6952         },
6954         // Don't automatically add "px" to these possibly-unitless properties
6955         cssNumber: {
6956                 "animationIterationCount": true,
6957                 "columnCount": true,
6958                 "fillOpacity": true,
6959                 "flexGrow": true,
6960                 "flexShrink": true,
6961                 "fontWeight": true,
6962                 "gridArea": true,
6963                 "gridColumn": true,
6964                 "gridColumnEnd": true,
6965                 "gridColumnStart": true,
6966                 "gridRow": true,
6967                 "gridRowEnd": true,
6968                 "gridRowStart": true,
6969                 "lineHeight": true,
6970                 "opacity": true,
6971                 "order": true,
6972                 "orphans": true,
6973                 "widows": true,
6974                 "zIndex": true,
6975                 "zoom": true
6976         },
6978         // Add in properties whose names you wish to fix before
6979         // setting or getting the value
6980         cssProps: {},
6982         // Get and set the style property on a DOM Node
6983         style: function( elem, name, value, extra ) {
6985                 // Don't set styles on text and comment nodes
6986                 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6987                         return;
6988                 }
6990                 // Make sure that we're working with the right name
6991                 var ret, type, hooks,
6992                         origName = camelCase( name ),
6993                         isCustomProp = rcustomProp.test( name ),
6994                         style = elem.style;
6996                 // Make sure that we're working with the right name. We don't
6997                 // want to query the value if it is a CSS custom property
6998                 // since they are user-defined.
6999                 if ( !isCustomProp ) {
7000                         name = finalPropName( origName );
7001                 }
7003                 // Gets hook for the prefixed version, then unprefixed version
7004                 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
7006                 // Check if we're setting a value
7007                 if ( value !== undefined ) {
7008                         type = typeof value;
7010                         // Convert "+=" or "-=" to relative numbers (trac-7345)
7011                         if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
7012                                 value = adjustCSS( elem, name, ret );
7014                                 // Fixes bug trac-9237
7015                                 type = "number";
7016                         }
7018                         // Make sure that null and NaN values aren't set (trac-7116)
7019                         if ( value == null || value !== value ) {
7020                                 return;
7021                         }
7023                         // If a number was passed in, add the unit (except for certain CSS properties)
7024                         // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
7025                         // "px" to a few hardcoded values.
7026                         if ( type === "number" && !isCustomProp ) {
7027                                 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
7028                         }
7030                         // background-* props affect original clone's values
7031                         if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
7032                                 style[ name ] = "inherit";
7033                         }
7035                         // If a hook was provided, use that value, otherwise just set the specified value
7036                         if ( !hooks || !( "set" in hooks ) ||
7037                                 ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
7039                                 if ( isCustomProp ) {
7040                                         style.setProperty( name, value );
7041                                 } else {
7042                                         style[ name ] = value;
7043                                 }
7044                         }
7046                 } else {
7048                         // If a hook was provided get the non-computed value from there
7049                         if ( hooks && "get" in hooks &&
7050                                 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
7052                                 return ret;
7053                         }
7055                         // Otherwise just get the value from the style object
7056                         return style[ name ];
7057                 }
7058         },
7060         css: function( elem, name, extra, styles ) {
7061                 var val, num, hooks,
7062                         origName = camelCase( name ),
7063                         isCustomProp = rcustomProp.test( name );
7065                 // Make sure that we're working with the right name. We don't
7066                 // want to modify the value if it is a CSS custom property
7067                 // since they are user-defined.
7068                 if ( !isCustomProp ) {
7069                         name = finalPropName( origName );
7070                 }
7072                 // Try prefixed name followed by the unprefixed name
7073                 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
7075                 // If a hook was provided get the computed value from there
7076                 if ( hooks && "get" in hooks ) {
7077                         val = hooks.get( elem, true, extra );
7078                 }
7080                 // Otherwise, if a way to get the computed value exists, use that
7081                 if ( val === undefined ) {
7082                         val = curCSS( elem, name, styles );
7083                 }
7085                 // Convert "normal" to computed value
7086                 if ( val === "normal" && name in cssNormalTransform ) {
7087                         val = cssNormalTransform[ name ];
7088                 }
7090                 // Make numeric if forced or a qualifier was provided and val looks numeric
7091                 if ( extra === "" || extra ) {
7092                         num = parseFloat( val );
7093                         return extra === true || isFinite( num ) ? num || 0 : val;
7094                 }
7096                 return val;
7097         }
7098 } );
7100 jQuery.each( [ "height", "width" ], function( _i, dimension ) {
7101         jQuery.cssHooks[ dimension ] = {
7102                 get: function( elem, computed, extra ) {
7103                         if ( computed ) {
7105                                 // Certain elements can have dimension info if we invisibly show them
7106                                 // but it must have a current display style that would benefit
7107                                 return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
7109                                         // Support: Safari 8+
7110                                         // Table columns in Safari have non-zero offsetWidth & zero
7111                                         // getBoundingClientRect().width unless display is changed.
7112                                         // Support: IE <=11 only
7113                                         // Running getBoundingClientRect on a disconnected node
7114                                         // in IE throws an error.
7115                                         ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
7116                                         swap( elem, cssShow, function() {
7117                                                 return getWidthOrHeight( elem, dimension, extra );
7118                                         } ) :
7119                                         getWidthOrHeight( elem, dimension, extra );
7120                         }
7121                 },
7123                 set: function( elem, value, extra ) {
7124                         var matches,
7125                                 styles = getStyles( elem ),
7127                                 // Only read styles.position if the test has a chance to fail
7128                                 // to avoid forcing a reflow.
7129                                 scrollboxSizeBuggy = !support.scrollboxSize() &&
7130                                         styles.position === "absolute",
7132                                 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
7133                                 boxSizingNeeded = scrollboxSizeBuggy || extra,
7134                                 isBorderBox = boxSizingNeeded &&
7135                                         jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
7136                                 subtract = extra ?
7137                                         boxModelAdjustment(
7138                                                 elem,
7139                                                 dimension,
7140                                                 extra,
7141                                                 isBorderBox,
7142                                                 styles
7143                                         ) :
7144                                         0;
7146                         // Account for unreliable border-box dimensions by comparing offset* to computed and
7147                         // faking a content-box to get border and padding (gh-3699)
7148                         if ( isBorderBox && scrollboxSizeBuggy ) {
7149                                 subtract -= Math.ceil(
7150                                         elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
7151                                         parseFloat( styles[ dimension ] ) -
7152                                         boxModelAdjustment( elem, dimension, "border", false, styles ) -
7153                                         0.5
7154                                 );
7155                         }
7157                         // Convert to pixels if value adjustment is needed
7158                         if ( subtract && ( matches = rcssNum.exec( value ) ) &&
7159                                 ( matches[ 3 ] || "px" ) !== "px" ) {
7161                                 elem.style[ dimension ] = value;
7162                                 value = jQuery.css( elem, dimension );
7163                         }
7165                         return setPositiveNumber( elem, value, subtract );
7166                 }
7167         };
7168 } );
7170 jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
7171         function( elem, computed ) {
7172                 if ( computed ) {
7173                         return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
7174                                 elem.getBoundingClientRect().left -
7175                                         swap( elem, { marginLeft: 0 }, function() {
7176                                                 return elem.getBoundingClientRect().left;
7177                                         } )
7178                         ) + "px";
7179                 }
7180         }
7183 // These hooks are used by animate to expand properties
7184 jQuery.each( {
7185         margin: "",
7186         padding: "",
7187         border: "Width"
7188 }, function( prefix, suffix ) {
7189         jQuery.cssHooks[ prefix + suffix ] = {
7190                 expand: function( value ) {
7191                         var i = 0,
7192                                 expanded = {},
7194                                 // Assumes a single number if not a string
7195                                 parts = typeof value === "string" ? value.split( " " ) : [ value ];
7197                         for ( ; i < 4; i++ ) {
7198                                 expanded[ prefix + cssExpand[ i ] + suffix ] =
7199                                         parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
7200                         }
7202                         return expanded;
7203                 }
7204         };
7206         if ( prefix !== "margin" ) {
7207                 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
7208         }
7209 } );
7211 jQuery.fn.extend( {
7212         css: function( name, value ) {
7213                 return access( this, function( elem, name, value ) {
7214                         var styles, len,
7215                                 map = {},
7216                                 i = 0;
7218                         if ( Array.isArray( name ) ) {
7219                                 styles = getStyles( elem );
7220                                 len = name.length;
7222                                 for ( ; i < len; i++ ) {
7223                                         map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
7224                                 }
7226                                 return map;
7227                         }
7229                         return value !== undefined ?
7230                                 jQuery.style( elem, name, value ) :
7231                                 jQuery.css( elem, name );
7232                 }, name, value, arguments.length > 1 );
7233         }
7234 } );
7237 // Based off of the plugin by Clint Helfers, with permission.
7238 jQuery.fn.delay = function( time, type ) {
7239         time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7240         type = type || "fx";
7242         return this.queue( type, function( next, hooks ) {
7243                 var timeout = window.setTimeout( next, time );
7244                 hooks.stop = function() {
7245                         window.clearTimeout( timeout );
7246                 };
7247         } );
7251 ( function() {
7252         var input = document.createElement( "input" ),
7253                 select = document.createElement( "select" ),
7254                 opt = select.appendChild( document.createElement( "option" ) );
7256         input.type = "checkbox";
7258         // Support: Android <=4.3 only
7259         // Default value for a checkbox should be "on"
7260         support.checkOn = input.value !== "";
7262         // Support: IE <=11 only
7263         // Must access selectedIndex to make default options select
7264         support.optSelected = opt.selected;
7266         // Support: IE <=11 only
7267         // An input loses its value after becoming a radio
7268         input = document.createElement( "input" );
7269         input.value = "t";
7270         input.type = "radio";
7271         support.radioValue = input.value === "t";
7272 } )();
7275 var boolHook,
7276         attrHandle = jQuery.expr.attrHandle;
7278 jQuery.fn.extend( {
7279         attr: function( name, value ) {
7280                 return access( this, jQuery.attr, name, value, arguments.length > 1 );
7281         },
7283         removeAttr: function( name ) {
7284                 return this.each( function() {
7285                         jQuery.removeAttr( this, name );
7286                 } );
7287         }
7288 } );
7290 jQuery.extend( {
7291         attr: function( elem, name, value ) {
7292                 var ret, hooks,
7293                         nType = elem.nodeType;
7295                 // Don't get/set attributes on text, comment and attribute nodes
7296                 if ( nType === 3 || nType === 8 || nType === 2 ) {
7297                         return;
7298                 }
7300                 // Fallback to prop when attributes are not supported
7301                 if ( typeof elem.getAttribute === "undefined" ) {
7302                         return jQuery.prop( elem, name, value );
7303                 }
7305                 // Attribute hooks are determined by the lowercase version
7306                 // Grab necessary hook if one is defined
7307                 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7308                         hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
7309                                 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
7310                 }
7312                 if ( value !== undefined ) {
7313                         if ( value === null ) {
7314                                 jQuery.removeAttr( elem, name );
7315                                 return;
7316                         }
7318                         if ( hooks && "set" in hooks &&
7319                                 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7320                                 return ret;
7321                         }
7323                         elem.setAttribute( name, value + "" );
7324                         return value;
7325                 }
7327                 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7328                         return ret;
7329                 }
7331                 ret = jQuery.find.attr( elem, name );
7333                 // Non-existent attributes return null, we normalize to undefined
7334                 return ret == null ? undefined : ret;
7335         },
7337         attrHooks: {
7338                 type: {
7339                         set: function( elem, value ) {
7340                                 if ( !support.radioValue && value === "radio" &&
7341                                         nodeName( elem, "input" ) ) {
7342                                         var val = elem.value;
7343                                         elem.setAttribute( "type", value );
7344                                         if ( val ) {
7345                                                 elem.value = val;
7346                                         }
7347                                         return value;
7348                                 }
7349                         }
7350                 }
7351         },
7353         removeAttr: function( elem, value ) {
7354                 var name,
7355                         i = 0,
7357                         // Attribute names can contain non-HTML whitespace characters
7358                         // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
7359                         attrNames = value && value.match( rnothtmlwhite );
7361                 if ( attrNames && elem.nodeType === 1 ) {
7362                         while ( ( name = attrNames[ i++ ] ) ) {
7363                                 elem.removeAttribute( name );
7364                         }
7365                 }
7366         }
7367 } );
7369 // Hooks for boolean attributes
7370 boolHook = {
7371         set: function( elem, value, name ) {
7372                 if ( value === false ) {
7374                         // Remove boolean attributes when set to false
7375                         jQuery.removeAttr( elem, name );
7376                 } else {
7377                         elem.setAttribute( name, name );
7378                 }
7379                 return name;
7380         }
7383 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
7384         var getter = attrHandle[ name ] || jQuery.find.attr;
7386         attrHandle[ name ] = function( elem, name, isXML ) {
7387                 var ret, handle,
7388                         lowercaseName = name.toLowerCase();
7390                 if ( !isXML ) {
7392                         // Avoid an infinite loop by temporarily removing this function from the getter
7393                         handle = attrHandle[ lowercaseName ];
7394                         attrHandle[ lowercaseName ] = ret;
7395                         ret = getter( elem, name, isXML ) != null ?
7396                                 lowercaseName :
7397                                 null;
7398                         attrHandle[ lowercaseName ] = handle;
7399                 }
7400                 return ret;
7401         };
7402 } );
7407 var rfocusable = /^(?:input|select|textarea|button)$/i,
7408         rclickable = /^(?:a|area)$/i;
7410 jQuery.fn.extend( {
7411         prop: function( name, value ) {
7412                 return access( this, jQuery.prop, name, value, arguments.length > 1 );
7413         },
7415         removeProp: function( name ) {
7416                 return this.each( function() {
7417                         delete this[ jQuery.propFix[ name ] || name ];
7418                 } );
7419         }
7420 } );
7422 jQuery.extend( {
7423         prop: function( elem, name, value ) {
7424                 var ret, hooks,
7425                         nType = elem.nodeType;
7427                 // Don't get/set properties on text, comment and attribute nodes
7428                 if ( nType === 3 || nType === 8 || nType === 2 ) {
7429                         return;
7430                 }
7432                 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7434                         // Fix name and attach hooks
7435                         name = jQuery.propFix[ name ] || name;
7436                         hooks = jQuery.propHooks[ name ];
7437                 }
7439                 if ( value !== undefined ) {
7440                         if ( hooks && "set" in hooks &&
7441                                 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7442                                 return ret;
7443                         }
7445                         return ( elem[ name ] = value );
7446                 }
7448                 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7449                         return ret;
7450                 }
7452                 return elem[ name ];
7453         },
7455         propHooks: {
7456                 tabIndex: {
7457                         get: function( elem ) {
7459                                 // Support: IE <=9 - 11 only
7460                                 // elem.tabIndex doesn't always return the
7461                                 // correct value when it hasn't been explicitly set
7462                                 // Use proper attribute retrieval (trac-12072)
7463                                 var tabindex = jQuery.find.attr( elem, "tabindex" );
7465                                 if ( tabindex ) {
7466                                         return parseInt( tabindex, 10 );
7467                                 }
7469                                 if (
7470                                         rfocusable.test( elem.nodeName ) ||
7471                                         rclickable.test( elem.nodeName ) &&
7472                                         elem.href
7473                                 ) {
7474                                         return 0;
7475                                 }
7477                                 return -1;
7478                         }
7479                 }
7480         },
7482         propFix: {
7483                 "for": "htmlFor",
7484                 "class": "className"
7485         }
7486 } );
7488 // Support: IE <=11 only
7489 // Accessing the selectedIndex property
7490 // forces the browser to respect setting selected
7491 // on the option
7492 // The getter ensures a default option is selected
7493 // when in an optgroup
7494 // eslint rule "no-unused-expressions" is disabled for this code
7495 // since it considers such accessions noop
7496 if ( !support.optSelected ) {
7497         jQuery.propHooks.selected = {
7498                 get: function( elem ) {
7500                         /* eslint no-unused-expressions: "off" */
7502                         var parent = elem.parentNode;
7503                         if ( parent && parent.parentNode ) {
7504                                 parent.parentNode.selectedIndex;
7505                         }
7506                         return null;
7507                 },
7508                 set: function( elem ) {
7510                         /* eslint no-unused-expressions: "off" */
7512                         var parent = elem.parentNode;
7513                         if ( parent ) {
7514                                 parent.selectedIndex;
7516                                 if ( parent.parentNode ) {
7517                                         parent.parentNode.selectedIndex;
7518                                 }
7519                         }
7520                 }
7521         };
7524 jQuery.each( [
7525         "tabIndex",
7526         "readOnly",
7527         "maxLength",
7528         "cellSpacing",
7529         "cellPadding",
7530         "rowSpan",
7531         "colSpan",
7532         "useMap",
7533         "frameBorder",
7534         "contentEditable"
7535 ], function() {
7536         jQuery.propFix[ this.toLowerCase() ] = this;
7537 } );
7542         // Strip and collapse whitespace according to HTML spec
7543         // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
7544         function stripAndCollapse( value ) {
7545                 var tokens = value.match( rnothtmlwhite ) || [];
7546                 return tokens.join( " " );
7547         }
7550 function getClass( elem ) {
7551         return elem.getAttribute && elem.getAttribute( "class" ) || "";
7554 function classesToArray( value ) {
7555         if ( Array.isArray( value ) ) {
7556                 return value;
7557         }
7558         if ( typeof value === "string" ) {
7559                 return value.match( rnothtmlwhite ) || [];
7560         }
7561         return [];
7564 jQuery.fn.extend( {
7565         addClass: function( value ) {
7566                 var classNames, cur, curValue, className, i, finalValue;
7568                 if ( isFunction( value ) ) {
7569                         return this.each( function( j ) {
7570                                 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
7571                         } );
7572                 }
7574                 classNames = classesToArray( value );
7576                 if ( classNames.length ) {
7577                         return this.each( function() {
7578                                 curValue = getClass( this );
7579                                 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7581                                 if ( cur ) {
7582                                         for ( i = 0; i < classNames.length; i++ ) {
7583                                                 className = classNames[ i ];
7584                                                 if ( cur.indexOf( " " + className + " " ) < 0 ) {
7585                                                         cur += className + " ";
7586                                                 }
7587                                         }
7589                                         // Only assign if different to avoid unneeded rendering.
7590                                         finalValue = stripAndCollapse( cur );
7591                                         if ( curValue !== finalValue ) {
7592                                                 this.setAttribute( "class", finalValue );
7593                                         }
7594                                 }
7595                         } );
7596                 }
7598                 return this;
7599         },
7601         removeClass: function( value ) {
7602                 var classNames, cur, curValue, className, i, finalValue;
7604                 if ( isFunction( value ) ) {
7605                         return this.each( function( j ) {
7606                                 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
7607                         } );
7608                 }
7610                 if ( !arguments.length ) {
7611                         return this.attr( "class", "" );
7612                 }
7614                 classNames = classesToArray( value );
7616                 if ( classNames.length ) {
7617                         return this.each( function() {
7618                                 curValue = getClass( this );
7620                                 // This expression is here for better compressibility (see addClass)
7621                                 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7623                                 if ( cur ) {
7624                                         for ( i = 0; i < classNames.length; i++ ) {
7625                                                 className = classNames[ i ];
7627                                                 // Remove *all* instances
7628                                                 while ( cur.indexOf( " " + className + " " ) > -1 ) {
7629                                                         cur = cur.replace( " " + className + " ", " " );
7630                                                 }
7631                                         }
7633                                         // Only assign if different to avoid unneeded rendering.
7634                                         finalValue = stripAndCollapse( cur );
7635                                         if ( curValue !== finalValue ) {
7636                                                 this.setAttribute( "class", finalValue );
7637                                         }
7638                                 }
7639                         } );
7640                 }
7642                 return this;
7643         },
7645         toggleClass: function( value, stateVal ) {
7646                 var classNames, className, i, self,
7647                         type = typeof value,
7648                         isValidValue = type === "string" || Array.isArray( value );
7650                 if ( isFunction( value ) ) {
7651                         return this.each( function( i ) {
7652                                 jQuery( this ).toggleClass(
7653                                         value.call( this, i, getClass( this ), stateVal ),
7654                                         stateVal
7655                                 );
7656                         } );
7657                 }
7659                 if ( typeof stateVal === "boolean" && isValidValue ) {
7660                         return stateVal ? this.addClass( value ) : this.removeClass( value );
7661                 }
7663                 classNames = classesToArray( value );
7665                 return this.each( function() {
7666                         if ( isValidValue ) {
7668                                 // Toggle individual class names
7669                                 self = jQuery( this );
7671                                 for ( i = 0; i < classNames.length; i++ ) {
7672                                         className = classNames[ i ];
7674                                         // Check each className given, space separated list
7675                                         if ( self.hasClass( className ) ) {
7676                                                 self.removeClass( className );
7677                                         } else {
7678                                                 self.addClass( className );
7679                                         }
7680                                 }
7682                         // Toggle whole class name
7683                         } else if ( value === undefined || type === "boolean" ) {
7684                                 className = getClass( this );
7685                                 if ( className ) {
7687                                         // Store className if set
7688                                         dataPriv.set( this, "__className__", className );
7689                                 }
7691                                 // If the element has a class name or if we're passed `false`,
7692                                 // then remove the whole classname (if there was one, the above saved it).
7693                                 // Otherwise bring back whatever was previously saved (if anything),
7694                                 // falling back to the empty string if nothing was stored.
7695                                 if ( this.setAttribute ) {
7696                                         this.setAttribute( "class",
7697                                                 className || value === false ?
7698                                                         "" :
7699                                                         dataPriv.get( this, "__className__" ) || ""
7700                                         );
7701                                 }
7702                         }
7703                 } );
7704         },
7706         hasClass: function( selector ) {
7707                 var className, elem,
7708                         i = 0;
7710                 className = " " + selector + " ";
7711                 while ( ( elem = this[ i++ ] ) ) {
7712                         if ( elem.nodeType === 1 &&
7713                                 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
7714                                 return true;
7715                         }
7716                 }
7718                 return false;
7719         }
7720 } );
7725 var rreturn = /\r/g;
7727 jQuery.fn.extend( {
7728         val: function( value ) {
7729                 var hooks, ret, valueIsFunction,
7730                         elem = this[ 0 ];
7732                 if ( !arguments.length ) {
7733                         if ( elem ) {
7734                                 hooks = jQuery.valHooks[ elem.type ] ||
7735                                         jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7737                                 if ( hooks &&
7738                                         "get" in hooks &&
7739                                         ( ret = hooks.get( elem, "value" ) ) !== undefined
7740                                 ) {
7741                                         return ret;
7742                                 }
7744                                 ret = elem.value;
7746                                 // Handle most common string cases
7747                                 if ( typeof ret === "string" ) {
7748                                         return ret.replace( rreturn, "" );
7749                                 }
7751                                 // Handle cases where value is null/undef or number
7752                                 return ret == null ? "" : ret;
7753                         }
7755                         return;
7756                 }
7758                 valueIsFunction = isFunction( value );
7760                 return this.each( function( i ) {
7761                         var val;
7763                         if ( this.nodeType !== 1 ) {
7764                                 return;
7765                         }
7767                         if ( valueIsFunction ) {
7768                                 val = value.call( this, i, jQuery( this ).val() );
7769                         } else {
7770                                 val = value;
7771                         }
7773                         // Treat null/undefined as ""; convert numbers to string
7774                         if ( val == null ) {
7775                                 val = "";
7777                         } else if ( typeof val === "number" ) {
7778                                 val += "";
7780                         } else if ( Array.isArray( val ) ) {
7781                                 val = jQuery.map( val, function( value ) {
7782                                         return value == null ? "" : value + "";
7783                                 } );
7784                         }
7786                         hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7788                         // If set returns undefined, fall back to normal setting
7789                         if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
7790                                 this.value = val;
7791                         }
7792                 } );
7793         }
7794 } );
7796 jQuery.extend( {
7797         valHooks: {
7798                 option: {
7799                         get: function( elem ) {
7801                                 var val = jQuery.find.attr( elem, "value" );
7802                                 return val != null ?
7803                                         val :
7805                                         // Support: IE <=10 - 11 only
7806                                         // option.text throws exceptions (trac-14686, trac-14858)
7807                                         // Strip and collapse whitespace
7808                                         // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
7809                                         stripAndCollapse( jQuery.text( elem ) );
7810                         }
7811                 },
7812                 select: {
7813                         get: function( elem ) {
7814                                 var value, option, i,
7815                                         options = elem.options,
7816                                         index = elem.selectedIndex,
7817                                         one = elem.type === "select-one",
7818                                         values = one ? null : [],
7819                                         max = one ? index + 1 : options.length;
7821                                 if ( index < 0 ) {
7822                                         i = max;
7824                                 } else {
7825                                         i = one ? index : 0;
7826                                 }
7828                                 // Loop through all the selected options
7829                                 for ( ; i < max; i++ ) {
7830                                         option = options[ i ];
7832                                         // Support: IE <=9 only
7833                                         // IE8-9 doesn't update selected after form reset (trac-2551)
7834                                         if ( ( option.selected || i === index ) &&
7836                                                         // Don't return options that are disabled or in a disabled optgroup
7837                                                         !option.disabled &&
7838                                                         ( !option.parentNode.disabled ||
7839                                                                 !nodeName( option.parentNode, "optgroup" ) ) ) {
7841                                                 // Get the specific value for the option
7842                                                 value = jQuery( option ).val();
7844                                                 // We don't need an array for one selects
7845                                                 if ( one ) {
7846                                                         return value;
7847                                                 }
7849                                                 // Multi-Selects return an array
7850                                                 values.push( value );
7851                                         }
7852                                 }
7854                                 return values;
7855                         },
7857                         set: function( elem, value ) {
7858                                 var optionSet, option,
7859                                         options = elem.options,
7860                                         values = jQuery.makeArray( value ),
7861                                         i = options.length;
7863                                 while ( i-- ) {
7864                                         option = options[ i ];
7866                                         /* eslint-disable no-cond-assign */
7868                                         if ( option.selected =
7869                                                 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
7870                                         ) {
7871                                                 optionSet = true;
7872                                         }
7874                                         /* eslint-enable no-cond-assign */
7875                                 }
7877                                 // Force browsers to behave consistently when non-matching value is set
7878                                 if ( !optionSet ) {
7879                                         elem.selectedIndex = -1;
7880                                 }
7881                                 return values;
7882                         }
7883                 }
7884         }
7885 } );
7887 // Radios and checkboxes getter/setter
7888 jQuery.each( [ "radio", "checkbox" ], function() {
7889         jQuery.valHooks[ this ] = {
7890                 set: function( elem, value ) {
7891                         if ( Array.isArray( value ) ) {
7892                                 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
7893                         }
7894                 }
7895         };
7896         if ( !support.checkOn ) {
7897                 jQuery.valHooks[ this ].get = function( elem ) {
7898                         return elem.getAttribute( "value" ) === null ? "on" : elem.value;
7899                 };
7900         }
7901 } );
7906 // Return jQuery for attributes-only inclusion
7909 support.focusin = "onfocusin" in window;
7912 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
7913         stopPropagationCallback = function( e ) {
7914                 e.stopPropagation();
7915         };
7917 jQuery.extend( jQuery.event, {
7919         trigger: function( event, data, elem, onlyHandlers ) {
7921                 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
7922                         eventPath = [ elem || document ],
7923                         type = hasOwn.call( event, "type" ) ? event.type : event,
7924                         namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
7926                 cur = lastElement = tmp = elem = elem || document;
7928                 // Don't do events on text and comment nodes
7929                 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
7930                         return;
7931                 }
7933                 // focus/blur morphs to focusin/out; ensure we're not firing them right now
7934                 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
7935                         return;
7936                 }
7938                 if ( type.indexOf( "." ) > -1 ) {
7940                         // Namespaced trigger; create a regexp to match event type in handle()
7941                         namespaces = type.split( "." );
7942                         type = namespaces.shift();
7943                         namespaces.sort();
7944                 }
7945                 ontype = type.indexOf( ":" ) < 0 && "on" + type;
7947                 // Caller can pass in a jQuery.Event object, Object, or just an event type string
7948                 event = event[ jQuery.expando ] ?
7949                         event :
7950                         new jQuery.Event( type, typeof event === "object" && event );
7952                 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
7953                 event.isTrigger = onlyHandlers ? 2 : 3;
7954                 event.namespace = namespaces.join( "." );
7955                 event.rnamespace = event.namespace ?
7956                         new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
7957                         null;
7959                 // Clean up the event in case it is being reused
7960                 event.result = undefined;
7961                 if ( !event.target ) {
7962                         event.target = elem;
7963                 }
7965                 // Clone any incoming data and prepend the event, creating the handler arg list
7966                 data = data == null ?
7967                         [ event ] :
7968                         jQuery.makeArray( data, [ event ] );
7970                 // Allow special events to draw outside the lines
7971                 special = jQuery.event.special[ type ] || {};
7972                 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
7973                         return;
7974                 }
7976                 // Determine event propagation path in advance, per W3C events spec (trac-9951)
7977                 // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
7978                 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
7980                         bubbleType = special.delegateType || type;
7981                         if ( !rfocusMorph.test( bubbleType + type ) ) {
7982                                 cur = cur.parentNode;
7983                         }
7984                         for ( ; cur; cur = cur.parentNode ) {
7985                                 eventPath.push( cur );
7986                                 tmp = cur;
7987                         }
7989                         // Only add window if we got to document (e.g., not plain obj or detached DOM)
7990                         if ( tmp === ( elem.ownerDocument || document ) ) {
7991                                 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
7992                         }
7993                 }
7995                 // Fire handlers on the event path
7996                 i = 0;
7997                 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
7998                         lastElement = cur;
7999                         event.type = i > 1 ?
8000                                 bubbleType :
8001                                 special.bindType || type;
8003                         // jQuery handler
8004                         handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
8005                                 dataPriv.get( cur, "handle" );
8006                         if ( handle ) {
8007                                 handle.apply( cur, data );
8008                         }
8010                         // Native handler
8011                         handle = ontype && cur[ ontype ];
8012                         if ( handle && handle.apply && acceptData( cur ) ) {
8013                                 event.result = handle.apply( cur, data );
8014                                 if ( event.result === false ) {
8015                                         event.preventDefault();
8016                                 }
8017                         }
8018                 }
8019                 event.type = type;
8021                 // If nobody prevented the default action, do it now
8022                 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
8024                         if ( ( !special._default ||
8025                                 special._default.apply( eventPath.pop(), data ) === false ) &&
8026                                 acceptData( elem ) ) {
8028                                 // Call a native DOM method on the target with the same name as the event.
8029                                 // Don't do default actions on window, that's where global variables be (trac-6170)
8030                                 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
8032                                         // Don't re-trigger an onFOO event when we call its FOO() method
8033                                         tmp = elem[ ontype ];
8035                                         if ( tmp ) {
8036                                                 elem[ ontype ] = null;
8037                                         }
8039                                         // Prevent re-triggering of the same event, since we already bubbled it above
8040                                         jQuery.event.triggered = type;
8042                                         if ( event.isPropagationStopped() ) {
8043                                                 lastElement.addEventListener( type, stopPropagationCallback );
8044                                         }
8046                                         elem[ type ]();
8048                                         if ( event.isPropagationStopped() ) {
8049                                                 lastElement.removeEventListener( type, stopPropagationCallback );
8050                                         }
8052                                         jQuery.event.triggered = undefined;
8054                                         if ( tmp ) {
8055                                                 elem[ ontype ] = tmp;
8056                                         }
8057                                 }
8058                         }
8059                 }
8061                 return event.result;
8062         },
8064         // Piggyback on a donor event to simulate a different one
8065         // Used only for `focus(in | out)` events
8066         simulate: function( type, elem, event ) {
8067                 var e = jQuery.extend(
8068                         new jQuery.Event(),
8069                         event,
8070                         {
8071                                 type: type,
8072                                 isSimulated: true
8073                         }
8074                 );
8076                 jQuery.event.trigger( e, null, elem );
8077         }
8079 } );
8081 jQuery.fn.extend( {
8083         trigger: function( type, data ) {
8084                 return this.each( function() {
8085                         jQuery.event.trigger( type, data, this );
8086                 } );
8087         },
8088         triggerHandler: function( type, data ) {
8089                 var elem = this[ 0 ];
8090                 if ( elem ) {
8091                         return jQuery.event.trigger( type, data, elem, true );
8092                 }
8093         }
8094 } );
8097 // Support: Firefox <=44
8098 // Firefox doesn't have focus(in | out) events
8099 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
8101 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
8102 // focus(in | out) events fire after focus & blur events,
8103 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
8104 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
8105 if ( !support.focusin ) {
8106         jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
8108                 // Attach a single capturing handler on the document while someone wants focusin/focusout
8109                 var handler = function( event ) {
8110                         jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
8111                 };
8113                 jQuery.event.special[ fix ] = {
8114                         setup: function() {
8116                                 // Handle: regular nodes (via `this.ownerDocument`), window
8117                                 // (via `this.document`) & document (via `this`).
8118                                 var doc = this.ownerDocument || this.document || this,
8119                                         attaches = dataPriv.access( doc, fix );
8121                                 if ( !attaches ) {
8122                                         doc.addEventListener( orig, handler, true );
8123                                 }
8124                                 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
8125                         },
8126                         teardown: function() {
8127                                 var doc = this.ownerDocument || this.document || this,
8128                                         attaches = dataPriv.access( doc, fix ) - 1;
8130                                 if ( !attaches ) {
8131                                         doc.removeEventListener( orig, handler, true );
8132                                         dataPriv.remove( doc, fix );
8134                                 } else {
8135                                         dataPriv.access( doc, fix, attaches );
8136                                 }
8137                         }
8138                 };
8139         } );
8143 // Cross-browser xml parsing
8144 jQuery.parseXML = function( data ) {
8145         var xml, parserErrorElem;
8146         if ( !data || typeof data !== "string" ) {
8147                 return null;
8148         }
8150         // Support: IE 9 - 11 only
8151         // IE throws on parseFromString with invalid input.
8152         try {
8153                 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8154         } catch ( e ) {}
8156         parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
8157         if ( !xml || parserErrorElem ) {
8158                 jQuery.error( "Invalid XML: " + (
8159                         parserErrorElem ?
8160                                 jQuery.map( parserErrorElem.childNodes, function( el ) {
8161                                         return el.textContent;
8162                                 } ).join( "\n" ) :
8163                                 data
8164                 ) );
8165         }
8166         return xml;
8171         rbracket = /\[\]$/,
8172         rCRLF = /\r?\n/g,
8173         rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8174         rsubmittable = /^(?:input|select|textarea|keygen)/i;
8176 function buildParams( prefix, obj, traditional, add ) {
8177         var name;
8179         if ( Array.isArray( obj ) ) {
8181                 // Serialize array item.
8182                 jQuery.each( obj, function( i, v ) {
8183                         if ( traditional || rbracket.test( prefix ) ) {
8185                                 // Treat each array item as a scalar.
8186                                 add( prefix, v );
8188                         } else {
8190                                 // Item is non-scalar (array or object), encode its numeric index.
8191                                 buildParams(
8192                                         prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
8193                                         v,
8194                                         traditional,
8195                                         add
8196                                 );
8197                         }
8198                 } );
8200         } else if ( !traditional && toType( obj ) === "object" ) {
8202                 // Serialize object item.
8203                 for ( name in obj ) {
8204                         buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8205                 }
8207         } else {
8209                 // Serialize scalar item.
8210                 add( prefix, obj );
8211         }
8214 // Serialize an array of form elements or a set of
8215 // key/values into a query string
8216 jQuery.param = function( a, traditional ) {
8217         var prefix,
8218                 s = [],
8219                 add = function( key, valueOrFunction ) {
8221                         // If value is a function, invoke it and use its return value
8222                         var value = isFunction( valueOrFunction ) ?
8223                                 valueOrFunction() :
8224                                 valueOrFunction;
8226                         s[ s.length ] = encodeURIComponent( key ) + "=" +
8227                                 encodeURIComponent( value == null ? "" : value );
8228                 };
8230         if ( a == null ) {
8231                 return "";
8232         }
8234         // If an array was passed in, assume that it is an array of form elements.
8235         if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
8237                 // Serialize the form elements
8238                 jQuery.each( a, function() {
8239                         add( this.name, this.value );
8240                 } );
8242         } else {
8244                 // If traditional, encode the "old" way (the way 1.3.2 or older
8245                 // did it), otherwise encode params recursively.
8246                 for ( prefix in a ) {
8247                         buildParams( prefix, a[ prefix ], traditional, add );
8248                 }
8249         }
8251         // Return the resulting serialization
8252         return s.join( "&" );
8255 jQuery.fn.extend( {
8256         serialize: function() {
8257                 return jQuery.param( this.serializeArray() );
8258         },
8259         serializeArray: function() {
8260                 return this.map( function() {
8262                         // Can add propHook for "elements" to filter or add form elements
8263                         var elements = jQuery.prop( this, "elements" );
8264                         return elements ? jQuery.makeArray( elements ) : this;
8265                 } ).filter( function() {
8266                         var type = this.type;
8268                         // Use .is( ":disabled" ) so that fieldset[disabled] works
8269                         return this.name && !jQuery( this ).is( ":disabled" ) &&
8270                                 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8271                                 ( this.checked || !rcheckableType.test( type ) );
8272                 } ).map( function( _i, elem ) {
8273                         var val = jQuery( this ).val();
8275                         if ( val == null ) {
8276                                 return null;
8277                         }
8279                         if ( Array.isArray( val ) ) {
8280                                 return jQuery.map( val, function( val ) {
8281                                         return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8282                                 } );
8283                         }
8285                         return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8286                 } ).get();
8287         }
8288 } );
8291 jQuery.fn.extend( {
8292         wrapAll: function( html ) {
8293                 var wrap;
8295                 if ( this[ 0 ] ) {
8296                         if ( isFunction( html ) ) {
8297                                 html = html.call( this[ 0 ] );
8298                         }
8300                         // The elements to wrap the target around
8301                         wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
8303                         if ( this[ 0 ].parentNode ) {
8304                                 wrap.insertBefore( this[ 0 ] );
8305                         }
8307                         wrap.map( function() {
8308                                 var elem = this;
8310                                 while ( elem.firstElementChild ) {
8311                                         elem = elem.firstElementChild;
8312                                 }
8314                                 return elem;
8315                         } ).append( this );
8316                 }
8318                 return this;
8319         },
8321         wrapInner: function( html ) {
8322                 if ( isFunction( html ) ) {
8323                         return this.each( function( i ) {
8324                                 jQuery( this ).wrapInner( html.call( this, i ) );
8325                         } );
8326                 }
8328                 return this.each( function() {
8329                         var self = jQuery( this ),
8330                                 contents = self.contents();
8332                         if ( contents.length ) {
8333                                 contents.wrapAll( html );
8335                         } else {
8336                                 self.append( html );
8337                         }
8338                 } );
8339         },
8341         wrap: function( html ) {
8342                 var htmlIsFunction = isFunction( html );
8344                 return this.each( function( i ) {
8345                         jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
8346                 } );
8347         },
8349         unwrap: function( selector ) {
8350                 this.parent( selector ).not( "body" ).each( function() {
8351                         jQuery( this ).replaceWith( this.childNodes );
8352                 } );
8353                 return this;
8354         }
8355 } );
8358 jQuery.expr.pseudos.hidden = function( elem ) {
8359         return !jQuery.expr.pseudos.visible( elem );
8361 jQuery.expr.pseudos.visible = function( elem ) {
8362         return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
8368 // Support: Safari 8 only
8369 // In Safari 8 documents created via document.implementation.createHTMLDocument
8370 // collapse sibling forms: the second one becomes a child of the first one.
8371 // Because of that, this security measure has to be disabled in Safari 8.
8372 // https://bugs.webkit.org/show_bug.cgi?id=137337
8373 support.createHTMLDocument = ( function() {
8374         var body = document.implementation.createHTMLDocument( "" ).body;
8375         body.innerHTML = "<form></form><form></form>";
8376         return body.childNodes.length === 2;
8377 } )();
8380 // Argument "data" should be string of html
8381 // context (optional): If specified, the fragment will be created in this context,
8382 // defaults to document
8383 // keepScripts (optional): If true, will include scripts passed in the html string
8384 jQuery.parseHTML = function( data, context, keepScripts ) {
8385         if ( typeof data !== "string" ) {
8386                 return [];
8387         }
8388         if ( typeof context === "boolean" ) {
8389                 keepScripts = context;
8390                 context = false;
8391         }
8393         var base, parsed, scripts;
8395         if ( !context ) {
8397                 // Stop scripts or inline event handlers from being executed immediately
8398                 // by using document.implementation
8399                 if ( support.createHTMLDocument ) {
8400                         context = document.implementation.createHTMLDocument( "" );
8402                         // Set the base href for the created document
8403                         // so any parsed elements with URLs
8404                         // are based on the document's URL (gh-2965)
8405                         base = context.createElement( "base" );
8406                         base.href = document.location.href;
8407                         context.head.appendChild( base );
8408                 } else {
8409                         context = document;
8410                 }
8411         }
8413         parsed = rsingleTag.exec( data );
8414         scripts = !keepScripts && [];
8416         // Single tag
8417         if ( parsed ) {
8418                 return [ context.createElement( parsed[ 1 ] ) ];
8419         }
8421         parsed = buildFragment( [ data ], context, scripts );
8423         if ( scripts && scripts.length ) {
8424                 jQuery( scripts ).remove();
8425         }
8427         return jQuery.merge( [], parsed.childNodes );
8431 jQuery.offset = {
8432         setOffset: function( elem, options, i ) {
8433                 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
8434                         position = jQuery.css( elem, "position" ),
8435                         curElem = jQuery( elem ),
8436                         props = {};
8438                 // Set position first, in-case top/left are set even on static elem
8439                 if ( position === "static" ) {
8440                         elem.style.position = "relative";
8441                 }
8443                 curOffset = curElem.offset();
8444                 curCSSTop = jQuery.css( elem, "top" );
8445                 curCSSLeft = jQuery.css( elem, "left" );
8446                 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
8447                         ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
8449                 // Need to be able to calculate position if either
8450                 // top or left is auto and position is either absolute or fixed
8451                 if ( calculatePosition ) {
8452                         curPosition = curElem.position();
8453                         curTop = curPosition.top;
8454                         curLeft = curPosition.left;
8456                 } else {
8457                         curTop = parseFloat( curCSSTop ) || 0;
8458                         curLeft = parseFloat( curCSSLeft ) || 0;
8459                 }
8461                 if ( isFunction( options ) ) {
8463                         // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
8464                         options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
8465                 }
8467                 if ( options.top != null ) {
8468                         props.top = ( options.top - curOffset.top ) + curTop;
8469                 }
8470                 if ( options.left != null ) {
8471                         props.left = ( options.left - curOffset.left ) + curLeft;
8472                 }
8474                 if ( "using" in options ) {
8475                         options.using.call( elem, props );
8477                 } else {
8478                         curElem.css( props );
8479                 }
8480         }
8483 jQuery.fn.extend( {
8485         // offset() relates an element's border box to the document origin
8486         offset: function( options ) {
8488                 // Preserve chaining for setter
8489                 if ( arguments.length ) {
8490                         return options === undefined ?
8491                                 this :
8492                                 this.each( function( i ) {
8493                                         jQuery.offset.setOffset( this, options, i );
8494                                 } );
8495                 }
8497                 var rect, win,
8498                         elem = this[ 0 ];
8500                 if ( !elem ) {
8501                         return;
8502                 }
8504                 // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
8505                 // Support: IE <=11 only
8506                 // Running getBoundingClientRect on a
8507                 // disconnected node in IE throws an error
8508                 if ( !elem.getClientRects().length ) {
8509                         return { top: 0, left: 0 };
8510                 }
8512                 // Get document-relative position by adding viewport scroll to viewport-relative gBCR
8513                 rect = elem.getBoundingClientRect();
8514                 win = elem.ownerDocument.defaultView;
8515                 return {
8516                         top: rect.top + win.pageYOffset,
8517                         left: rect.left + win.pageXOffset
8518                 };
8519         },
8521         // position() relates an element's margin box to its offset parent's padding box
8522         // This corresponds to the behavior of CSS absolute positioning
8523         position: function() {
8524                 if ( !this[ 0 ] ) {
8525                         return;
8526                 }
8528                 var offsetParent, offset, doc,
8529                         elem = this[ 0 ],
8530                         parentOffset = { top: 0, left: 0 };
8532                 // position:fixed elements are offset from the viewport, which itself always has zero offset
8533                 if ( jQuery.css( elem, "position" ) === "fixed" ) {
8535                         // Assume position:fixed implies availability of getBoundingClientRect
8536                         offset = elem.getBoundingClientRect();
8538                 } else {
8539                         offset = this.offset();
8541                         // Account for the *real* offset parent, which can be the document or its root element
8542                         // when a statically positioned element is identified
8543                         doc = elem.ownerDocument;
8544                         offsetParent = elem.offsetParent || doc.documentElement;
8545                         while ( offsetParent &&
8546                                 ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
8547                                 jQuery.css( offsetParent, "position" ) === "static" ) {
8549                                 offsetParent = offsetParent.parentNode;
8550                         }
8551                         if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
8553                                 // Incorporate borders into its offset, since they are outside its content origin
8554                                 parentOffset = jQuery( offsetParent ).offset();
8555                                 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
8556                                 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
8557                         }
8558                 }
8560                 // Subtract parent offsets and element margins
8561                 return {
8562                         top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
8563                         left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
8564                 };
8565         },
8567         // This method will return documentElement in the following cases:
8568         // 1) For the element inside the iframe without offsetParent, this method will return
8569         //    documentElement of the parent window
8570         // 2) For the hidden or detached element
8571         // 3) For body or html element, i.e. in case of the html node - it will return itself
8572         //
8573         // but those exceptions were never presented as a real life use-cases
8574         // and might be considered as more preferable results.
8575         //
8576         // This logic, however, is not guaranteed and can change at any point in the future
8577         offsetParent: function() {
8578                 return this.map( function() {
8579                         var offsetParent = this.offsetParent;
8581                         while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
8582                                 offsetParent = offsetParent.offsetParent;
8583                         }
8585                         return offsetParent || documentElement;
8586                 } );
8587         }
8588 } );
8590 // Create scrollLeft and scrollTop methods
8591 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
8592         var top = "pageYOffset" === prop;
8594         jQuery.fn[ method ] = function( val ) {
8595                 return access( this, function( elem, method, val ) {
8597                         // Coalesce documents and windows
8598                         var win;
8599                         if ( isWindow( elem ) ) {
8600                                 win = elem;
8601                         } else if ( elem.nodeType === 9 ) {
8602                                 win = elem.defaultView;
8603                         }
8605                         if ( val === undefined ) {
8606                                 return win ? win[ prop ] : elem[ method ];
8607                         }
8609                         if ( win ) {
8610                                 win.scrollTo(
8611                                         !top ? val : win.pageXOffset,
8612                                         top ? val : win.pageYOffset
8613                                 );
8615                         } else {
8616                                 elem[ method ] = val;
8617                         }
8618                 }, method, val, arguments.length );
8619         };
8620 } );
8622 // Support: Safari <=7 - 9.1, Chrome <=37 - 49
8623 // Add the top/left cssHooks using jQuery.fn.position
8624 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
8625 // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
8626 // getComputedStyle returns percent when specified for top/left/bottom/right;
8627 // rather than make the css module depend on the offset module, just check for it here
8628 jQuery.each( [ "top", "left" ], function( _i, prop ) {
8629         jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
8630                 function( elem, computed ) {
8631                         if ( computed ) {
8632                                 computed = curCSS( elem, prop );
8634                                 // If curCSS returns percentage, fallback to offset
8635                                 return rnumnonpx.test( computed ) ?
8636                                         jQuery( elem ).position()[ prop ] + "px" :
8637                                         computed;
8638                         }
8639                 }
8640         );
8641 } );
8644 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
8645 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
8646         jQuery.each( {
8647                 padding: "inner" + name,
8648                 content: type,
8649                 "": "outer" + name
8650         }, function( defaultExtra, funcName ) {
8652                 // Margin is only for outerHeight, outerWidth
8653                 jQuery.fn[ funcName ] = function( margin, value ) {
8654                         var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
8655                                 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
8657                         return access( this, function( elem, type, value ) {
8658                                 var doc;
8660                                 if ( isWindow( elem ) ) {
8662                                         // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
8663                                         return funcName.indexOf( "outer" ) === 0 ?
8664                                                 elem[ "inner" + name ] :
8665                                                 elem.document.documentElement[ "client" + name ];
8666                                 }
8668                                 // Get document width or height
8669                                 if ( elem.nodeType === 9 ) {
8670                                         doc = elem.documentElement;
8672                                         // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
8673                                         // whichever is greatest
8674                                         return Math.max(
8675                                                 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
8676                                                 elem.body[ "offset" + name ], doc[ "offset" + name ],
8677                                                 doc[ "client" + name ]
8678                                         );
8679                                 }
8681                                 return value === undefined ?
8683                                         // Get width or height on the element, requesting but not forcing parseFloat
8684                                         jQuery.css( elem, type, extra ) :
8686                                         // Set width or height on the element
8687                                         jQuery.style( elem, type, value, extra );
8688                         }, type, chainable ? margin : undefined, chainable );
8689                 };
8690         } );
8691 } );
8694 jQuery.fn.extend( {
8696         bind: function( types, data, fn ) {
8697                 return this.on( types, null, data, fn );
8698         },
8699         unbind: function( types, fn ) {
8700                 return this.off( types, null, fn );
8701         },
8703         delegate: function( selector, types, data, fn ) {
8704                 return this.on( types, selector, data, fn );
8705         },
8706         undelegate: function( selector, types, fn ) {
8708                 // ( namespace ) or ( selector, types [, fn] )
8709                 return arguments.length === 1 ?
8710                         this.off( selector, "**" ) :
8711                         this.off( types, selector || "**", fn );
8712         },
8714         hover: function( fnOver, fnOut ) {
8715                 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8716         }
8717 } );
8719 jQuery.each(
8720         ( "blur focus focusin focusout resize scroll click dblclick " +
8721         "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8722         "change select submit keydown keypress keyup contextmenu" ).split( " " ),
8723         function( _i, name ) {
8725                 // Handle event binding
8726                 jQuery.fn[ name ] = function( data, fn ) {
8727                         return arguments.length > 0 ?
8728                                 this.on( name, null, data, fn ) :
8729                                 this.trigger( name );
8730                 };
8731         }
8737 // Support: Android <=4.0 only
8738 // Make sure we trim BOM and NBSP
8739 // Require that the "whitespace run" starts from a non-whitespace
8740 // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
8741 var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
8743 // Bind a function to a context, optionally partially applying any
8744 // arguments.
8745 // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
8746 // However, it is not slated for removal any time soon
8747 jQuery.proxy = function( fn, context ) {
8748         var tmp, args, proxy;
8750         if ( typeof context === "string" ) {
8751                 tmp = fn[ context ];
8752                 context = fn;
8753                 fn = tmp;
8754         }
8756         // Quick check to determine if target is callable, in the spec
8757         // this throws a TypeError, but we will just return undefined.
8758         if ( !isFunction( fn ) ) {
8759                 return undefined;
8760         }
8762         // Simulated bind
8763         args = slice.call( arguments, 2 );
8764         proxy = function() {
8765                 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
8766         };
8768         // Set the guid of unique handler to the same of original handler, so it can be removed
8769         proxy.guid = fn.guid = fn.guid || jQuery.guid++;
8771         return proxy;
8774 jQuery.holdReady = function( hold ) {
8775         if ( hold ) {
8776                 jQuery.readyWait++;
8777         } else {
8778                 jQuery.ready( true );
8779         }
8781 jQuery.isArray = Array.isArray;
8782 jQuery.parseJSON = JSON.parse;
8783 jQuery.nodeName = nodeName;
8784 jQuery.isFunction = isFunction;
8785 jQuery.isWindow = isWindow;
8786 jQuery.camelCase = camelCase;
8787 jQuery.type = toType;
8789 jQuery.now = Date.now;
8791 jQuery.isNumeric = function( obj ) {
8793         // As of jQuery 3.0, isNumeric is limited to
8794         // strings and numbers (primitives or objects)
8795         // that can be coerced to finite numbers (gh-2662)
8796         var type = jQuery.type( obj );
8797         return ( type === "number" || type === "string" ) &&
8799                 // parseFloat NaNs numeric-cast false positives ("")
8800                 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
8801                 // subtraction forces infinities to NaN
8802                 !isNaN( obj - parseFloat( obj ) );
8805 jQuery.trim = function( text ) {
8806         return text == null ?
8807                 "" :
8808                 ( text + "" ).replace( rtrim, "$1" );
8813 // Register as a named AMD module, since jQuery can be concatenated with other
8814 // files that may use define, but not via a proper concatenation script that
8815 // understands anonymous AMD modules. A named AMD is safest and most robust
8816 // way to register. Lowercase jquery is used because AMD module names are
8817 // derived from file names, and jQuery is normally delivered in a lowercase
8818 // file name. Do this after creating the global so that if an AMD module wants
8819 // to call noConflict to hide this version of jQuery, it will work.
8821 // Note that for maximum portability, libraries that are not jQuery should
8822 // declare themselves as anonymous modules, and avoid setting a global if an
8823 // AMD loader is present. jQuery is a special case. For more information, see
8824 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
8826 if ( typeof define === "function" && define.amd ) {
8827         define( "jquery", [], function() {
8828                 return jQuery;
8829         } );
8837         // Map over jQuery in case of overwrite
8838         _jQuery = window.jQuery,
8840         // Map over the $ in case of overwrite
8841         _$ = window.$;
8843 jQuery.noConflict = function( deep ) {
8844         if ( window.$ === jQuery ) {
8845                 window.$ = _$;
8846         }
8848         if ( deep && window.jQuery === jQuery ) {
8849                 window.jQuery = _jQuery;
8850         }
8852         return jQuery;
8855 // Expose jQuery and $ identifiers, even in AMD
8856 // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
8857 // and CommonJS for browser emulators (trac-13566)
8858 if ( typeof noGlobal === "undefined" ) {
8859         window.jQuery = window.$ = jQuery;
8865 return jQuery;
8866 } );